Model upgrading method, electronic equipment and computer readable storage medium

By performing verification and upgrade processing on the model to be upgraded at the model application end, the problem of large data transmission volume during the model upgrade process is solved, and efficient and accurate model upgrade is achieved.

CN121658028APending Publication Date: 2026-03-13ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-10
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing model upgrade methods involve large data transfer volumes when the model is large or when upgrading multiple models, resulting in low model upgrade efficiency.

Method used

After receiving an upgrade request from the model training end, the model application end verifies the model to be upgraded using the verification information. If the verification passes, the model is upgraded using the upgrade configuration information, and the model to be upgraded is replaced with the upgraded model after the verification passes.

Benefits of technology

This reduces the amount of data transmitted during the model upgrade process, improves the efficiency and accuracy of model upgrades, avoids erroneous model upgrades, and ensures the reliability and efficiency of model upgrades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658028A_ABST
    Figure CN121658028A_ABST
Patent Text Reader

Abstract

The invention discloses a model upgrading method, electronic equipment and a computer readable storage medium. The method comprises the following steps: in response to a received model upgrading request sent by a model training end and a to-be-upgraded model corresponding to the model upgrading request existing in a model application end, performing verification processing on the to-be-upgraded model according to first verification information in the model upgrading request to obtain a first verification result; in response to the fact that the first verification result represents that verification is passed, the to-be-upgraded model is upgraded according to upgrading configuration information in the model upgrading request, and an upgraded model is obtained; and replacing the to-be-upgraded model with the upgraded model. Therefore, the data transmission quantity in the model upgrading process is reduced. And meanwhile, the model upgrading efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of deep learning technology, and in particular to a model upgrade method, an electronic device, and a computer-readable storage medium. Background Technology

[0002] Deep learning is one of the hottest technology fields today, with rapid updates and development. Especially since the advent of large language models, the attention mechanism they introduce has shown significant advantages in natural language processing. The technical applications of deep learning mainly include model training and model application. Due to the large computational demands of training, model training is typically performed on servers with abundant computing resources, such as workstations or cloud servers equipped with GPUs or NPUs. Model application, on the other hand, involves running the trained model on various devices with different computing resources, including edge devices, mobile devices, and servers, depending on the amount of data the model needs to process. Therefore, model training and model application are usually performed on different devices.

[0003] Current model upgrade methods typically involve sending the trained model to the application. However, this method results in a large data transfer volume when the model is large or when upgrading multiple models, leading to low model upgrade efficiency. Summary of the Invention

[0004] The main technical problem addressed by this application is to provide a model upgrade method, electronic device, and computer-readable storage medium that can improve model upgrade efficiency.

[0005] To address the aforementioned technical problems, this application provides a model upgrade method applied to a model application. The method includes: responding to receiving a model upgrade request sent by a model training end and the existence of a model to be upgraded corresponding to the model upgrade request in the model application, performing verification processing on the model to be upgraded according to first verification information in the model upgrade request to obtain a first verification result; responding to the first verification result indicating that the verification is successful, performing upgrade processing on the model to be upgraded according to upgrade configuration information in the model upgrade request to obtain an upgraded model; and replacing the model to be upgraded with the upgraded model.

[0006] In one embodiment, the method further includes: performing verification processing on the upgraded model according to the second verification information in the model upgrade request to obtain a second verification result; and in response to the second verification result indicating that the verification is passed, performing the step of replacing the model to be upgraded with the upgraded model.

[0007] In one embodiment, the upgrade configuration information includes at least one configuration parameter name and an adjustment strategy corresponding to the configuration parameter name. The step of upgrading the model to be upgraded according to the upgrade configuration information in the model upgrade request to obtain the upgraded model includes: selecting the corresponding current configuration parameter from the configuration information library of the model to be upgraded according to the configuration parameter name in the upgrade configuration information, wherein the configuration information library includes a correspondence between preset configuration parameter names and preset configuration parameters; adjusting the current configuration parameter of the model to be upgraded according to the adjustment strategy corresponding to the configuration parameter name to obtain the target configuration parameter; replacing the current configuration parameter in the configuration information library with the target configuration parameter to obtain the target configuration information library; and running the model based on the configuration parameter in the target configuration information library to obtain the upgraded model.

[0008] In one embodiment, the adjustment strategy is to modify the value of the weight, the current configuration parameter is the current weight, and the target configuration parameter is the target weight. The step of adjusting the current configuration parameter of the model to be upgraded according to the adjustment strategy corresponding to the configuration parameter name to obtain the target configuration parameter includes: modifying the current weight according to the target value in the adjustment strategy to obtain the modified weight; and determining the modified weight as the target weight.

[0009] In one embodiment, the step of verifying the model to be upgraded based on the first verification information in the model upgrade request to obtain a first verification result includes: obtaining first model verification information based on the first configuration information of the model to be upgraded; determining that the verification passed is the first verification result if the first verification information and the first model verification information are consistent; and determining that the verification failed is the first verification result if the first verification information and the first model verification information are inconsistent.

[0010] In one embodiment, the first configuration information includes multiple model parameters, and the first model verification information includes a first hash value. The step of obtaining the first model verification information based on the configuration information of the model to be upgraded includes: sorting the multiple model parameters of the model to be upgraded to obtain a parameter sequence; serializing each model parameter in the parameter sequence to obtain a processed parameter sequence; and calculating the first hash value based on the processed parameter sequence.

[0011] To address the aforementioned technical problems, this application provides a model upgrade method applied to a model training end. The method includes: generating a model upgrade request based on a model to be upgraded and a corresponding upgraded model; sending the model upgrade request to a model application end, so that the model application end, upon receiving the model upgrade request from the model training end and finding that the model to be upgraded exists in the model application end, performs verification processing on the model to be upgraded according to first verification information in the model upgrade request to obtain a first verification result; in response to the first verification result indicating that the verification is successful, performs upgrade processing on the model to be upgraded according to upgrade configuration information in the model upgrade request to obtain an upgraded model; and replacing the model to be upgraded with the upgraded model.

[0012] In one embodiment, the step of generating a model upgrade request based on the model to be upgraded and the corresponding upgraded model includes: reading first configuration information of the model to be upgraded and second configuration information of the upgraded model; comparing the first configuration information and the second configuration information to obtain a comparison result; and generating the upgrade configuration information based on the difference information in the comparison result, in response to the comparison result indicating that there is a difference between the first configuration information and the second configuration information.

[0013] To address the aforementioned technical problems, this application provides an electronic device, including a memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the aforementioned model upgrade method.

[0014] To address the aforementioned technical problems, this application provides a computer-readable storage medium, comprising: storing program data, which, when executed by a processor, is used to implement the aforementioned model upgrade method.

[0015] The above scheme, in response to receiving a model upgrade request from the model training end and finding that the model application end has a corresponding model to be upgraded, verifies the model to be upgraded based on the first verification information in the upgrade request, obtaining a first verification result; in response to the first verification result indicating successful verification, it upgrades the model to be upgraded based on the upgrade configuration information in the upgrade request, obtaining an upgraded model; and then replaces the model to be upgraded with the upgraded model. Thus, by using upgrade configuration information to upgrade the model to be upgraded, less data is required, thereby reducing the data transmission volume during the model upgrade process and improving model upgrade efficiency. Simultaneously, by verifying the model to be upgraded based on the first verification information and then upgrading the verified model, the accuracy of the model upgrade is improved. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein:

[0017] Figure 1 This is a flowchart illustrating an exemplary embodiment of the model upgrade method shown in this application;

[0018] Figure 2 This is a schematic flowchart of yet another exemplary embodiment of the model upgrade method shown in this application;

[0019] Figure 3 This is a flowchart illustrating yet another exemplary embodiment of the model upgrade method shown in this application;

[0020] Figure 4 This is a schematic diagram of an exemplary embodiment of the model upgrade system shown in this application;

[0021] Figure 5 This is a block diagram illustrating a model upgrade apparatus according to an exemplary embodiment of this application;

[0022] Figure 6 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application;

[0023] Figure 7 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are only for explaining this application and not for limiting it. Furthermore, it should be noted that, for ease of description, only the parts related to this application are shown in the accompanying drawings, not all structures. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] First, it's important to note that deep learning is one of the hottest technology fields today, with rapid updates and development. Especially since the advent of large language models, the attention mechanism they introduce has demonstrated significant advantages in natural language processing. The applications of deep learning mainly include model training and model application. Due to the large computational demands of training, model training typically needs to be completed on servers with abundant computing resources, such as workstations or cloud servers equipped with GPUs or NPUs. Model application, on the other hand, involves running the trained model on various devices with different computing resources, including edge devices, mobile devices, and servers, depending on the amount of data the model needs to process. Therefore, model training and model application usually occur on different devices. Current model upgrade methods typically involve sending the trained model to the application side; however, this method results in large data transfer volumes and low upgrade efficiency when the model is large or many models are being upgraded.

[0026] Based on this, this application provides a model upgrade method, an electronic device, and a computer-readable storage medium. For details, please refer to [link / reference needed]. Figure 1 , Figure 1 This is a schematic flowchart of an exemplary embodiment of a model upgrade method shown in this application.

[0027] The execution entity of a model upgrade method can be a terminal device, a server, or other processing device. The terminal device can be a computer, mobile device, terminal, computing device, vehicle-mounted device, etc. The execution entity of the model upgrade method can also be a model upgrade device. In some possible implementations, the model upgrade method can be implemented by a processor calling computer-readable instructions stored in memory. The execution entity of the model upgrade method can also be a big data cluster. A big data cluster is a computer system architecture formed by multiple computers connected through a network. The big data cluster can be deployed on a private cloud built with K8S (Kubernetes, a container orchestration engine).

[0028] Specifically, the model upgrade method is applied to the model application end. One model upgrade method in this embodiment includes the following steps:

[0029] Step S110: In response to receiving a model upgrade request sent by the model training end and the existence of a model to be upgraded corresponding to the model upgrade request in the model application end, perform verification processing on the model to be upgraded according to the first verification information in the model upgrade request to obtain the first verification result.

[0030] The model application end refers to the device that uses a trained model to process unlabeled data and obtain prediction results. The model application end can also be called the model inference end, and it runs the model through an inference engine. The inference engine refers to the hardware computing module that performs model inference calculations, such as a GPU, NPU, or CPU, or it can refer to the software module or framework that implements model inference. The model application end can be an edge device, a mobile device, or a server, etc.

[0031] The model training end refers to the device that uses labeled data to train a pre-defined network to obtain a trained model. The model training end can be a workstation or a cloud server, etc.

[0032] A model upgrade request is a request to update an existing model. A model upgrade request includes first verification information, second verification information, and upgrade configuration information. The model upgrade request also includes model identification information, which may include the model name, model serial number, or model access address.

[0033] The model to be upgraded refers to the model before the upgrade. The model to be upgraded can be a predictive model or a generative model before the upgrade. The model to be upgraded includes a separately stored model structure and a configuration information repository. The model structure includes model scripts and configuration files, and the configuration information repository includes the model's configuration parameters. For example, configuration parameters can be weights.

[0034] The first verification information is used to verify whether the model to be upgraded is accurate. The first verification information can be a first checksum or preset verification logic. For example, preset verification logic could be to determine whether the model script is a preset script, or to determine whether the model configuration file is a preset file.

[0035] Specifically, when the model application receives a model upgrade request from the model training end, it performs a query operation from the preset model database based on the model identification information in the model upgrade request. If the model corresponding to the model identification information is found, the found model is taken as the model to be upgraded, and it is confirmed that the model to be upgraded exists in the model application. If the model corresponding to the model identification information is not found, the model upgrade is confirmed to have failed, and a warning message is sent to the preset client.

[0036] The model application performs verification processing on the model to be upgraded based on the first verification information in the model upgrade request, and obtains the first verification result. As an example, the model application obtains the model script of the model to be upgraded, and determines whether the model script is consistent with the preset script. If so, the verification passes and is determined as the first verification result; otherwise, the verification fails and is determined as the first verification result. As another example, the model application obtains the configuration file, and determines whether the configuration file is consistent with the preset file. If so, the verification passes and is determined as the first verification result; otherwise, the verification fails and is determined as the first verification result.

[0037] As another example, the model application obtains the first model verification information based on the first configuration information of the model to be upgraded; if the first verification information and the first model verification information are consistent, the verification is determined to be passed as the first verification result; if the first verification information and the first model verification information are inconsistent, the verification is determined to be failed as the first verification result.

[0038] The first configuration information includes multiple model parameters. These model parameters can be weights. For example, the first configuration information may include a first weight and a second weight.

[0039] The first model verification information includes the first hash value.

[0040] The steps for obtaining the first model verification information based on the configuration information of the model to be upgraded by the model application end include: sorting multiple model parameters of the model to be upgraded to obtain a parameter sequence; serializing each model parameter in the parameter sequence to obtain a processed parameter sequence; and calculating the first hash value based on the processed parameter sequence.

[0041] The model application sorts multiple model parameters of the model to be upgraded to obtain a parameter sequence. Specifically, the model application sorts the parameters according to one of the following: name, priority, number of characters, or occurrence time.

[0042] The model application performs serialization processing on each model parameter in the parameter sequence to obtain the processed parameter sequence. Specifically, the model application converts the first attribute corresponding to each model parameter of the model to be upgraded into a first attribute in a preset format, and concatenates the first attributes corresponding to each model parameter according to the order of the model parameters to obtain the processed parameter sequence of the model to be upgraded.

[0043] The first attribute can include the name, data type, shape, and value of each model parameter in the model to be upgraded. The shape includes dimensions and quantity. For example, the first attribute can be the weight name, weight data type, weight shape, and weight value of the first weight in the model to be upgraded.

[0044] The default format is one that the model application can store or transmit.

[0045] In one embodiment, the model application converts the weight name, weight data type, weight shape, and weight value corresponding to the first weight into a first weight attribute in a preset format; converts the weight name, weight data type, weight shape, and weight value corresponding to the second weight into a second weight attribute in a preset format; and sorts the first weight attribute and the second weight attribute according to the order of the first weight and the second weight in the parameter sequence to obtain the processed parameter sequence of the model to be upgraded.

[0046] The model application calculates the first hash value based on the processed parameter sequence of the model to be upgraded. Specifically, the model application uses a preset hash function to calculate the first hash value from the processed parameter sequence of the model to be upgraded. The preset hash function can be a hash algorithm, such as md5 (Message Digest Algorithm 5) or sha256 (Secure Hash Algorithm 256-bit).

[0047] Step S120: In response to the first verification result indicating that the verification is passed, the model to be upgraded is upgraded according to the upgrade configuration information in the model upgrade request to obtain the upgraded model.

[0048] Upgrade configuration information refers to information that updates the configuration parameters of the model.

[0049] Upgrade processing refers to processes that improve model performance. Specifically, upgrade processing can involve updating configuration parameters.

[0050] An upgraded model refers to the upgraded model. An upgraded model can be an upgraded predictive model or a generative model, etc. An upgraded model includes a separately stored model structure and a target configuration information repository. It should be noted that the model structure of the model to be upgraded is the same as the model structure of the upgraded model.

[0051] The model application responds to the first verification result, indicating that the verification has passed. Based on the upgrade configuration information in the model upgrade request, it upgrades the model to be upgraded, resulting in an upgraded model. Specifically, the model application updates the configuration information database of the model to be upgraded according to the upgrade configuration information, obtaining a target configuration information database. Based on the model structure of the model to be upgraded and the target configuration information database, it determines the upgraded model. For example, the model application replaces the configuration information database of the model to be upgraded with the upgrade configuration information, obtaining the target configuration information database. The model running according to the model structure of the model to be upgraded and the target configuration information database is then identified as the upgraded model.

[0052] If the model application responds to the first verification result indicating that the verification failed, it will send a warning message to the preset client.

[0053] Step S130: Replace the model to be upgraded with the already upgraded model.

[0054] The model application replaces the model to be upgraded with the upgraded model. Specifically, the model application updates the configuration information database of the model to be upgraded to the target configuration information database of the upgraded model, and runs according to the model structure of the model to be upgraded and the target configuration information database, thereby realizing the replacement of the model to be upgraded and the upgraded model.

[0055] As can be seen, in response to a model upgrade request received from the model training end and the existence of a corresponding model to be upgraded in the model application end, the model to be upgraded is verified according to the first verification information in the model upgrade request, resulting in a first verification result. Responding to the first verification result indicating successful verification, the model to be upgraded is upgraded according to the upgrade configuration information in the model upgrade request, resulting in an upgraded model. The model to be upgraded is then replaced with the upgraded model. Therefore, upgrading the model to be upgraded using upgrade configuration information requires less data, thus reducing the data transmission volume during the model upgrade process and improving model upgrade efficiency. Simultaneously, verifying the model to be upgraded using the first verification information and then upgrading the verified model improves the accuracy of the model upgrade.

[0056] Figure 2 This is a flowchart illustrating another exemplary embodiment of the model upgrade method shown in this application. Specifically, one model upgrade method of this embodiment includes the following steps:

[0057] Step S210: In response to receiving a model upgrade request sent by the model training end and the existence of a model to be upgraded corresponding to the model upgrade request in the model application end, perform verification processing on the model to be upgraded according to the first verification information in the model upgrade request to obtain the first verification result.

[0058] For detailed steps of S210, please refer to step S110, which will not be repeated here.

[0059] Step S220: In response to the first verification result indicating that the verification is passed, the model to be upgraded is upgraded according to the upgrade configuration information in the model upgrade request to obtain the upgraded model.

[0060] For detailed steps of S220, please refer to step S120, which will not be repeated here.

[0061] Step S230: Perform verification processing on the upgraded model according to the second verification information in the model upgrade request to obtain the second verification result.

[0062] The second verification information is used to verify whether the upgraded model is accurate. The second verification information can be a second checksum or preset verification logic.

[0063] As an example, the model application obtains the model script or configuration file of the upgraded model, and determines whether the model script or configuration file is consistent with the second verification information. If so, the verification is passed and determined as the second verification result; otherwise, the verification fails and determined as the second verification result.

[0064] As another example, the model application obtains the second model verification information based on the second configuration information of the upgraded model; if the second verification information is consistent with the second model verification information, the verification is determined to be passed as the second verification result; if the second verification information is inconsistent with the second model verification information, the verification is determined to be failed as the second verification result.

[0065] The second configuration information includes multiple model parameters of the upgraded model. For example, the second configuration information may include third and fourth weights.

[0066] The second model verification information includes the second hash value.

[0067] The steps for obtaining the second model verification information based on the second configuration information of the upgraded model by the model application end include: sorting multiple model parameters of the upgraded model to obtain the parameter sequence of the upgraded model; serializing each model parameter in the parameter sequence of the upgraded model to obtain the processed parameter sequence of the upgraded model; and calculating the second hash value based on the processed parameter sequence of the upgraded model.

[0068] The model application sorts multiple model parameters of the upgraded model to obtain the parameter sequence of the upgraded model. Specifically, the model application sorts the parameters according to one of the following: name, priority, number of characters, or occurrence time. It should be noted that the model application uses the same sorting method as the model training end to sort the model parameters.

[0069] The model application serializes each model parameter in the parameter sequence of the upgraded model to obtain the processed parameter sequence of the upgraded model. Specifically, the model application converts the second attribute corresponding to each model parameter of the upgraded model into a second attribute in a preset format; and concatenates the second attributes corresponding to each model parameter according to the order of the model parameters to obtain the processed parameter sequence of the upgraded model.

[0070] The second attribute can include name, data type, shape, and value, with the shape including dimensions and quantity. For example, the second attribute could be the weight name, weight data type, weight shape, and weight value of the third weight in the upgraded model.

[0071] In one embodiment, the model application converts the weight name, weight data type, weight shape, and weight value corresponding to the third weight of the upgraded model into a third weight attribute in a preset format; converts the weight name, weight data type, weight shape, and weight value corresponding to the fourth weight of the upgraded model into a fourth weight attribute in a preset format; and concatenates the third weight attribute and the fourth weight attribute according to the order of the third weight and the fourth weight in the parameter sequence to obtain the processed parameter sequence of the upgraded model.

[0072] The model application calculates the second hash value based on the processed parameter sequence of the upgraded model. Specifically, the model application uses a preset hash function to calculate the second hash value on the processed parameter sequence of the upgraded model. It should be noted that the model application and the model training end use the same hash function to calculate the hash value.

[0073] Step S240: In response to the second verification result indicating that the verification is passed, the model to be upgraded is replaced with the upgraded model.

[0074] For detailed steps in step S240 of replacing the model to be upgraded with the already upgraded model, please refer to step S130, which will not be repeated here.

[0075] It should be noted that when the model application has models A and B with the same network structure but different configuration parameters, and these models are actually used in different scenarios, the algorithm performance will decrease if models A and B are used interchangeably. If the model application receives a model upgrade request that requires upgrading model A, the upgrade configuration information may upgrade model B incorrectly because models A and B have the same structure. To solve the above problem, this embodiment uses the first verification information in the model upgrade request to verify the model to be upgraded. If the verification passes, the model to be upgraded is upgraded, thereby avoiding the incorrect upgrade of model B with the same structure on the model application and improving the accuracy of model upgrades.

[0076] Furthermore, incomplete data transmission may occur during the model upgrade process. If the upgrade configuration information in the upgrade request is incomplete, the model to be upgraded will be upgraded using this incomplete information. The resulting upgraded model may differ from the upgraded model used in the model training process, leading to errors in the model upgrade. To address this issue, this application verifies the upgraded model using second verification information. Upon successful verification, the model to be upgraded is replaced with the upgraded model, thus ensuring the correctness of the model upgrade.

[0077] It can be seen that by performing dual verification on the model to be upgraded and the already upgraded model, erroneous model upgrades and errors that occur during model upgrades are avoided, ensuring the reliability and efficiency of model upgrades in the application end, while also improving the accuracy of model upgrades.

[0078] The steps for the model application to upgrade the model to be upgraded based on the upgrade configuration information in the model upgrade request to obtain the upgraded model include: selecting the corresponding current configuration parameter from the configuration information library of the model to be upgraded according to the configuration parameter name in the upgrade configuration information, the configuration information library including the correspondence between preset configuration parameter names and preset configuration parameters; adjusting the current configuration parameter of the model to be upgraded according to the adjustment strategy corresponding to the configuration parameter name to obtain the target configuration parameter; replacing the current configuration parameter in the configuration information library with the target configuration parameter to obtain the target configuration information library; and running the model based on the configuration parameter in the target configuration information library to obtain the upgraded model.

[0079] The steps of upgrading the model to be upgraded based on the upgrade configuration information in the model upgrade request to obtain the upgraded model also include: selecting the corresponding current configuration parameter from the configuration information library of the model to be upgraded according to the configuration parameter name in the upgrade configuration information, wherein the configuration information library includes the correspondence between preset configuration parameter names and preset configuration parameters; adjusting the current configuration parameter in the configuration information library according to the adjustment strategy corresponding to the configuration parameter name to obtain the target configuration information library; and running the model based on the configuration parameters in the target configuration information library to obtain the upgraded model.

[0080] Upgrade configuration information includes at least one upgrade entry, which includes the configuration parameter name and the corresponding adjustment strategy. For example, upgrade information can be replacement information, deletion information, or addition information.

[0081] In one embodiment, the replacement information includes the name of the weight to be replaced, and the data type, shape, and weight value of the replaced weight; the deletion information includes the name of the weight to be deleted; and the addition information includes the name of the weight to be added, and the data type, shape, and value of the weight to be added.

[0082] The model application process involves adjusting the current configuration parameters of the model to be upgraded according to the adjustment strategy corresponding to the configuration parameter name, to obtain the target configuration parameters. This includes: modifying the current weights according to the target values ​​in the adjustment strategy to obtain the modified weights; and determining the modified weights as the target weights. Here, the adjustment strategy refers to the value of the modified weights, the current configuration parameters are the current weights, and the target configuration parameters are the target weights.

[0083] In one embodiment, the model application traverses each upgrade information in the upgrade configuration information and adjusts the current configuration parameters of the model to be upgraded based on each upgrade information to obtain the target configuration parameters. For example, if the model application traverses each upgrade information in the upgrade configuration information and the currently traversed upgrade information is replacement information, the model application obtains the current weight of the model to be upgraded based on the name of the weight to be replaced, and replaces the data type, shape, and value of the current weight with the data type, shape, and value of the replacement weight to obtain the target weight; and / or, if the currently traversed upgrade information is deletion information, the model application obtains the current weight of the model to be upgraded based on the name of the weight to be deleted, and deletes the current weight and its attributes; and / or, if the currently traversed upgrade information is addition information, the model application stores the name of the weight to be added in the configuration information database and sets the data type, shape, and value of the weight to be added.

[0084] In another embodiment, the model application reads multiple current weights from the configuration information database of the model to be upgraded and stores these current weights in a current mapping table. The key of the current mapping table is the name of the current weight, and the data values ​​are the attributes of the current weight. The model application iterates through the replacement information in the upgrade configuration information and queries the current mapping table for the weight name to be replaced. If the weight name to be replaced does not exist in the current mapping table, the model upgrade fails. If it exists, the attribute corresponding to the weight name to be replaced in the current mapping table is replaced with the attribute corresponding to the replaced weight in the replacement information. The model application iterates through the deletion information in the upgrade configuration information and queries the current mapping table for the weight name to be deleted. If the weight name to be deleted does not exist in the current mapping table, the model upgrade fails. If it exists, the weight name to be deleted and its attributes are deleted from the current mapping table. The model application iterates through the addition information in the upgrade configuration information and queries the current mapping table for the weight name to be added. If the weight name to be added exists in the current mapping table, the model upgrade fails. If it does not exist, the weight name to be added and its attributes are inserted into the current mapping table. The model application generates second model verification information based on the modified current mapping table. The second model verification information is compared with the second verification information. If the second verification information and the second model verification information are consistent, the modified current mapping table is used as the model weight of the upgraded model.

[0085] Figure 3 This is a flowchart illustrating another exemplary embodiment of the model upgrade method shown in this application. Specifically, the model upgrade method provided in this embodiment is applied to the model training end, and the model upgrade method includes:

[0086] Step S310: Generate a model upgrade request based on the model to be upgraded and the corresponding upgraded model.

[0087] The model training end generates a model upgrade request based on the model to be upgraded and the corresponding upgraded model.

[0088] As an example, the model training end reads the first configuration information of the model to be upgraded and the second configuration information of the upgraded model; generates first verification information based on the first configuration information and generates second verification information based on the second configuration information; and uses the difference data between the second configuration information and the first configuration information as the upgrade configuration information.

[0089] The model training end generates the first verification information based on the first configuration information. Specifically, the model training end sorts multiple model parameters of the model to be upgraded to obtain a parameter sequence; it serializes each model parameter in the parameter sequence of the model to be upgraded to obtain the processed parameter sequence of the model to be upgraded; it calculates a hash value based on the processed parameter sequence of the model to be upgraded, and determines the calculated hash value as the first verification code.

[0090] The model training end generates second verification information based on the second configuration information. Specifically, the model training end sorts multiple model parameters of the upgraded model to obtain the parameter sequence of the upgraded model; it serializes each model parameter in the parameter sequence of the upgraded model to obtain the processed parameter sequence of the upgraded model; it calculates a hash value based on the processed parameter sequence of the upgraded model, and determines the calculated hash value as the second verification code.

[0091] As another example, the model training end reads the first configuration information of the model to be upgraded and the second configuration information of the upgraded model; compares the first configuration information and the second configuration information to obtain a comparison result; in response to the comparison result indicating that there is a difference between the first configuration information and the second configuration information, upgrade configuration information is generated based on the difference information in the comparison result; the model training end generates first verification information based on the first configuration information and second verification information based on the second configuration information; and uses the first verification information, the second verification information, and the upgrade configuration information as a model upgrade request.

[0092] In one embodiment, the model training end trains the model to be upgraded to obtain the upgraded model; reads the model weights of the model to be upgraded and stores them in the weight mapping table of the model to be upgraded, and reads the model weights of the upgraded model and stores them in the weight mapping table of the upgraded model. The key value of the weight mapping table is the name of the weight, and the data value is the attribute of the weight. The weight names in the weight mapping table of the upgraded model are traversed, and it is determined whether the currently traversed weight name exists in the weight mapping table of the model to be upgraded. If it does not exist, new information is generated in the upgrade configuration information based on the currently traversed weight name and its corresponding attribute. If it exists, it is determined whether the data value corresponding to the currently traversed weight name is the same as the data value corresponding to the same weight name in the weight mapping table of the model to be upgraded. If they are not the same, replacement information is generated in the upgrade configuration information based on the currently traversed weight name and its corresponding attribute. The model training end traverses the weight names in the weight mapping table of the model to be upgraded and determines whether the currently traversed weight name exists in the weight mapping table of the upgraded model. If it does not exist, deletion information is generated in the upgrade configuration information based on the currently traversed weight name and its corresponding attribute.

[0093] Therefore, upgrade configuration information is generated with weight as the smallest unit, and then the upgrade configuration information is used to upgrade the model to be upgraded on the model application side. The amount of data transmission is small, which is very suitable for the case of model fine-tuning and upgrading.

[0094] Step S320: Send the model upgrade request to the model application terminal so that the model application terminal responds to the receipt of the model upgrade request sent by the model training terminal and the existence of the model to be upgraded corresponding to the model upgrade request in the model application terminal. It performs verification processing on the model to be upgraded according to the first verification information in the model upgrade request and obtains the first verification result. In response to the first verification result indicating that the verification is passed, it performs upgrade processing on the model to be upgraded according to the upgrade configuration information in the model upgrade request and obtains the upgraded model. Replace the model to be upgraded with the upgraded model.

[0095] For detailed steps of step S320, please refer to steps S110, S120 and S130, which will not be repeated here.

[0096] In one embodiment, combined with Figure 4As shown, a model upgrade system includes a model training end and a model application end. The model training end trains a preset network to obtain a model to be upgraded, and then deploys this model to the model application end for the first time via data transmission. The model application end receives the model to be upgraded and deploys it to the inference engine for practical application. Upon receiving an instruction to fine-tune and update the model to be upgraded, the model training end trains the model to be upgraded using new training data to obtain an upgraded model. The training process may involve freezing some parameters of the model to be upgraded, updating the weight parameters, performing low-rank correction on some fully connected layers, adding some low-rank correction parameters, and adjusting the quantization parameters or quantization methods of some layers, causing changes in some parameters of the quantized model. The model training end generates a model upgrade request based on the model to be upgraded and its corresponding upgraded model, and sends the upgrade request to the model application end via data transmission. Upon receiving the model upgrade request, the model application end upgrades the model to be upgraded to obtain an upgraded model and replaces the model to be upgraded with the upgraded model.

[0097] As can be seen, a model upgrade request is generated using the model to be upgraded and its corresponding upgraded model. This upgrade request is then sent to the model application. Upon receiving the upgrade request, the application upgrades the model to be upgraded using the upgrade configuration information. Therefore, compared to transmitting the entire model, the training and application ends only need to transmit the upgrade request, significantly reducing the amount of data transmitted during the upgrade process and improving efficiency. Simultaneously, model verification is performed based on the first and second verification information in the upgrade request, achieving dual verification of both the model to be upgraded and the upgraded model. This effectively avoids erroneous upgrades and errors during the upgrade process, ensuring the reliability and efficiency of the model upgrade.

[0098] Figure 5 This is a block diagram illustrating a model upgrade apparatus as shown in an exemplary embodiment of this application. Figure 5 As shown, the exemplary model upgrade device 500 includes: a verification module 510, an upgrade module 520, and a replacement module 530. Specifically:

[0099] The verification module 510 is used to respond to a model upgrade request sent by the model training end and the model application end has a model to be upgraded corresponding to the model upgrade request, and to perform verification processing on the model to be upgraded according to the first verification information in the model upgrade request to obtain the first verification result.

[0100] The upgrade module 520 is used to respond to the first verification result indicating that the verification has passed, and to upgrade the model to be upgraded according to the upgrade configuration information in the model upgrade request, so as to obtain the upgraded model.

[0101] Replacement module 530 is used to replace the model to be upgraded with the already upgraded model.

[0102] In this exemplary model upgrade device, in response to receiving a model upgrade request from the model training end and the existence of a model to be upgraded corresponding to the upgrade request in the model application end, the model to be upgraded is verified according to the first verification information in the model upgrade request to obtain a first verification result; in response to the first verification result indicating that the verification is passed, the model to be upgraded is upgraded according to the upgrade configuration information in the model upgrade request to obtain an upgraded model; and the model to be upgraded is replaced with the upgraded model. Therefore, by upgrading the model to be upgraded using the upgrade configuration information, less data is required, thereby reducing the data transmission volume in the model upgrade process and improving the model upgrade efficiency. Simultaneously, by verifying the model to be upgraded using the first verification information and then upgrading the verified model, the accuracy of the model upgrade is improved.

[0103] The functions of each module can be found in the implementation examples of the model upgrade method, and will not be repeated here.

[0104] To implement the model upgrade method of the above embodiments, this application proposes another electronic device, please refer to [link / reference needed]. Figure 6 , Figure 6 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application.

[0105] Electronic device 600 includes memory 601 and processor 602, wherein memory 601 and processor 602 are coupled together.

[0106] The memory 601 is used to store program data, and the processor 602 is used to execute the program data to implement the model upgrade method of the above embodiment.

[0107] In this embodiment, processor 602 can also be referred to as CPU (Central Processing Unit). Processor 602 may be an integrated circuit chip with signal processing capabilities. Processor 602 can also be a general-purpose processor, digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. The general-purpose processor can be a microprocessor, or processor 602 can be any conventional processor.

[0108] This application also provides a computer-readable storage medium, such as Figure 7 As shown, the computer-readable storage medium 700 is used to store program data 701, which, when executed by a processor, is used to implement the model upgrade method as described in the method embodiments of this application.

[0109] The methods involved in the model upgrade method embodiments of this application, when implemented as software functional units and sold or used as independent products, can be stored in a device, such as a computer-readable storage medium. Based on this understanding, the technical solution of this application, essentially, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0110] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A model upgrade method, characterized in that, Applied to the model application end, the method includes: In response to receiving a model upgrade request sent by the model training end and the existence of a model to be upgraded corresponding to the model upgrade request in the model application end, the model to be upgraded is verified according to the first verification information in the model upgrade request to obtain a first verification result; In response to the first verification result indicating that the verification is passed, the model to be upgraded is upgraded according to the upgrade configuration information in the model upgrade request to obtain the upgraded model; Replace the model to be upgraded with the already upgraded model.

2. The method according to claim 1, characterized in that, The method further includes: The upgraded model is verified based on the second verification information in the model upgrade request to obtain the second verification result. If the second verification result indicates that the verification is successful, then the step of replacing the model to be upgraded with the upgraded model is executed.

3. The method according to claim 1, characterized in that, The upgrade configuration information includes at least one configuration parameter name and an adjustment strategy corresponding to the configuration parameter name. The step of upgrading the model to be upgraded according to the upgrade configuration information in the model upgrade request to obtain the upgraded model includes: Based on the configuration parameter name in the upgrade configuration information, the corresponding current configuration parameter is selected from the configuration information library of the model to be upgraded. The configuration information library includes the correspondence between preset configuration parameter names and preset configuration parameters. The current configuration parameters of the model to be upgraded are adjusted according to the adjustment strategy corresponding to the configuration parameter name to obtain the target configuration parameters; Replace the current configuration parameters in the configuration information base with the target configuration parameters to obtain the target configuration information base; The upgraded model is obtained by running the model based on the configuration parameters in the target configuration information database.

4. The method according to claim 3, characterized in that, The adjustment strategy is to modify the numerical value of the weights, the current configuration parameter is the current weight, and the target configuration parameter is the target weight. The step of adjusting the current configuration parameter of the model to be upgraded according to the adjustment strategy corresponding to the configuration parameter name to obtain the target configuration parameter includes: The current weight is modified according to the target value in the adjustment strategy to obtain the modified weight; The modified weights are determined as the target weights.

5. The method according to claim 1, characterized in that, The step of verifying the model to be upgraded based on the first verification information in the model upgrade request to obtain the first verification result includes: Obtain first model verification information based on the first configuration information of the model to be upgraded; If the first verification information and the first model verification information are consistent, then the verification is determined to be passed as the first verification result; If the first verification information and the first model verification information are inconsistent, then the verification failure is determined as the first verification result.

6. The method according to claim 5, characterized in that, The first configuration information includes multiple model parameters, the first model verification information includes a first hash value, and the step of obtaining the first model verification information based on the configuration information of the model to be upgraded includes: The multiple model parameters of the model to be upgraded are sorted to obtain a parameter sequence; The model parameters in the parameter sequence are serialized to obtain the processed parameter sequence; The first hash value is calculated based on the processed parameter sequence.

7. A model upgrade method, characterized in that, Applied to the model training end, the method includes: A model upgrade request is generated based on the model to be upgraded and the corresponding upgraded model. The model upgrade request is sent to the model application terminal, so that the model application terminal, in response to receiving the model upgrade request sent by the model training terminal and having a model to be upgraded corresponding to the model upgrade request in the model application terminal, performs verification processing on the model to be upgraded according to the first verification information in the model upgrade request to obtain a first verification result; in response to the first verification result indicating that the verification is passed, the model to be upgraded is upgraded according to the upgrade configuration information in the model upgrade request to obtain an upgraded model; and the model to be upgraded is replaced with the upgraded model.

8. The method according to claim 7, characterized in that, The step of generating a model upgrade request based on the model to be upgraded and the corresponding upgraded model includes: Read the first configuration information of the model to be upgraded and the second configuration information of the upgraded model; The first configuration information and the second configuration information are compared to obtain a comparison result. In response to the comparison result indicating a difference between the first configuration information and the second configuration information, the upgrade configuration information is generated based on the difference information in the comparison result.

9. An electronic device, characterized in that, include: A memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to perform the method as claimed in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, include: The system stores program data, which, when executed by a processor, is used to implement the method as described in any one of claims 1-8.