Model source closing method and device, electronic equipment, storage medium and product

By using encrypted model files and edge functions for decryption and encryption during model training, the risk of model core code leakage is solved, and the confidentiality of model files and the security of developer research results is achieved.

CN119830312APending Publication Date: 2025-04-15CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411716286.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

During the model training process, developers fail to effectively protect model files, resulting in the risk of leaking the core code of the model and bringing unpredictable losses to developers.

Method used

By obtaining the encrypted model file and the first edge function, in response to the model training request, the trigger corresponding to the edge function is matched based on the preset trigger rules, confirm the user's identity and decryption processing, and encrypt it again after the training is completed.

Benefits of technology

Ensure the confidentiality of model files during model training, prevent non-developers from obtaining core model code, and protect developers' research results and the safety of corporate or government's property.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830312A_ABST
    Figure CN119830312A_ABST
Patent Text Reader

Abstract

The invention provides a model closed source method and device, electronic equipment, a storage medium and a product, and relates to the technical field of communication, and the method comprises the steps: obtaining an encrypted model file and a first edge function; in response to the model training request, matching with a first trigger corresponding to the first edge function based on a first trigger rule; under the condition of successful matching, decrypting the model file based on the first edge function, and training the target model based on the decrypted model file to obtain a model training file; and based on the first edge function and the first trigger rule, performing encryption processing on the model training file. According to the embodiment of the invention, the first edge function is matched with the first trigger rule, a user is affirmed to decrypt the model file for a developer under the condition of successful matching, and encryption is performed again after training is finished, so that the confidentiality of the model file in the training process is ensured, and a model closed source is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communication technology, and specifically, to a model closed-source method, device, electronic device, storage medium, and product. Background Art

[0002] Model developers use a certain development language to write models, prepare existing test data sets and training data sets to train them, and confirm the precision and accuracy of the models. In actual use, the model needs to be verified and tested, and there may be fine-tuning of the model to improve model performance and ensure the performance of the model in actual scenarios. However, if the developer does not take confidentiality measures during this process, there will be a risk of leakage of the core code of the model, which will bring unpredictable losses to the developer.

[0003] Based on the protection of the core code and training results of the enterprise or government model, and avoiding major property losses of the company or government caused by model leakage, how to achieve the confidentiality of model files during model training, and then realize the closed source of the model, so that the research results of developers can be safely guaranteed, has become an urgent problem to be solved in this field. Summary of the invention

[0004] The embodiments of the present application provide a model closed-source method, device, electronic device, storage medium and product, aiming to solve the problem of how to keep the model files confidential during the model training process and thus achieve model closed-source.

[0005] A first aspect of an embodiment of the present application provides a model closed-source method, the method comprising:

[0006] Obtain the encrypted model file and the first edge function;

[0007] In response to a model training request, matching a first trigger corresponding to the first edge function based on a first trigger rule, the first trigger rule being configured to confirm that the user is a credential of a decryptable object in a model training process;

[0008] In the case of successful matching, the model file is decrypted based on the first edge function, and the target model is trained based on the decrypted model file to obtain a model training file;

[0009] Based on the first edge function and the first trigger rule, the model training file is encrypted.

[0010] In an optional implementation, before matching the first trigger corresponding to the first edge function based on the first trigger rule, the method further includes:

[0011] Binding the first edge function and the first trigger;

[0012] receiving the model training request, and acquiring the first trigger rule set by the user based on the model training request;

[0013] In response to the model training request, a target edge node is determined.

[0014] In an optional implementation, in response to the model training request, matching the first trigger corresponding to the first edge function based on the first trigger rule includes:

[0015] Calling, at the target edge node, a calculation logic corresponding to the first edge function;

[0016] Based on the acceleration domain name of the target edge node, the first trigger rule is matched with the trigger rule of the first trigger.

[0017] In an optional implementation, when the matching is successful, decrypting the model file based on the first edge function, and training the target model based on the decrypted model file includes:

[0018] Based on the routing access rule, sending the first trigger rule that matches successfully to the first edge function corresponding to the first trigger;

[0019] Decrypting the model file based on the first edge function to obtain the decrypted model file;

[0020] The target model is trained based on the model training parameters in the decrypted model file.

[0021] In an optional implementation manner, decrypting the model file based on the first edge function to obtain the decrypted model file includes:

[0022] Constructing a decryption request based on the first edge function, the decryption request including at least an access key ID, an original message, and a signature;

[0023] Based on the access key ID in the decryption request, searching for a secret access key corresponding to the access key ID;

[0024] Obtaining a first digest based on the original message, and obtaining a second digest based on the secret access key and the signature;

[0025] When the first digest is identical to the second digest, the model file is decrypted to obtain the decrypted model file.

[0026] In an optional implementation, after encrypting the trained model file based on the first edge function and the first trigger rule, the method further includes:

[0027] Obtaining the model training file and the second edge function;

[0028] In response to the model deployment request, matching a second trigger corresponding to the second edge function based on a second trigger rule, the second trigger rule being configured to confirm that the user is a credential of a decryptable object in a model deployment and testing process;

[0029] In the case of successful matching, decrypting the model training file based on the second edge function;

[0030] The target model is deployed and tested based on the decrypted model training file.

[0031] A second aspect of the embodiments of the present application provides a model closed-source device, which is used to implement the model closed-source method described in any one of the first aspects of the embodiments of the present application, and the device includes:

[0032] A trigger module, the trigger module is used to obtain an encrypted model file and a first edge function; in response to a model training request, matching a first trigger corresponding to the first edge function based on a first trigger rule, wherein the first trigger rule is configured to confirm that the user is a credential of a decryptable object in the model training process;

[0033] A preprocessing module, wherein the preprocessing module is used to decrypt the model file based on the first edge function when the matching is successful;

[0034] A model training module, wherein the model training module is used to train a target model using the decrypted model file to obtain a model training file;

[0035] A post-processing module, wherein the post-processing module is used to encrypt the model training file based on the first edge function and the first trigger rule.

[0036] In an optional implementation, the trigger module includes:

[0037] A binding submodule, wherein the binding submodule is used to bind the first edge function and the first trigger;

[0038] A first trigger rule acquisition submodule, the first trigger rule acquisition submodule is used to receive the model training request, and based on the model training request, acquire the first trigger rule set by the user;

[0039] A target edge node determination submodule is used to determine a target edge node in response to the model training request.

[0040] In an optional implementation, the trigger module includes:

[0041] A computing logic submodule, wherein the computing logic submodule is used to call computing logic corresponding to the first edge function at the target edge node;

[0042] The first matching submodule is used to match the first trigger rule with the trigger rule of the first trigger based on the acceleration domain name of the target edge node.

[0043] In an optional implementation, the preprocessing module includes:

[0044] A routing access submodule, the routing access submodule being used for sending the first trigger rule that matches successfully to the first edge function corresponding to the first trigger based on the routing access rule;

[0045] A first decryption submodule, the decryption submodule is used to decrypt the model file based on the first edge function to obtain the decrypted model file;

[0046] The model training module includes:

[0047] A model training submodule, wherein the model training submodule is used to train the target model based on the model training parameters in the decrypted model file.

[0048] In an optional implementation manner, the first decryption submodule includes:

[0049] A decryption request unit, the decryption request unit being used to construct a decryption request based on the first edge function, the decryption request comprising at least an access key ID, an original message, and a signature;

[0050] an access key unit, the access key unit being used to find a secret access key corresponding to the access key ID based on the access key ID in the decryption request;

[0051] a digest obtaining unit, the digest obtaining unit being configured to obtain a first digest based on the original message, and to obtain a second digest based on the secret access key and the signature;

[0052] A decryption unit is used for decrypting the model file to obtain the decrypted model file when the first digest is the same as the second digest.

[0053] In an optional implementation, the trigger module further includes:

[0054] A second edge function acquisition submodule, the second edge function acquisition submodule is used to secondly acquire the model training file and the second edge function;

[0055] A second matching submodule, the second matching submodule being configured to match a second trigger corresponding to the second edge function based on a second trigger rule in response to the model deployment request, wherein the second trigger rule is configured to confirm that the user is a credential of a decryptable object in a model deployment and testing process;

[0056] A second decryption submodule, wherein the second decryption submodule is used to decrypt the model training file based on the second edge function when the matching is successful;

[0057] The model closed-source device further includes:

[0058] A model deployment module, the model deployment module is used to deploy the target model based on the decrypted model training file;

[0059] A model testing module is used to test the deployed target model based on the decrypted model training file.

[0060] A third aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps in the model closed-source method described in any one of the first aspect of the embodiments of the present application.

[0061] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the steps of the model closed-source method described in any one of the first aspect of the embodiment of the present application are implemented.

[0062] A fifth aspect of an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps in the model closed-source method disclosed in the embodiment of the present application.

[0063] Beneficial effects:

[0064] The present application provides a model closed-source method, device, electronic device, storage medium and product, the method comprising: obtaining an encrypted model file and a first edge function; in response to a model training request, matching a first trigger corresponding to the first edge function based on a first trigger rule, the first trigger rule being configured as a credential for confirming that the user is a decryptable object in the model training process; in the case of a successful match, decrypting the model file based on the first edge function, and training the target model based on the decrypted model file to obtain a model training file; encrypting the model training file based on the first edge function and the first trigger rule. The embodiment of the present application matches the first edge function preset by the user with the first trigger rule of the user, and in the case of a successful match, identifies the user as a developer to decrypt the model file, and encrypts it again based on the first edge function and the first trigger rule after the training is completed, thereby ensuring the confidentiality of the model file during the training process and realizing model closed-source. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0066] Figure 1 It is a schematic diagram of the steps of a model closed-source method proposed in one embodiment of the present application;

[0067] Figure 2 It is a schematic diagram of realizing model closure based on an edge function in a trigger in a model closure method proposed in an embodiment of the present application;

[0068] Figure 3 It is a schematic diagram of an application module of a model training process in a model closed-source method proposed in an embodiment of the present application;

[0069] Figure 4 It is a schematic diagram of an application module of a model deployment test process in a model closed-source method proposed in one embodiment of the present application;

[0070] Figure 5 It is a structural schematic diagram of a model closed-source device proposed in one embodiment of the present application;

[0071] Figure 6 It is a schematic diagram of an electronic device proposed in an embodiment of the present application. DETAILED DESCRIPTION

[0072] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0073] In the drawings, the size of the constituent elements, the thickness of the layer or the area may be exaggerated for the sake of clarity. Therefore, any implementation of the present disclosure is not necessarily limited to the size shown in the drawings, and the shapes and sizes of the components in the drawings do not reflect the true proportions. In addition, the drawings schematically show ideal examples, and any implementation of the present disclosure is not limited to the shapes or values ​​shown in the drawings.

[0074] Machine learning has entered the era of large models, and the scene applications based on large models have also been continuously expanded. AI has gradually penetrated all walks of life, such as video, text, and dialogue. For example, the ChatGPT model launched in 2023 simulates real interactions, and the Sora model launched in 2024 directly generates a one-minute video based on text instructions. These models have demonstrated strong expressiveness and generalization capabilities by absorbing massive amounts of data for training.

[0075] Edge functions allow enterprise developers to deploy customized JavaScript code to global edge nodes in seconds with one click. Developers only need to focus on business logic, and the expansion, operation and maintenance, and scheduling of the remaining machine resources are automatically completed by the CDN acceleration platform. Edge functions allow developers to deploy customized function codes to multiple edge nodes in different regions on the cloud platform with one click in seconds. Combined with CDN technology, it responds to user requests nearby, greatly reducing the network delay caused by back-to-source. In addition, with the use of WebAssembly technology, function cold start is optimized to the subtle level, minimizing the impact on network delay. After deployment, serverless applications can respond to demand and automatically expand capacity as needed. Public cloud providers' serverless products are usually metered on demand through an event-driven execution model (such as HTTP triggers). When serverless functions are idle, no fees are incurred. Users bind triggers and corresponding functions to achieve multiple call effects to achieve the effect of automated processing.

[0076] Model developers use a certain development language to write models, prepare existing test data sets and training data sets to train them, and confirm the precision and accuracy of the models. In actual use, the model needs to be verified and tested, and there may be fine-tuning of the model to improve model performance and ensure the performance of the model in actual scenarios. However, if the developer does not take confidentiality measures during this process, there will be a risk of leakage of the core code of the model, which will bring unpredictable losses to the developer.

[0077] Based on the protection of the core code and training results of the enterprise or government model, and avoiding major property losses of the company or government caused by model leakage, how to achieve the confidentiality of model files during model training, and then realize the closed source of the model, so that the research results of developers can be safely guaranteed, has become an urgent problem to be solved in this field.

[0078] In view of this, the present application embodiment proposes a model closed source method. Figure 1 A schematic diagram of the steps of a model closed-source method proposed in an embodiment of the present application is shown. Figure 1 As shown, the method comprises the following steps:

[0079] S101, obtaining an encrypted model file and a first edge function.

[0080] When step S101 is specifically implemented, Figure 3 A schematic diagram of an application module of a model training process in a model closed-source method proposed in an embodiment of the present application is shown. Figure 3 As shown, before model training, first obtain the model file for model training, the model file is used to define the structure, weight, configuration and related preprocessing information of the model for the model training process, and optionally, the model file includes at least one of the following: model configuration file (such as config.json), model weight file, tokenizer (Tokenizer) related file, version control and additional tag file and other files. Among them, the model configuration file contains the configuration information of the model, such as model architecture, hyperparameters, etc., which are used to define the structure and function of the model, including the definition of various layers, the size of the fully connected layer, the type of attention, etc. In addition, the model configuration file also contains parameters for controlling the model training, evaluation, and reasoning process, such as learning rate, optimizer type, etc.; the model weight file is used to save the weights and parameters learned by the model during the training process; the tokenizer related files include but are not limited to vocabulary files, special tag mapping files, word segmenter configuration files, etc.; the version control and additional tag files include files for version control, and JSON format files that record new tags added to the tokenizer.

[0081] When submitting a model for training or deployment, you need to ensure that all necessary files are correctly included. These files together form a complete representation of the model, allowing the model to be loaded, inferred, and evaluated in different environments or frameworks. At the same time, depending on the specific deep learning framework and library (such as Hugging Face Transformers, TensorFlow, PyTorch, etc.), the structure and naming of the model files may vary. Therefore, when submitting a model, you also need to refer to the documentation of the corresponding framework or library to ensure the correctness and completeness of the file.

[0082] Among them, since the model developer uses a certain development language to write the model, prepares existing test data sets and training data sets to train it and confirm the precision and accuracy of the model. During the training and deployment test of the actual model, the model needs to be verified and tested, and there may be fine-tuning of the model to improve model performance and ensure the performance of the model in actual scenarios. However, if the developer does not take confidentiality measures during this process, there will be a risk of leakage of the core code of the model, which will bring unpredictable losses to the developer.

[0083] In the embodiment of the present application, in order to improve the confidentiality of the model during the training process and prevent the core code of the model in the model file from being obtained by non-developers during the training process and causing significant losses, before the model training, the user uploads the first edge function to the trigger module, and the first edge function is used to decrypt the model file when the user is confirmed to be a model developer, and encrypt the model training file after the model training is completed. Among them, the trigger module is an event-driven execution model, and the trigger module is used to call the stored edge function to implement encryption and decryption processing.

[0084] In the embodiments of the present application, the edge function refers to a function executed at the edge of the network (such as an edge node such as an IoT device or an edge server), which can process data in real time, reduce data transmission delays, and improve system response speed. Edge functions are usually lightweight, easy to deploy, and scalable, and can be integrated with a variety of data sources and triggers.

[0085] In some optional implementations, after obtaining the encrypted model file and the first edge function, the first edge function is preset in the trigger module, and the trigger module includes multiple triggers. The trigger is a special type of stored procedure or logic. When a specific event occurs in the system (such as data insertion, update, deletion, or specific conditions are met), the trigger will be automatically executed. In the context of model training and deployment, the trigger can be used to monitor changes in data flow, changes in system status, etc., and trigger the execution of the edge function accordingly. Since multiple different edge functions can be preset in the trigger module to perform different tasks, it is necessary to correspond different triggers to different edge functions respectively, and bind each edge function to the trigger so that when the matching conditions of the embodiment of the present application are met, the corresponding edge function is triggered to perform the corresponding task. By binding the corresponding edge function and trigger, it is ensured that when a specific event occurs, the corresponding edge function can be automatically called to process data or perform tasks. Specifically, before matching the first trigger corresponding to the first edge function based on the trigger rule, the first edge function and the first trigger are bound so that when the model closed-source device or system meets the matching conditions for the first edge function, the bound first edge function is called by the first trigger to perform decryption processing.

[0086] In some optional implementations, the binding method of the first edge function and the first trigger includes but is not limited to the following methods: declarative binding, the declarative binding refers to declaring the binding relationship between the first trigger and the first edge function through a configuration file (such as function.json) or an annotation (such as @FunctionName in Java), specifying the type, direction (input / output), name and connection information of the first trigger in the configuration file, and at the same time, specifying the name, parameters and return value type of the first edge function, so as to realize the binding of the first trigger and the first edge function; programmatic binding, the programmatic binding refers to directly writing logic in the code of the first edge function to listen to the event of the first trigger, and executing the corresponding processing logic when the event occurs; using a framework or tool for binding, specifically refers to using an existing framework or tool (such as Azure Functions, AWS Lambda, etc.) to simplify the binding process of the first trigger and the first edge function, and providing a rich set of triggers and binding options, as well as an easy-to-use development and management interface through the framework or tool. It should be noted that the binding schemes given above are only some optional schemes, and the technical personnel of this application can also use other binding methods to realize the binding of the first edge function and the first trigger according to actual conditions, and the embodiments of this application are not specifically limited to this.

[0087] After the binding of the first edge function and the first trigger is realized, a model training request sent by a user is received, and the model training request is used to start the training task of the model on the model training platform. In order to improve the effect of the model training, it is necessary to push the model training process closer to the data source. Specifically, in response to the model training request, a target edge node is determined, and the target edge node is the edge node with the lowest transmission delay with the model data among the multiple edge nodes of the system platform.

[0088] In some optional implementations, the target edge node is determined according to the following steps: first, in response to the user's model training request, the delay information between multiple edge nodes at different locations in the system platform and the location where the model data is located is obtained, wherein the delay information between the edge node at each location and the location where the model data is located represents the total time required for the terminal device at the location where the model data is located to send to the edge node at each location and return the result. In the case where the delay information between the edge node and the location where the model data is located is large, it indicates that when the edge node is used as the target edge node for running the model training task, there will be a large delay in the data transmission between the target edge node and the terminal device storing the model data; on the contrary, when the delay information between the edge node and the location where the model data is located is small, it indicates that when the edge node is used as the target edge node for running the model training data, there will be a small delay in the data transmission between the target edge node and the terminal device storing the model data. Subsequently, based on the delay information between the multiple edge nodes and the location where the model data is located, the edge node with the smallest delay information between the edge node and the location where the model data is located is determined as the target edge node.

[0089] In some other optional implementations, the target edge node can also be determined in the following manner: first, in response to the user's model training request, the distance information between multiple edge nodes at different locations in the system platform and the location where the model data is located is obtained. When the distance information between the edge node and the location where the model data is located is large, it indicates that when the edge node is used as the target edge node for running the model training task, the target edge node and the terminal device storing the model data need to be transmitted over a longer distance, resulting in a larger delay in data transmission; on the contrary, when the distance information between the edge node and the location where the model data is located is small, it indicates that when the edge node is used as the target edge node for executing the model training task, the target edge node and the user terminal device storing the model data need to be transmitted over a shorter distance for data transmission, resulting in a smaller delay in data transmission. Subsequently, based on the distance information between the multiple edge nodes and the location where the model data is located, the edge node with the smallest distance information to the location where the model data is located is determined as the target edge node.

[0090] In the embodiment of the present application, by setting the target edge node to perform the model training task, the following effects are achieved:

[0091] Reduced transmission costs and latency: Edge computing pushes computing functions closer to the data source, avoiding the transmission of large amounts of data to the cloud for model training and reasoning, thereby reducing network transmission costs and latency and improving the real-time nature of services.

[0092] Improve data privacy protection: Edge computing model training and deployment can push data processing closer to the data source, avoiding the risk of transmitting sensitive data to the cloud, thereby protecting data privacy and security. Model training and reasoning on edge nodes can reduce the risk of data being stolen or tampered with during transmission, thereby enhancing data security.

[0093] Reducing network bandwidth pressure: Placing part of the computing work on the edge nodes can reduce the pressure of data transmission to the cloud and save network bandwidth resources.

[0094] Improve application response speed: By training and deploying models on edge nodes, the number of times data is transmitted to the cloud can be reduced, thereby improving application response speed and user experience, which is of great significance for application scenarios that require fast response and real-time processing.

[0095] In some optional implementations, after receiving the model training request, based on the model training request, a first trigger rule set by the user is obtained, and the first trigger rule is configured to be used to confirm that the user is a credential of a decryptable object in the model training process. Wherein, in the case where the user is the developer of the target model, the first trigger rule provided by the user can be matched with the first edge function preset by the user in the trigger module before the model training process, so as to decrypt the model file for the developer and execute the subsequent model training process; in the case where the user is not the developer of the target model, it indicates that the user cannot match the first edge function preset by the developer in the trigger module before the model training process through the first trigger rule provided. At this time, if the matching condition is not met, the trigger will not decrypt the model file, thereby ensuring the confidentiality of the model file and realizing the closed source model.

[0096] S102. In response to a model training request, matching is performed based on a first trigger rule and a first trigger corresponding to the first edge function, wherein the first trigger rule is configured to confirm that the user is a credential of a decryptable object in the model training process.

[0097] When the step S102 is specifically implemented, the response to the model training request is matched based on the trigger rule and the first trigger corresponding to the first edge function. Specifically, the specific route of the hosted domain name in the access security and acceleration service is called, and the calculation logic corresponding to the first edge function is called at the target edge node; then, based on the acceleration domain name of the target edge node, the first trigger rule is matched with the trigger rule of the first trigger, wherein the trigger rule of the first trigger is used to characterize the trigger rule of the first edge function, and when the user is not the developer of the target model, the first trigger rule cannot be matched with the trigger rule of the first edge function (i.e., the trigger rule of the first trigger); when the user is the developer of the target model, the first trigger rule and the trigger rule of the first edge function (i.e., the trigger rule of the first trigger) are both provided by the developer, so the first trigger rule and the trigger rule of the first edge function can be matched.

[0098] In an embodiment of the present application, the developer only needs to write the business function code, preset the first edge function in the trigger module, and set the first trigger rule corresponding to the first edge function when model training is required. There is no need to configure and manage infrastructure such as servers. While ensuring data confidentiality, it effectively improves the developer's experience as a user in performing model training tasks.

[0099] S103. When the match is successful, the model file is decrypted based on the first edge function, and the target model is trained based on the decrypted model file to obtain a model training file.

[0100] When the step S103 is specifically implemented, after the trigger module successfully matches, the trigger module triggers the preprocessing module to carry out the corresponding file decryption calculation logic (the first edge function) according to the routing access rule and the corresponding first trigger rule, so as to decrypt the model file based on the first edge function. First, based on the routing access rule, the first trigger rule that matches successfully is sent to the first edge function corresponding to the first trigger; then, the model file is decrypted based on the first edge function to obtain the decrypted model file; after obtaining the decrypted model file, the target model is trained based on the model training parameters in the decrypted model file.

[0101] In some optional implementations, the decryption processing of the model file based on the first edge function is a decryption processing based on the key pair used by the cloud service provider to verify the user identity and authorize the request, wherein AK (Access Key ID) is used to identify the user, and SK (Secret Access Key) is a key used to encrypt the authentication string, which is used to ensure the confidentiality, integrity and correctness of the requester's identity of the request, and the API request is verified and authorized based on AK / SK to implement the decryption processing of the successfully matched model file to obtain the decrypted model file. Specifically, a decryption request is constructed based on the first edge function, and the decryption request includes at least an access key ID, an original message and a signature; based on the access key ID in the decryption request, the secret access key corresponding to the access key ID is searched; based on the original message, a first summary is obtained, and based on the secret access key and the signature, a second summary is obtained; when the first summary is the same as the second summary, the model file is decrypted to obtain the decrypted model file.

[0102] S104. Encrypt the model training file based on the first edge function and the first trigger rule.

[0103] When step S104 is implemented, a corresponding model training file will be generated after the training of the target model is completed. Since the model deployment and model testing processes are required after the training of the target model is completed, in order to avoid data leakage caused by the model training data being obtained by non-developer users during the process of entering the model deployment, in an embodiment of the present application, after obtaining the model training file, the model training file is encrypted based on the first edge function and the first trigger rule.

[0104] Specifically, the model training file is sent to the post-processing module, and the post-processing module performs corresponding encryption processing operations according to specific routing access rules (i.e., the trigger rules corresponding to the first edge function) and corresponding request parameter trigger rules (i.e., the first trigger rules) to obtain an encrypted model training file, and sends the encrypted model training file to the edge node used for model deployment to enter the deployment process and model testing phase. Before the formal deployment process is carried out, it is necessary to deploy the trigger rules in the model script execution code to trigger the corresponding scheduling function, and process the model training file obtained after model training according to the process defined in the function. According to the AK / SK, test access path and SSL certificate corresponding to the domain name pre-filled during model deployment, after successful deployment, it can be directly accessed on the page to verify and test the model.

[0105] Specifically, Figure 4 A schematic diagram of an application module of a model deployment test process in a model closed source method proposed in an embodiment of the present application is shown, such as Figure 4 As shown, first, before the model is deployed, the model training file and the second edge function are obtained. In an embodiment of the present application, in order to improve the confidentiality of the model during the deployment and testing process and prevent the model core code in the model file from being obtained by non-developers during the deployment and testing process and causing significant losses, before the model is deployed, the user uploads the second edge function to the trigger module. The second edge function is used to decrypt the model training file when the user is confirmed to be a model developer.

[0106] Subsequently, the trigger module receives a model deployment request sent by the user, and binds the second edge function and the second trigger, so that when the model closed-source device or system meets the matching conditions for the second edge function, the second trigger calls the bound second edge function to perform decryption processing on the model training file; in response to the model deployment request, the second trigger corresponding to the second edge function is matched based on the second trigger rule, and the second trigger rule is configured to confirm that the user is a credential of a decryptable object in the model deployment and testing process; if the match is successful, the preprocessing module decrypts the model training file based on the second edge function; finally, the model deployment module deploys the target model based on the decrypted model training file, and the model testing module performs subsequent testing on the deployed target model.

[0107] In some optional embodiments, Figure 2 FIG. 1 shows a schematic diagram of implementing model closure based on an edge function in a trigger in a model closure method proposed in an embodiment of the present application, such as Figure 2 As shown, the model training is based on the first edge function ( Figure 2 The edge function A in the example implements the decryption and encryption processing of data. The model deployment process is based on the second edge function ( Figure 2 The edge function B in the embodiment of the present invention decrypts the model training data, wherein the first edge function and the second edge function are both preset in the trigger module. Optionally, the second edge function can be preset in the trigger module together with the first edge function before the model training starts, or can be preset in the trigger module after the model training ends and before the model deployment starts, and this application does not impose any specific restrictions on this.

[0108] The present application provides a model closed-source method, device, electronic device, storage medium and product, the method comprising: obtaining an encrypted model file and a first edge function; in response to a model training request, matching a first trigger corresponding to the first edge function based on a first trigger rule, the first trigger rule being configured as a credential for confirming that the user is a decryptable object in the model training process; in the case of a successful match, decrypting the model file based on the first edge function, and training the target model based on the decrypted model file to obtain a model training file; encrypting the model training file based on the first edge function and the first trigger rule. The embodiment of the present application matches the first edge function preset by the user with the first trigger rule of the user, and in the case of a successful match, identifies the user as a developer to decrypt the model file, and encrypts it again based on the first edge function and the first trigger rule after the training is completed, thereby ensuring the confidentiality of the model file during the training process and realizing the closed-source model to protect the user's intellectual property rights.

[0109] Based on the same inventive concept, the embodiment of the present application discloses a model closed-source device, which is used to implement the model closed-source method described in any one of the first aspects of the embodiments of the present application. Figure 5 FIG. 4 shows a schematic diagram of the structure of a model closed-source device proposed in an embodiment of the present application. Figure 5 As shown, the model closed-source device includes:

[0110] A trigger module, the trigger module is used to obtain an encrypted model file and a first edge function; in response to a model training request, matching a first trigger corresponding to the first edge function based on a first trigger rule, wherein the first trigger rule is configured to confirm that the user is a credential of a decryptable object in the model training process;

[0111] A preprocessing module, wherein the preprocessing module is used to decrypt the model file based on the first edge function when the matching is successful;

[0112] A model training module, wherein the model training module is used to train a target model using the decrypted model file to obtain a model training file;

[0113] A post-processing module, wherein the post-processing module is used to encrypt the model training file based on the first edge function and the first trigger rule.

[0114] In an optional implementation, the trigger module includes:

[0115] A binding submodule, wherein the binding submodule is used to bind the first edge function and the first trigger;

[0116] A first trigger rule acquisition submodule, the first trigger rule acquisition submodule is used to receive the model training request, and based on the model training request, acquire the first trigger rule set by the user;

[0117] A target edge node determination submodule is used to determine a target edge node in response to the model training request.

[0118] In an optional implementation, the trigger module includes:

[0119] A computing logic submodule, wherein the computing logic submodule is used to call computing logic corresponding to the first edge function at the target edge node;

[0120] The first matching submodule is used to match the first trigger rule with the trigger rule of the first trigger based on the acceleration domain name of the target edge node.

[0121] In an optional implementation, the preprocessing module includes:

[0122] A routing access submodule, the routing access submodule being used for sending the first trigger rule that matches successfully to the first edge function corresponding to the first trigger based on the routing access rule;

[0123] A first decryption submodule, the decryption submodule is used to decrypt the model file based on the first edge function to obtain the decrypted model file;

[0124] The model training module includes:

[0125] A model training submodule, wherein the model training submodule is used to train the target model based on the model training parameters in the decrypted model file.

[0126] In an optional implementation manner, the first decryption submodule includes:

[0127] A decryption request unit, the decryption request unit being used to construct a decryption request based on the first edge function, the decryption request comprising at least an access key ID, an original message, and a signature;

[0128] an access key unit, the access key unit being used to find a secret access key corresponding to the access key ID based on the access key ID in the decryption request;

[0129] a digest obtaining unit, the digest obtaining unit being configured to obtain a first digest based on the original message, and to obtain a second digest based on the secret access key and the signature;

[0130] A decryption unit is used for decrypting the model file to obtain the decrypted model file when the first digest is the same as the second digest.

[0131] In an optional implementation, the trigger module further includes:

[0132] A second edge function acquisition submodule, the second edge function acquisition submodule is used to secondly acquire the model training file and the second edge function;

[0133] A second matching submodule, the second matching submodule being configured to match a second trigger corresponding to the second edge function based on a second trigger rule in response to the model deployment request, wherein the second trigger rule is configured to confirm that the user is a credential of a decryptable object in a model deployment and testing process;

[0134] A second decryption submodule, wherein the second decryption submodule is used to decrypt the model training file based on the second edge function when the matching is successful;

[0135] The model closed-source device further includes:

[0136] A model deployment module, the model deployment module is used to deploy the target model based on the decrypted model training file;

[0137] A model testing module is used to test the deployed target model based on the decrypted model training file.

[0138] Based on the same inventive concept, the present application embodiment discloses an electronic device, Figure 6 A schematic diagram of an electronic device proposed in an embodiment of the present application is shown, such as Figure 6 As shown, the electronic device 100 includes: a memory 110 and a processor 120, the memory 110 and the processor 120 are connected to each other through a bus communication, the memory 110 stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, the at least one program, the code set or instruction set can be loaded and run on the processor 120 to implement the steps in the model closed source method disclosed in the embodiment of the present application.

[0139] Based on the same inventive concept, an embodiment of the present application discloses a computer-readable storage medium, on which is stored at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the steps in the model closed-source method disclosed in the embodiment of the present application.

[0140] Based on the same inventive concept, an embodiment of the present application discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps in the model closed-source method disclosed in the embodiment of the present application.

[0141] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

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

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

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

[0145] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0146] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal 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 terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0147] The above is a detailed introduction to a model closed-source method, device, electronic device, storage medium and product provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A model closed source method, characterized in that: The method comprises: Obtain the encrypted model file and the first edge function; In response to a model training request, matching a first trigger corresponding to the first edge function based on a first trigger rule, the first trigger rule being configured to confirm that the user is a credential of a decryptable object in a model training process; In the case of successful matching, the model file is decrypted based on the first edge function, and the target model is trained based on the decrypted model file to obtain a model training file; Based on the first edge function and the first trigger rule, the model training file is encrypted.

2. The closed-source model method according to claim 1, characterized in that: Before matching the first trigger corresponding to the first edge function based on the first trigger rule, the method further includes: Binding the first edge function and the first trigger; receiving the model training request, and acquiring the first trigger rule set by the user based on the model training request; In response to the model training request, a target edge node is determined.

3. The closed-source model method according to claim 2, characterized in that: The step of matching, in response to the model training request, a first trigger corresponding to the first edge function based on a first trigger rule includes: Calling, at the target edge node, a calculation logic corresponding to the first edge function; Based on the acceleration domain name of the target edge node, the first trigger rule is matched with the trigger rule of the first trigger.

4. The closed-source model method according to claim 1, characterized in that: In the case where the matching is successful, the model file is decrypted based on the first edge function, and the target model is trained based on the decrypted model file, including: Based on the routing access rule, sending the first trigger rule that matches successfully to the first edge function corresponding to the first trigger; Decrypting the model file based on the first edge function to obtain the decrypted model file; The target model is trained based on the model training parameters in the decrypted model file.

5. The closed-source model method according to claim 4, characterized in that: The method of decrypting the model file based on the first edge function to obtain the decrypted model file includes: Constructing a decryption request based on the first edge function, the decryption request including at least an access key ID, an original message, and a signature; Based on the access key ID in the decryption request, searching for a secret access key corresponding to the access key ID; Obtaining a first digest based on the original message, and obtaining a second digest based on the secret access key and the signature; When the first digest is identical to the second digest, the model file is decrypted to obtain the decrypted model file.

6. The closed-source model method according to any one of claims 1 to 5, characterized in that: After encrypting the trained model file based on the first edge function and the first trigger rule, the method further includes: Obtaining the model training file and the second edge function; In response to the model deployment request, matching a second trigger corresponding to the second edge function based on a second trigger rule, the second trigger rule being configured to confirm that the user is a credential of a decryptable object in a model deployment and testing process; In the case of successful matching, decrypting the model training file based on the second edge function; The target model is deployed and tested based on the decrypted model training file.

7. A model closed source device, characterized in that: The model closed-source device is used to implement the model closed-source method according to any one of claims 1 to 6, and the device comprises: A trigger module, the trigger module is used to obtain an encrypted model file and a first edge function; in response to a model training request, matching a first trigger corresponding to the first edge function based on a first trigger rule, wherein the first trigger rule is configured to confirm that the user is a credential of a decryptable object in the model training process; A preprocessing module, wherein the preprocessing module is used to decrypt the model file based on the first edge function when the matching is successful; A model training module, wherein the model training module is used to train a target model using the decrypted model file to obtain a model training file; A post-processing module, wherein the post-processing module is used to encrypt the model training file based on the first edge function and the first trigger rule.

8. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps in the model closed source method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps in the model closed-source method described in any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that It includes a computer program / instruction, which, when executed by a processor, implements the steps in the model closed-source method disclosed in the embodiment of the present application.

Citation Information

Patent Citations

  • Data processing method, device and equipment

    CN111783630A

  • Data transmission method and system based on function encryption, blockchain and machine learning

    CN113328864A

  • Model file encryption and decryption method and device

    CN114386058A

  • Model updating method, device and equipment and computer storage medium

    CN117077808A

  • Drug prediction model training method, system and device, medium, product and equipment

    CN118824401A