Operator uninstallation and registration method, device, storage medium and electronic device
By determining the usage state of the target operator and the operating state of the network model in the deep learning solution, the operator of a certain solution is implemented separately without affecting other solutions, and the failure in the existing technology is solved Problem of uninstalling the solution operator separately.
Patent Information
- Application Number
- CN202111645543.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-12-29
AI Technical Summary
In the prior art, it is impossible to uninstall only one solution's operator, which makes it difficult to uninstall the operator of a certain solution alone in the case where multiple deep learning solutions coexist.
By determining the usage status of the target operator called by the solution to be uninstalled, if the target operator is being called by other solutions, first determine the operating status of the operator of the network model included in the other solutions, and wait for it to After the run is completed, uninstall the target operator.
It implements the uninstallation of the operator corresponding to one of multiple solutions without affecting the operation of other solutions, solving the problem that the operator corresponding to only one solution cannot be uninstalled.
Smart Images

Figure CN114398095B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of deep learning, and more specifically, to a method, device, storage medium and electronic device for unloading and registering an operator. Background Art
[0002] The rapid development of deep learning technology has accelerated the coverage of artificial intelligence. Although deep learning requires a lot of computing resources and memory resources, with the development of computers, it has become possible to put multiple deep learning solutions on the same computer. How to coordinate the deep learning operators in multiple solutions has also become a problem that needs to be solved urgently.
[0003] In the related art, when a plurality of solutions are included in the same computer, when the plurality of solutions stop running, operators corresponding to the solutions are uninstalled at the same time.
[0004] It can be seen from this that there is a problem in the related art that it is impossible to offload only the operators corresponding to one solution.
[0005] With respect to the above-mentioned problems existing in the related technologies, no effective solution has been proposed yet. Summary of the invention
[0006] Embodiments of the present invention provide an operator uninstallation and registration method, device, storage medium and electronic device to at least solve the problem in the related art that it is impossible to uninstall only the operator corresponding to one solution.
[0007] According to one embodiment of the present invention, a method for uninstalling an operator is provided, comprising: determining a usage status of a target operator called by a solution to be uninstalled, wherein the target operator is stored in an operator decorator, each of the operator decorators is used to store operators of the same type, and the operator decorators are pre-registered in a target operator pool; when the usage status indicates that the target operator is being called by other solutions, determining an operator running status of a network model included in the other solutions; and when the running status indicates that the operation of the operator of the network model is finished, uninstalling the target operator.
[0008] According to one embodiment of the present invention, a method for registering an operator is provided, comprising: determining a first type of a received target operator; determining a second type of an operator supported for storage by a registered operator decorator in a target operator pool, wherein each registered operator decorator is used to store operators of the same type; storing the target operator in the target operator decorator when it is determined based on the second type that the operator decorator includes a target operator decorator that supports storage of the first type of operator; creating the target operator decorator to store the target operator in an operator pointer queue of the target operator decorator when it is determined based on the second type that the operator decorator does not include a target operator decorator that supports storage of the first type of operator.
[0009] According to another embodiment of the present invention, there is provided an operator unloading device, comprising: a first determination module, used to determine the usage status of a target operator called by a solution to be uninstalled; a second determination module, used to determine the running status of an operator of a network model included in other solutions when the usage status indicates that the target operator is being called by other solutions; and an unloading module, used to uninstall the target operator when the running status indicates that the operation of the operator of the network model has ended.
[0010] According to another embodiment of the present invention, a registration device for an operator is provided, comprising: a third determination module, used to determine a first type of a received target operator; a fourth determination module, used to determine a second type of operator supported for storage by a registered operator decorator in a target operator pool, wherein each registered operator decorator is used to store operators of the same type; a first registration module, used to store the target operator in the target operator decorator when it is determined based on the second type that the operator decorator includes a target operator decorator that supports storage of the first type of operator; and a second registration module, used to create the target operator decorator to store the target operator in the operator pointer queue of the target operator decorator when it is determined based on the second type that the operator decorator does not include a target operator decorator that supports storage of the first type of operator.
[0011] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of any of the above methods when executed by a processor.
[0012] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0013] Through the present invention, the use status of the target operator called by the solution to be uninstalled is determined. When the use status indicates that the target operator is being called by other solutions, the running status of the operator of the network model included in the other solutions is determined. When the running status indicates that the operator of the network model has finished running, the target operator is uninstalled. Since the target operator is uninstalled when the target operator is not being called, the solution corresponding to the target operator is uninstalled, and one of the multiple solutions is uninstalled separately. Therefore, the problem that the operator corresponding to only one solution cannot be uninstalled in the related art can be solved, and the effect of uninstalling the operator corresponding to one of the multiple solutions is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a hardware structure block diagram of a mobile terminal of an operator unloading method according to an embodiment of the present invention;
[0015] Figure 2 is a flowchart of an operator unloading method according to an embodiment of the present invention;
[0016] Figure 3 It is an operation flow chart of the solution in the related art;
[0017] Figure 4 is an operational flow chart of a solution according to an exemplary embodiment of the present invention;
[0018] Figure 5 is an operator calling flow chart according to an exemplary embodiment of the present invention;
[0019] Figure 6 is a flowchart of a registration method for an operator according to an embodiment of the present invention.
[0020] Figure 7 is a flow chart of an operator unloading method according to a specific embodiment of the present invention;
[0021] Figure 8 is a structural block diagram of an operator unloading device according to an embodiment of the present invention;
[0022] Fig. 9 4 is a structural block diagram of an operator registration device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0025] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of an operator unloading method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0026] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the unloading method of the operator in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a 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 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0027] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0028] In this embodiment, a method for unloading an operator is provided. Figure 2 is a flowchart of an operator unloading method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0029] Step S202, determining the usage status of the target operator called by the solution to be uninstalled, wherein the target operator is stored in an operator decorator, each of the operator decorators is used to store operators of the same type, and the operator decorators are pre-registered in the target operator pool;
[0030] Step S204, when the usage status indicates that the target operator is being called by other solutions, determining the running status of the operator of the network model included in the other solutions;
[0031] Step S206: when the running status indicates that the operation of the operator of the network model is finished, uninstall the target operator.
[0032] In the above embodiment, the solution to be uninstalled and other solutions may be solutions deployed in the same device. Each solution may include one or more network models, and the solution is the function that can be realized by the one or more network models included therein. For example, the solution may be an image processing solution, such as a face recognition solution, and the face recognition solution may include a face positioning network model and a face recognition network model. Each network model may correspond to one or more operators. Multiple operators may be stored in an operator pool, and the target operator may be an operator called by an image processing network model. Different solutions may call the same or different operators. When the target operator called by the solution to be uninstalled is being called by other solutions, the operation of the operators of the network models included in the other solutions may be waited for to be completed, and when the operation is completed, the target operator may be uninstalled. This is to achieve the operation of other solutions without affecting the operation of other solutions when the target operator is uninstalled. Among them, the usage status may be determined by the pointer variable of the target operator.
[0033] In the above embodiment, the target operator may be an operator stored in an operator decorator pre-registered in the target operator pool, and each operator decorator may store operators of the same type. The target operator pool may include one or more operator decorators. When the target operator is obtained, the target operator may be first packaged and stored in the operator decorator, and the operator decorator may be registered in the target operator pool. Among them, the target operator pool may be a custom operator pool, and the custom operator pool may be further registered and registered in the operator pool.
[0034] Optionally, the execution subject of the above steps can be a background processor, or other devices with similar processing capabilities, or a machine that at least integrates a data processing device, wherein the data processing device may include terminals such as computers and mobile phones, but is not limited to this.
[0035] Through the present invention, the use status of the target operator called by the solution to be uninstalled is determined. When the use status indicates that the target operator is being called by other solutions, the running status of the operator of the network model included in the other solutions is determined. When the running status indicates that the operator of the network model has finished running, the target operator is uninstalled. Since the target operator is uninstalled when the target operator is not being called, the solution corresponding to the target operator is uninstalled, and one of the multiple solutions is uninstalled separately. Therefore, the problem that the operator corresponding to only one solution cannot be uninstalled in the related art can be solved, and the effect of uninstalling the operator corresponding to one of the multiple solutions is achieved.
[0036] In an exemplary embodiment, when the usage status indicates that the target operator is being called by other solutions, the method further includes: determining the target operator decorator where the target operator is located; determining a replacement operator for the target operator from the target operator decorator; and, when the target operator is uninstalled, configuring the replacement operator to allow the other solutions to call the replacement operator when they are running. In this embodiment, when the target operator is being called by other solutions, the target operator decorator where the target operator is located can be determined, and a replacement operator for the target operator can be determined in the target operator decorator. When the target operator is uninstalled, the replacement operator can be configured to allow other solutions to call the replacement operator when they are running, so that uninstalling the target operator will not affect the re-running of other solutions.
[0037] In an exemplary embodiment, configuring the replacement operator includes: adjusting the pointer variable of the replacement operator from a default variable indicating that the call is allowed in the default state to a preset variable indicating that the call is allowed in the preset state; updating the call state of the target operator decorator from the default state to the preset state; when the call state of the target operator decorator is the preset state and the pointer variable of the replacement operator is the preset variable, allowing the other solutions to call the replacement operator when running. In this embodiment, when configuring the replacement operator, the pointer variable of the replacement operator can be adjusted from the default variable to the preset variable, and the call state of the target operator decorator can be updated from the default state to the preset state. When the call state of the target operator decorator is the preset state and the pointer variable of the replacement operator is the preset variable, other solutions are allowed to call the replacement operator when running. Among them, the default variable can be a (this variable is only an exemplary description, and can also be represented by other characters, and the present invention is not limited to this), the preset variable can be b (this variable is only an exemplary description, and can also be represented by other characters, and the present invention is not limited to this), the default state can be not requesting replacement, and the preset state can be requesting replacement. Among them, not requesting replacement can be represented by 0, and requesting replacement can be represented by 1. It should be noted that the above status can also be represented by other characters, and 0 and 1 are only an exemplary description, and the present invention does not limit this.
[0038] In related technologies, the deep learning framework provides an interface to register operators to the operator pool. During operation, the required operators will be extracted from the operator pool for operation. The operation flow chart of the solution can be found in the attached Figure 3 ,like Figure 3 As shown in the figure, operators are registered in the operator pool, and when running the solution, operators are called in the operator pool. Different solutions can call the same or different operators.
[0039] In the above embodiment, the operation flow chart of the solution can be found in the attached Figure 4 ,like Figure 4As shown in the figure, first a custom operator pool is added. All operators need to be registered in the custom operator pool before they can be registered in the operator pool of the deep learning framework itself. Secondly, an operator decorator is added to package the operators that are actually called. The operator decorator class has five main properties: a pointer queue of operators of the same type, a solution name queue corresponding to the operator pointer queue, two operator pointer variables, and a request substitution variable. The operator decorator can be used to separate the definition and implementation of the operator interface. With the iteration of the deep learning framework version, its interface form will continue to change. If there are many operators, the operator interface needs to be modified one by one. Among them, the operator pointer queue contains the same type of operator pointers of each solution. The solution name queue indicates which solution each operator comes from, which is used to correctly remove the corresponding operator pointer when the solution is uninstalled. The two operator pointer variables are represented by a and b respectively. a represents the operator pointer used by the current network inference, and the initial value is the first operator pointer registered to the operator decorator object. b represents the replaced operator pointer, and the initial value is a null pointer. If the values of a and b are not empty, then both operator pointers exist in the operator pointer queue. The request substitution variable (corresponding to the call state) has two states, 0 for no substitution request and 1 for substitution request. The initial state of this variable is 0. The operator call flow chart can be found in the attached Figure 5 ,like Figure 5 As shown in the figure, during the calling process of the operator at runtime, the program first determines the state of the requested replacement variable. If the state is 0, the a operator pointer is called, and if the state is 1, the b operator pointer is called.
[0040] In an exemplary embodiment, after configuring the replacement operator, and in the case where it is determined that the other solution has called the replacement operator, the method further includes: updating the pointer variable of the replacement operator to the default variable; and setting the call state of the target operator decorator to the default state. In this embodiment, after configuring the replacement operator, and in the case where it is determined that the other solution has called the replacement operator, the pointer variable of the replacement operator can be restored to the default variable, and the call state of the target operator decorator can be restored to the default state.
[0041] In an exemplary embodiment, unloading the target operator includes: determining the number of operators included in the operator pointer queue of the target operator decorator where the target operator is located; when the number is 1, unloading the target operator decorator to unload the target operator; when the number is greater than 1, unloading the target operator. In this embodiment, when the number of operators included in the operator pointer queue where the target operator is located is 1, the target operator decorator is unloaded, and when the number of operators included in the operator pointer queue where the target operator is located is greater than 1, the target operator is unloaded.
[0042] In this embodiment, a registration method for an operator is provided. Figure 6 is a flowchart of a registration method for an operator according to an embodiment of the present invention. Figure 6 As shown, the process includes the following steps:
[0043] Step S602, determining a first type of the received target operator;
[0044] Step S604, determining that the registered operator decorators in the target operator pool support the second type of stored operators, wherein each of the registered operator decorators is used to store operators of the same type;
[0045] Step S606, when it is determined based on the second type that the operator decorator includes a target operator decorator that supports storing operators of the first type, storing the target operator in the target operator decorator;
[0046] Step S608: When it is determined based on the second type that the operator decorator does not include a target operator decorator that supports storing operators of the first type, create the target operator decorator to store the target operator in the operator pointer queue of the target operator decorator.
[0047] In this embodiment, when registering an operator, each solution will first traverse the target operator pool. If there is no operator decorator of the corresponding type, a new decorator will be created and registered in the target operator pool and the deep learning framework operator pool, and then the operator pointer will be written into the operator pointer queue of the decorator. If it already exists, it will be directly written into the operator pointer queue of the corresponding decorator object. Each solution will register operators in turn.
[0048] In an exemplary embodiment, creating the target operator decorator includes: setting the property information of the initial operator decorator in the following manner: setting the pointer variable of the target operator to a default variable indicating that it is allowed to be called in the default state, creating an operator pointer queue in the initial operator decorator, and setting the call state of the initial operator decorator to the default state; determining the initial operator decorator with the property information set as the target operator decorator. In this embodiment, when creating the target operator decorator, the property information of the initial operator decorator can be set first, that is, setting the pointer variable of the target operator to the default variable, setting the call state of the target operator decorator to the default state, and creating a pointer queue in the target operator decorator, wherein the pointer queue is used to store operators of the same type. The initial operator decorator with the property information set is determined as the target operator decorator.
[0049] The following describes the operator unloading method in conjunction with a specific implementation method:
[0050] Figure 7 is a flow chart of an operator unloading method according to a specific embodiment of the present invention. Figure 7 As shown in the figure, when uninstalling an operator, the corresponding custom operator pool will be queried first to find the corresponding operator decorator. Then the number of operator pointer queues in the operator decorator object is queried. If the number is equal to 1, it indicates that the operator of this type will not be called again and can be uninstalled directly. If the number is greater than 1, it indicates that the operator of this type may be called later. Then determine whether the pointer of the operator to be uninstalled is equal to a. If it is not equal to a, it indicates that the operator pointer is not a pointer in use and can be uninstalled directly. If it is equal to a, it indicates that the operator pointer is in use and cannot be uninstalled directly. Then find the next available operator pointer in the operator pointer queue and assign it to b. And set the request replacement status value to 1. Then start the delayed waiting, which is mainly to wait for those operators that call a and are running to exit. Then assign the value of b to a, and set the request replacement status to 0. At this time, the operator pointer of the solution can be uninstalled from the operator pointer queue. If the operator pointer queue is found to be empty after uninstallation, it means that the operator decorator object of this type will no longer be used and can be uninstalled from the operator pool. When multiple solutions request uninstallation, they can be uninstalled one by one.
[0051] In the above-mentioned embodiment, by setting the operator pointer queue, switching the operator pointer and the synchronization mode of delay waiting, it is achieved that the forward operation of the operator and the operator unloading do not affect each other, so that multiple solutions will not affect the running solution when unloading. By adding a custom operator pool, the registration, search and modification of operators are more flexible, and no longer rely solely on the interface provided by the deep learning framework, which improves the operator control ability. By adding an operator decorator class and using a combination method, the separation of operator interface definition and implementation is achieved.
[0052] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0053] In this embodiment, an operator unloading device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0054] Figure 8 is a structural block diagram of an operator unloading device according to an embodiment of the present invention, such as Figure 8 As shown, the device comprises:
[0055] A first determination module 82 is used to determine the usage status of the target operator called by the solution to be uninstalled, wherein the target operator is stored in an operator decorator, the operator decorator is used to store operators of the same type, and the operator decorator is pre-registered in the target operator pool;
[0056] A second determination module 84 is configured to determine the operation status of the operator of the network model included in the other solution when the usage status indicates that the target operator is being called by the other solution;
[0057] The unloading module 86 is used to unload the target operator when the running status indicates that the operation of the operator of the network model is completed.
[0058] In an exemplary embodiment, the device is also used to: determine the target operator decorator where the target operator is located; determine a replacement operator for the target operator from the target operator decorator when the usage status indicates that the target operator is being called by other solutions; and configure the replacement operator to allow the other solutions to call the replacement operator when the target operator is uninstalled.
[0059] In an exemplary embodiment, the device can configure the replacement operator in the following manner: adjust the pointer variable of the replacement operator from a default variable indicating that it is allowed to be called in the default state to a preset variable indicating that it is allowed to be called in the preset state; update the calling state of the target operator decorator from the default state to the preset state; when the calling state of the target operator decorator is the preset state and the pointer variable of the replacement operator is the preset variable, allow the other solutions to call the replacement operator when they are running.
[0060] In an exemplary embodiment, the device can also be used to update the pointer variable of the replacement operator to the default variable and set the calling state of the target operator decorator to the default state after configuring the replacement operator and when it is determined that the other solution has called the replacement operator.
[0061] In an exemplary embodiment, the unloading module 86 can unload the target operator in the following manner: determine the number of operators included in the operator pointer queue of the target operator decorator where the target operator is located; when the number is 1, unload the target operator decorator to unload the target operator; when the number is greater than 1, unload the target operator.
[0062] Fig. 9 is a structural block diagram of an operator registration device according to an embodiment of the present invention, such as Fig. 9 As shown, the device comprises:
[0063] A third determination module 92, configured to determine a first type of a received target operator;
[0064] A fourth determination module 94 is used to determine the second type of operators supported by the registered operator decorators in the target operator pool, wherein each of the registered operator decorators is used to store operators of the same type;
[0065] A first registration module 96, configured to store the target operator in the target operator decorator when it is determined based on the second type that the operator decorator includes a target operator decorator that supports storing the operator of the first type;
[0066] The second registration module 98 is used to create the target operator decorator to store the target operator in the operator pointer queue of the target operator decorator when it is determined based on the second type that the operator decorator does not include the target operator decorator that supports storing the first type of operator.
[0067] In an exemplary embodiment, the second registration module 98 can create the target operator decorator by: setting the attribute information of the initial operator decorator in the following manner: setting the pointer variable of the target operator to a default variable indicating that it is allowed to be called in the default state, creating an operator pointer queue in the initial operator decorator, and setting the calling state of the initial operator decorator to the default state; determining the initial operator decorator with the attribute information set as the target operator decorator.
[0068] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0069] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0070] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0071] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0072] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0073] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0074] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0075] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for unloading an operator, characterized in that: include: Determine the usage status of the target operator called by the solution to be uninstalled, wherein the target operator is stored in an operator decorator, the operator decorator is used to store operators of the same type, and the operator decorator is pre-registered in the target operator pool; In a case where the usage status indicates that the target operator is being called by other solutions, determining the running status of the operator of the network model included in the other solutions; When the running status indicates that the operation of the operator of the network model is finished, the target operator is uninstalled.
2. The method according to claim 1, characterized in that In a case where the usage status indicates that the target operator is being called by other solutions, the method further includes: Determine the target operator decorator where the target operator is located; Determine a replacement operator for the target operator from the target operator decorator; When the target operator is uninstalled, the replacement operator is configured to allow the other solution to call the replacement operator when it is running.
3. The method according to claim 2, characterized in that Configuring the replacement operator includes: Adjusting the pointer variable of the replacement operator from a default variable used to indicate that the call is allowed in a default state to a preset variable used to indicate that the call is allowed in a preset state; Update the calling state of the target operator decorator from the default state to the preset state; When the calling state of the target operator decorator is the preset state and the pointer variable of the replacement operator is the preset variable, the other solutions are allowed to call the replacement operator during runtime.
4. The method according to claim 3, characterized in that After configuring the replacement operator, and in the case where it is determined that the other solution has called the replacement operator, the method further includes: Updating the pointer variable of the replacement operator to the default variable; The calling state of the target operator decorator is set to the default state.
5. The method according to claim 1, characterized in that Unloading the target operator includes: Determine the number of operators included in the operator pointer queue of the target operator decorator where the target operator is located; When the number is 1, uninstall the target operator decorator to uninstall the target operator; When the number is greater than 1, the target operator is unloaded.
6. A registration method for an operator, characterized in that: include: determining a first type of the received target operator; Determining that the registered operator decorators in the target operator pool support a second type of operators to be stored, wherein each of the registered operator decorators is used to store operators of the same type; In a case where it is determined based on the second type that the operator decorator includes a target operator decorator that supports storing an operator of the first type, storing the target operator in the target operator decorator; When it is determined based on the second type that the operator decorator does not include a target operator decorator that supports storing operators of the first type, the target operator decorator is created to store the target operator in an operator pointer queue of the target operator decorator.
7. The method according to claim 6, characterized in that Creating the target operator decorator includes: Setting the attribute information of the initial operator decorator in the following manner: setting the pointer variable of the target operator to a default variable for indicating that the operator is allowed to be called in a default state, creating an operator pointer queue in the initial operator decorator, and setting the calling state of the initial operator decorator to the default state; The initial operator decorator in which the attribute information is set is determined as the target operator decorator.
8. An operator unloading device, characterized in that: include: A first determination module is used to determine the usage status of a target operator called by the solution to be uninstalled, wherein the target operator is stored in an operator decorator, each of the operator decorators is used to store operators of the same type, and the operator decorators are pre-registered in a target operator pool; A second determination module is used to determine the operation status of the operator of the network model included in the other solution when the usage status indicates that the target operator is being called by the other solution; An unloading module is used to unload the target operator when the running status indicates that the operation of the operator of the network model has ended.
9. An operator registration device, characterized in that: include: A third determination module, configured to determine a first type of a received target operator; A fourth determination module, used to determine a second type of operator supported for storage by a registered operator decorator in the target operator pool, wherein each registered operator decorator is used to store operators of the same type; A first registration module, configured to store the target operator in the target operator decorator when it is determined based on the second type that the operator decorator includes a target operator decorator that supports storing operators of the first type; The second registration module is used to create the target operator decorator when it is determined based on the second type that the operator decorator does not include a target operator decorator that supports storing operators of the first type, so as to store the target operator in the operator pointer queue of the target operator decorator.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 5 are implemented, or the steps of the method described in any one of claims 6 to 7 are implemented.
11. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 5, or to execute the method described in any one of claims 6 to 7.
Citation Information
Patent Citations
Method, device and system for adjusting calculation operator type distribution in calculation system
CN111694653A
Energy-efficient and resource-limited mobile edge computing task allocation method
CN112073452A