CN111813533B - Dynamic management method and device for model instantiation and storage medium - Google Patents

Dynamic management method and device for model instantiation and storage medium Download PDF

Info

Publication number
CN111813533B
CN111813533B CN202010950669.2A CN202010950669A CN111813533B CN 111813533 B CN111813533 B CN 111813533B CN 202010950669 A CN202010950669 A CN 202010950669A CN 111813533 B CN111813533 B CN 111813533B
Authority
CN
China
Prior art keywords
model
thread
instance
time
exists
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010950669.2A
Other languages
Chinese (zh)
Other versions
CN111813533A (en
Inventor
段永耀
黄美灵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010950669.2A priority Critical patent/CN111813533B/en
Publication of CN111813533A publication Critical patent/CN111813533A/en
Application granted granted Critical
Publication of CN111813533B publication Critical patent/CN111813533B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/10Interfaces, programming languages or software development kits, e.g. for simulating neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence

Abstract

The invention discloses a dynamic management method and device for model instantiation in an artificial intelligence scene and a storage medium, and particularly relates to deep learning and other technologies in mechanical learning. Wherein, the method comprises the following steps: setting a first object lock for the first model when the first thread and the second thread judge that the first model does not exist for the first time; judging whether an instance of the first model exists for the second time through the first thread, and under the condition that the instance of the first model does not exist for the second time through the first thread, creating the first instance of the first model through the first thread; and judging whether the instance of the first model exists for the second time through the second thread, and acquiring the first instance through the second thread under the condition that the first instance exists through the second thread for the second time. The invention solves the technical problem of low dynamic management efficiency of model instantiation.

Description

Dynamic management method and device for model instantiation and storage medium
Technical Field
The invention relates to the field of computers, in particular to a dynamic management method and device for model instantiation and a storage medium.
Background
The rapid development of deep learning in recent years has led to a strong demand for more rational instantiation methods. In recent years, deep learning has achieved remarkable achievements in a variety of scenes, such as image recognition, natural language processing, and recommendation systems. With the wide application, deep learning models in the industrial and academic fields have two major trends, more and more models are available, and more model parameters are available.
So many, so large models, how to instantiate and then provide services online. The current general approach is Singleton Pattern. Singleton is really a simple and intuitive instantiation method, and is often used for instantiating some objects with relatively large creation overhead, such as a client connected with a database. However, the problem of single instance is very acute, and especially when the method is applied to the online service of deep learning, a large number of service requests generated in a short time are faced, so that multiple single instances are built by multiple same models, namely, the storage space of a system is wasted, and the dynamic management efficiency of model instantiation is lowered. Therefore, there is a problem that dynamic management of model instantiation is inefficient.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a dynamic management method and device for model instantiation and a storage medium, and aims to at least solve the technical problem of low dynamic management efficiency of model instantiation.
According to an aspect of the embodiments of the present invention, there is provided a dynamic management method for model instantiation, including: acquiring a first service request and a second service request, wherein the first service request and the second service request are used for requesting a target service provided on line; calling a first model using a first thread request in response to the first service request, and calling the first model using a second thread request in response to the second service request, wherein the first model is a model for providing the target service online; setting a first object lock for the first model when it is determined for the first time by the first thread and the second thread that the first model does not exist, the first object lock being used to set the first thread and the second thread to operate in series, the first thread operating in priority to the second thread in the series operation; determining whether an instance of the first model exists by the first thread for a second time, and creating a first instance of the first model by the first thread if it is determined that the instance of the first model does not exist by the first thread for the second time; and judging whether the instance of the first model exists for the second time through the second thread, and acquiring the first instance through the second thread under the condition that the first instance exists through the second thread for the second time.
According to another aspect of the embodiments of the present invention, there is also provided a dynamic management apparatus for model instantiation, including: a first obtaining unit, configured to obtain a first service request and a second service request, where the first service request and the second service request are used to request a target service provided online; a response unit, configured to respond to the first service request, call a first model using a first thread request, and respond to the second service request, call the first model using a second thread request, where the first model provides a model of the target service online; a first determination unit configured to set a first object lock to the first model when it is determined for the first time by the first thread and the second thread that there is no instance of the first model, the first object lock being configured to set the first thread and the second thread to operate in series, the first thread operating in priority to the second thread in the series operation; a second determination unit configured to determine whether or not an instance of the first model exists for a second time by the first thread, and create a first instance of the first model by the first thread if it is determined that the instance of the first model does not exist for the second time by the first thread; and a second obtaining unit, configured to determine whether an instance of the first model exists for the second time through the second thread, and obtain the first instance through the second thread when the first instance exists for the second time through the second thread.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned model instantiation dynamic management method when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-mentioned model instantiation dynamic management method through the computer program.
In the embodiment of the present invention, a first service request and a second service request are obtained, where the first service request and the second service request are used to request a target service provided online; calling a first model using a first thread request in response to the first service request, and calling the first model using a second thread request in response to the second service request, wherein the first model is a model for providing the target service online; setting a first object lock for the first model when it is determined for the first time by the first thread and the second thread that the first model does not exist, the first object lock being used to set the first thread and the second thread to operate in series, the first thread operating in priority to the second thread in the series operation; determining whether an instance of the first model exists by the first thread for a second time, and creating a first instance of the first model by the first thread if it is determined that the instance of the first model does not exist by the first thread for the second time; the second thread is used for judging whether the instance of the first model exists or not, the second thread is used for obtaining the first instance under the condition that the second thread is used for judging that the first instance exists, and the first thread and the second thread are used for calling the first model in a serial working mode under the condition that the first thread and the second thread both request to call the same model, so that the instance of the first model cannot be repeatedly created, the aim of reducing repeated creation of the instance in the dynamic management process of model instantiation is fulfilled, the technical effect of improving the dynamic management efficiency of model instantiation is achieved, and the technical problem that the dynamic management efficiency of model instantiation is low is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of an application environment of an alternative model instantiated dynamic management method according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a flow chart of an alternative model instantiated dynamic management method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of an alternative model instantiated dynamic management method according to an embodiment of the invention;
FIG. 4 is a schematic diagram of an alternative model instantiated dynamic management method according to an embodiment of the invention;
FIG. 5 is a schematic diagram of an alternative model instantiated dynamic management method according to an embodiment of the invention;
FIG. 6 is a schematic diagram of an alternative model instantiated dynamic management method according to an embodiment of the invention;
FIG. 7 is a schematic diagram of an alternative model instantiated dynamic management method according to an embodiment of the invention;
FIG. 8 is a schematic diagram of an alternative model instantiated dynamic management method according to an embodiment of the invention;
FIG. 9 is a schematic diagram of an alternative model instantiated dynamic management method according to an embodiment of the invention;
FIG. 10 is a schematic diagram of an alternative model instantiated dynamic management method according to an embodiment of the invention;
FIG. 11 is a schematic diagram of an alternative model instantiated dynamic management method according to an embodiment of the invention;
FIG. 12 is a schematic diagram of an alternative model instantiated dynamic management device, according to an embodiment of the invention;
fig. 13 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human Intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making.
The artificial intelligence technology is a comprehensive subject and relates to the field of extensive technology, namely the technology of a hardware level and the technology of a software level. The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
Machine Learning (ML for short) is a multi-domain cross subject, and relates to multiple subjects such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and the like. The special research on how a computer simulates or realizes the learning behavior of human beings so as to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve the performance of the computer. Machine learning is the core of artificial intelligence, is the fundamental approach for computers to have intelligence, and is applied to all fields of artificial intelligence. Machine learning and deep learning generally include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and formal education learning.
Deep learning (deep learning): the method is a branch of machine learning, and is a technology for learning data representation by taking an artificial neural network as an architecture.
GBDT: a gradient boosting tree is a machine learning technology for regression and classification problems, and can be used for click rate estimation in a recommendation system.
LR: logistic regression is a machine learning technique mainly used for classifying problems, and can be used for click rate estimation in a recommendation system.
GBDT + LR: the method organically combines the gradient lifting tree with the logistic regression, combines the quick updating of the logistic regression and the accuracy of the gradient lifting tree, improves the actual effect, and is commonly used for estimating the click rate in a recommendation system.
FM (catalysis machine): an algorithm commonly used for estimating click rate of a recommendation system mainly solves the problem of feature combination under the condition of sparse data.
Deep FM: the model considering characteristic combination and accurate prediction is mainly used for estimating the click rate of a recommendation system, namely the combination of an FM algorithm and an artificial neural network technology, the model is divided into two parts, the FM part is consistent with the FM algorithm, and the Deep part is mainly a neural network formed by a plurality of full-connection layers.
Deep cross: similar to Deep FM, the model is also a model considering feature combination and accurate prediction, is mainly used for recommending system click rate prediction, and is different from Deep Cross which does not adopt an explicit cross feature mode, but utilizes a residual error network structure to mine the relationship between features.
Model instantiation: the configuration of the model and the model file are read, the model object is created, and then the predictive capability of the model is provided. Is a comparison step of the model to provide online services.
According to an aspect of the embodiment of the present invention, a dynamic management method for model instantiation is provided, and optionally, as an optional implementation, the dynamic management method for model instantiation may be, but is not limited to be, applied to the environment as shown in fig. 1. The user device 102-1 may include, but is not limited to, a user device 102-2, a network 110, and a server 112, where the user device 102-1 may include, but is not limited to, a display 108-1, a processor 106-1, and a memory 104-1, the display 108-1 may be, but is not limited to, displaying an interface on which a text "please select a file for inputting a first model" shown in fig. 1 is located, the interface on which the text "please select a file for inputting a first model" is located may be, but is not limited to, a selection interface representing "deep learning model online service", and a file (e.g., a file C) for inputting a deep learning model (a first model) may be, but is not limited to, selected in the same manner in other interfaces through the selection interface, where the deep learning model may be, but is not limited to, and the first model may be, but is selected in the, the user equipment 102-1 is similar to the user equipment 102-1 and will not be redundantly described here.
The specific process comprises the following steps:
step S102-1, step S102-2, in a short time, the user equipment 102-1 and the user equipment 102-2 respectively obtain a first service request and a second service request on a page of the same website (for example, "www.abc.com" shown in the figure), where the first service request is used to indicate that a first model (not shown in the figure) to be input is requested to be provided online, and input data of the first model to be input is a file C, the second service request is used to indicate that a first model (not shown in the figure) to be input is requested to be provided online, and input data of the first model to be input is a file F;
step S104-S106, the user equipment 102 sends the first service request and the second service request to the server 112 through the network 110, optionally, the first service request and the second service request may also be, but are not limited to, sent through two networks, respectively, and this is not limited herein;
step S108, the server 112 invokes a first thread according to the first service request and invokes a second thread according to the second service request through the processing engine 116, and sets a first object lock to the first model when it is determined that the first thread does not have the instance of the first model for the first time and it is determined that the second thread does not have the instance of the first model for the first time, where the first object lock is used to set the first thread and the second thread to operate in serial, and the first thread takes precedence over the second thread to operate in serial;
step S110, the server 112 determines whether there is an instance of the first model by the first thread for the second time, and creates a first instance of the first model by the first thread in the case that it is determined that there is no instance of the first model by the first thread for the second time;
step S112, the server 112 determines whether the instance of the first model exists for the second time through the second thread, and acquires the first instance through the second thread under the condition that the first instance exists for the second time through the second thread;
step S114, the server 112 obtains a first output result according to the first service request and the first instance and obtains a second output result according to the second service request and the first instance through the processing engine 116;
in steps S116-S118, the server 112 sends the first output result and the second output result to the user device 102 through the network 110, respectively, and the processor 106-1 in the user device 102-1 displays the first output result on the display 108-1 and stores the first output result in the memory 104, similarly to the user device 102-2. Optionally, the first output result and the second output result may also be, but are not limited to, sent through two networks, which is not limited herein.
Optionally, as an optional implementation, as shown in fig. 2, the method for dynamically managing model instantiation includes:
s202, a first service request and a second service request are obtained, wherein the first service request and the second service request are used for requesting a target service provided on line;
s204, responding to a first service request, calling a first model by using a first thread request, responding to a second service request, and calling the first model by using a second thread request, wherein the first model provides a model of a target service online;
s206, when judging that the first model does not exist for the first time through the first thread and the second thread, setting a first object lock for the first model, wherein the first object lock is used for setting the first thread and the second thread to work in series, and the first thread takes precedence over the second thread under the serial work;
s208, judging whether the instance of the first model exists for the second time through the first thread, and under the condition that the instance of the first model does not exist through the second judgment of the first thread, creating the first instance of the first model through the first thread;
and S210, judging whether the instance of the first model exists for the second time through the second thread, and acquiring the first instance through the second thread under the condition that the first instance exists through the second thread.
Optionally, the dynamic management method of model instantiation may be applied, but not limited, in an application scenario where a deep learning online service or a model provides an online service. The thread may be, but is not limited to, the smallest unit capable of performing operation scheduling by the operating system, is included in the process, and is an actual operation unit in the process, and optionally, a thread refers to a single sequential control flow in the process. The model can be, but is not limited to, a deep learning model in a variety of application scenarios, such as a deep learning model applied in the scenarios of search technology, data mining, machine learning, machine translation, natural language processing, image recognition, multimedia learning, speech recognition, recommendation systems, and personalization technologies. Setting as a serial job may be, but is not limited to, indicating setting as performing jobs in order of execution priority, where the execution priority in the serial job may be, but is not limited to, dependent on the invocation time of the thread, and may also be, but is not limited to, manually set. The object lock may be set to work serially, but is not limited to representing a request to invoke the first model.
It should be noted that, a first service request and a second service request are obtained, where the first service request and the second service request are used to request a target service provided online; calling a first model by using a first thread request in response to a first service request, and calling the first model by using a second thread request in response to a second service request, wherein the first model provides a model of a target service on line; setting a first object lock for the first model when the first thread and the second thread judge that the first model does not exist for the first time, wherein the first object lock is used for setting the first thread and the second thread to work in series, and the first thread takes precedence over the second thread under the serial work; judging whether an instance of the first model exists for the second time through the first thread, and under the condition that the instance of the first model does not exist for the second time through the first thread, creating the first instance of the first model through the first thread; and judging whether the instance of the first model exists for the second time through the second thread, and acquiring the first instance through the second thread under the condition that the first instance exists through the second thread for the second time.
Further by way of example, an alternative example is shown in fig. 3, which includes a first page 304 and a second page 306 displayed under the same target website 302 but on different clients, where both the first page 304 and the second page 306 are used to determine a file imported with the first model, and the specific steps after obtaining the file imported with the first model as "file C" on the first page 304 and obtaining the file imported with the first model as "file F" on the second page 306 are as follows:
step S302-1, a first thread calls a first model;
step S302-2, the second thread executes to call the first model;
step S304-1, the first thread judges whether the instance of the first model exists, if so, step S316 is executed, and if not, step S306 is executed
Step S304-2, the second thread judges whether the instance of the first model exists, if so, the step S314 is executed, and if not, the step S306 is executed;
step S306, setting a first object lock for the first model;
optionally, the first object lock set on the first model is used to set the work of creating or acquiring the instance of the first model by the first thread and the second thread as serial work, for example, step S308 is performed first, the first thread determines whether the instance of the first model exists, if so, step S316 is performed, and if not, step S310 is performed;
step S310, a first thread creates an instance of a first model;
then step S312 is executed, the second thread determines whether the instance of the first model exists, if yes, step S314 is executed, and if no, step S310 is executed to reestablish the instance, because abnormal time may occur so that the instance established in step S310 is lost;
step S314, because the first thread already creates the instance of the first model, and the instance of the first model exists, in this case, the second thread 302 does not need to create the instance of the first model again, and only needs to obtain the instance of the first model;
in step S316, the first thread obtains an existing instance of the first model.
According to the embodiment provided by the application, a first service request and a second service request are obtained, wherein the first service request and the second service request are used for requesting a target service provided on line; calling a first model by using a first thread request in response to a first service request, and calling the first model by using a second thread request in response to a second service request, wherein the first model provides a model of a target service on line; setting a first object lock for the first model when the first thread and the second thread judge that the first model does not exist for the first time, wherein the first object lock is used for setting the first thread and the second thread to work in series, and the first thread takes precedence over the second thread under the serial work; judging whether an instance of the first model exists for the second time through the first thread, and under the condition that the instance of the first model does not exist for the second time through the first thread, creating the first instance of the first model through the first thread; whether the instance of the first model exists is judged for the second time through the second thread, the first instance is obtained through the second thread under the condition that the first instance exists is judged for the second time through the second thread, and the instance of the first model cannot be repeatedly created under the condition that the first thread and the second thread both request to call the same model by utilizing a serial working mode under the condition that the first thread and the second thread request to call the first model, so that the aim of reducing repeated creation of the instance in the dynamic management process of model instantiation is fulfilled, and the technical effect of improving the dynamic management efficiency of model instantiation is achieved.
As an optional solution, the method further comprises:
and under the condition that the first thread and the second thread are set to work serially, and the third thread requests to call the second model, judging whether an instance of the second model exists for the first time through the third thread, wherein the second model is a model for providing services online, and the third thread is set to work in parallel with the first thread and the second thread.
It should be noted that, when the first thread and the second thread are set to work serially and the third thread requests to invoke the second model, the third thread determines whether there is an instance of the second model for the first time, where the second model is a model for providing services online and the third thread is set to work in parallel with the first thread and the second thread.
Further by way of example, an alternative example is shown in fig. 4, which includes a first thread 402, a second thread 404 and a third thread 406, where the first thread 402 and the second thread 404 are used to request to invoke the first model 408, the third thread 402 is used to request to invoke the second model 410, and in the case that the first model is set to the object lock 412, the first thread 402 and the second thread 404 used to request to invoke the first model 408 will work in series, and the third thread 402 used to request to invoke the second model 410 is not affected, and presents a relation of working in parallel with the first thread 402 and the second thread 404 working in series.
According to the embodiment provided by the application, under the condition that the first thread and the second thread are set to work serially, and the third thread requests to call the second model, whether the instance of the second model exists is judged for the first time through the third thread, wherein the second model is a model for providing services online, the third thread is set to work in parallel with the first thread and the second thread, and under the condition that a plurality of different models are called simultaneously, mutual waiting is not needed, the purpose of accelerating the creation speed of the model instance is achieved, and the effect of improving the running speed of the system is achieved.
As an alternative, the method comprises:
s1, under the condition that the third thread and the fourth thread both request to call the second model, judging whether an instance of the second model exists for the first time through the fourth thread, wherein the fourth thread is set to work in parallel with the first thread and the second thread;
s2, setting a second object lock for the second model when the third thread determines for the first time that the instance of the second model does not exist and the fourth thread determines for the first time that the instance of the second model does not exist, wherein the second object lock is used to set the third thread and the fourth thread to operate in series, and the third thread operates in preference to the fourth thread under the serial operation;
s3, judging whether an instance of the second model exists for the second time through the third thread, and creating a second instance of the second model through the third thread under the condition that the instance of the second model does not exist through the second judgment of the third thread;
and S4, judging whether the instance of the second model exists for the second time through the fourth thread, and acquiring the second instance through the fourth thread under the condition that the second instance exists through the second judgment of the fourth thread.
It should be noted that, in the case where both the third thread and the fourth thread request to call the second model, whether an instance of the second model exists is determined for the first time by the fourth thread, where the fourth thread is set to operate in parallel with the first thread and the second thread; under the condition that the third thread judges that the example of the second model does not exist for the first time and the fourth thread judges that the example of the second model does not exist for the first time, setting a second object lock for the second model, wherein the second object lock is used for setting the third thread and the fourth thread to be in serial work, and the third thread takes precedence over the fourth thread under the serial work; judging whether an instance of the second model exists for the second time through the third thread, and under the condition that the instance of the second model does not exist for the second time through the third thread, creating a second instance of the second model through the third thread; and judging whether the instance of the second model exists for the second time through the fourth thread, and acquiring the second instance through the fourth thread under the condition that the second instance exists through the second judgment of the fourth thread.
To further illustrate, an alternative example is shown in FIG. 5, which includes a fourth thread 502, where the fourth thread 502 is used to request invocation of the second model 410, and where the second model 410 is set with an object lock 504, the fourth thread 502 and the third thread 402 will operate in series.
According to the embodiment provided by the application, under the condition that the third thread and the fourth thread both request to call the second model, whether an instance of the second model exists is judged for the first time through the fourth thread, wherein the fourth thread is set to work in parallel with the first thread and the second thread; under the condition that the third thread judges that the example of the second model does not exist for the first time and the fourth thread judges that the example of the second model does not exist for the first time, setting a second object lock for the second model, wherein the second object lock is used for setting the third thread and the fourth thread to be in serial work, and the third thread takes precedence over the fourth thread under the serial work; judging whether an instance of the second model exists for the second time through the third thread, and under the condition that the instance of the second model does not exist for the second time through the third thread, creating a second instance of the second model through the third thread; whether the instance of the second model exists is judged for the second time through the fourth thread, the second instance is obtained through the fourth thread under the condition that the second instance exists is judged for the second time through the fourth thread, and the purpose that threads for requesting model instances of the same and/or different types work simultaneously is achieved by setting different object locks for different models, so that the effect of improving the efficiency of calling the models through the thread request is achieved.
As an optional solution, before invoking the first model using the first thread request in response to the first service request and invoking the first model using the second thread request in response to the second service request, the method further comprises:
first configuration information of the first model and a first model file of the first model are obtained, wherein the first configuration information and the first model file are used for creating the first instance.
It should be noted that first configuration information of the first model and a first model file of the first model are obtained, where the first configuration information and the first model file are used to create the first instance. Alternatively, the configuration information may be, but is not limited to, the necessary configuration for building a model instance, such as a path of a model file.
Further illustratively, optionally, for example, as shown in fig. 6, the first configuration information 602 of the first model and the first model file 604 of the first model are included, wherein both the first configuration information 602 and the first model file 604 are obtained before the first instance 606 is created according to the first model.
According to the embodiment provided by the application, the first configuration information of the first model and the first model file of the first model are obtained, wherein the first configuration information and the first model file are used for creating the first instance, the purpose that the configuration required by creation is prepared under the condition that the model instance is about to be created is achieved, and the effect of improving the efficiency of creating the model instance is achieved.
As an optional solution, the method further comprises:
s1, detecting whether the configuration information of the first model and the model file are updated at regular time;
s2, acquiring second configuration information of the first model when detecting that the configuration information of the first model is updated, wherein the latest configuration information of the first model is replaced by the second configuration information;
s3, acquiring a second model file of the first model under the condition that the model file of the first model is detected to be updated, wherein the latest model file of the first model is replaced by the second model file;
s4, in case the configuration information of the first model or the model file of the first model is updated, the first instance is deleted.
It should be noted that, whether the configuration information of the first model and the model file are updated is detected at regular time; under the condition that the configuration information of the first model is detected to be updated, second configuration information of the first model is obtained, wherein the latest configuration information of the first model is replaced by the second configuration information from the first configuration information; under the condition that the model file of the first model is detected to be updated, acquiring a second model file of the first model, wherein the latest model file of the first model is replaced by the second model file from the first model file; in the event that the configuration information for the first model or the model file for the first model is updated, the first instance is deleted.
To further illustrate, an alternative example is shown in fig. 7, which includes a first model 702, wherein the configuration information and the model file in the first model 702 are both updated, and then the first configuration information 704 and the first model file 706 in the first model 702 are updated (bidirectional arrows) to be the second configuration information 710 and the second model file 708, respectively, and a first instance 712 (dotted arrows indicate non-current operations) created according to the first configuration information 704 and the first model 702 of the first model file 706 at the time is deleted (x indicates deletion).
By the embodiment provided by the application, whether the configuration information and the model file of the first model are updated or not is detected at regular time; under the condition that the configuration information of the first model is detected to be updated, second configuration information of the first model is obtained, wherein the latest configuration information of the first model is replaced by the second configuration information from the first configuration information; under the condition that the model file of the first model is detected to be updated, acquiring a second model file of the first model, wherein the latest model file of the first model is replaced by the second model file from the first model file; under the condition that the configuration information of the first model or the model file of the first model is updated, the first instance is deleted, the purposes of updating the configuration information of the model and the model file in time and deleting the instance established according to the old configuration information and the model file are achieved, and the effects of improving the timeliness of model updating and reducing the storage pressure of the system are achieved.
As an optional solution, after deleting the first instance, the method further includes:
s1, under the condition that the fifth thread and the sixth thread both request to call the first model, judging whether the instance of the first model exists for the first time through the fifth thread and judging whether the instance of the first model exists for the first time through the sixth thread;
s2, under the condition that the fifth thread judges that the example of the first model does not exist for the first time and the sixth thread judges that the example of the first model does not exist for the first time, setting a first object lock for the first model, wherein the first object lock is used for setting the fifth thread and the sixth thread to work in series, and the fifth thread takes precedence over the sixth thread under the serial work;
s3, judging whether the instance of the first model exists for the second time through a fifth thread, and under the condition that the instance of the first model does not exist through a sixth thread, creating a third instance of the first model through the fifth thread according to the latest configuration information and the latest model file of the first model;
s4, determining whether or not the instance of the first model exists by the sixth thread for the second time, and acquiring the third instance by the sixth thread in the case where it is determined that the third instance exists by the sixth thread for the second time.
It should be noted that, under the condition that the fifth thread and the sixth thread both request to call the first model, whether an instance of the first model exists is determined for the first time by the fifth thread, and whether an instance of the first model exists is determined for the first time by the sixth thread; under the condition that the fifth thread judges that the example of the first model does not exist for the first time and the sixth thread judges that the example of the first model does not exist for the first time, setting a first object lock for the first model, wherein the first object lock is used for setting the fifth thread and the sixth thread to work in series, and the fifth thread takes precedence over the sixth thread under the serial work; judging whether the instance of the first model exists for the second time through a fifth thread, and under the condition that the instance of the first model does not exist through a sixth thread, creating a third instance of the first model through the fifth thread according to the latest configuration information and the latest model file of the first model; and judging whether the instance of the first model exists or not through the sixth thread for the second time, and acquiring the third instance through the sixth thread under the condition that the third instance exists through the sixth thread for the second time.
For further example, an optional example is shown in fig. 8, which includes a fifth thread 802 and a sixth thread 804, wherein the fifth thread 802 and the sixth thread 804 are both used to request to invoke the first model 702; further, since the fifth thread 802 and the sixth thread 804 are both used to request to call the first model 702, an object lock 806 is set for the first model 702, where the object lock 806 is used to set the fifth thread 802 and the sixth thread 804 to serial work, specifically, the fifth thread 802 first executes the work of establishing or obtaining the instance of the first model 702, and the sixth thread 804 thereafter; further, since the existing instance 712 created according to the first configuration information 704 and the first model 702 of the first model file 706 at that time and the first model 702 does not exist is deleted, the fifth thread 802 cannot directly obtain the existing instance in which the first model 702 does not exist; further, the fifth thread 802 creates a second instance 808 of the first model 702 based on the current second configuration information 710 of the first model 702 and the second model file 708; further, when the sixth thread 804 executes the establishing or obtaining work, the fifth thread 802 creates the second instance 808 of the first model 702 according to the current second configuration information 710 of the first model 702 and the second model file 708, and then the sixth thread 804 directly obtains the second instance 808.
According to the embodiment provided by the application, under the condition that the fifth thread and the sixth thread both request to call the first model, whether the instance of the first model exists is judged for the first time through the fifth thread, and whether the instance of the first model exists is judged for the first time through the sixth thread; under the condition that the fifth thread judges that the example of the first model does not exist for the first time and the sixth thread judges that the example of the first model does not exist for the first time, setting a first object lock for the first model, wherein the first object lock is used for setting the fifth thread and the sixth thread to work in series, and the fifth thread takes precedence over the sixth thread under the serial work; judging whether the instance of the first model exists for the second time through a fifth thread, and under the condition that the instance of the first model does not exist through a sixth thread, creating a third instance of the first model through the fifth thread according to the latest configuration information and the latest model file of the first model; and judging whether the instance of the first model exists or not through the sixth thread for the second time, and acquiring the third instance through the sixth thread under the condition that the third instance exists through the sixth thread for the second time, so that the aim of smoothly creating or acquiring the model instance according to the latest configuration information and the model file under a relatively complex scene is fulfilled, and the effect of dynamic management efficiency of model instantiation is realized.
As an optional solution, the method further comprises:
s1, detecting whether the first model is requested to be called in the just finished detection period every preset detection period;
s2, in the case where the first model is not requested to be called within the just-ended detection period, the first instance is deleted.
It should be noted that, every predetermined detection period, it is detected whether the first model is requested to be called in the detection period that has just ended; in the event that the first model is not called by a request within the just-ended detection period, the first instance is deleted.
For further example, optionally, for example, a call record of the first model in a period from t0 to t1 is queried, and if the call record does not record that the first model is called in the period from t0 to t1, or the frequency of calling is less than a preset threshold, the first instance is deleted, where the first instance is an instance created according to configuration information of the first model at that time and the model file when the first model was called last time.
According to the embodiment provided by the application, whether the first model is requested to be called in the just finished detection period is detected every a preset detection period; and under the condition that the first model is not requested to be called in the just finished detection period, deleting the first instance, and timely deleting the instance which is established according to the old configuration information and the model file and is not frequently called, so that the aim of timely cleaning the storage space of the system is fulfilled, and the effect of reducing the pressure of the storage space of the system is realized.
As an optional solution, the method further comprises:
and under the condition that the first model is not requested to be called in the just finished detection period, reserving first configuration information of the first model and a first model file of the first model, which are acquired in advance, wherein the first configuration information and the first model file are used for creating an instance of the first model.
It should be noted that, in the case that the first model is not requested to be called in the just-ended detection period, the first configuration information of the first model and the first model file of the first model, which are acquired in advance, are retained, where the first configuration information and the first model file are used to create an instance of the first model.
For example, optionally, for example, when the first model is not requested to be called in the just-completed detection period, although the first instance built according to the first configuration information of the first model and the first model file of the first model is deleted, the first configuration information of the first model and the first model file of the first model acquired in advance are retained, so that the first instance can be replied at the fastest speed based on the first configuration information of the first model and the first model file of the first model when the first instance is needed.
According to the embodiment provided by the application, under the condition that the first model is not called by a request in the just finished detection period, the first configuration information of the first model and the first model file of the first model which are acquired in advance are reserved, wherein the first configuration information and the first model file are used for creating the instance of the first model, the purpose that the first instance can be replied at the fastest speed based on the first configuration information of the first model and the first model file of the first model under the condition that the first instance is needed is achieved, and the effect of improving the dynamic management comprehensiveness of model instantiation is achieved.
As an alternative, for convenience of understanding, the following is described with an embodiment in a specific online service recommendation system scenario:
for further example, as shown in fig. 9, optionally, the online service recommendation system 902 is included, where the online service recommendation system 902 includes a dynamic creation model instance module 904, a hot loading model module 906, and a timed cleaning model instance module 908, and the specific steps are as follows:
step S902, inputting a feature vector to the online service recommendation system 902, for example, in a recommendation system scenario, inputting a feature vector related to a user and an article;
step S904, running the dynamic creation model instance module 904, the hot loading model module 906, and the timed cleaning model instance module 908 in parallel, in other words, performing step S906, step S910, and step S912, respectively;
step S906, the dynamic model instance creating module 904 reads the model file at a preset time (for example, when the model is called) to generate the model instance, specifically, the dynamic model instance creating module 904 first detects whether the model instance exists, if the model instance exists, the model instance is directly called to output a model prediction result, and if the model instance does not exist, step S908 is executed;
step S908, establishing a model instance, and then calling the model instance to output a model prediction result;
step S910, the module 908 for regularly cleaning the model instance first detects whether the model in the model list has been called in the last time period, if so, directly exits from the current module, and if not, cleans the model instance in the memory, deletes the model file, and then exits from the current module;
step S912, when the model is newly online or the service is just started, the hot loading model module 906 prepares the configuration and model files required by the model before calling, and combines with the dynamic model instance creating module 904, so that the operations of model modification, updating, online and the like can be realized, and the whole system does not need any change; specifically, the hot-load model module 906 first detects whether the model is updated, and if not, directly exits the current module, and if the model is updated or is a new model, reads the configuration of the model (such as the path of the model file, the parameters of the model), downloads the model file, and then exits the current module.
For further example, an optional dynamic creation Model instance module 904 shown in fig. 9 may be, but is not limited to, include a pre-read Model list, such as a Unified Modeling Language (UML) -like Model, including a Model list (modelMap), where data recorded by the Model list (modelMap) is a static variable and is always held in a memory, for example, there are 3 models providing services such as DeepFM, deepscanning, and DNN on a line, and what is stored in the Model list is 1- > DeepFM,2- > deepscanning, 3- > DNN, where a Model variable in the Model list only contains a configuration of a Model, and a corresponding file is downloaded, and an instance is not created and does not occupy the memory;
the class ModeManager only provides one function getModelByModelId externally, when a certain Model is called on line, the Model id is transmitted in to obtain a corresponding Model variable, and it is worth noting that a Model object does not necessarily have a Model instance, but Model configuration is read in advance through a getModelConfig function and a Model file is downloaded;
the internal method getModelConfig is mainly used for obtaining the configuration of the model and downloading the model file, when the service is started, a thread is opened up, the configuration is read again every time period, and the configuration and the model file of the model can be prepared after a period of time after a new model is on line.
The private variable modelConfig is the model configuration obtained when preloading the model list, and the model instance modelInstance is null and not instantiated when preloading the model list.
The Model class only provides one function externally, when the predict function is started to be called after the Model object is obtained through the Model id, the getModelInstance function is called inside the Model object, the private variable modelInstance of the current object is instantiated, and then the prediction result is provided.
The instantiation function getModelInstance has the following two key points:
1. this. model instance = = null to ensure that a model is only created once;
2. the this pointer of the Model object is added with a synchronous lock, so that the thread safety is ensured, and the mutual isolation among various models is ensured.
Further, to help understanding the embodiment of the two key points, specifically, the model attribute of the model instance ensures that the model instance enters the shared memory after being created, and avoids another thread from sharing the memory again.
In the double verification, when multiple threads simultaneously acquire the same lock after the first judgment, once a certain thread firstly creates an instance, the subsequent threads pass the judgment, and the instance is prevented from being created again.
The object lock is a class lock relatively, if synchronized modifies model, all models are the same lock used when creating the instance, and need to wait for each other, for example, the deep fm model needs to wait until the deep cross model creates the instance, and then the model creation instance can be read, and when the model is dozens of models and the model file is large, the waiting time is long. In the module, the same Model object corresponds to the same Model Id Model, for example, Model 1 is DeepFM, Model 2 is DeepCross, and the two models cannot wait for each other and create instances in parallel, so that the creation of the Model instance is greatly accelerated, and the overall speed of the system is improved.
Further illustrating, an optional hot load model module 906 such as shown in FIG. 9, wherein hot load model module 906 may be used to address, but is not limited to, the following:
1. the new model is on line, the service automatically reads the configuration, downloads the model file and instantiates the model file quickly when the model has a request;
2. when the configuration of the Model is updated, the configuration is read again, and the old Model object is destroyed;
3. when the Model file is updated, the Model file is re-downloaded and the old Model object is destroyed.
For further illustration, the algorithm execution logic of an alternative hot-load model module such as that shown in FIG. 10 is as follows:
step S1002, when the program is started, starting a detection thread;
step S1004, detecting a thread timing cycle triggering step S1006;
step S1006, detecting whether the configuration is updated (for example, update _ time can be used in mysql) by configuring the updated flag, if so, entering step S1008, and if not, entering step S1010;
step S1008, re-reading the model configuration, and entering step S1010;
in step S1010, if the Model configuration is read again or the Model file is downloaded again in the current cycle, the Model (Model) object is destroyed, and the process goes to step S1004 to wait for triggering the next detection.
Optionally, in step S1010, when the Model object is destroyed, the Model instance is also destroyed, and at this time, if the Model is continuously called, the dynamic Model instance creation module is triggered again to obtain a new Model instance, which is imperceptible to the caller, so that hot loading of the Model is realized, and when the Model configuration and the file are changed or a new Model is on-line, the program can automatically prepare the corresponding Model object and wait for calling.
For further example, in an optional example of the timed cleaning model instance module 908 shown in fig. 9, the detecting thread may periodically detect whether the model has been called in a previous period, for example, the period is 1 hour, the detecting thread may detect whether the model has been called every 1 hour, and if a model is not called in the previous 1 hour, the model instance may be cleaned, but the model configuration and the model file may be retained. After the model instance is cleaned, and if called again, the dynamic model instance creation module 904 is retriggered to obtain a new model instance. It can be said that the design of the dynamic creation model instance module 904 effectively simplifies the implementation of the hot-loading model module 908 and the timed cleaning model instance module 906.
For further example, optionally, for example, as shown in fig. 11, in the process of executing the program, a thread a1102 and a thread B1104 that are invoked for different clients are optionally included, where the thread a1102 and the thread B1104 may be used for invoking the model a, but are not limited to, and the specific steps are as follows:
s1102, triggering the starting of a program on a page of a target website, wherein the program can be used for calling or creating a model instance but not limited;
it should be noted that, in the scenario shown in fig. 11, the thread a1102 and the thread B1104 are performed almost simultaneously in a parallel manner, and for clarity, the following is performed based on the thread a11022 and the thread B1104, respectively, and first, the following steps are performed based on the thread a 11022:
s1104-1, calling the model A;
s1106-1, judging whether the instance exists, if not, executing the step S1108-1 (in the scenario shown in FIG. 11, if the instance does not exist, the execution step of the instance existence is not described here for reducing redundant explanation);
s1108-1, acquiring an object lock;
meanwhile, the following steps are performed based on thread B1104:
s1104-2, calling the model A;
s1106-2, judging whether the instance exists, if not, executing the step S1108-2 (in the scenario shown in FIG. 11, if the instance does not exist, the execution step of the instance existence is not described here for reducing redundant explanation);
s1108-2, acquiring an object lock;
it should be noted that, the obtained object locks are the same object lock, the optional object locks are class locks, if synchronized modified is model.class, all models are the same lock when creating an instance, and need to wait for each other, for example, the deep fm model needs to wait until the deep cross model creates the instance, and the waiting time is very long when the model is tens of models and the model file is large. In the scene, the same Model object corresponds to the same Model Id Model, for example, Model A is DeepFM, Model B is DeepCross, and the two models cannot wait for each other and establish an instance in parallel, so that the establishment of the Model instance is greatly accelerated, and the overall speed of the system is improved;
further, the following steps are performed in a serial manner:
s1110, determining whether the instance exists, if yes, performing step S1114, and if not, performing step S1112;
s1112, creating an instance;
s1114, releasing the object lock, wherein the premise of releasing the object lock is that the instance exists and is shared, and specifically, due to the voltate attribute of the model A, the model instance is ensured to enter the shared memory immediately after being created, so that other threads are prevented from sharing the memory again;
s1116, determining whether the instance exists, if so, executing step S1118 (since the premise of releasing the object lock in step S1114 is that the instance exists, and further, in step S1116, if no other abnormal factors are considered, the instance inevitably exists, and in order to avoid redundant description, the step that the instance does not exist is not considered);
s1118, releasing the object lock;
s1120, an example is obtained, wherein the example is created in the previous thread A1102, and the subsequent thread B1104 only needs to judge to avoid the redundant step of creating the example again, so that the creation of the model example is greatly accelerated, and the overall speed of the system is improved.
Through the embodiment provided by the application, the model instance can be prevented from being repeatedly created and can be destroyed in time, the instance is unique and can be automatically destroyed when the model is offline, the dynamic expansion of the instance is realized, not only can each instance be unique, but also a plurality of different model instances can be created, in addition, a double-locking object lock mode is also provided, the thread safety of the same type of model is ensured, the models of different types can be instantiated in parallel, the unicity and the isolation are considered, based on the dynamic creation of the model instance module, the thermal loading of the model and the timing cleaning of the model instance are also realized, when a new model is online and an old model is offline, or the model configuration is modified, or the model file is updated, the online program can automatically create or the instance without extra work destruction, the method and the system enable the program under the scene of the online service recommendation system to be stable and easy to use.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to another aspect of the embodiment of the present invention, there is also provided a model instantiation dynamic management device for implementing the above model instantiation dynamic management method. As shown in fig. 12, the apparatus includes:
a first obtaining unit 1202, configured to obtain a first service request and a second service request, where the first service request and the second service request are used to request a target service provided online;
a response unit 1204, configured to invoke a first model using a first thread request in response to the first service request, and invoke the first model using a second thread request in response to the second service request, where the first model is a model for providing the target service online;
a first judging unit 1206, configured to set a first object lock to the first model when it is judged for the first time by the first thread and the second thread that there is no instance of the first model, where the first object lock is used to set the first thread and the second thread to operate in series, and the first thread operates preferentially over the second thread in the series operation;
a second judging unit 1208, configured to judge whether an instance of the first model exists for the second time through the first thread, and in a case that it is judged that the instance of the first model does not exist for the second time through the first thread, create a first instance of the first model through the first thread;
a second obtaining unit 1210, configured to determine whether an instance of the first model exists for the second time through the second thread, and obtain the first instance through the second thread if it is determined that the first instance exists for the second time through the second thread.
Alternatively, the model instantiated dynamic management device can be applied to, but is not limited to, an application scenario in which a deep learning online service or a model provides an online service. The thread may be, but is not limited to, the smallest unit capable of performing operation scheduling by the operating system, is included in the process, and is an actual operation unit in the process, and optionally, a thread refers to a single sequential control flow in the process. The model can be, but is not limited to, a deep learning model in a variety of application scenarios, such as a deep learning model applied in the scenarios of search technology, data mining, machine learning, machine translation, natural language processing, image recognition, multimedia learning, speech recognition, recommendation systems, and personalization technologies. Setting as a serial job may be, but is not limited to, indicating setting as performing jobs in order of execution priority, where the execution priority in the serial job may be, but is not limited to, dependent on the invocation time of the thread, and may also be, but is not limited to, manually set. The object lock may be set to work serially, but is not limited to representing a request to invoke the first model.
It should be noted that, a first service request and a second service request are obtained, where the first service request and the second service request are used to request a target service provided online; calling a first model by using a first thread request in response to a first service request, and calling the first model by using a second thread request in response to a second service request, wherein the first model provides a model of a target service on line; setting a first object lock for the first model when the first thread and the second thread judge that the first model does not exist for the first time, wherein the first object lock is used for setting the first thread and the second thread to work in series, and the first thread takes precedence over the second thread under the serial work; judging whether an instance of the first model exists for the second time through the first thread, and under the condition that the instance of the first model does not exist for the second time through the first thread, creating the first instance of the first model through the first thread; and judging whether the instance of the first model exists for the second time through the second thread, and acquiring the first instance through the second thread under the condition that the first instance exists through the second thread for the second time.
For a specific embodiment, reference may be made to an example shown in the above model instantiated dynamic management method, and details in this example are not described here again.
According to the embodiment provided by the application, a first service request and a second service request are obtained, wherein the first service request and the second service request are used for requesting a target service provided on line; calling a first model by using a first thread request in response to a first service request, and calling the first model by using a second thread request in response to a second service request, wherein the first model provides a model of a target service on line; setting a first object lock for the first model when the first thread and the second thread judge that the first model does not exist for the first time, wherein the first object lock is used for setting the first thread and the second thread to work in series, and the first thread takes precedence over the second thread under the serial work; judging whether an instance of the first model exists for the second time through the first thread, and under the condition that the instance of the first model does not exist for the second time through the first thread, creating the first instance of the first model through the first thread; whether the instance of the first model exists is judged for the second time through the second thread, the first instance is obtained through the second thread under the condition that the first instance exists is judged for the second time through the second thread, and the instance of the first model cannot be repeatedly created under the condition that the first thread and the second thread both request to call the same model by utilizing a serial working mode under the condition that the first thread and the second thread request to call the first model, so that the aim of reducing repeated creation of the instance in the dynamic management process of model instantiation is fulfilled, and the technical effect of improving the dynamic management efficiency of model instantiation is achieved.
As an optional scheme, the apparatus further comprises:
and the third judging unit is used for judging whether an instance of the second model exists for the first time through the third thread under the condition that the first thread and the second thread are set to work serially and the third thread requests to call the second model, wherein the second model is a model for providing services online, and the third thread is set to work in parallel with the first thread and the second thread.
For a specific embodiment, reference may be made to an example shown in the above model instantiated dynamic management method, and details in this example are not described here again.
As an alternative, the apparatus comprises:
a fourth judging unit, configured to, in a case where both the third thread and the fourth thread request to call the second model, judge, for the first time, whether there is an instance of the second model by the fourth thread, where the fourth thread is set to operate in parallel with the first thread and the second thread;
a fifth judging unit, configured to set a second object lock for the second model when it is judged that the instance of the second model does not exist for the first time by the third thread and it is judged that the instance of the second model does not exist for the first time by the fourth thread, where the second object lock is used to set the third thread and the fourth thread to operate in series, and the third thread operates in preference to the fourth thread under the serial operation;
a sixth judging unit, configured to judge whether an instance of the second model exists for the second time through the third thread, and create a second instance of the second model through the third thread when it is judged that the instance of the second model does not exist for the second time through the third thread;
and the seventh judging unit is used for judging whether the instance of the second model exists for the second time through the fourth thread, and acquiring the second instance through the fourth thread under the condition that the second instance exists through the second judgment of the fourth thread.
For a specific embodiment, reference may be made to an example shown in the above model instantiated dynamic management method, and details in this example are not described here again.
As an optional scheme, the apparatus further comprises:
and the third obtaining unit is used for obtaining the first configuration information of the first model and the first model file of the first model before the first model is called by using the first thread request in response to the first service request and the first model file of the first model is called by using the second thread request in response to the second service request, wherein the first configuration information and the first model file are used for creating the first instance.
For a specific embodiment, reference may be made to an example shown in the above model instantiated dynamic management method, and details in this example are not described here again.
As an optional scheme, the apparatus further comprises:
the first detection unit is used for detecting whether the configuration information of the first model and the model file are updated at regular time;
the fourth acquisition unit is used for acquiring second configuration information of the first model under the condition that the configuration information of the first model is detected to be updated, wherein the latest configuration information of the first model is replaced by the second configuration information;
a fifth obtaining unit, configured to obtain a second model file of the first model when it is detected that the model file of the first model is updated, where a latest model file of the first model is replaced with the second model file by the first model file;
and the first deleting unit is used for deleting the first instance when the configuration information of the first model or the model file of the first model is updated.
For a specific embodiment, reference may be made to an example shown in the above model instantiated dynamic management method, and details in this example are not described here again.
As an optional scheme, the apparatus further comprises:
the eighth judging unit is used for judging whether the instance of the first model exists for the first time through the fifth thread and judging whether the instance of the first model exists for the first time through the sixth thread under the condition that the fifth thread and the sixth thread both request to call the first model after deleting the first instance;
the setting unit is used for setting a first object lock for the first model under the condition that the fifth thread judges that the example of the first model does not exist for the first time and the sixth thread judges that the example of the first model does not exist for the first time after the first example is deleted, wherein the first object lock is used for setting the fifth thread and the sixth thread to be operated in series, and the fifth thread is prior to the sixth thread to operate under the serial operation;
a creating unit, configured to determine whether an instance of the first model exists for the second time through a fifth thread after the first instance is deleted, and create a third instance of the first model according to the latest configuration information and the latest model file of the first model through the fifth thread in a case where it is determined that the instance of the first model does not exist for the second time through a sixth thread;
and the fifth acquiring unit is used for judging whether the instance of the first model exists for the second time through the sixth thread after deleting the first instance, and acquiring the third instance through the sixth thread under the condition that the third instance exists through the second time judgment of the sixth thread.
For a specific embodiment, reference may be made to an example shown in the above model instantiated dynamic management method, and details in this example are not described here again.
As an optional scheme, the apparatus further comprises:
the second detection unit is used for detecting whether the first model is requested to be called in the just finished detection period every preset detection period;
and the second deleting unit is used for deleting the first instance under the condition that the first model is not requested to be called in the just finished detection period.
For a specific embodiment, reference may be made to an example shown in the above model instantiated dynamic management method, and details in this example are not described here again.
As an optional scheme, the apparatus further comprises:
and a sixth obtaining unit, configured to, in a case that the first model is not requested to be called within the just-ended detection period, retain first configuration information of the first model and a first model file of the first model, which are obtained in advance, where the first configuration information and the first model file are used to create an instance of the first model.
For a specific embodiment, reference may be made to an example shown in the above model instantiated dynamic management method, and details in this example are not described here again.
According to yet another aspect of the embodiments of the present invention, there is further provided an electronic device for implementing the dynamic management method for model instantiation, as shown in fig. 13, the electronic device includes a memory 1302 and a processor 1304, the memory 1302 stores a computer program, and the processor 1304 is configured to execute the steps in any one of the method embodiments through the computer program.
Optionally, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring a first service request and a second service request, wherein the first service request and the second service request are used for requesting a target service provided online;
s2, responding to the first service request, using a first thread request to call a first model, responding to the second service request, using a second thread request to call the first model, wherein the first model provides the target service model on line;
s3, setting a first object lock for the first model when the first thread and the second thread judge that the first model instance does not exist for the first time, wherein the first object lock is used for setting the first thread and the second thread to be in serial work, and the first thread is prior to the second thread to work under the serial work;
s4, judging whether an instance of the first model exists for the second time through the first thread, and creating a first instance of the first model through the first thread under the condition that the instance of the first model does not exist through the second judgment of the first thread;
and S5, judging whether the instance of the first model exists for the second time through the second thread, and acquiring the first instance through the second thread under the condition that the first instance exists through the second thread.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 13 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 13 is not intended to limit the structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 13, or have a different configuration than shown in FIG. 13.
The memory 1302 may be used to store software programs and modules, such as program instructions/modules corresponding to the dynamic management method and apparatus for model instantiation in the embodiment of the present invention, and the processor 1304 executes various functional applications and data processing by running the software programs and modules stored in the memory 1302, that is, implementing the above-described dynamic management method for model instantiation. The memory 1302 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1302 may further include memory located remotely from the processor 1304, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 1302 may be specifically, but not limited to, used for storing information such as a first service request, a second service request, a first thread, a second thread, a first model, and a first instance. As an example, as shown in fig. 13, the memory 1302 may include, but is not limited to, a first obtaining unit 1202, a response unit 1204, a first judging unit 1206, a second judging unit 1208, and a second obtaining unit 1210 in the dynamic management device instantiated by the model. In addition, other module units in the dynamic management device instantiated by the above model may also be included, but are not limited to these, and are not described in detail in this example.
Optionally, the transmitting device 1306 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 1306 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmitting device 1306 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In addition, the electronic device further includes: a display 1308, configured to display information of the first service request, the second service request, the first thread, the second thread, the first model, the first instance, and the like; and a connection bus 1310 for connecting the respective module parts in the above-described electronic apparatus.
In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting a plurality of nodes through a network communication. The nodes may form a Peer-To-Peer (P2P) network, and any type of computing device, such as a server, a terminal, and other electronic devices, may become a node in the blockchain system by joining the Peer-To-Peer network.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations of the online service module instance aspect or the multi-thread parallel aspect described above. Wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring a first service request and a second service request, wherein the first service request and the second service request are used for requesting a target service provided online;
s2, responding to the first service request, using a first thread request to call a first model, responding to the second service request, using a second thread request to call the first model, wherein the first model provides the target service model on line;
s3, setting a first object lock for the first model when the first thread and the second thread judge that the first model instance does not exist for the first time, wherein the first object lock is used for setting the first thread and the second thread to be in serial work, and the first thread is prior to the second thread to work under the serial work;
s4, judging whether an instance of the first model exists for the second time through the first thread, and creating a first instance of the first model through the first thread under the condition that the instance of the first model does not exist through the second judgment of the first thread;
and S5, judging whether the instance of the first model exists for the second time through the second thread, and acquiring the first instance through the second thread under the condition that the first instance exists through the second thread.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be substantially or partially implemented in the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, or network devices) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (15)

1. A method for dynamic management of model instantiation, comprising:
acquiring a first service request and a second service request, wherein the first service request and the second service request are used for requesting a target service provided online;
calling a first model using a first thread request in response to the first service request, and calling the first model using a second thread request in response to the second service request, wherein the first model is a model for providing the target service online;
setting a first object lock on the first model under the condition that the first thread and the second thread judge that no instance of the first model exists for the first time, wherein the first object lock is used for setting the first thread and the second thread to be in serial work, and the first thread is superior to the second thread to work under the serial work;
judging whether an instance of the first model exists for the second time through the first thread, and under the condition that the instance of the first model does not exist through the second judgment of the first thread, creating a first instance of the first model through the first thread;
and judging whether the instance of the first model exists for the second time through the second thread, and acquiring the first instance through the second thread under the condition that the first instance exists through the second thread for the second time.
2. The method of claim 1, further comprising:
and under the condition that the first thread and the second thread are set to work serially and a third thread requests to call a second model, judging whether an instance of the second model exists for the first time through the third thread, wherein the second model is a model for providing services online, and the third thread is set to work in parallel with the first thread and the second thread.
3. The method of claim 2, wherein the method comprises:
under the condition that the third thread and a fourth thread both request to call the second model, judging whether an instance of the second model exists for the first time through the fourth thread, wherein the fourth thread is set to work in parallel with the first thread and the second thread;
setting a second object lock for the second model in a case where it is determined for the first time by the third thread that the instance of the second model does not exist and it is determined for the first time by the fourth thread that the instance of the second model does not exist, wherein the second object lock is used to set the third thread and the fourth thread to serial operation in which the third thread operates in preference to the fourth thread;
determining, by the third thread, a second time whether an instance of the second model exists, in the event that it is determined by the third thread that an instance of the second model does not exist, creating, by the third thread, a second instance of the second model;
and judging whether the second model example exists for the second time through the fourth thread, and acquiring the second example through the fourth thread under the condition that the second example exists through the fourth thread.
4. The method of claim 1, wherein prior to invoking a first model using a first thread request in response to the first service request and invoking the first model using a second thread request in response to the second service request, the method further comprises:
acquiring first configuration information of the first model and a first model file of the first model, wherein the first configuration information and the first model file are used for creating the first instance.
5. The method of claim 4, further comprising:
detecting whether the configuration information and the model file of the first model are updated at regular time;
under the condition that the configuration information of the first model is detected to be updated, acquiring second configuration information of the first model, wherein the latest configuration information of the first model is replaced by the second configuration information from the first configuration information;
under the condition that the model file of the first model is detected to be updated, acquiring a second model file of the first model, wherein the latest model file of the first model is replaced by the second model file from the first model file;
deleting the first instance if the configuration information of the first model or the model file of the first model is updated.
6. The method of claim 5, wherein after said deleting the first instance, the method further comprises:
under the condition that a fifth thread and a sixth thread both request to call the first model, judging whether an instance of the first model exists for the first time through the fifth thread and judging whether the instance of the first model exists for the first time through the sixth thread;
setting the first object lock on the first model when the fifth thread judges that the instance of the first model does not exist for the first time and the sixth thread judges that the instance of the first model does not exist for the first time, wherein the first object lock is used for setting the fifth thread and the sixth thread to work in series, and the fifth thread is prior to the sixth thread to work under the serial work;
judging whether an instance of the first model exists for the second time through the fifth thread, and under the condition that the instance of the first model does not exist through the sixth thread, creating a third instance of the first model through the fifth thread according to the latest configuration information and the latest model file of the first model;
and judging whether the instance of the first model exists for the second time through the sixth thread, and acquiring the third instance through the sixth thread under the condition that the third instance exists through the second judgment of the sixth thread.
7. The method according to any one of claims 1 to 6, further comprising:
detecting whether the first model is requested to be called in the just finished detection period every preset detection period;
deleting the first instance if the first model is not requested to be invoked within the just-ended detection period.
8. The method of claim 7, further comprising:
and under the condition that the first model is not requested to be called in the just finished detection period, reserving first configuration information of the first model and a first model file of the first model which are acquired in advance, wherein the first configuration information and the first model file are used for creating an instance of the first model.
9. A model instantiation dynamic management device, comprising:
a first obtaining unit, configured to obtain a first service request and a second service request, where the first service request and the second service request are used to request a target service provided online;
a response unit, configured to, in response to the first service request, invoke a first model using a first thread request, and, in response to the second service request, invoke the first model using a second thread request, where the first model provides a model of the target service online;
a first determination unit configured to set a first object lock to the first model when it is determined for the first time by the first thread and the second thread that an instance of the first model does not exist, wherein the first object lock is configured to set the first thread and the second thread to operate in series, and the first thread operates in preference to the second thread in the series operation;
a second judging unit, configured to judge whether there is an instance of the first model by the first thread for a second time, and in a case where it is judged by the first thread for the second time that there is no instance of the first model, create a first instance of the first model by the first thread;
and the second acquiring unit is used for judging whether the instance of the first model exists for the second time through the second thread, and acquiring the first instance through the second thread under the condition that the first instance exists through the second thread for the second time.
10. The apparatus of claim 9, further comprising:
and a third judging unit, configured to, when the first thread and the second thread are set to operate serially and a third thread requests to invoke a second model, judge, for the first time, whether an instance of the second model exists by the third thread, where the second model is a model for providing services online and the third thread is set to operate in parallel with the first thread and the second thread.
11. The apparatus of claim 10, wherein the apparatus comprises:
a fourth judging unit, configured to, when both the third thread and a fourth thread request to invoke the second model, judge, for the first time by the fourth thread, whether an instance of the second model exists, where the fourth thread is set to operate in parallel with the first thread and the second thread;
a fifth judging unit, configured to set a second object lock to the second model when it is judged for the first time by the third thread that the instance of the second model does not exist and when it is judged for the first time by the fourth thread that the instance of the second model does not exist, where the second object lock is configured to set the third thread and the fourth thread to serial operation in which the third thread operates preferentially over the fourth thread;
a sixth judging unit, configured to judge whether there is an instance of the second model by the third thread for the second time, and create a second instance of the second model by the third thread in a case where it is judged by the third thread for the second time that there is no instance of the second model;
a seventh determining unit, configured to determine whether an instance of the second model exists for the second time through the fourth thread, and acquire the second instance through the fourth thread when it is determined that the second instance exists for the second time through the fourth thread.
12. The apparatus of claim 9, further comprising:
a third obtaining unit, configured to obtain first configuration information of the first model and a first model file of the first model before calling the first model using a first thread request in response to the first service request and calling the first model using a second thread request in response to the second service request, where the first configuration information and the first model file are used to create the first instance.
13. The apparatus of claim 12, further comprising:
the first detection unit is used for detecting whether the configuration information and the model file of the first model are updated at regular time;
a fourth obtaining unit, configured to obtain second configuration information of the first model when it is detected that configuration information of the first model is updated, where latest configuration information of the first model is replaced with the second configuration information by the first configuration information;
a fifth obtaining unit, configured to, in a case where it is detected that a model file of the first model is updated, obtain a second model file of the first model, where an up-to-date model file of the first model is replaced with the second model file by the first model file;
a first deleting unit, configured to delete the first instance when the configuration information of the first model or the model file of the first model is updated.
14. A computer-readable storage medium, comprising a stored program, wherein the program is operable to perform the method of any one of claims 1 to 8.
15. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 8 by means of the computer program.
CN202010950669.2A 2020-09-11 2020-09-11 Dynamic management method and device for model instantiation and storage medium Active CN111813533B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010950669.2A CN111813533B (en) 2020-09-11 2020-09-11 Dynamic management method and device for model instantiation and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010950669.2A CN111813533B (en) 2020-09-11 2020-09-11 Dynamic management method and device for model instantiation and storage medium

Publications (2)

Publication Number Publication Date
CN111813533A CN111813533A (en) 2020-10-23
CN111813533B true CN111813533B (en) 2020-12-11

Family

ID=72859288

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010950669.2A Active CN111813533B (en) 2020-09-11 2020-09-11 Dynamic management method and device for model instantiation and storage medium

Country Status (1)

Country Link
CN (1) CN111813533B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103765469A (en) * 2011-07-14 2014-04-30 株式会社东芝 Dynamic infrastructure administration system
CN107784400A (en) * 2016-08-24 2018-03-09 北京京东尚科信息技术有限公司 A kind of execution method and apparatus of business model
CN111124702A (en) * 2019-11-22 2020-05-08 腾讯科技(深圳)有限公司 Performance data acquisition method, device and computer readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7418445B1 (en) * 2004-11-08 2008-08-26 Unisys Corporation Method for reducing the scope of the K node construction lock
US8301700B1 (en) * 2010-08-06 2012-10-30 Open Invention Network Llc System and method for event-driven live migration of multi-process applications
US10310820B2 (en) * 2016-05-12 2019-06-04 Basal Nuclei Inc Programming model and interpreted runtime environment for high performance services with implicit concurrency control
CN111459588A (en) * 2020-03-27 2020-07-28 深圳融安网络科技有限公司 Big data model setting method, terminal device and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103765469A (en) * 2011-07-14 2014-04-30 株式会社东芝 Dynamic infrastructure administration system
CN107784400A (en) * 2016-08-24 2018-03-09 北京京东尚科信息技术有限公司 A kind of execution method and apparatus of business model
CN111124702A (en) * 2019-11-22 2020-05-08 腾讯科技(深圳)有限公司 Performance data acquisition method, device and computer readable storage medium

Also Published As

Publication number Publication date
CN111813533A (en) 2020-10-23

Similar Documents

Publication Publication Date Title
AU2017253672C1 (en) Automatically updating a hybrid application
CN105468702B (en) A kind of extensive RDF data associated path discovery method
CN106022007B (en) The cloud platform system and method learning big data and calculating is organized towards biology
CN106164866A (en) The efficient migration of client-side WEB state
CN103473696A (en) Method and system for collecting, analyzing and distributing internet business information
CN105302920A (en) Optimal management method and system for cloud storage data
CN110347651A (en) Method of data synchronization, device, equipment and storage medium based on cloud storage
CN110659261A (en) Data mining model publishing method, model and model service management method
CN102999608A (en) System and method for tree table demonstration of large data
CN111752723B (en) Visual multi-source service management system and implementation method thereof
CN114327857A (en) Operation data processing method and device, computer equipment and storage medium
CN111340404A (en) Method and device for constructing index system and computer storage medium
CN103077186B (en) A kind of layer data treating apparatus and method
CN110851211A (en) Method, apparatus, electronic device, and medium for displaying application information
CN112199200B (en) Resource scheduling method and device, computer equipment and storage medium
CN111813533B (en) Dynamic management method and device for model instantiation and storage medium
WO2024041035A1 (en) Machine learning model management method and device, model management platform, and storage medium
CN115203172B (en) Model construction and model data subscription method and device, electronic equipment and medium
CN116974465A (en) Data loading method, device, equipment and computer storage medium
CN115455006A (en) Data processing method, data processing device, electronic device, and storage medium
CN115878860A (en) Menu generation method, device, server equipment and medium
CN114493185A (en) Approval processing method, device, system, electronic equipment, storage medium and product
CN115238006A (en) Retrieval data synchronization method, device, equipment and computer storage medium
CN114756362A (en) Resource quota management method and system, intelligent terminal and storage medium
CN112860844A (en) Case clue processing system, method and device and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40030686

Country of ref document: HK