Model operation method, device and equipment

By storing part of the model data and complete data in electronic devices and repairing the corrupted data from the complete data when the data is damaged, the problem of corruption in the existing technology resulting in low user experience is solved, and efficient repair and normal operation of model data is achieved.

CN120029690APending Publication Date: 2025-05-23LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510125393.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-26
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In the prior art, when the model data is corrupted, it is usually necessary to re-download the model data or detect it again, resulting in a low user experience and time-consuming and labor-intensive.

Method used

By storing part of the data and complete data of the target model in the first storage area and the second storage area of ​​the electronic device, when the data corruption of the first storage area is detected, the complete data is obtained from the second storage area, and the repaired third data is generated based on both to ensure the integrity and normal operation of the model.

Benefits of technology

Improves the integrity and security of model data, ensuring that the model can be quickly repaired and operated normally when the data is damaged, thereby improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029690A_ABST
    Figure CN120029690A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a model operation method, device and equipment, and the method comprises the steps: obtaining first data of a target model from a first storage region of electronic equipment; the first data represents data needing to be loaded when the target model is started; under the condition that the first data is different from second data of a target model, obtaining the second data of the target model from a second storage area of the electronic equipment, and generating third data based on the second data and the first data; the second data characterizes complete data forming the target model; loading the third data to run the target model; wherein the first storage area and the second storage area are storage areas at different positions in a local storage space of the electronic equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to but is not limited to the field of computer technology, and in particular to a model operation method, device and equipment. Background Art

[0002] In the prior art, when running a model, model data may be damaged, causing the model to fail to run normally, thereby reducing the user experience. Summary of the invention

[0003] In view of this, the embodiments of the present application at least provide a model operation method, device and equipment.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] In a first aspect, an embodiment of the present application provides a model running method, which is applied to an electronic device, including: obtaining first data of a target model from a first storage area of ​​the electronic device; the first data represents data that needs to be loaded when starting the target model; when the first data is different from the second data of the target model, obtaining second data of the target model from a second storage area of ​​the electronic device, and generating third data based on the second data and the first data; the second data represents complete data constituting the target model; loading the third data to run the target model; wherein the first storage area and the second storage area are storage areas at different positions in the local storage space of the electronic device.

[0006] In a second aspect, an embodiment of the present application provides a model running device, which is applied to an electronic device, including: an acquisition module, used to acquire first data of a target model from a first storage area of ​​the electronic device; the first data represents data that needs to be loaded when starting the target model; a generation module, used to acquire second data of the target model from a second storage area of ​​the electronic device when the first data is different from the second data of the target model, and generate third data based on the second data and the first data; the second data represents complete data constituting the target model; a loading module, used to load the third data to run the target model; wherein the first storage area and the second storage area are storage areas at different positions in the local storage space of the electronic device.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, the memory comprising a first storage area and a second storage area; the first storage area stores first data of a target model; the second storage area stores second data of the target model; the processor is used to execute the acquisition of the first data of the target model from the first storage area; the first data represents the data that needs to be loaded when starting the target model; when the first data is different from the second data of the target model, the second data of the target model is acquired from the second storage area of ​​the electronic device, and the third data is obtained based on the second data and the first data; the second data represents the complete data constituting the target model; the third data is loaded to run the target model.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements some or all of the steps in the above method when executed by a processor.

[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement some or all of the steps in the above method.

[0010] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0012] Figure 1 A schematic diagram of a flow chart of a model operation method according to an embodiment of the present application;

[0013] Figure 2 A schematic diagram of a flow chart of a model operation method according to an embodiment of the present application;

[0014] Figure 3 A schematic diagram of a flow chart of a model operation method according to an embodiment of the present application;

[0015] Figure 4 A schematic diagram of a flow chart of a model operation method according to an embodiment of the present application;

[0016] Figure 5 A schematic diagram of a flow chart of a model operation method according to an embodiment of the present application;

[0017] Figure 6 A schematic diagram of a flow chart of a model operation method according to an embodiment of the present application;

[0018] Figure 7 A schematic diagram of a flow chart of a model operation method according to an embodiment of the present application;

[0019] Figure 8 A schematic diagram of a flow chart of a model operation method according to an embodiment of the present application;

[0020] Fig. 9 A schematic diagram of an implementation flow of a model partitioning method provided in an embodiment of the present application;

[0021] Fig.10 A schematic diagram of implementing a model data provided in an embodiment of the present application;

[0022] Fig.11 A schematic diagram of the structure of a model operation device provided in an embodiment of the present application;

[0023] Fig.12 A hardware entity schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0025] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific order for the objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing this application and are not intended to limit this application.

[0027] With the update and iteration of artificial intelligence (AI) models, the parameters and accuracy of AI models have become the focus of attention, but the security issues at the model usage level are rarely mentioned. In the existing technology, when the model encounters data corruption during operation, the model data is generally downloaded again or the wrong model data is detected from beginning to end, which is time-consuming, labor-intensive and user-unfriendly, resulting in a poor user experience.

[0028] The embodiment of the present application provides a model operation method, which can be executed by a processor of an electronic device. The electronic device may refer to a server, a laptop, a tablet computer, a desktop computer, a smart TV, a set-top box, a mobile device (such as a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device, a portable gaming device) and other devices with data processing capabilities.

[0029] Figure 1 The following is a schematic diagram of a flow chart of a model operation method provided in an embodiment of the present application, which method can be executed by a processor of an electronic device. Figure 1 As shown, the method includes the following steps S101 to S103, combining Figure 1 The following steps are described.

[0030] Step S101: Acquire first data of a target model from a first storage area of ​​an electronic device.

[0031] The first data represents data that needs to be loaded when starting the target model.

[0032] In some embodiments, the first storage area may be a designated or default data storage location for the target model in the memory of the electronic device (which may be a mobile hard disk, solid-state hard disk, read-only memory (ROM), magnetic disk or optical disk, etc.).

[0033] In some embodiments, the first storage area may also be a cloud storage area.

[0034] In some embodiments, the target model may be an image recognition model, a semantic segmentation model, a large language model, etc.

[0035] In some embodiments, the first data may include configuration parameters, verification data, weight data, etc. of the target model. The configuration parameters may include the model's architecture information, input and output sizes, training hyperparameters, etc.; the verification data may include the model's loss value, etc., and the weight data may include weight coefficients of different structures of the model, etc.

[0036] In some embodiments, in response to starting the target model on the electronic device, first data of the target model is acquired in the first storage area based on an identification, index information, a storage path, etc. of the target model.

[0037] Exemplarily, in response to starting an image recognition model on an electronic device, based on attributes such as the name, version number, and creation time of the image recognition model, architecture information, input and output sizes, training hyperparameters, etc. of the image recognition model are obtained in the local storage space of the electronic device.

[0038] In some embodiments, the first data is pre-stored in a first storage area of ​​the electronic device, and after the target model is started, the target model is run by loading the first data.

[0039] Step S102: When the first data is different from the second data of the target model, the second data of the target model is acquired from a second storage area of ​​the electronic device, and third data is generated based on the second data and the first data.

[0040] The second data represents the complete data constituting the target model.

[0041] The first storage area and the second storage area are storage areas at different locations in the local storage space of the electronic device.

[0042] In some embodiments, the second storage area may be a designated or default specific storage location in the memory of the electronic device (which may be a mobile hard disk, a solid-state hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, etc.), wherein, if the second storage area and the first storage area are both storage areas in the memory of the electronic device, then the first storage area is the storage area of ​​the first partition in the memory of the electronic device, and the second storage area is the storage area of ​​the second partition in the memory of the electronic device; or, the first storage area is the storage area of ​​the second partition in the memory of the electronic device, and the second storage area is the storage area of ​​the first partition in the memory of the electronic device.

[0043] In some embodiments, the second storage area can also be a cloud storage area. If the first storage area and the second storage area are both storage areas in the cloud, if the cloud includes the first cloud and the second cloud, then the first storage area is the storage area in the first cloud, and the second storage area is the storage area in the second cloud; or the first storage area is the storage area in the second cloud, and the second storage space is the storage area in the first cloud.

[0044] In some embodiments, the second data is complete data of running the target model, and the second data is stored in the second storage area of ​​the electronic device as backup data of the target model.

[0045] In some embodiments, the second data represents the complete data constituting the target model, that is, the expected data when running the target, for example, the second data is the complete data constituting the target model of the target version. The first data can also be the complete data constituting the target model or the missing data.

[0046] When the first data is different from the second data of the target model, it indicates that the first data required to be loaded when starting the target model is damaged or the first data is not expected data when running the target model.

[0047] In some embodiments, in response to a startup instruction for a target model on an electronic device, first data of the target model is obtained from a first storage area of ​​the electronic device based on identification information, index information, name, etc. of the target model, and second data of the target model is obtained from a second storage area of ​​the electronic device based on identification information, index information, name, etc. of the target model, and the first data and the second data of the target model are compared. If the first data is different from the complete second data of the target model, indicating that the first data is damaged or the first data is not the expected data of the target model, the first data is repaired based on the second data of the target model to obtain the third data of the target model. The third data obtained by repairing the first data based on the expected second data is also the expected data when running the target model.

[0048] In some embodiments, the first data is repaired based on the second data of the target model to obtain the complete third data of the target model; this can be achieved by: obtaining damaged data in the first data that is different from the second data, and repairing the damaged data in the first data based on the second data to obtain the complete third data of the target model; or the second data can be used as the complete third data of the target model.

[0049] Step S103: Load the third data to run the target model.

[0050] In some embodiments, after obtaining the third data of the target model, the third data is first read into the memory of the electronic device; wherein, in the process of reading the data, it is necessary to read the third data in blocks or use memory mapping based on the size of the third data or the memory limit of the electronic device if the third data occupies a large amount of memory; then the third data read into the memory is processed to convert the third data into an object that can be operated or understood by the program. Different types of models have different parsing methods. For deep learning models, the parsing process usually involves restoring the architecture and parameters of the model; finally, it is also necessary to configure the operating environment of the target model, including setting the data format and dimension of the input and output of the target model to ensure that the shape and target type of the input data meet the requirements of the model; for example, for a deep learning model, it is necessary to set the number of channels and size of the input data to be consistent with the settings during model training; thereby completing the loading of the third data of the target model to run the target model.

[0051] In an embodiment of the present application, data that needs to be loaded when running a target model and expected complete data of the target model are stored in a first storage area and a second storage area of ​​an electronic device, respectively, to improve data security; when starting the target model on the electronic device, firstly, the first data that needs to be loaded when running the target model is obtained from the first storage area of ​​the electronic device, and the second data expected by the target model is obtained from the second storage area, so as to check the first data with the second data expected by the target model; when the first data that needs to be loaded is different from the complete second data, it indicates that the first data of the target model is damaged or the first model is not the expected data of the target model, so as to repair the first data based on the second data to obtain the expected third data, and load the third data to run the target model, thereby improving the integrity of the data when the target model is running; when the first data that needs to be loaded by the target model is damaged, the damaged first data can be repaired in time, thereby ensuring the normal operation of the target model and improving the user experience.

[0052] Figure 2 The following is a schematic diagram of a flow chart of a model operation method provided in an embodiment of the present application, which can be executed by a processor of an electronic device. Figure 1 , the first data and the second data are divided into at least one block of sub-data using the same division rule; each block of sub-data in the first data carries a position identifier in the first data; each block of sub-data in the second data carries a position identifier in the second data; Figure 1 Step S102 in the above method can be updated to step S201 to step S203, which will be combined with Figure 2 The steps shown are explained.

[0053] Step S201: Obtain block sub-data of a target group from at least one group of block sub-data with the same position identifier among at least one block sub-data of the first data and at least one block sub-data of the second data.

[0054] The sub-data of each group of blocks include first sub-data in the first data and second sub-data in the second data.

[0055] In some embodiments, the division rule may be to divide according to a preset size. For example, the first data and the second data of the target model are divided according to a size of 40 megabytes to obtain at least one block of sub-data of the first data and at least one block of sub-data of the second data.

[0056] In some embodiments, the division rules can also be based on the composition structure of the target model. For example, if the target model is a convolutional neural network (CNN) model, including convolutional layers, pooling layers, fully connected layers, etc., the target model is divided according to the convolutional layers, pooling layers and fully connected layers to obtain three blocks of sub-data.

[0057] In some embodiments, each block of the first data carries an identifier of its position in the first data. Exemplarily, the first data is divided according to a preset size starting from the head of the first data to obtain the first sub-data of five blocks of the first data, wherein the first block of the five blocks includes the first sub-data of the first block and a position identifier that the block is the first block of the five blocks, the second block of the five blocks includes the first sub-data of the block and a position identifier that the block is the second block of the five blocks, and so on. Similarly, each block of the second data carries an identifier of its position in the second data. Exemplarily, the second data is divided according to a preset size starting from the head of the second data to obtain the second sub-data of five blocks of the second data, wherein the first block of the five blocks includes the second sub-data of the first block and a position identifier that the block is the first block of the five blocks, the second block of the five blocks includes the second sub-data of the block and a position identifier that the block is the second block of the five blocks, and so on.

[0058] In some embodiments, subdata of two blocks with the same position identifier are obtained from the first subdata of at least one block of the first data and the second subdata of at least one block of the second data, and the subdata of the two blocks with the same position identifier are determined as a group; illustratively, the first data includes 1 to 5 blocks of first subdata, and the second data includes 1 to 5 blocks of second subdata, the first subdata of the first block of the first data and the second subdata of the first block of the second data are determined as a group of subdata of the blocks, and so on, to obtain 5 groups of subdata of the blocks.

[0059] In some embodiments, the first sub-data of the block of the first data and the second sub-data of the block of the second data in each group of blocked sub-data are compared, and the group where the first sub-data and the second sub-data are different is determined as the blocked sub-data of the target group; exemplarily, in each group of 5 groups of blocked sub-data, the hash values ​​of the first sub-data of the block of the first data and the second sub-data of the block of the second data are compared, and the group corresponding to the sub-data and the second sub-data with different hash values ​​is determined as the target group.

[0060] Step S202: reorganize the first sub-data and the second sub-data in the target group to generate target sub-data.

[0061] In some embodiments, the target group may include multiple groups, each target group corresponds to a target sub-data; illustratively, there are three target groups, namely the first target group, the second target group and the third target group, and the first target sub-data is obtained by data reorganization based on the first sub-data and the second sub-data in the first target group; the second target sub-data is obtained by data reorganization based on the first sub-data and the second sub-data in the second target group; the third target sub-data is obtained by data reorganization based on the first sub-data and the second sub-data in the third target group.

[0062] In some embodiments, the first sub-data is repaired based on the second sub-data in the target group to obtain the target sub-data.

[0063] In some embodiments, the second sub-data in the target group is determined as the target sub-data.

[0064] Step S203: Generate the third data based on the target sub-data and the first data.

[0065] In some embodiments, a target position identifier of a block corresponding to target sub-data is obtained, and in the sub-data of at least one block of the first data, the sub-data of the target block corresponding to the target position identifier is obtained, and the sub-data of the target block is replaced by the target sub-data to generate the third data; or the sub-data of the target block in the first data is repaired based on the target sub-data to obtain the third data.

[0066] In an embodiment of the present application, when the first data and the second data of the target model are different, that is, when the first data that needs to be loaded when starting the target model is damaged, the first data is divided into at least one block of sub-data, and based on at least one block of sub-data of the pre-divided second data, the damaged position in the first data is quickly determined, and the data at the damaged position in the first data is repaired based on at least one block of sub-data of the second data, so as to obtain complete third data, thereby improving the accuracy and security of data during the runtime of the target model and improving the user experience.

[0067] Figure 3 The following is a schematic diagram of a flow chart of a model operation method provided in an embodiment of the present application, which can be executed by a processor of an electronic device. Figure 2 , Figure 2 Step S203 in the above example can be updated to step S301 or step S302. Figure 3 The steps shown are explained.

[0068] Step S301: repair the first sub-data in the target group based on the second sub-data in the target group to obtain the target sub-data.

[0069] In some embodiments, the target group may include multiple groups, each target group corresponds to a target sub-data, and the first sub-data is repaired based on the second sub-data in each target group to obtain the target sub-data; exemplarily, there are three target groups, namely the first target group, the second target group and the third target group, and the first sub-data in the first target group is repaired based on the second sub-data in the first target group to obtain the first target sub-data; the first sub-data in the second target group is repaired based on the second sub-data in the second target group to obtain the second target sub-data; the first sub-data in the third target group is repaired based on the second sub-data in the third target group to obtain the third target sub-data.

[0070] In some embodiments, the first sub-data and the second sub-data may represent the architecture information of the model (such as the number of layers, the type of each layer, the number of neurons, the connection method, etc.), the hyperparameters used in training (such as the learning rate, the batch size, the optimizer type, etc.), and possible metadata (such as the training rounds, the statistical information of the training data set, etc.; it can be understood that the architecture information, the hyperparameters used in training, and the metadata in the first sub-data are repaired based on the architecture information, the hyperparameters used in training, and the metadata in the second sub-data to obtain the target sub-data.

[0071] Step S302: Determine the second sub-data in the target group as the target sub-data.

[0072] In some embodiments, the architecture information, hyperparameters used during training, metadata, etc. in the second sub-data replace the architecture information, hyperparameters used during training, metadata in the first sub-data to obtain the target sub-data.

[0073] In some embodiments, after obtaining the target sub-data, the target sub-data needs to be verified to improve the accuracy of the data.

[0074] In an embodiment of the present application, the first sub-data with data loss is repaired or replaced based on the complete second sub-data to obtain complete target sub-data, and then the complete third data is obtained based on the complete target sub-data to improve the accuracy of the model data and enhance the user experience.

[0075] Figure 4 The following is a schematic diagram of a flow chart of a model operation method provided in an embodiment of the present application, which can be executed by a processor of an electronic device. Figure 2 , Figure 2 Step S202 in can be updated to step S401 to step S402, combining Figure 4 The steps shown are explained.

[0076] Step S401: Obtain hash values ​​of the first sub-data and the second sub-data in the sub-data of each group of blocks.

[0077] In some embodiments, the hash values ​​of the first sub-data and the second sub-data can be calculated based on a hash value algorithm; illustratively, the hash value algorithm includes Message-Digest Algorithm 5 (MD5), Secure Hash Algorithm (SHA), and Cyclic Redundancy Check (CRC).

[0078] In some embodiments, the embodiments of the present application are described by taking the information digest algorithm 5 as an example. Data padding First, the first sub-data and the second sub-data to be hashed are padded so that the remainder after the modulus of their length is 448 after 512; for example, if the original data length is 400 bits, then a 1 needs to be added first, and then 47 0s need to be added to make its length 448 bits. Secondly, add length information to the padded data. At the end of the padded data, add another 64 bits to indicate the length of the original data (in bits). For example, if the original data length is 1000 bits, add a 64-bit binary number indicating 1000 after padded to 448 bits. Then group the data. Divide the padded and length-added data into several groups of 51 bits each. For example, if the total length of the data is 1536 bits after the previous processing, it can be divided into three 512-bit groups. Initialize variables. For example, initialize four 32-bit register variables, denoted as A, B, C, and D. The initial values ​​are usually: A=0x67452301, B=0xefcdab89, C=0x98badcf e, D = 0x10325476; loop processing, 4 rounds of processing for each 512-bit group, each round of processing contains 16 steps, a total of 64 steps; then merge the results, after all groups are processed, the values ​​of the four registers A, B, C, and D obtained in the last round of processing are connected in order to obtain a 128-bit result; finally output the hash value, usually converting the 128-bit result into a 32-bit hexadecimal number representation, for example, the 128-bit result obtained is 01100111010001010010001100000001……, which may be a string like 67452301efcdab8998badcfe10325476 after conversion to hexadecimal. Thus, the hash values ​​of the first sub-data and the second sub-data are obtained.

[0079] Step S402: determine the sub-data of the blocks of the corresponding groups of the first sub-data and the second sub-data having different hash values ​​as the sub-data of the blocks of the target group.

[0080] In some embodiments, the hash values ​​of the first sub-data and the second sub-data in each group of blocks are compared, and the sub-data of the blocks corresponding to the first sub-data and the second sub-data with different hash values ​​are determined as the sub-data of the blocks of the target group.

[0081] Exemplarily, the hash value of the first sub-data and the second sub-data in the first component block is 10101101 in binary, the hash value of the first sub-data in the second component block is 10100001, and the hash value of the second sub-data in the second component block is 1000011. It can be seen that the hash values ​​of the first sub-data and the second sub-data in the second component block are different, so the sub-data of the second component block is determined as the sub-data of the target component block.

[0082] In an embodiment of the present application, by calculating the hash values ​​of the first sub-data and the second sub-data in each group of blocks, the sub-data of the blocks corresponding to the first sub-data and the second sub-data with different hash values ​​are determined as the sub-data of the blocks of the target group, so as to quickly determine the damaged blocks in the first data, and then repair the damaged blocks in the first data based on the data of the corresponding complete blocks in the second data, thereby improving the accuracy of the data.

[0083] Figure 5 The following is a schematic diagram of a flow chart of a model operation method provided in an embodiment of the present application. The method can be executed by a processor of an electronic device. The method includes steps S501 to S503. Figure 5 The steps shown are explained.

[0084] Step S501: based on a preset division rule, divide the second data into at least one block of sub-data; and determine a hash value of each block of sub-data.

[0085] In some embodiments, the preset division rule may be division according to a preset size. For example, the first data and the second data of the target model are divided according to a size of 40 megabytes to obtain at least one block of sub-data of the second data.

[0086] In some embodiments, the preset division rule can also be based on the composition structure of the target model. For example, if the target model is a convolutional neural network (CNN) model, including convolutional layers, pooling layers, fully connected layers, etc., the target model is divided according to the convolutional layers, pooling layers and fully connected layers to obtain three blocks of sub-data of the second data.

[0087] In some embodiments, a hash value of the sub-data of each block of the at least one block of the second data is calculated based on a hash value algorithm.

[0088] Step S502: Determine the hash value of the second data based on the hash value of the sub-data of each block.

[0089] In some embodiments, hash values ​​of sub-data of each block in at least one block of the second data are accumulated to obtain a hash value of the second data.

[0090] Exemplarily, the second data includes three blocks of sub-data, and the hash values ​​of the three blocks of sub-data are accumulated to obtain the hash value of the second data.

[0091] Step S503: compress the sub-data of each block to obtain compressed second data; and save the compressed second data, the hash value of the second data, and the hash value of the sub-data of each block to the second storage area.

[0092] In some embodiments, the sub-data of each block of the second data is compressed through a compression algorithm to obtain compressed sub-data of each block, and the compressed sub-data of each block is determined as compressed second data; wherein the compression algorithm may include a lossless compression algorithm and a lossy compression algorithm. In the embodiment of the present application, since the data of the target model is compressed, a lossless compression algorithm can be used to improve the integrity of the compressed data.

[0093] In some embodiments, the compressed second data, the hash value of the sub-data of each block, and the hash value of the second data are stored as backup data of the target model in the second storage area of ​​the electronic device.

[0094] In an embodiment of the present application, the complete data of the target model is divided according to a preset division rule to perform block compression backup, and the hash value of each block and the hash value of the complete data are saved in a second storage area, so that the integrity of the data to be loaded can be checked when the target model is started, and when the data to be loaded is damaged, it can be repaired based on the backup data, thereby ensuring the normal operation of the target model, improving the user experience and improving the integrity of the target model data.

[0095] Figure 6 The following is a schematic diagram of a flow chart of a model operation method provided in an embodiment of the present application. The method can be executed by a processor of an electronic device. The method includes steps S601 to S602. Figure 6 The steps shown are explained.

[0096] Step S601: In response to starting the target model, obtaining a hash value of the first data from the first storage area, and obtaining a hash value of the second data from the second storage area.

[0097] In some embodiments, a user can start the target model on an electronic device through voice, mouse, keyboard, etc. After receiving the user's startup instruction for the target model, based on the identification information, index information, storage path, etc. of the target model, the first data of the target model is obtained in the first storage area, and the hash value of the first data is calculated based on the hash value algorithm; wherein the hash value of the first data can be calculated as a whole or in blocks; at the same time, based on the identification information, index information, storage path, etc. of the target model, the second data of the target model and the hash value of the second data are obtained in the second storage area.

[0098] Exemplarily, in response to a user obtaining first data of a target model from a first storage area of ​​an electronic device based on a name, version number, etc. of an image recognition model, a hash value of the first data is calculated based on a hash value algorithm, and simultaneously based on the name, version number, etc. of the image recognition model, a hash value of second data of the target model is obtained from a second storage area of ​​the electronic device.

[0099] Step S602: When the hash value of the first data is different from the hash value of the second data, it indicates that the first data is different from the second data.

[0100] In some embodiments, hash values ​​of first data and second data of the target model are compared. When the hash value of the first data is different from the hash value of the second data, the first data representing the target model is different from the second data, that is, the first data of the target model is lost or damaged.

[0101] In an embodiment of the present application, when it is necessary to run the target model, the hash value of the backup complete data of the target model is obtained from the second storage area of ​​the electronic device, and the data required to be loaded to run the target model is obtained from the first storage area of ​​the electronic device. A comprehensive check is performed on the data to be loaded based on the backup complete data. When the hash value of the backup complete data is different from the hash value of the data to be loaded, it is determined that the data to be loaded is corrupted, so that the data to be loaded is repaired, thereby improving the security of the model data and improving the user experience.

[0102] Figure 7 The following is a schematic diagram of a flow chart of a model operation method provided in an embodiment of the present application, which can be executed by a processor of an electronic device. Figure 1 The method may further include steps S701 to S703, combining Figure 7 The steps shown are explained.

[0103] Step S701: when the first data is different from the second data, based on a preset division rule, divide the first data into at least one block of sub-data; determine the hash value of each block of sub-data; and obtain the hash value of each block of sub-data in the second data from the second storage area.

[0104] In some embodiments, when the first data is characterized as damaged, the first data is divided into at least one block of sub-data based on a preset size, and a hash value of each block of sub-data is calculated based on a hash value algorithm; at the same time, at least one block of sub-data of the compressed second data and the hash value of each block of sub-data are obtained from the second storage area.

[0105] Each block of the first data carries a position identifier of the first data, and each block of the second data carries a position identifier of the second data.

[0106] Exemplarily, the first data is 4000 megabytes in size, and the first data of the target model is divided into 40 megabytes in size to obtain sub-data of up to 100 blocks of the first data, and a hash value of the sub-data of each block is calculated based on a hash value algorithm, and the sub-data of at least one block of the compressed second data and the hash value of the sub-data of each block are obtained from the second storage area.

[0107] Step S702: When the hash values ​​of the sub-data of the first target block in the first data are different from the corresponding sub-data of the second target block in the second data, obtain the sub-data of other blocks in the first data except the sub-data of the first target block from the first storage area, and obtain the sub-data of the second target block from the second storage area.

[0108] In some embodiments, in at least one block of the first data and at least one block of the second data, subdata of a first target block in the first data and subdata of a second target block in the second data with the same position identifier are obtained, and hash values ​​of the subdata of the first target block and the subdata of the second target block are compared. If the hash value of the subdata of the first target block is different from the hash value of the subdata of the second target block with its corresponding position identifier, it indicates that the subdata of the first target block is damaged, and at the same time, the subdata of the second target block is decompressed from the second storage area.

[0109] Step S703: Load the sub-data of other blocks in the first data and the sub-data of the second target block to run the target model.

[0110] In some embodiments, a damaged first target block in the first data is replaced by a second target block to obtain complete data of a target model, and data in the first data except the first target block and sub-data of the second target block are loaded to run the target model.

[0111] In an embodiment of the present application, before loading the first data of the target model, an integrity check is performed on the first data based on the complete second data of the backup of the target model stored in the second storage area. In the event that the first data is damaged, the first data is segmented and the segmentation of the second data locates the location where the data damage occurs in the first data, so that the first data is repaired through the segments in the second data to obtain the complete data of the target model. The complete data of the target model is loaded to run the target model, thereby improving data security and user experience at the same time.

[0112] In some embodiments, the above method further includes repairing the first data in the first storage area, which can be implemented in the following manner:

[0113] The first data in the first storage area is repaired based on the second data to obtain the repaired first data.

[0114] In some embodiments, the second data is backup data of a second storage area storing the electronic device, that is, the complete data of the target model. After the first data of the target model is damaged, the first data of the target model stored in the first storage area is repaired based on the complete data backed up for the target model, so that the first data of the target model stored in the first storage area is the complete data of the target model.

[0115] The first data in the first storage area is repaired based on the third data to obtain the repaired first data.

[0116] The repaired first data includes complete data of the target model.

[0117] In some embodiments, the third data is the third data obtained after the first data of the target model is damaged, and the first data is repaired based on the backup data of the second storage area of ​​the electronic device, that is, the complete data of the target model after the repair, and the first data of the target model stored in the first storage area is repaired so that the first data of the target model stored in the first storage area is the complete data of the target model. This ensures that when the target model is started next time, the complete first data of the target model in the first storage area is loaded to run the target model, so as to improve the security of the data and improve the user experience.

[0118] The following describes an exemplary application of a model operation method provided in an embodiment of the present application in an actual scenario.

[0119] With the update and iteration of artificial intelligence (AI) models, the parameters and accuracy of AI models have become the focus of attention, but the security issues at the model usage level are rarely mentioned. Models are also a kind of data and can also be damaged. It is difficult to safely run large-size models on artificial intelligence computers or laptops. In the prior art, when data corruption occurs during model operation, the model data is generally downloaded again or the wrong model data is detected from beginning to end, which is time-consuming, labor-intensive, and not user-friendly, resulting in a low user experience.

[0120] In response to the above technical problems, this application proposes an innovative block-based model data backup. When the model data is damaged, it can accurately locate the damaged area of ​​the model data and repair the damaged area, thereby improving the user experience and protecting data security.

[0121] In an embodiment of the present application, the data integrity of the model is checked before the local large model is loaded into the memory. If the model data is found to be damaged, the backup model data is obtained from the backup area and loaded into the memory, and the model data on the local disk is restored at the same time, thereby improving the security of the model data.

[0122] Figure 8 The following is a schematic diagram of a process implementation of a model operation method provided in an embodiment of the present application. The method can be executed by a processor of an electronic device. The method includes steps S801 to S804. Figure 8 The steps shown are explained.

[0123] Step S801: Divide the model data into multiple blocks, and calculate the hash value of the data in each block.

[0124] In some embodiments, before running the model, the complete data of the model is divided into multiple blocks based on a preset size, and a hash value of each block is calculated, and a total hash value of the complete data of the model is obtained based on the hash value of each block, where each block carries its position identifier in the complete data of the model.

[0125] Exemplarily, the model complete data size is 4000 megabytes. The model complete data is divided into 100 40-megabyte blocks of 40 megabytes in size, and the hash value of each block is calculated, where each block carries a location identifier in the model complete data. Fig. 9A schematic diagram of the process implementation of a model partitioning method provided in an embodiment of the present application, wherein 901 represents the model data after partitioning, 902 is the first block of the complete model data, and 903 is the 40th block of the model data.

[0126] Step S802: Compress the data of each block independently, and save the compressed data of each block, the hash value of the data of each block, and the hash value of the complete model data to the backup area.

[0127] In some embodiments, the backup area (corresponding to the second storage area in the above embodiment) can be a storage area in a local disk or a cloud storage.

[0128] Step S803: Before the model is loaded into the memory, the model data stored in the local disk is checked.

[0129] In some embodiments, the hash value of the model data (corresponding to the first data in the above embodiment) in the local disk (corresponding to the first storage area in the above embodiment) is first calculated, and the hash value of the complete model data is obtained from the backup area. If the hash value of the model data in the local disk is different from the hash value of the complete model data in the backup area, it indicates that the model data stored in the local disk is damaged.

[0130] Fig.10 A schematic diagram of an implementation of model data provided in an embodiment of the present application, wherein 1001 is the normal data part of the model, 1002 is the block where the normal data part 1001 is located, 1003 is the damaged part of the model, and 1004 is the block where the damaged part is located.

[0131] Step S804: repair the model data in the local disk based on the complete data of the model in the backup area.

[0132] In some embodiments, the model data stored in the local disk and the complete data in the backup area (corresponding to the second data in the above embodiment) are divided into multiple blocks according to the same division rule, and the hash value of the model data of each block is calculated, and the hash value of the block of model data in the local disk located at the same position of the model and the hash value of the block of complete data in the backup area are compared to obtain the first target block where the damaged location of the model data in the local disk is located, and the second target block in the backup area corresponding to the first target block is decompressed to obtain the data of the second target block, and the data of the first target block is repaired based on the data of the second target block to obtain the repaired complete data, and the repaired complete data is loaded into the memory to run the model.

[0133] In some embodiments, the model data in the local disk is repaired based on the data of the second target block, so that the model data stored in the local disk is complete model data.

[0134] In the embodiment of the present application, before the target model is run, the complete data of the target model needs to be backed up in the second storage area of ​​the electronic device. When the target model is started on the electronic device, the first data that needs to be loaded when running the target model is first obtained from the first storage area of ​​the electronic device, and the second data that backs up the complete target model is obtained from the second storage area. The complete second data of the backed up target model is compared with the first data. When the first data that needs to be loaded is different from the complete second data, the first data representing the target model is damaged, so the damaged first data is repaired based on the complete second data to obtain the complete third data, and the third data is loaded to run the target model, which enhances the model data security protection, can automatically check and restore the damaged model in time; it also speeds up the detection speed, and when the data is damaged, the AI ​​model data can be quickly loaded into the memory from the backup area; at the same time, through the block backup design, the data recovery is accurate and efficient, and the data recovery speed of the local large model is greatly improved. This allows users to experience fast and accurate services when using it, and data security is also fully guaranteed.

[0135] Based on the foregoing embodiments, the embodiments of the present application provide a model operation device, which includes the units included and the modules included in the units, which can be implemented by a processor in an electronic device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0136] Fig.11 A schematic diagram of the structure of a model operation device provided in an embodiment of the present application is shown in FIG. Fig.11As shown, the model running device 1100 includes: an acquisition module 1101, a generation module 1102, and a loading module 1103, wherein: the acquisition module 1101 is used to acquire the first data of the target model from the first storage area of ​​the electronic device; the first data represents the data that needs to be loaded when starting the target model; the generation module 1102 is used to acquire the second data of the target model from the second storage area of ​​the electronic device when the first data is different from the second data of the target model, and generate third data based on the second data and the first data; the second data represents the complete data constituting the target model; the loading module 1103 is used to load the third data to run the target model.

[0137] In some embodiments, the first data and the second data are divided into at least one block of sub-data using the same division rule; each block of sub-data in the first data carries a position identifier in the first data; each block of sub-data in the second data carries a position identifier in the second data; the generation module 1102 is also used to obtain the block sub-data of a target group in at least one group of block sub-data with the same position identifier in at least one block of sub-data of the first data and at least one block of sub-data of the second data; wherein each group of block sub-data includes the first sub-data in the first data and the second sub-data in the second data; the first sub-data and the second sub-data in the target group are reorganized to generate target sub-data; and the third data is generated based on the target sub-data and the first data.

[0138] In some embodiments, the generating module 1102 is further used to repair the first sub-data in the target group based on the second sub-data in the target group to obtain the target sub-data; and determine the second sub-data in the target group as the target sub-data.

[0139] In some embodiments, the generation module 1102 is further used to obtain hash values ​​of the first sub-data and the second sub-data in the sub-data of each group block; and determine the sub-data of the blocks corresponding to the first sub-data and the second sub-data with different hash values ​​as the sub-data of the target group block.

[0140] In some embodiments, the model running device 1100 also includes a saving module (not shown in the figure), which is used to divide the second data into at least one block of sub-data based on a preset division rule; and determine the hash value of the sub-data of each block; determine the hash value of the second data based on the hash value of the sub-data of each block; compress the sub-data of each block to obtain compressed second data; and save the compressed second data, the hash value of the second data, and the hash value of the sub-data of each block to the second storage area.

[0141] In some embodiments, the acquisition module 1101 is also used to obtain the hash value of the first data from the first storage area and the hash value of the second data from the second storage area in response to the startup of the target model; when the hash value of the first data is different from the hash value of the second data, it is characterized that the first data is different from the second data.

[0142] In some embodiments, the loading module 1103 is also used to, when the first data is different from the second data, divide the first data into at least one block of sub-data based on a preset division rule; determine the hash value of the sub-data of each block; and obtain the hash value of the sub-data of each block in the second data from the second storage area; when the hash value of the sub-data of a first target block in the first data is different from the hash value of the sub-data of the corresponding second target block in the second data, obtain the sub-data of other blocks in the first data except the sub-data of the first target block from the first storage area, and obtain the sub-data of the second target block from the second storage area; load the sub-data of other blocks in the first data and the sub-data of the second target block to run the target model.

[0143] In some embodiments, the model running device 1100 also includes a repair module (not shown in the figure), which is used to repair the first data in the first storage area based on the second data to obtain the repaired first data; repair the first data in the first storage area based on the third data to obtain the repaired first data; wherein the repaired first data includes the complete data of the target model.

[0144] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided in the embodiment of the present application can be used to execute the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0145] It should be noted that in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.

[0146] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.

[0147] The embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.

[0148] An embodiment of the present application provides a computer program, including a computer-readable code. When the computer-readable code is run in an electronic device, a processor in the electronic device executes some or all of the steps for implementing the above method.

[0149] The embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented specifically by hardware, software or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK) and the like.

[0150] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiments of the device, storage medium, computer program and computer program product of this application, please refer to the description of the method embodiment of this application for understanding.

[0151] Fig.12 A hardware entity diagram of an electronic device provided in an embodiment of the present application, such as Fig.12 As shown, the hardware entity of the electronic device 1200 includes: a processor 1201 and a memory 1202 , wherein the memory 1202 stores a first storage area 1203 and a second storage area 1204 .

[0152] The first storage area 1203 stores first data of the target model; the second storage area 1204 stores second data of the target model.

[0153] The processor 1201 is used to execute the following steps: obtaining first data of a target model from a first storage area; the first data represents data that needs to be loaded when starting the target model; when the first data is different from the second data of the target model, obtaining second data of the target model from a second storage area of ​​the electronic device, and obtaining third data based on the second data and the first data; the second data represents complete data constituting the target model; and loading the third data to run the target model. The processor 1201 generally controls the overall operation of the electronic device 1200.

[0154] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the method of any of the above embodiments.

[0155] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0156] The processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that implements the functions of the processor may also be other, and the embodiments of the present application are not specifically limited.

[0157] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0158] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of each step / process mentioned above does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The serial numbers of the embodiments of the present application mentioned above are for description only and do not represent the advantages and disadvantages of the embodiments.

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

[0160] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0161] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0162] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units. A person of ordinary skill in the art can understand that all or part of the steps of the above method embodiments can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above method embodiments are executed; and the above storage medium includes: mobile storage devices, read-only memory (ROM), disks or optical disks, etc. Various media that can store program codes.

[0163] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0164] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A model operation method, applied to an electronic device, comprising: Acquire first data of the target model from a first storage area of ​​the electronic device; The first data represents data that needs to be loaded when starting the target model; When the first data is different from the second data of the target model, acquiring the second data of the target model from a second storage area of ​​the electronic device, and generating third data based on the second data and the first data; the second data represents complete data constituting the target model; Loading the third data to run the target model; The first storage area and the second storage area are storage areas at different locations in the local storage space of the electronic device.

2. The method according to claim 1, wherein the first data and the second data are divided into at least one block of sub-data using the same division rule; each block of sub-data in the first data carries a position identifier in the first data; Each block of sub-data in the second data carries a position identifier in the second data; The generating the third data based on the second data and the first data comprises: Obtaining, from at least one block of sub-data of the first data and at least one block of sub-data of the second data, the block sub-data of the target group in at least one group of block sub-data with the same position identifier; wherein each group of block sub-data includes the first sub-data in the first data and the second sub-data in the second data; Recombining the first sub-data and the second sub-data in the target group to generate target sub-data; The third data is generated based on the target sub-data and the first data.

3. The method according to claim 2, wherein the step of reorganizing the first sub-data and the second sub-data in the target group to generate the target sub-data comprises at least one of the following: Repairing the first sub-data in the target group based on the second sub-data in the target group to obtain the target sub-data; The second sub-data in the target group is determined as the target sub-data.

4. The method according to claim 2, wherein obtaining the target group of block sub-data in at least one group of block sub-data having the same position identifier in the sub-data of the first data and the sub-data of the second data comprises: Obtain hash values ​​of first sub-data and second sub-data in the sub-data of each group of blocks; The sub-data of the blocks of the corresponding groups of the first sub-data and the second sub-data having different hash values ​​are determined as the sub-data of the blocks of the target group.

5. The method according to any one of claims 1 to 4, further comprising: Based on a preset division rule, the second data is divided into at least one block of sub-data; And determine the hash value of the sub-data of each block; Determine a hash value of the second data based on a hash value of the sub-data of each block; Compressing the sub-data of each block to obtain compressed second data; The compressed second data, the hash value of the second data, and the hash value of the sub-data of each block are stored in the second storage area.

6. The method according to claim 5, further comprising: In response to the activation of the target model, obtaining a hash value of the first data from the first storage area and a hash value of the second data from the second storage area; When the hash value of the first data is different from the hash value of the second data, it indicates that the first data is different from the second data.

7. The method according to claim 6, further comprising: In the case where the first data is different from the second data, dividing the first data into at least one block of sub-data based on a preset division rule; And determine the hash value of the sub-data of each block; and obtaining from the second storage area a hash value of the sub-data of each block in the second data; When the hash values ​​of the sub-data of the first target block in the first data and the sub-data of the corresponding second target block in the second data are different, obtaining the sub-data of other blocks in the first data except the sub-data of the first target block from the first storage area, and obtaining the sub-data of the second target block from the second storage area; Load the sub-data of other blocks in the first data and the sub-data of the second target block to run the target model.

8. The method according to any one of claims 1 to 4, further comprising at least one of the following: Repairing the first data in the first storage area based on the second data to obtain the repaired first data; Repairing the first data in the first storage area based on the third data to obtain the repaired first data; in, The repaired first data includes complete data of the target model.

9. A model running device, applied to an electronic device, comprising: An acquisition module, used for acquiring first data of a target model from a first storage area of ​​an electronic device; The first data represents data that needs to be loaded when starting the target model; a generating module, configured to obtain the second data of the target model from a second storage area of ​​the electronic device when the first data is different from the second data of the target model, and generate third data based on the second data and the first data; the second data represents the complete data constituting the target model; A loading module is used to load the third data to run the target model.

10. An electronic device, comprising a memory and a processor, wherein the memory comprises a first storage area and a second storage area; the first storage area stores first data of a target model; The second storage area stores second data of the target model; The processor is used to execute the acquisition of first data of the target model from the first storage area; the first data represents the data that needs to be loaded when starting the target model; When the first data is different from the second data of the target model, the second data of the target model is acquired from a second storage area of ​​the electronic device, and third data is obtained based on the second data and the first data; the second data represents complete data constituting the target model; The third data is loaded to run the target model.