WO2021139358A1 - Service method and apparatus based on micro-kernel model plug-in mode, device, and storage medium - Google Patents

Service method and apparatus based on micro-kernel model plug-in mode, device, and storage medium Download PDF

Info

Publication number
WO2021139358A1
WO2021139358A1 PCT/CN2020/125075 CN2020125075W WO2021139358A1 WO 2021139358 A1 WO2021139358 A1 WO 2021139358A1 CN 2020125075 W CN2020125075 W CN 2020125075W WO 2021139358 A1 WO2021139358 A1 WO 2021139358A1
Authority
WO
WIPO (PCT)
Prior art keywords
algorithm
plug
dynamic library
service
main program
Prior art date
Application number
PCT/CN2020/125075
Other languages
French (fr)
Chinese (zh)
Inventor
沈冬明
夏学海
张国辉
宋晨
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021139358A1 publication Critical patent/WO2021139358A1/en

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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • 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

Definitions

  • This application relates to artificial intelligence, and in particular to a service method, device, equipment, and storage medium based on a plug-in mode of a micronucleus model.
  • AI artificial intelligence technology mainly relies on data, computing power, and algorithms. Data is the foundation of model training. Computing power is the tool for training models. Algorithms are the training methods of models. Different training methods lead to the birth of various algorithms. Or evolve.
  • the models are deeply integrated according to the actual needs of the project (practical application scenarios), and the coding is implemented (the model is trained) to meet the needs of the project or the customer, and provide the customer with a certain specific function.
  • the inventor realizes that this method, although the algorithm has been implemented, cannot be expanded in terms of function and cannot be used universally between customer groups. Upgrades need to be redeployed. There is almost no reference value for reference, resulting in long-term research and development and operation and maintenance personnel. Repeated labor and low output rate.
  • This application provides a service method, device, equipment, and storage medium based on the plug-in mode of the micronucleus model. Its main purpose is to improve the scalability, versatility, concurrency and compatibility of algorithm functions to meet different customers and different scenarios. Applications.
  • this application provides a service method based on the plug-in mode of the micronucleus model, and the method includes:
  • the system main program is used as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a layered design;
  • the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-ins, so as to perform algorithm services externally.
  • this application also provides a service device based on the plug-in mode of the micronucleus model, the device including:
  • the layered deployment module is used for the plug-in mode based on the micronucleus model, with the system main program as the core component, and adopts a layered design to deploy the algorithm plug-in management layer and auxiliary service layer in the system main program;
  • the encapsulation module is used to encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface of the system defined by the algorithm plug-in management layer;
  • the management service module is used for unified management of the algorithm dynamic library plug-in through the algorithm plug-in management layer under the cooperation of the auxiliary service layer, so as to perform algorithm services externally.
  • the present application also provides an electronic device, the electronic device including:
  • At least one processor and,
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the following steps:
  • the system main program is used as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a layered design;
  • the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-ins, so as to perform algorithm services externally.
  • the present application also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the following steps are implemented:
  • the system main program is used as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a layered design;
  • the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-ins, so as to perform algorithm services externally.
  • the system main program in this application and each algorithm form a micronucleus model plug-in architecture.
  • the system main program adopts a hierarchical design to separate the algorithm plug-in management layer, and uses the algorithm plug-in management layer to define the plug-in interface of the system, and With the assistance of the auxiliary service layer, the unified management of the algorithm dynamic library plug-in is realized, and the independence between the algorithms is realized, so that there is no coupling and interference between the algorithms. At the same time, the scalability, versatility, and concurrency of the algorithm functions are improved. compatibility.
  • This application involves distributed artificial intelligence. By designing the logic program, this application can satisfy different customers and applications in different scenarios; effectively reduce the customer's system development costs and later operation and maintenance costs.
  • FIG. 1 is a flowchart of a service method based on a plug-in mode of a micronucleus model provided by an embodiment of the present application;
  • FIG. 2 is a schematic diagram of the architecture design of a micronucleus model plug-in provided by an embodiment of the application;
  • FIG. 3 is a diagram of the overall architecture design of a service based on the micronucleus model plug-in mode provided by an embodiment of the application;
  • FIG. 5 is a schematic diagram of invoking remake by an external application provided by an embodiment of the application.
  • FIG. 6 is a schematic diagram of functional modules of a service device based on a micronucleus model plug-in mode provided by an embodiment of the present application;
  • FIG. 7 is a schematic diagram of the internal structure of an electronic device that implements a service method based on a micronucleus model plug-in mode provided by an embodiment of the application.
  • This application provides a service method based on the plug-in mode of the micronucleus model.
  • FIG. 1 it is a schematic flowchart of a service method based on a plug-in mode of a micronucleus model provided by an embodiment of this application.
  • the method can be executed by a device, and the device can be implemented by software and/or hardware.
  • the service method based on the plug-in mode of the micronucleus model includes:
  • the system main program is taken as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a hierarchical design.
  • the system main program is the core
  • the micronucleus model plug-in architecture is designed between the system main program and each algorithm.
  • FIG. 2 is a schematic diagram of the architecture design of the micronucleus model plug-in provided by an embodiment of this application, the distributed deployment of algorithms such as algorithm A to algorithm G can be loaded onto the main program of the system to form a micronucleus model plug-in architecture.
  • This application uses a hierarchical design of the system main program, separates the algorithm plug-in management layer, supplemented by the auxiliary service layer, and combines each function with each other. After the algorithm dynamic library plug-in is subsequently connected, an efficient algorithm service can be formed. Wherein, the system main program can still maintain the normal operation of the system without accessing the algorithm dynamic library plug-in, but it does not provide specific algorithm function services.
  • the step of defining the plug-in interface of the system includes the step of defining the form of the plug-in interface.
  • the plug-in interface form can be defined as five types of interfaces: Init, UnInit, Config, Version, and Process.
  • the algorithm plug-in management layer independently designs the standard system plug-in interface according to the design idea of the plug-in, and the subsequent algorithm dynamic library plug-in provides seamless access to the system main program as long as the external interface conforming to the defined plug-in interface is provided in accordance with the standard. During normal operation, the corresponding algorithm function is provided.
  • the algorithm dynamic library plug-in in this application can be deployed in a distributed or clustered manner according to a microservice mode, and the deployment method is relatively flexible, and suitable algorithm functions can be selected according to actual needs.
  • the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-in, so as to perform algorithm services externally.
  • the algorithm plug-in management layer described in this application with the cooperation of the auxiliary service layer, conducts unified management of the algorithm dynamic library plug-ins, which realizes the independence between the algorithms, so that there is no coupling and interference between the algorithms; at the same time, the expansion of the algorithm functions is improved. Versatility, concurrency and compatibility.
  • step of the algorithm plug-in management layer's unified management of the algorithm dynamic library plug-in includes:
  • FIG. 4 shows a schematic diagram of dependency decoupling between algorithms according to an embodiment of the present application.
  • a dependency call interface is specially designed to adjust the dependency between the algorithms to be selected by the upper layer, the algorithm plug-in management layer, to be called by the dependent algorithm, which also effectively solves the problem.
  • the coupling relationship between the algorithms is improved, so that each algorithm can run independently, forming a closed loop within the algorithm.
  • algorithm B in the prior art relies on algorithm A. Under normal circumstances, algorithm B must be deployed with another set of algorithm A, which is equivalent to two sets of algorithm A in the system service. The deployment of the plug-in in the plug-in management layer relies on the calling interface.
  • the setting of the dependent calling interface can combine Algorithm A and Algorithm B for algorithm service, avoiding the problem of multiple identical Algorithm A in the system.
  • the dependent calling interface is an open interface, which can contain multiple dependence relationships among multiple algorithms.
  • the method further includes: according to some special scenarios or some customized requirements proposed by customers, etc., according to actual business requirements, writing algorithm dynamic library plug-ins with specified functions, and accessing the main program of the system according to the above method, It can directly meet the requirements.
  • This method greatly reduces the repetitive development work of R&D personnel, and at the same time reduces the maintenance work of operation and maintenance personnel, making the team's focus more inclined to the research of the algorithm itself, without having to care about the work of engineering deployment.
  • This application is a general engineering method that turns algorithms into services. It refers to the design ideas of the independent function model of the micro-core model plug-in model and the micro-service model, deploys the main program of the system as the core component, and encapsulates the specific algorithm modules into independent
  • the algorithm dynamic library plug-in fully considers the unique function of each algorithm, the dependence between algorithms, and the characteristics of the fusion and use of multiple algorithms. It combines the algorithms efficiently without coupling and interference between them. Make the algorithm service function possess versatility, scalability, concurrency, compatibility, etc. For a specific algorithm function, according to the actual deployment and operating environment, all the algorithm function services that can be provided can be deployed, or distributed and clustered deployment can be performed in accordance with the microservice model.
  • the microservice function refers to a service composed of a certain set of algorithms or certain algorithms separately deployed in a clustered or distributed manner.
  • the deployment method of this system is relatively flexible, and suitable algorithm functions can be selected according to actual needs; it can effectively reduce the repetitive work of developers and maintenance personnel; and this case has a very high level of network high concurrency systems or multi-system integration.
  • Reference value can effectively reduce customers' system development costs and later operation and maintenance costs, and enable customers to invest manpower and funds in their areas of expertise to create greater value.
  • step of the algorithm plug-in management layer for unified management of the algorithm dynamic library plug-in may further include: S34, constructing a system service configuration file to load the algorithm dynamic library plug-in into the system main program.
  • the algorithm plug-in management layer performs unified management of the algorithm dynamic library plug-ins with the assistance of the auxiliary service layer.
  • the assistance of the auxiliary service layer includes: receiving algorithm service requests sent from outside; maintaining the algorithm service request queue in the system, performing task scheduling management, and generating call requests; and distributing the call requests to the algorithm dynamic library plug-in for processing ; Record or query the operating status of the system's algorithm services; maintain, update and take effect in time for various data at runtime.
  • FIG. 3 shows the overall architecture design diagram of the service based on the plug-in mode of the microkernel model in an embodiment of the present application.
  • the core idea of this application is to separate the algorithm plug-in management layer, supplemented by the above-mentioned auxiliary service layer, namely configuration management, log management, concurrency management, routing management, queue management, data management, etc., and the functions in the auxiliary service layer are combined with each other. , To form an efficient algorithm service, and provide algorithm service functions to the outside world.
  • the algorithm plug-in management layer may include: plug-in loading, plug-in unloading, plug-in interface definition, plug-in configuration, plug-in calling, dependency calling, etc., to achieve the above-mentioned unified management of the algorithm dynamic library plug-ins .
  • the algorithm plug-in management layer independently designs a plug-in interface that conforms to the system according to the plug-in design idea, so as to connect the corresponding algorithm dynamic library plug-in to the main program of the system to provide algorithm services to the outside.
  • the auxiliary service layer may include configuration management, log management, concurrency management, routing management, queue management, data management, etc., to realize the auxiliary function of the aforementioned auxiliary service layer to the algorithm plug-in management layer.
  • the auxiliary service layer provides reading and writing of configuration parameters of system services and reading of algorithm library configuration items through configuration management; providing system service operation status records, log queries, etc. through log management; For highly concurrent call requests, effective task scheduling management is performed, call requests are distributed to the corresponding algorithm for processing, and the concurrent processing capabilities of system services are improved; the message queue in the system is maintained through queue management to support concurrent management task scheduling, etc. ; Provide maintenance of various data during system operation through data management, real-time update, and timely effect.
  • a network service layer can also be deployed in the main program of the system.
  • the network service layer is used to provide an external service interface for external calls by the system, and interface communication is performed through ZMQ.
  • an external service interface is set in the network service layer, the external service interface is called through the network service layer according to the external network environment, and the communication connection is performed based on the ZMQ communication mode.
  • step S34 the construction of the system service configuration file to load the algorithm dynamic library plug-in into the system main program includes: S341, identifying the name of the algorithm dynamic library plug-in, and obtaining the path of the configuration information of the algorithm dynamic library plug-in S342, add the configuration information of the algorithm dynamic library plug-in to the configuration file of the system main program according to the path, and construct the system service configuration file; S343, read the system service configuration file to add the algorithm dynamic library The plug-in is loaded into the main program of the system.
  • the method further includes: S345, reading the configuration items of the algorithm dynamic library plug-in; The enalbed value is used to determine whether the algorithm dynamic library plug-in is effective; if the enalbed value is configured to 1, the loading is successful and the algorithm dynamic library plug-in is effective; otherwise, the algorithm dynamic library plug-in is not effective.
  • step S34 in detail with reference to an embodiment: Taking access to the remake dynamic library as an example, the working process is as follows:
  • the system main program After setting up the system service configuration file, the system main program will read the configuration information in the configuration file of the remake dynamic library, and load the dynamic library into the memory of the system service as required. After the loading is successful, remake the dynamic library Can provide the corresponding function.
  • FIG. 5 shows a schematic diagram of the external application calling the Remake plugin algorithm plug-in provided by this embodiment of the present application, which is specifically shown by the dotted line in FIG. 5.
  • the algorithm dynamic library plug-in packaged in this application constitutes the algorithm dynamic library.
  • This application integrates the hot deployment function of the algorithm dynamic library, adopts the dynamic loading technology of the algorithm function, loads the algorithm when the service is initialized, or when the specified algorithm needs to be used, the algorithm is loaded separately; when it is not needed, or when an algorithm is updated , According to the algorithm uninstall request, the specified algorithm can be dynamically uninstalled.
  • the state of the algorithm dynamic library plug-in in the system service includes: unloaded, loaded, effective, pending unloading, the default state is effective during normal operation, if the state to be unloaded is detected, the system service selects the algorithm dynamic library plug-in Unload the dynamic library when it is idle; after the algorithm dynamic library plug-in is updated, the system service detects that the algorithm dynamic library plug-in is not loaded, then the algorithm dynamic library plug-in is loaded, and if it succeeds, it will switch to the loaded state; according to the algorithm dynamic library plug-in
  • the enabled value of the configuration item determines whether the algorithm dynamic library plug-in takes effect. With this technology, it is possible to update the algorithm of the non-stop service program, and it can also effectively reduce the loss of service downtime and the customer's operating cost.
  • FIG. 6 it is a functional block diagram of the service device 100 based on the plug-in mode of the micronucleus model provided by an embodiment of the present application.
  • the service device 100 based on the plug-in mode of the micronucleus model described in this application can be installed in an electronic device.
  • the service device 100 based on the plug-in mode of the microkernel model may include a hierarchical deployment module 101, an encapsulation module 102, and a management service module 103.
  • the module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
  • This application is based on the micronucleus model plug-in mode, with the system main program as the core, and the system main program and each algorithm are designed into a micronucleus model plug-in architecture; through the hierarchical design of the system main program, the algorithm plug-in management layer is independent , Supplemented by the auxiliary service layer, each function is combined with each other, and then after the algorithm dynamic library plug-in is connected, an efficient algorithm service can be formed.
  • the system main program can still maintain the normal operation of the system without accessing the algorithm dynamic library plug-in, but it does not provide specific algorithm function services.
  • each module/unit is as follows:
  • the hierarchical deployment module 101 is used to deploy an algorithm plug-in management layer and an auxiliary service layer in the system main program using a hierarchical design based on a plug-in mode of a micronucleus model, with a system main program as a core component.
  • the algorithm plug-in management layer may include: plug-in loading, plug-in unloading, plug-in interface definition, plug-in configuration, plug-in calling, dependency calling, etc., to realize unified management of the algorithm dynamic library plug-ins.
  • the auxiliary service layer may include: configuration management, log management, concurrency management, route management, queue management, data management, etc., to realize the auxiliary function of the auxiliary service layer to the algorithm plug-in management layer.
  • the auxiliary function may include: receiving algorithm service requests sent from outside; maintaining the algorithm service request queue in the system, performing task scheduling management, and generating call requests; distributing the call requests to the algorithm dynamic library plug-in for processing; recording or Query the operating status of the algorithm service of the system; maintain, update and take effect in time for various data at runtime.
  • the layered deployment module 101 is also used to deploy a network service layer in the main program of the system, and set an external service interface in the network service layer; according to the external network environment, call through the network service layer
  • the external service interface is used for communication connection based on the ZMQ communication mode.
  • the encapsulation module 102 is configured to encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface of the system defined by the algorithm plug-in management layer.
  • the algorithm plug-in management layer independently designs the standard system plug-in interface according to the design idea of the plug-in, and the subsequent algorithm dynamic library plug-in provides seamless access to the system main program as long as the external interface conforming to the defined plug-in interface is provided in accordance with the standard. During normal operation, the corresponding algorithm function is provided.
  • the algorithm dynamic library plug-in in this application can be deployed in a distributed or clustered manner according to a microservice mode, and the deployment method is relatively flexible, and suitable algorithm functions can be selected according to actual needs.
  • the management service module 103 is configured to perform unified management of the algorithm dynamic library plug-in through the algorithm plug-in management layer with the cooperation of the auxiliary service layer, so as to perform algorithm services externally.
  • the algorithm plug-in management layer with the cooperation of the auxiliary service layer, performs unified management of the algorithm dynamic library plug-ins, which realizes the independence between the algorithms, so that there is no coupling and interference between the algorithms; at the same time, the scalability of the algorithm functions is improved, Versatility, concurrency and compatibility.
  • the unified management of the algorithm dynamic library plug-in through the algorithm plug-in management layer includes: loading the algorithm dynamic library plug-in into the system main program according to the algorithm service request; unloading the algorithm dynamics in the system main program as required Library plug-ins: According to the dependency between algorithms, make dependent calls to the algorithm dynamic library plug-ins to combine multiple algorithm dynamic library plug-ins and load them into the main program of the system.
  • the unified management of the algorithm dynamic library plug-in through the algorithm plug-in management layer may also include: constructing a system service configuration file to load the algorithm dynamic library plug-in into the system main program.
  • the constructing the system service configuration file to load the algorithm dynamic library plug-in into the system main program includes: identifying the name of the algorithm dynamic library plug-in, and obtaining the path of the configuration information of the algorithm dynamic library plug-in; According to the path, add the configuration information of the algorithm dynamic library plug-in to the configuration file of the system main program to construct the system service configuration file; read the system service configuration file to load the algorithm dynamic library plug-in to the system main In the process.
  • the constructing the system service configuration file to load the algorithm dynamic library plug-in into the system main program may also include: reading the configuration items of the algorithm dynamic library plug-in; judging according to the enalbed value of the configuration item Whether the algorithm dynamic library plug-in is effective; if the enalbed value is configured to 1, the loading is successful and the algorithm dynamic library plug-in is effective; otherwise, the algorithm dynamic library plug-in is not effective.
  • the service device 100 based on the plug-in mode of the micronucleus model further includes: an add-in module, which is used to write algorithm dynamic library plug-ins with specified functions according to customization requirements, so as to be loaded into the main program of the system for corresponding algorithm services .
  • an add-in module which is used to write algorithm dynamic library plug-ins with specified functions according to customization requirements, so as to be loaded into the main program of the system for corresponding algorithm services .
  • FIG. 7 it is a schematic diagram of the structure of an electronic device that implements the service program in this application.
  • the electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a service program 12.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1.
  • the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various types of data installed in the electronic device 1, such as service program codes, etc., but also to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc.
  • the processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules (such as service modules) stored in the memory 11 Programs, etc.), and call data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 7 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 6 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
  • the electronic device 1 may also include a power source (such as a battery) for supplying power to various components.
  • the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling the power supply.
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators.
  • the electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface.
  • the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may also include a user interface.
  • the user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)).
  • the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
  • the service program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions.
  • the system main program is used as a core component Deploying the algorithm plug-in management layer and the auxiliary service layer in the main program of the system using a layered design; defining the system plug-in interface through the algorithm plug-in management layer, and encapsulating the algorithm into an independent algorithm dynamic library according to the plug-in interface Plug-in; with the assistance of the auxiliary service layer, the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-in to perform algorithm services externally.
  • the integrated module/unit of the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
  • the embodiment of the present application also proposes a computer-readable storage medium.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the computer-readable storage medium includes a computer program, and the computer program is The following operations are implemented when the processor is executed:
  • the system main program is used as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a layered design;
  • the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-ins, so as to perform algorithm services externally.
  • the specific implementation of the computer-readable storage medium of the present application is substantially the same as the specific implementation of the service method, apparatus, and electronic device based on the micronucleus model plug-in mode, and will not be repeated here.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.

Abstract

Disclosed are a service method and apparatus based on a micro-kernel model plug-in mode, and an electronic device and a computer-readable storage medium. The method comprises: on the basis of a micro-kernel model plug-in mode, taking a system main program as a core component, and deploying an algorithm plug-in management layer and an auxiliary service layer in the system main program by using a hierarchical design (S1); defining a plug-in interface of a system by means of the algorithm plug-in management layer, and encapsulating an algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface (S2); and with the assistance of the auxiliary service layer, using the algorithm plug-in management layer to carry out unified management on the algorithm dynamic library plug-in so as to carry out algorithm service externally (S3). Therefore, the expansibility, universality, concurrency and compatibility of the algorithm functions can be improved.

Description

基于微核模型插件模式的服务方法、装置、设备及存储介质Service method, device, equipment and storage medium based on micronucleus model plug-in mode
本申请要求于2020年07月30日提交中国专利局、申请号为202010755915.9,发明名称为“基于微核模型插件模式的服务方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of a Chinese patent application filed with the Chinese Patent Office on July 30, 2020, the application number is 202010755915.9, and the invention title is "service methods, devices, equipment and storage media based on the micronucleus model plug-in model". The entire content is incorporated into this application by reference.
技术领域Technical field
本申请涉及人工智能,尤其是涉及一种基于微核模型插件模式的服务方法、装置、设备及存储介质。This application relates to artificial intelligence, and in particular to a service method, device, equipment, and storage medium based on a plug-in mode of a micronucleus model.
背景技术Background technique
随着目前AI人工智能技术的不断发展、进步,这些技术将能够改变现代生活,甚至能够使得某些行业发生根本性的变革,人工智能的应用逐渐涉及到日常生活的方方面面。AI人工智能技术主要依靠的是数据、算力、算法,数据是模型训练的基础,算力是训练模型的工具,算法就是模型的训练方法,训练方法不一样,就导致了各种算法的诞生或者衍化。With the continuous development and progress of current AI artificial intelligence technology, these technologies will be able to change modern life and even make fundamental changes in certain industries. The application of artificial intelligence gradually involves all aspects of daily life. AI artificial intelligence technology mainly relies on data, computing power, and algorithms. Data is the foundation of model training. Computing power is the tool for training models. Algorithms are the training methods of models. Different training methods lead to the birth of various algorithms. Or evolve.
现有技术一般情况下是将模型根据项目的实际需要(实际应用场景)进行深度结合,编码实现(训练出模型),以满足项目或客户的需求,为客户提供某种具体的功能。发明人意识到这种方式,虽然实现了算法的落地,但是功能上无法扩展,客户群体之间无法通用,升级换代需要重新部署,可借鉴参考价值几乎没有,导致研发和运维人员长时间的重复劳动,产出率低下。In the prior art, generally, the models are deeply integrated according to the actual needs of the project (practical application scenarios), and the coding is implemented (the model is trained) to meet the needs of the project or the customer, and provide the customer with a certain specific function. The inventor realizes that this method, although the algorithm has been implemented, cannot be expanded in terms of function and cannot be used universally between customer groups. Upgrades need to be redeployed. There is almost no reference value for reference, resulting in long-term research and development and operation and maintenance personnel. Repeated labor and low output rate.
发明内容Summary of the invention
本申请提供一种基于微核模型插件模式的服务方法、装置、设备及存储介质,其主要目的在于提高算法功能的扩展性、通用性、并发性和兼容性,以满足不同客户、不同场景下的应用。This application provides a service method, device, equipment, and storage medium based on the plug-in mode of the micronucleus model. Its main purpose is to improve the scalability, versatility, concurrency and compatibility of algorithm functions to meet different customers and different scenarios. Applications.
为实现上述目的,本申请提供一种基于微核模型插件模式的服务方法,该方法包括:In order to achieve the above-mentioned purpose, this application provides a service method based on the plug-in mode of the micronucleus model, and the method includes:
基于微核模型插件模式,将系统主程序作为核心部件,采用分层设计在所述系统主程序中部署算法插件管理层和辅助服务层;Based on the plug-in mode of the micronucleus model, the system main program is used as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a layered design;
通过所述算法插件管理层定义系统的插件接口,按照所述插件接口,将算法封装成独立的算法动态库插件;Define the plug-in interface of the system through the algorithm plug-in management layer, and encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface;
在所述辅助服务层的辅助下,采用所述算法插件管理层对所述算法动态库插件进行统一管理,以对外进行算法服务。With the assistance of the auxiliary service layer, the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-ins, so as to perform algorithm services externally.
为实现上述目的,本申请还提供一种基于微核模型插件模式的服务装置,所述装置包括:To achieve the above objective, this application also provides a service device based on the plug-in mode of the micronucleus model, the device including:
分层部署模块,用于基于微核模型插件模式,以系统主程序为核心部件,采用分层设计在所述系统主程序中部署算法插件管理层和辅助服务层;The layered deployment module is used for the plug-in mode based on the micronucleus model, with the system main program as the core component, and adopts a layered design to deploy the algorithm plug-in management layer and auxiliary service layer in the system main program;
封装模块,用于根据所述算法插件管理层定义的系统的插件接口,将算法封装成独立的算法动态库插件;The encapsulation module is used to encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface of the system defined by the algorithm plug-in management layer;
管理服务模块,用于在所述辅助服务层的配合下,通过所述算法插件管理层对所述算法动态库插件进行统一管理,以对外进行算法服务。The management service module is used for unified management of the algorithm dynamic library plug-in through the algorithm plug-in management layer under the cooperation of the auxiliary service layer, so as to perform algorithm services externally.
为实现上述目的,本申请还提供一种电子设备,所述电子设备包括:To achieve the above objective, the present application also provides an electronic device, the electronic device including:
至少一个处理器;以及,At least one processor; and,
与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the following steps:
基于微核模型插件模式,将系统主程序作为核心部件,采用分层设计在所述系统主程序中部署算法插件管理层和辅助服务层;Based on the plug-in mode of the micronucleus model, the system main program is used as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a layered design;
通过所述算法插件管理层定义系统的插件接口,按照所述插件接口,将算法封装成独立的算法动态库插件;Define the plug-in interface of the system through the algorithm plug-in management layer, and encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface;
在所述辅助服务层的辅助下,采用所述算法插件管理层对所述算法动态库插件进行统一管理,以对外进行算法服务。With the assistance of the auxiliary service layer, the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-ins, so as to perform algorithm services externally.
为实现上述目的,本申请还提供一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现如下步骤:In order to achieve the above objective, the present application also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the following steps are implemented:
基于微核模型插件模式,将系统主程序作为核心部件,采用分层设计在所述系统主程序中部署算法插件管理层和辅助服务层;Based on the plug-in mode of the micronucleus model, the system main program is used as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a layered design;
通过所述算法插件管理层定义系统的插件接口,按照所述插件接口,将算法封装成独立的算法动态库插件;Define the plug-in interface of the system through the algorithm plug-in management layer, and encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface;
在所述辅助服务层的辅助下,采用所述算法插件管理层对所述算法动态库插件进行统一管理,以对外进行算法服务。With the assistance of the auxiliary service layer, the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-ins, so as to perform algorithm services externally.
本申请中的系统主程序与各算法之间形成了微核模型插件架构,系统主程序采用分层设计将算法插件管理层独立出来,利用该算法插件管理层对系统的插件接口进行定义,并在辅助服务层的辅助下对算法动态库插件进行统一性管理,实现了各算法间的独立,使得各算法间无耦合,无干扰,同时提高了算法功能的扩展性,通用性,并发性和兼容性。本申请涉及了分布式人工智能。本申请通过对逻辑程序设计,从而可以满足不同客户、不同场景下的应用;有效的降低客户的系统开发成本、后期运维成本。The system main program in this application and each algorithm form a micronucleus model plug-in architecture. The system main program adopts a hierarchical design to separate the algorithm plug-in management layer, and uses the algorithm plug-in management layer to define the plug-in interface of the system, and With the assistance of the auxiliary service layer, the unified management of the algorithm dynamic library plug-in is realized, and the independence between the algorithms is realized, so that there is no coupling and interference between the algorithms. At the same time, the scalability, versatility, and concurrency of the algorithm functions are improved. compatibility. This application involves distributed artificial intelligence. By designing the logic program, this application can satisfy different customers and applications in different scenarios; effectively reduce the customer's system development costs and later operation and maintenance costs.
附图说明Description of the drawings
图1是本申请一实施例提供的基于微核模型插件模式的服务方法的流程图;FIG. 1 is a flowchart of a service method based on a plug-in mode of a micronucleus model provided by an embodiment of the present application;
图2为本申请一实施例提供的微核模型插件架构设计示意图;2 is a schematic diagram of the architecture design of a micronucleus model plug-in provided by an embodiment of the application;
图3为本申请一实施例提供的基于微核模型插件模式的服务的整体架构设计图;FIG. 3 is a diagram of the overall architecture design of a service based on the micronucleus model plug-in mode provided by an embodiment of the application;
图4为本申请一实施例提供的算法间依赖解耦示意图;4 is a schematic diagram of dependency decoupling between algorithms provided by an embodiment of the application;
图5为本申请一实施例提供的外部应用调用remake示意图;FIG. 5 is a schematic diagram of invoking remake by an external application provided by an embodiment of the application;
图6是本申请一实施例提供的基于微核模型插件模式的服务装置的功能模块示意图;FIG. 6 is a schematic diagram of functional modules of a service device based on a micronucleus model plug-in mode provided by an embodiment of the present application;
图7为本申请一实施例提供的实现基于微核模型插件模式的服务方法的电子设备的内部结构示意图。FIG. 7 is a schematic diagram of the internal structure of an electronic device that implements a service method based on a micronucleus model plug-in mode provided by an embodiment of the application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.
本申请提供一种基于微核模型插件模式的服务方法。参照图1所示,为本申请一实施例提供的基于微核模型插件模式的服务方法的流程示意图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。This application provides a service method based on the plug-in mode of the micronucleus model. Referring to FIG. 1, it is a schematic flowchart of a service method based on a plug-in mode of a micronucleus model provided by an embodiment of this application. The method can be executed by a device, and the device can be implemented by software and/or hardware.
在本实施例中,基于微核模型插件模式的服务方法包括:In this embodiment, the service method based on the plug-in mode of the micronucleus model includes:
S1、基于微核模型插件模式,将系统主程序作为核心部件,采用分层设计在所述系统主程序中部署算法插件管理层和辅助服务层。S1. Based on the plug-in mode of the micro-nucleus model, the system main program is taken as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a hierarchical design.
其中,基于微核模型插件模式,以系统主程序为核心,将系统主程序与各算法之间设 计成微核模型插件架构。参照图2所示,为本申请一实施例提供的微核模型插件架构设计示意图,可以将算法A到算法G等算法分布式部署加载到系统主程序上以形成一种微核模型插件架构。Among them, based on the micronucleus model plug-in mode, the system main program is the core, and the micronucleus model plug-in architecture is designed between the system main program and each algorithm. Referring to FIG. 2, which is a schematic diagram of the architecture design of the micronucleus model plug-in provided by an embodiment of this application, the distributed deployment of algorithms such as algorithm A to algorithm G can be loaded onto the main program of the system to form a micronucleus model plug-in architecture.
本申请通过对系统主程序进行分层设计,将算法插件管理层独立出来,辅以辅助服务层,各功能之间相互组合,后续将算法动态库插件接入后,可形成高效的算法服务。其中,所述系统主程序在不接入算法动态库插件的情况下,仍然可以保持系统的正常运行,只是不提供具体的算法功能服务。This application uses a hierarchical design of the system main program, separates the algorithm plug-in management layer, supplemented by the auxiliary service layer, and combines each function with each other. After the algorithm dynamic library plug-in is subsequently connected, an efficient algorithm service can be formed. Wherein, the system main program can still maintain the normal operation of the system without accessing the algorithm dynamic library plug-in, but it does not provide specific algorithm function services.
S2、通过所述算法插件管理层定义系统的插件接口,按照所述插件接口,将算法封装成独立的算法动态库插件。S2. Define the plug-in interface of the system through the algorithm plug-in management layer, and encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface.
其中,所述定义系统的插件接口的步骤中,包括:定义插件接口形式的步骤。具体地,可以将插件接口形式定义为Init、UnInit、Config、Version和Process五大类接口。所述算法插件管理层根据插件的设计思想独立设计标准的系统的插件接口,后续算法动态库插件,只要按照标准提供符合这些定义的插件接口的对外接口,就可以无缝接入到系统主程序中,进行正常工作,提供相应的算法功能。本申请中算法动态库插件可以按照微服务的模式进行分布式或集群式部署,部署方式上比较灵活,可根据实际需要选择合适的算法功能。Wherein, the step of defining the plug-in interface of the system includes the step of defining the form of the plug-in interface. Specifically, the plug-in interface form can be defined as five types of interfaces: Init, UnInit, Config, Version, and Process. The algorithm plug-in management layer independently designs the standard system plug-in interface according to the design idea of the plug-in, and the subsequent algorithm dynamic library plug-in provides seamless access to the system main program as long as the external interface conforming to the defined plug-in interface is provided in accordance with the standard. During normal operation, the corresponding algorithm function is provided. The algorithm dynamic library plug-in in this application can be deployed in a distributed or clustered manner according to a microservice mode, and the deployment method is relatively flexible, and suitable algorithm functions can be selected according to actual needs.
S3、在所述辅助服务层的辅助下,采用所述算法插件管理层对所述算法动态库插件进行统一管理,以对外进行算法服务。本申请所述算法插件管理层在辅助服务层的配合下,对算法动态库插件进行统一管理,实现了各算法间的独立,使得各算法间无耦合,无干扰;同时提高了算法功能的扩展性,通用性,并发性和兼容性。S3. With the assistance of the auxiliary service layer, the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-in, so as to perform algorithm services externally. The algorithm plug-in management layer described in this application, with the cooperation of the auxiliary service layer, conducts unified management of the algorithm dynamic library plug-ins, which realizes the independence between the algorithms, so that there is no coupling and interference between the algorithms; at the same time, the expansion of the algorithm functions is improved. Versatility, concurrency and compatibility.
进一步地,所述算法插件管理层对算法动态库插件进行统一管理的步骤中,包括:Further, the step of the algorithm plug-in management layer's unified management of the algorithm dynamic library plug-in includes:
S31,根据算法服务请求,将算法动态库插件加载到系统主程序中;S31: According to the algorithm service request, load the algorithm dynamic library plug-in into the system main program;
S32,根据需要,卸载系统主程序中的算法动态库插件;S32, according to need, uninstall the algorithm dynamic library plug-in in the system main program;
S33,根据算法间的依赖关系,对算法动态库插件进行依赖调用,以将多个算法动态库插件组合起来加载到系统主程序中。S33: According to the dependency relationship between the algorithms, make a dependent call to the algorithm dynamic library plug-in, so as to combine multiple algorithm dynamic library plug-ins and load them into the main program of the system.
图4示出了本申请一实施例的算法间依赖解耦示意图。如图4所示,针对算法动态库插件之间的依赖关系,特别设计了依赖调用接口,将算法间的依赖关系调整为由上层即算法插件管理层选择被依赖算法的调用,也有效的解决了算法间的耦合关系,使得每个算法能够独立运行,在算法内部形成闭环。如图4所示,现有技术中算法B依赖算法A,正常情况下,部署算法B时必须再带一套算法A,相当于系统服务内部存在两套算法A,而本申请在所述算法插件管理层中部署插件依赖调用接口,该依赖调用接口的设置可以将算法A和算法B组合进行算法服务,避免了系统中存在多个相同算法A的问题。需要说明的是,该依赖调用接口为开放接口,其中可以包含有多种算法间的多种依赖关系。采用上述设计模式,能够将各算法有机、任意的组合,提高了算法功能的扩展性,可以提供多种形式的服务功能,满足不同客户、不同场景下的各种应用。FIG. 4 shows a schematic diagram of dependency decoupling between algorithms according to an embodiment of the present application. As shown in Figure 4, in view of the dependency between the algorithm dynamic library plug-ins, a dependency call interface is specially designed to adjust the dependency between the algorithms to be selected by the upper layer, the algorithm plug-in management layer, to be called by the dependent algorithm, which also effectively solves the problem. The coupling relationship between the algorithms is improved, so that each algorithm can run independently, forming a closed loop within the algorithm. As shown in Figure 4, algorithm B in the prior art relies on algorithm A. Under normal circumstances, algorithm B must be deployed with another set of algorithm A, which is equivalent to two sets of algorithm A in the system service. The deployment of the plug-in in the plug-in management layer relies on the calling interface. The setting of the dependent calling interface can combine Algorithm A and Algorithm B for algorithm service, avoiding the problem of multiple identical Algorithm A in the system. It should be noted that the dependent calling interface is an open interface, which can contain multiple dependence relationships among multiple algorithms. By adopting the above design mode, various algorithms can be organically and arbitrarily combined, which improves the scalability of algorithm functions, and can provide various forms of service functions to meet various applications in different customers and different scenarios.
在一实施例中,所述方法还包括:根据某些特殊场景或者客户提出的一些定制化需求等,按照实际业务需求,编写指定功能的算法动态库插件,按照上述方法接入系统主程序,就能就能直接满足要求。这种方式大大减少了研发人员的重复性开发工作,同时也减轻了运维人员的维护工作,使得团队的重心更偏向于算法本身的研究,而无需关心工程化部署的工作。In one embodiment, the method further includes: according to some special scenarios or some customized requirements proposed by customers, etc., according to actual business requirements, writing algorithm dynamic library plug-ins with specified functions, and accessing the main program of the system according to the above method, It can directly meet the requirements. This method greatly reduces the repetitive development work of R&D personnel, and at the same time reduces the maintenance work of operation and maintenance personnel, making the team's focus more inclined to the research of the algorithm itself, without having to care about the work of engineering deployment.
本申请是将算法变成服务的通用型工程化方法,其参照微核模型插件模式和微服务模型的独立功能模式设计思想,将系统主程序部署为核心部件,具体的算法模块封装成各自独立的算法动态库插件,充分考虑了各算法的功能独特性、算法间的依赖性以及多种算法相互融合配合使用的特点,高效的将各算法糅合在一起,并且相互间无耦合,无干扰,使得算法服务功能具备了通用性、扩展性、并发性、兼容性等。针对具体某算法功能而言, 可根据实际部署运行环境,可部署能提供的全部的算法功能服务,也可按照微服务的模式进行分布式、集群式部署。微服务功能是指按照集群式或者分布式,单独部署某套算法或者某一些算法组成的服务。本系统在部署方式上比较灵活,可根据实际需要选择合适的算法功能;能够有效降低开发人员、维护人员的重复性劳动;并且本案对于网络高并发系统或者多系统融合等,都具有极高的参考价值,能够有效的降低客户的系统开发成本、后期运维成本,能够让客户将人力、资金等投入在擅长的领域,创造更大的价值。This application is a general engineering method that turns algorithms into services. It refers to the design ideas of the independent function model of the micro-core model plug-in model and the micro-service model, deploys the main program of the system as the core component, and encapsulates the specific algorithm modules into independent The algorithm dynamic library plug-in fully considers the unique function of each algorithm, the dependence between algorithms, and the characteristics of the fusion and use of multiple algorithms. It combines the algorithms efficiently without coupling and interference between them. Make the algorithm service function possess versatility, scalability, concurrency, compatibility, etc. For a specific algorithm function, according to the actual deployment and operating environment, all the algorithm function services that can be provided can be deployed, or distributed and clustered deployment can be performed in accordance with the microservice model. The microservice function refers to a service composed of a certain set of algorithms or certain algorithms separately deployed in a clustered or distributed manner. The deployment method of this system is relatively flexible, and suitable algorithm functions can be selected according to actual needs; it can effectively reduce the repetitive work of developers and maintenance personnel; and this case has a very high level of network high concurrency systems or multi-system integration. Reference value can effectively reduce customers' system development costs and later operation and maintenance costs, and enable customers to invest manpower and funds in their areas of expertise to create greater value.
进一步地,所述算法插件管理层对所述算法动态库插件进行统一管理的步骤中,还可以包括:S34,构建系统服务配置文件,以将算法动态库插件加载到系统主程序中。Further, the step of the algorithm plug-in management layer for unified management of the algorithm dynamic library plug-in may further include: S34, constructing a system service configuration file to load the algorithm dynamic library plug-in into the system main program.
需要说明的是,上述步骤S31~S34的描述并不是限定其顺序的先后,仅为了体现统一管理所包含的多个功能作用。It should be noted that the description of the above steps S31 to S34 does not limit the sequence of the steps, but only reflects the multiple functions included in the unified management.
本申请中,所述算法插件管理层对算法动态库插件进行统一管理,是在辅助服务层的辅助下进行的。优选地,所述辅助服务层的辅助,包括:接收外部发出的算法服务请求;维护系统内算法服务请求队列,进行任务调度管理,生成调用请求;将调用请求分发至算法动态库插件中进行处理;记录或查询系统的算法服务的运行状态;对运行时的各项数据进行维护、实时更新和及时生效。In this application, the algorithm plug-in management layer performs unified management of the algorithm dynamic library plug-ins with the assistance of the auxiliary service layer. Preferably, the assistance of the auxiliary service layer includes: receiving algorithm service requests sent from outside; maintaining the algorithm service request queue in the system, performing task scheduling management, and generating call requests; and distributing the call requests to the algorithm dynamic library plug-in for processing ; Record or query the operating status of the system's algorithm services; maintain, update and take effect in time for various data at runtime.
图3中示出了本申请一实施例中基于微核模型插件模式的服务的整体架构设计图。本申请的核心思想是将算法插件管理层独立出来,辅以上述的辅助服务层即配置管理、日志管理、并发管理、路由管理、队列管理、数据管理等等,辅助服务层内各功能相互结合,形成高效的算法服务,对外提供算法服务功能。FIG. 3 shows the overall architecture design diagram of the service based on the plug-in mode of the microkernel model in an embodiment of the present application. The core idea of this application is to separate the algorithm plug-in management layer, supplemented by the above-mentioned auxiliary service layer, namely configuration management, log management, concurrency management, routing management, queue management, data management, etc., and the functions in the auxiliary service layer are combined with each other. , To form an efficient algorithm service, and provide algorithm service functions to the outside world.
参考图3所示,所述算法插件管理层中可以包括:插件加载,插件卸载,插件接口定义,插件配置,插件调用,依赖调用等等,以实现上述对所述算法动态库插件的统一管理。所述算法插件管理层按照插件的设计思想,独立设计符合该系统的插件接口,以将对应的算法动态库插件接入系统主程序中以对外提供算法服务。As shown in Figure 3, the algorithm plug-in management layer may include: plug-in loading, plug-in unloading, plug-in interface definition, plug-in configuration, plug-in calling, dependency calling, etc., to achieve the above-mentioned unified management of the algorithm dynamic library plug-ins . The algorithm plug-in management layer independently designs a plug-in interface that conforms to the system according to the plug-in design idea, so as to connect the corresponding algorithm dynamic library plug-in to the main program of the system to provide algorithm services to the outside.
所述辅助服务层可以包括配置管理、日志管理、并发管理、路由管理、队列管理、数据管理等等,以实现上述的辅助服务层对算法插件管理层的辅助作用。具体地,所述辅助服务层通过配置管理提供系统服务的配置参数的读写,算法库配置项的读取;通过日志管理提供系统服务运行状态记录,日志查询等;通过并发管理和路由管理在高并发的调用请求时,有效的进行任务调度管理,将调用请求分发至对应的算法进行处理,提高系统服务的并发处理能力;通过队列管理对系统内消息队列进行维护,支撑并发管理任务调度等;通过数据管理提供系统运行时的各项数据的维护,实时更新,及时生效等。The auxiliary service layer may include configuration management, log management, concurrency management, routing management, queue management, data management, etc., to realize the auxiliary function of the aforementioned auxiliary service layer to the algorithm plug-in management layer. Specifically, the auxiliary service layer provides reading and writing of configuration parameters of system services and reading of algorithm library configuration items through configuration management; providing system service operation status records, log queries, etc. through log management; For highly concurrent call requests, effective task scheduling management is performed, call requests are distributed to the corresponding algorithm for processing, and the concurrent processing capabilities of system services are improved; the message queue in the system is maintained through queue management to support concurrent management task scheduling, etc. ; Provide maintenance of various data during system operation through data management, real-time update, and timely effect.
可选地,如图3所示,还可以在系统主程序中部署网络服务层,所述网络服务层用于提供系统对外调用的对外服务接口,并通过ZMQ进行接口通信。具体地,在所述网络服务层中设置对外服务接口,根据外部网络环境,通过所述网络服务层调用所述对外服务接口,并基于ZMQ的通信模式进行通信连接。从而能适配各种编程语言及机器网络环境,也避免了由于硬件条件、开发人员技能水平、技术架构等因素导致的不兼容问题,有效降低了使用方的开发维护成本。Optionally, as shown in FIG. 3, a network service layer can also be deployed in the main program of the system. The network service layer is used to provide an external service interface for external calls by the system, and interface communication is performed through ZMQ. Specifically, an external service interface is set in the network service layer, the external service interface is called through the network service layer according to the external network environment, and the communication connection is performed based on the ZMQ communication mode. Thus, it can adapt to various programming languages and machine network environments, and also avoids incompatibility problems caused by factors such as hardware conditions, developer skill level, technical architecture, etc., and effectively reduces the user's development and maintenance costs.
本申请中,步骤S34,所述构建系统服务配置文件以将算法动态库插件加载到系统主程序中,包括:S341,识别算法动态库插件的名称,获取算法动态库插件的配置信息的所在路径;S342,根据所在路径,将所述算法动态库插件的配置信息加入到系统主程序的配置文件中,构建得到系统服务配置文件;S343,读取所述系统服务配置文件,以将算法动态库插件加载到系统主程序中。In this application, in step S34, the construction of the system service configuration file to load the algorithm dynamic library plug-in into the system main program includes: S341, identifying the name of the algorithm dynamic library plug-in, and obtaining the path of the configuration information of the algorithm dynamic library plug-in S342, add the configuration information of the algorithm dynamic library plug-in to the configuration file of the system main program according to the path, and construct the system service configuration file; S343, read the system service configuration file to add the algorithm dynamic library The plug-in is loaded into the main program of the system.
进一步地,读取所述系统服务配置文件以将算法动态库插件加载到系统主程序中的步骤之后,还包括:S345,读取所述算法动态库插件的配置项;根据所述配置项的enalbed值,判断所述算法动态库插件是否生效;若enalbed值配置成1,则加载成功且所述算法动态库插件生效,否则,所述算法动态库插件未生效。Further, after the step of reading the system service configuration file to load the algorithm dynamic library plug-in into the system main program, the method further includes: S345, reading the configuration items of the algorithm dynamic library plug-in; The enalbed value is used to determine whether the algorithm dynamic library plug-in is effective; if the enalbed value is configured to 1, the loading is successful and the algorithm dynamic library plug-in is effective; otherwise, the algorithm dynamic library plug-in is not effective.
下面结合一个实施例对步骤S34进行详细描述:以接入remake动态库为例,工作过程如下所述:The following describes step S34 in detail with reference to an embodiment: Taking access to the remake dynamic library as an example, the working process is as follows:
Figure PCTCN2020125075-appb-000001
Figure PCTCN2020125075-appb-000001
1.在系统主程序的配置文件中,加入remake动态库的配置信息,以获得系统服务配置文件。其中,enabled决定该动态库是否生效,只有配置成1,才说明加载了该动态库并且会正常工作,否则即使加载了,该动态库也不能提供对应的功能;command是该动态库在系统服务中对应的唯一命令号;name是该动态库在系统服务中的标识名称,即为Remake;lib_path、config_file是该动态库文件所在路径,及该动态库依赖的配置信息文件的所在路径;init、uninit、config、version、proc是动态库按照系统服务中的算法插件管理层的要求,提供的功能接口。1. In the configuration file of the system main program, add the configuration information of the remake dynamic library to obtain the system service configuration file. Among them, enabled determines whether the dynamic library is effective. Only when it is configured to 1, it means that the dynamic library is loaded and will work normally. Otherwise, even if it is loaded, the dynamic library cannot provide the corresponding function; the command is the dynamic library in the system service The corresponding unique command number in the system; name is the identification name of the dynamic library in the system service, which is Remake; lib_path and config_file are the path of the dynamic library file, and the path of the configuration information file that the dynamic library depends on; init, Uninit, config, version, and proc are functional interfaces provided by the dynamic library in accordance with the requirements of the algorithm plug-in management layer in the system service.
2.设置好系统服务配置文件后,系统主程序会读取关于remake动态库的配置文件中的配置信息,并且根据要求将该动态库加载到系统服务的内存中,加载成功后,remake动态库就能提供对应的功能。2. After setting up the system service configuration file, the system main program will read the configuration information in the configuration file of the remake dynamic library, and load the dynamic library into the memory of the system service as required. After the loading is successful, remake the dynamic library Can provide the corresponding function.
3.外部应用向系统的网络服务层发起命令号为1001的请求,经过辅助服务层将该请求转发至remake动态库中进行处理。图5示出了本申请该实施例提供的外部应用调用Remake plugin算法插件的示意图,具体如图5中虚线所示。3. The external application initiates a request with a command number of 1001 to the network service layer of the system, and the auxiliary service layer forwards the request to the remake dynamic library for processing. FIG. 5 shows a schematic diagram of the external application calling the Remake plugin algorithm plug-in provided by this embodiment of the present application, which is specifically shown by the dotted line in FIG. 5.
本申请封装后的算法动态库插件构成了算法动态库。本申请集成了算法动态库的热部署功能,采用算法功能的动态加载技术,在服务初始化启动时加载算法,或者需要使用指定算法时,单独加载该算法;在不需要时,或者更新某算法时,根据算法卸载请求,可以动态卸载指定算法。算法动态库插件在系统服务内部的状态有:未加载、已加载、已生效、待卸载,正常运行时默认状态为已生效,如检测到待卸载状态时,则系统服务选择该算法动态库插件空闲时进行动态库卸载操作;在算法动态库插件更新后,系统服务检测到算法动态库插件未加载,则进行算法动态库插件的加载操作,成功则切换至已加载状态;根据算法动态库插件的配置项的enabled值决定该算法动态库插件是否生效。采用该技术,可以达到不停服务程序进行算法更新,也能有效的降低服务停机的损失及客户的运营成本。The algorithm dynamic library plug-in packaged in this application constitutes the algorithm dynamic library. This application integrates the hot deployment function of the algorithm dynamic library, adopts the dynamic loading technology of the algorithm function, loads the algorithm when the service is initialized, or when the specified algorithm needs to be used, the algorithm is loaded separately; when it is not needed, or when an algorithm is updated , According to the algorithm uninstall request, the specified algorithm can be dynamically uninstalled. The state of the algorithm dynamic library plug-in in the system service includes: unloaded, loaded, effective, pending unloading, the default state is effective during normal operation, if the state to be unloaded is detected, the system service selects the algorithm dynamic library plug-in Unload the dynamic library when it is idle; after the algorithm dynamic library plug-in is updated, the system service detects that the algorithm dynamic library plug-in is not loaded, then the algorithm dynamic library plug-in is loaded, and if it succeeds, it will switch to the loaded state; according to the algorithm dynamic library plug-in The enabled value of the configuration item determines whether the algorithm dynamic library plug-in takes effect. With this technology, it is possible to update the algorithm of the non-stop service program, and it can also effectively reduce the loss of service downtime and the customer's operating cost.
如图6所示,是本申请一实施例提供的基于微核模型插件模式的服务装置100的功能模块图。参考图6所示,本申请所述基于微核模型插件模式的服务装置100可以安装于电子设备中。根据实现的功能,所述基于微核模型插件模式的服务装置100可以包括分层部署模块101、封装模块102以及管理服务模块103。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。As shown in FIG. 6, it is a functional block diagram of the service device 100 based on the plug-in mode of the micronucleus model provided by an embodiment of the present application. Referring to FIG. 6, the service device 100 based on the plug-in mode of the micronucleus model described in this application can be installed in an electronic device. According to the implemented functions, the service device 100 based on the plug-in mode of the microkernel model may include a hierarchical deployment module 101, an encapsulation module 102, and a management service module 103. The module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
本申请基于微核模型插件模式,以系统主程序为核心,将系统主程序与各算法之间设计成微核模型插件架构;通过对系统主程序进行分层设计,将算法插件管理层独立出来,辅以辅助服务层,各功能之间相互组合,后续将算法动态库插件接入后,可形成高效的算法服务。其中,所述系统主程序在不接入算法动态库插件的情况下,仍然可以保持系统的 正常运行,只是不提供具体的算法功能服务。This application is based on the micronucleus model plug-in mode, with the system main program as the core, and the system main program and each algorithm are designed into a micronucleus model plug-in architecture; through the hierarchical design of the system main program, the algorithm plug-in management layer is independent , Supplemented by the auxiliary service layer, each function is combined with each other, and then after the algorithm dynamic library plug-in is connected, an efficient algorithm service can be formed. Wherein, the system main program can still maintain the normal operation of the system without accessing the algorithm dynamic library plug-in, but it does not provide specific algorithm function services.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述分层部署模块101用于基于微核模型插件模式,以系统主程序为核心部件,采用分层设计在所述系统主程序中部署算法插件管理层和辅助服务层。The hierarchical deployment module 101 is used to deploy an algorithm plug-in management layer and an auxiliary service layer in the system main program using a hierarchical design based on a plug-in mode of a micronucleus model, with a system main program as a core component.
优选地,所述算法插件管理层可以包括:插件加载,插件卸载,插件接口定义,插件配置,插件调用,依赖调用等等,以实现对所述算法动态库插件的统一管理。Preferably, the algorithm plug-in management layer may include: plug-in loading, plug-in unloading, plug-in interface definition, plug-in configuration, plug-in calling, dependency calling, etc., to realize unified management of the algorithm dynamic library plug-ins.
优选地,所述辅助服务层可以包括:配置管理、日志管理、并发管理、路由管理、队列管理、数据管理等等,以实现辅助服务层对算法插件管理层的辅助作用。具体地,所述辅助作用可以包括:接收外部发出的算法服务请求;维护系统内算法服务请求队列,进行任务调度管理,生成调用请求;将调用请求分发至算法动态库插件中进行处理;记录或查询系统的算法服务的运行状态;对运行时的各项数据进行维护、实时更新和及时生效。Preferably, the auxiliary service layer may include: configuration management, log management, concurrency management, route management, queue management, data management, etc., to realize the auxiliary function of the auxiliary service layer to the algorithm plug-in management layer. Specifically, the auxiliary function may include: receiving algorithm service requests sent from outside; maintaining the algorithm service request queue in the system, performing task scheduling management, and generating call requests; distributing the call requests to the algorithm dynamic library plug-in for processing; recording or Query the operating status of the algorithm service of the system; maintain, update and take effect in time for various data at runtime.
进一步地,所述分层部署模块101还用于在所述系统主程序中部署网络服务层,并在所述网络服务层中设置对外服务接口;根据外部网络环境,通过所述网络服务层调用所述对外服务接口,并基于ZMQ的通信模式进行通信连接。Further, the layered deployment module 101 is also used to deploy a network service layer in the main program of the system, and set an external service interface in the network service layer; according to the external network environment, call through the network service layer The external service interface is used for communication connection based on the ZMQ communication mode.
所述封装模块102用于根据所述算法插件管理层定义的系统的插件接口,将算法封装成独立的算法动态库插件。所述算法插件管理层根据插件的设计思想独立设计标准的系统的插件接口,后续算法动态库插件,只要按照标准提供符合这些定义的插件接口的对外接口,就可以无缝接入到系统主程序中,进行正常工作,提供相应的算法功能。本申请中算法动态库插件可以按照微服务的模式进行分布式或集群式部署,部署方式上比较灵活,可根据实际需要选择合适的算法功能。The encapsulation module 102 is configured to encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface of the system defined by the algorithm plug-in management layer. The algorithm plug-in management layer independently designs the standard system plug-in interface according to the design idea of the plug-in, and the subsequent algorithm dynamic library plug-in provides seamless access to the system main program as long as the external interface conforming to the defined plug-in interface is provided in accordance with the standard. During normal operation, the corresponding algorithm function is provided. The algorithm dynamic library plug-in in this application can be deployed in a distributed or clustered manner according to a microservice mode, and the deployment method is relatively flexible, and suitable algorithm functions can be selected according to actual needs.
所述管理服务模块103用于在所述辅助服务层的配合下,通过所述算法插件管理层对所述算法动态库插件进行统一管理,以对外进行算法服务。所述算法插件管理层在辅助服务层的配合下,对算法动态库插件进行统一管理,实现了各算法间的独立,使得各算法间无耦合,无干扰;同时提高了算法功能的扩展性,通用性,并发性和兼容性。The management service module 103 is configured to perform unified management of the algorithm dynamic library plug-in through the algorithm plug-in management layer with the cooperation of the auxiliary service layer, so as to perform algorithm services externally. The algorithm plug-in management layer, with the cooperation of the auxiliary service layer, performs unified management of the algorithm dynamic library plug-ins, which realizes the independence between the algorithms, so that there is no coupling and interference between the algorithms; at the same time, the scalability of the algorithm functions is improved, Versatility, concurrency and compatibility.
其中,通过所述算法插件管理层对所述算法动态库插件进行统一管理,包括:根据算法服务请求,将算法动态库插件加载到系统主程序中;根据需要,卸载系统主程序中的算法动态库插件;根据算法间的依赖关系,对算法动态库插件进行依赖调用,以将多个算法动态库插件组合起来加载到系统主程序中。Wherein, the unified management of the algorithm dynamic library plug-in through the algorithm plug-in management layer includes: loading the algorithm dynamic library plug-in into the system main program according to the algorithm service request; unloading the algorithm dynamics in the system main program as required Library plug-ins: According to the dependency between algorithms, make dependent calls to the algorithm dynamic library plug-ins to combine multiple algorithm dynamic library plug-ins and load them into the main program of the system.
进一步地,通过所述算法插件管理层对所述算法动态库插件进行统一管理,还可以包括:构建系统服务配置文件,以将算法动态库插件加载到系统主程序中。具体地,所述构建系统服务配置文件,以将算法动态库插件加载到系统主程序中,包括:识别所述算法动态库插件的名称,获取所述算法动态库插件的配置信息的所在路径;根据所在路径,将所述算法动态库插件的配置信息加入到系统主程序的配置文件中,构建得到系统服务配置文件;读取所述系统服务配置文件,以将算法动态库插件加载到系统主程序中。Further, the unified management of the algorithm dynamic library plug-in through the algorithm plug-in management layer may also include: constructing a system service configuration file to load the algorithm dynamic library plug-in into the system main program. Specifically, the constructing the system service configuration file to load the algorithm dynamic library plug-in into the system main program includes: identifying the name of the algorithm dynamic library plug-in, and obtaining the path of the configuration information of the algorithm dynamic library plug-in; According to the path, add the configuration information of the algorithm dynamic library plug-in to the configuration file of the system main program to construct the system service configuration file; read the system service configuration file to load the algorithm dynamic library plug-in to the system main In the process.
进一步地,所述构建系统服务配置文件,以将算法动态库插件加载到系统主程序中,还可以包括:读取所述算法动态库插件的配置项;根据所述配置项的enalbed值,判断所述算法动态库插件是否生效;若enalbed值配置成1,则加载成功且所述算法动态库插件生效,否则,所述算法动态库插件未生效。Further, the constructing the system service configuration file to load the algorithm dynamic library plug-in into the system main program may also include: reading the configuration items of the algorithm dynamic library plug-in; judging according to the enalbed value of the configuration item Whether the algorithm dynamic library plug-in is effective; if the enalbed value is configured to 1, the loading is successful and the algorithm dynamic library plug-in is effective; otherwise, the algorithm dynamic library plug-in is not effective.
优选地,所述基于微核模型插件模式的服务装置100还包括:添加插件模块,用于根据定制化需求,编写指定功能的算法动态库插件,以加载到系统主程序中进行相应的算法服务。Preferably, the service device 100 based on the plug-in mode of the micronucleus model further includes: an add-in module, which is used to write algorithm dynamic library plug-ins with specified functions according to customization requirements, so as to be loaded into the main program of the system for corresponding algorithm services .
如图7所示,是本申请实现服务程序的电子设备的结构示意图。As shown in FIG. 7, it is a schematic diagram of the structure of an electronic device that implements the service program in this application.
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如服务程序12。The electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a service program 12.
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、 移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如服务程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can be used not only to store application software and various types of data installed in the electronic device 1, such as service program codes, etc., but also to temporarily store data that has been output or will be output.
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如服务程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。The processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc. The processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules (such as service modules) stored in the memory 11 Programs, etc.), and call data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
图7仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图6示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 7 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 6 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling the power supply. The device implements functions such as charge management, discharge management, and power consumption management. The power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators. The electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。Further, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may also include a user interface. The user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)). Optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only for illustrative purposes, and are not limited by this structure in the scope of the patent application.
所述电子设备1中的所述存储器11存储的服务程序12是多个指令的组合,在所述处理器10中运行时,可以实现:基于微核模型插件模式,将系统主程序作为核心部件,采用分层设计在所述系统主程序中部署算法插件管理层和辅助服务层;通过所述算法插件管理层定义系统的插件接口,按照所述插件接口,将算法封装成独立的算法动态库插件;在所述辅助服务层的辅助下,采用所述算法插件管理层对所述算法动态库插件进行统一管理,以对外进行算法服务。The service program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can be implemented: based on the micronucleus model plug-in mode, the system main program is used as a core component Deploying the algorithm plug-in management layer and the auxiliary service layer in the main program of the system using a layered design; defining the system plug-in interface through the algorithm plug-in management layer, and encapsulating the algorithm into an independent algorithm dynamic library according to the plug-in interface Plug-in; with the assistance of the auxiliary service layer, the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-in to perform algorithm services externally.
具体地,所述处理器10对上述指令的具体实现方法可参考图1对应实施例中相关步 骤的描述,在此不赘述。Specifically, for the specific implementation method of the above-mentioned instructions by the processor 10, reference may be made to the description of the relevant steps in the embodiment corresponding to FIG. 1, which will not be repeated here.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Further, if the integrated module/unit of the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性,计算机可读存储介质中包括计算机程序,该计算机程序被处理器执行时实现如下操作:In addition, the embodiment of the present application also proposes a computer-readable storage medium. The computer-readable storage medium may be non-volatile or volatile. The computer-readable storage medium includes a computer program, and the computer program is The following operations are implemented when the processor is executed:
基于微核模型插件模式,将系统主程序作为核心部件,采用分层设计在所述系统主程序中部署算法插件管理层和辅助服务层;Based on the plug-in mode of the micronucleus model, the system main program is used as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a layered design;
通过所述算法插件管理层定义系统的插件接口,按照所述插件接口,将算法封装成独立的算法动态库插件;Define the plug-in interface of the system through the algorithm plug-in management layer, and encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface;
在所述辅助服务层的辅助下,采用所述算法插件管理层对所述算法动态库插件进行统一管理,以对外进行算法服务。With the assistance of the auxiliary service layer, the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-ins, so as to perform algorithm services externally.
本申请计算机可读存储介质的具体实施方式与上述基于微核模型插件模式的服务方法、装置、电子设备的具体实施方式大致相同,在此不再赘述。The specific implementation of the computer-readable storage medium of the present application is substantially the same as the specific implementation of the service method, apparatus, and electronic device based on the micronucleus model plug-in mode, and will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed equipment, device, and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。For those skilled in the art, it is obvious that the present application is not limited to the details of the foregoing exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or basic characteristics of the application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description, and therefore it is intended to fall into the claims. All changes in the meaning and scope of the equivalent elements of are included in this application. Any associated diagram marks in the claims should not be regarded as limiting the claims involved.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。In addition, it is obvious that the word "including" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claims can also be implemented by one unit or device through software or hardware. The second class words are used to indicate names, and do not indicate any specific order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application and not to limit them. Although the application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the application can be Make modifications or equivalent replacements without departing from the spirit and scope of the technical solution of the present application.

Claims (20)

  1. 一种基于微核模型插件模式的服务方法,其中,所述方法包括:A service method based on a plug-in mode of a micronucleus model, wherein the method includes:
    基于微核模型插件模式,将系统主程序作为核心部件,采用分层设计在所述系统主程序中部署算法插件管理层和辅助服务层;Based on the plug-in mode of the micronucleus model, the system main program is used as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a layered design;
    通过所述算法插件管理层定义系统的插件接口,按照所述插件接口,将算法封装成独立的算法动态库插件;Define the plug-in interface of the system through the algorithm plug-in management layer, and encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface;
    在所述辅助服务层的辅助下,采用所述算法插件管理层对所述算法动态库插件进行统一管理,以对外进行算法服务。With the assistance of the auxiliary service layer, the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-ins, so as to perform algorithm services externally.
  2. 根据权利要求1所述的基于微核模型插件模式的服务方法,其中,采用所述算法插件管理层对所述算法动态库插件进行统一管理的步骤中,包括:The service method based on the microkernel model plug-in mode according to claim 1, wherein the step of using the algorithm plug-in management layer to uniformly manage the algorithm dynamic library plug-in includes:
    根据算法服务请求,将算法动态库插件加载到系统主程序中;According to the algorithm service request, load the algorithm dynamic library plug-in into the system main program;
    根据算法卸载请求,卸载系统主程序中的算法动态库插件;According to the algorithm uninstall request, uninstall the algorithm dynamic library plug-in in the system main program;
    根据算法间的依赖关系,对算法动态库插件进行依赖调用,以将多个算法动态库插件组合起来加载到系统主程序中。According to the dependency between algorithms, the algorithm dynamic library plug-in is called dependently, so as to combine multiple algorithm dynamic library plug-ins and load them into the main program of the system.
  3. 根据权利要求2所述的基于微核模型插件模式的服务方法,其中,采用所述算法插件管理层对所述算法动态库插件进行统一管理的步骤中,还包括:构建系统服务配置文件,以将算法动态库插件加载到系统主程序中;所述构建系统服务配置文件,以将算法动态库插件加载到系统主程序中的步骤,包括:The service method based on the microkernel model plug-in mode according to claim 2, wherein the step of using the algorithm plug-in management layer to uniformly manage the algorithm dynamic library plug-in further comprises: constructing a system service configuration file to The algorithm dynamic library plug-in is loaded into the system main program; the step of constructing the system service configuration file to load the algorithm dynamic library plug-in into the system main program includes:
    识别所述算法动态库插件的名称,获取所述算法动态库插件的配置信息的所在路径;Identify the name of the algorithm dynamic library plug-in, and obtain the path where the configuration information of the algorithm dynamic library plug-in is located;
    根据所在路径,将所述算法动态库插件的配置信息加入到系统主程序的配置文件中,构建得到系统服务配置文件;According to the path, add the configuration information of the algorithm dynamic library plug-in to the configuration file of the system main program to construct the system service configuration file;
    读取所述系统服务配置文件,以将算法动态库插件加载到系统主程序中。The system service configuration file is read to load the algorithm dynamic library plug-in into the system main program.
  4. 根据权利要求3所述的基于微核模型插件模式的服务方法,其中,读取所述系统服务配置文件以将算法动态库插件加载到系统主程序中的步骤之后,还包括:The service method based on the micronucleus model plug-in mode according to claim 3, wherein after the step of reading the system service configuration file to load the algorithm dynamic library plug-in into the system main program, the method further comprises:
    读取所述算法动态库插件的配置项;Read the configuration items of the algorithm dynamic library plug-in;
    根据所述配置项的enalbed值,判断所述算法动态库插件是否生效;若enalbed值配置成1,则加载成功且所述算法动态库插件生效,否则,所述算法动态库插件未生效。According to the enalbed value of the configuration item, it is determined whether the algorithm dynamic library plug-in is effective; if the enalbed value is configured to 1, the loading is successful and the algorithm dynamic library plug-in is effective; otherwise, the algorithm dynamic library plug-in is not effective.
  5. 根据权利要求1所述的基于微核模型插件模式的服务方法,其中,所述辅助服务层的辅助,包括:The service method based on the plug-in mode of the micronucleus model according to claim 1, wherein the assistance of the auxiliary service layer includes:
    接收外部发出的算法服务请求;Receive algorithm service requests sent from outside;
    维护系统内算法服务请求队列,进行任务调度管理,生成调用请求;Maintain the algorithm service request queue in the system, perform task scheduling management, and generate call requests;
    将调用请求分发至算法动态库插件中进行处理;Distribute the call request to the algorithm dynamic library plug-in for processing;
    记录或查询系统的算法服务的运行状态;Record or query the operating status of the algorithm service of the system;
    对运行时的各项数据进行维护、实时更新和及时生效。Maintain, update and take effect in time for various data at runtime.
  6. 根据权利要求1所述的基于微核模型插件模式的服务方法,其中,所述方法还包括:在所述系统主程序中部署网络服务层,在所述网络服务层中设置对外服务接口;根据外部网络环境,通过所述网络服务层调用所述对外服务接口,并基于ZMQ的通信模式进行通信连接。The service method based on the plug-in mode of the microkernel model according to claim 1, wherein the method further comprises: deploying a network service layer in the main program of the system, and setting an external service interface in the network service layer; In the external network environment, the external service interface is called through the network service layer, and the communication connection is made based on the ZMQ communication mode.
  7. 根据权利要求1所述的基于微核模型插件模式的服务方法,其中,所述方法还包括:根据定制化需求,编写指定功能的算法动态库插件,以加载到系统主程序中进行相应的算法服务。The service method based on the plug-in mode of the micronucleus model according to claim 1, wherein the method further comprises: according to customization requirements, writing algorithm dynamic library plug-ins with specified functions to be loaded into the main program of the system to perform corresponding algorithms service.
  8. 一种基于微核模型插件模式的服务装置,其中,所述装置包括:A service device based on a plug-in mode of a micronucleus model, wherein the device includes:
    分层部署模块,用于基于微核模型插件模式,以系统主程序为核心部件,采用分层设 计在所述系统主程序中部署算法插件管理层和辅助服务层;The layered deployment module is used for the plug-in mode based on the micronucleus model, with the system main program as the core component, and adopts a layered design to deploy the algorithm plug-in management layer and the auxiliary service layer in the system main program;
    封装模块,用于根据所述算法插件管理层定义的系统的插件接口,将算法封装成独立的算法动态库插件;The encapsulation module is used to encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface of the system defined by the algorithm plug-in management layer;
    管理服务模块,用于在所述辅助服务层的配合下,通过所述算法插件管理层对所述算法动态库插件进行统一管理,以对外进行算法服务。The management service module is used for unified management of the algorithm dynamic library plug-in through the algorithm plug-in management layer under the cooperation of the auxiliary service layer, so as to perform algorithm services externally.
  9. 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device includes:
    至少一个处理器;以及,At least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the following steps:
    基于微核模型插件模式,将系统主程序作为核心部件,采用分层设计在所述系统主程序中部署算法插件管理层和辅助服务层;Based on the plug-in mode of the micronucleus model, the system main program is used as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a layered design;
    通过所述算法插件管理层定义系统的插件接口,按照所述插件接口,将算法封装成独立的算法动态库插件;Define the plug-in interface of the system through the algorithm plug-in management layer, and encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface;
    在所述辅助服务层的辅助下,采用所述算法插件管理层对所述算法动态库插件进行统一管理,以对外进行算法服务。With the assistance of the auxiliary service layer, the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-ins, so as to perform algorithm services externally.
  10. 根据权利要求9所述的电子设备,其中,所述至少一个处理器执行的所述采用算法插件管理层对算法动态库插件进行统一管理的步骤中,包括:9. The electronic device according to claim 9, wherein the step of using the algorithm plug-in management layer to perform unified management of the algorithm dynamic library plug-ins performed by the at least one processor comprises:
    根据算法服务请求,将算法动态库插件加载到系统主程序中;According to the algorithm service request, load the algorithm dynamic library plug-in into the system main program;
    根据算法卸载请求,卸载系统主程序中的算法动态库插件;According to the algorithm uninstall request, uninstall the algorithm dynamic library plug-in in the system main program;
    根据算法间的依赖关系,对算法动态库插件进行依赖调用,以将多个算法动态库插件组合起来加载到系统主程序中。According to the dependency between algorithms, the algorithm dynamic library plug-in is called dependently, so as to combine multiple algorithm dynamic library plug-ins and load them into the main program of the system.
  11. 根据权利要求10所述的电子设备,其中,所述至少一个处理器执行的所述采用算法插件管理层对算法动态库插件进行统一管理的步骤中,还包括:构建系统服务配置文件,以将算法动态库插件加载到系统主程序中;The electronic device according to claim 10, wherein the step of using the algorithm plug-in management layer to uniformly manage the algorithm dynamic library plug-ins executed by the at least one processor further comprises: constructing a system service configuration file to integrate The algorithm dynamic library plug-in is loaded into the system main program;
    所述构建系统服务配置文件,以将算法动态库插件加载到系统主程序中的步骤,包括:The step of constructing the system service configuration file to load the algorithm dynamic library plug-in into the system main program includes:
    识别所述算法动态库插件的名称,获取所述算法动态库插件的配置信息的所在路径;Identify the name of the algorithm dynamic library plug-in, and obtain the path where the configuration information of the algorithm dynamic library plug-in is located;
    根据所在路径,将所述算法动态库插件的配置信息加入到系统主程序的配置文件中,构建得到系统服务配置文件;According to the path, add the configuration information of the algorithm dynamic library plug-in to the configuration file of the system main program to construct the system service configuration file;
    读取所述系统服务配置文件,以将算法动态库插件加载到系统主程序中。The system service configuration file is read to load the algorithm dynamic library plug-in into the system main program.
  12. 根据权利要求11所述的电子设备,其中,所述至少一个处理器执行的所述读取系统服务配置文件以将算法动态库插件加载到系统主程序中的步骤之后,还包括:11. The electronic device according to claim 11, wherein after the step of reading the system service configuration file executed by the at least one processor to load the algorithm dynamic library plug-in into the system main program, the method further comprises:
    读取所述算法动态库插件的配置项;Read the configuration items of the algorithm dynamic library plug-in;
    根据所述配置项的enalbed值,判断所述算法动态库插件是否生效;若enalbed值配置成1,则加载成功且所述算法动态库插件生效,否则,所述算法动态库插件未生效。According to the enalbed value of the configuration item, it is determined whether the algorithm dynamic library plug-in is effective; if the enalbed value is configured to 1, the loading is successful and the algorithm dynamic library plug-in is effective; otherwise, the algorithm dynamic library plug-in is not effective.
  13. 根据权利要求11所述的电子设备,其中,所述至少一个处理器执行的在辅助服务层的辅助下采用算法插件管理层对算法动态库插件进行统一管理以对外进行算法服务的步骤中,所述辅助服务层的辅助,包括:The electronic device according to claim 11, wherein the at least one processor executes the step of using an algorithm plug-in management layer with the assistance of an auxiliary service layer to uniformly manage the algorithm dynamic library plug-in to perform algorithm services externally, The assistance of the auxiliary service layer, including:
    接收外部发出的算法服务请求;Receive algorithm service requests sent from outside;
    维护系统内算法服务请求队列,进行任务调度管理,生成调用请求;Maintain the algorithm service request queue in the system, perform task scheduling management, and generate call requests;
    将调用请求分发至算法动态库插件中进行处理;Distribute the call request to the algorithm dynamic library plug-in for processing;
    记录或查询系统的算法服务的运行状态;Record or query the operating status of the algorithm service of the system;
    对运行时的各项数据进行维护、实时更新和及时生效。Maintain, update and take effect in time for various data at runtime.
  14. 根据权利要求11所述的电子设备,其中,所述至少一个处理器执行的步骤,还包括:在所述系统主程序中部署网络服务层,在所述网络服务层中设置对外服务接口;根据 外部网络环境,通过所述网络服务层调用所述对外服务接口,并基于ZMQ的通信模式进行通信连接。The electronic device according to claim 11, wherein the steps performed by the at least one processor further comprise: deploying a network service layer in the main program of the system, and setting an external service interface in the network service layer; according to In the external network environment, the external service interface is called through the network service layer, and the communication connection is made based on the ZMQ communication mode.
  15. 根据权利要求11所述的电子设备,其中,所述至少一个处理器执行的步骤,还包括:根据定制化需求,编写指定功能的算法动态库插件,以加载到系统主程序中进行相应的算法服务。11. The electronic device according to claim 11, wherein the steps executed by the at least one processor further comprise: according to customization requirements, writing a dynamic library plug-in with a specified function to load it into the main program of the system to perform the corresponding algorithm service.
  16. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the following steps:
    基于微核模型插件模式,将系统主程序作为核心部件,采用分层设计在所述系统主程序中部署算法插件管理层和辅助服务层;Based on the plug-in mode of the micronucleus model, the system main program is used as the core component, and the algorithm plug-in management layer and auxiliary service layer are deployed in the system main program by using a layered design;
    通过所述算法插件管理层定义系统的插件接口,按照所述插件接口,将算法封装成独立的算法动态库插件;Define the plug-in interface of the system through the algorithm plug-in management layer, and encapsulate the algorithm into an independent algorithm dynamic library plug-in according to the plug-in interface;
    在所述辅助服务层的辅助下,采用所述算法插件管理层对所述算法动态库插件进行统一管理,以对外进行算法服务。With the assistance of the auxiliary service layer, the algorithm plug-in management layer is used to uniformly manage the algorithm dynamic library plug-ins, so as to perform algorithm services externally.
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时实现的所述采用算法插件管理层对算法动态库插件进行统一管理的步骤中,包括:16. The computer-readable storage medium according to claim 16, wherein the step of using the algorithm plug-in management layer to implement unified management of the algorithm dynamic library plug-ins when the computer program is executed by the processor comprises:
    根据算法服务请求,将算法动态库插件加载到系统主程序中;According to the algorithm service request, load the algorithm dynamic library plug-in into the system main program;
    根据算法卸载请求,卸载系统主程序中的算法动态库插件;According to the algorithm uninstall request, uninstall the algorithm dynamic library plug-in in the system main program;
    根据算法间的依赖关系,对算法动态库插件进行依赖调用,以将多个算法动态库插件组合起来加载到系统主程序中。According to the dependency between algorithms, the algorithm dynamic library plug-in is called dependently, so as to combine multiple algorithm dynamic library plug-ins and load them into the main program of the system.
  18. 根据权利要求17所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时实现的所述算法插件管理层对算法动态库插件进行统一管理的步骤中,还包括:The computer-readable storage medium according to claim 17, wherein the step of the algorithm plug-in management layer implemented when the computer program is executed by the processor uniformly manages the algorithm dynamic library plug-in, further comprising:
    构建系统服务配置文件,以将算法动态库插件加载到系统主程序中;Build the system service configuration file to load the algorithm dynamic library plug-in into the system main program;
    所述构建系统服务配置文件,以将算法动态库插件加载到系统主程序中的步骤,包括:The step of constructing the system service configuration file to load the algorithm dynamic library plug-in into the system main program includes:
    识别所述算法动态库插件的名称,获取所述算法动态库插件的配置信息的所在路径;Identify the name of the algorithm dynamic library plug-in, and obtain the path where the configuration information of the algorithm dynamic library plug-in is located;
    根据所在路径,将所述算法动态库插件的配置信息加入到系统主程序的配置文件中,构建得到系统服务配置文件;According to the path, add the configuration information of the algorithm dynamic library plug-in to the configuration file of the system main program to construct the system service configuration file;
    读取所述系统服务配置文件,以将算法动态库插件加载到系统主程序中。The system service configuration file is read to load the algorithm dynamic library plug-in into the system main program.
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时实现的所述读取系统服务配置文件以将算法动态库插件加载到系统主程序中的步骤之后,还包括:18. The computer-readable storage medium according to claim 18, wherein after the step of reading the system service configuration file to load the algorithm dynamic library plug-in into the system main program implemented when the computer program is executed by the processor, Also includes:
    读取所述算法动态库插件的配置项;Read the configuration items of the algorithm dynamic library plug-in;
    根据所述配置项的enalbed值,判断所述算法动态库插件是否生效;若enalbed值配置成1,则加载成功且所述算法动态库插件生效,否则,所述算法动态库插件未生效。According to the enalbed value of the configuration item, it is determined whether the algorithm dynamic library plug-in is effective; if the enalbed value is configured to 1, the loading is successful and the algorithm dynamic library plug-in is effective; otherwise, the algorithm dynamic library plug-in is not effective.
  20. 根据权利要求16所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时实在所述辅助服务层的辅助下采用所述算法插件管理层对算法动态库插件进行统一管理以对外进行算法服务的步骤中,所述辅助服务层的辅助,包括:The computer-readable storage medium according to claim 16, wherein when the computer program is executed by the processor, with the assistance of the auxiliary service layer, the algorithm plug-in management layer adopts the algorithm plug-in management layer to uniformly manage the algorithm dynamic library plug-in to external In the step of performing algorithm services, the assistance of the auxiliary service layer includes:
    接收外部发出的算法服务请求;Receive algorithm service requests sent from outside;
    维护系统内算法服务请求队列,进行任务调度管理,生成调用请求;Maintain the algorithm service request queue in the system, perform task scheduling management, and generate call requests;
    将调用请求分发至算法动态库插件中进行处理;Distribute the call request to the algorithm dynamic library plug-in for processing;
    记录或查询系统的算法服务的运行状态;Record or query the operating status of the algorithm service of the system;
    对运行时的各项数据进行维护、实时更新和及时生效。Maintain, update and take effect in time for various data at runtime.
PCT/CN2020/125075 2020-07-30 2020-10-30 Service method and apparatus based on micro-kernel model plug-in mode, device, and storage medium WO2021139358A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010755915.9 2020-07-30
CN202010755915.9A CN111897599A (en) 2020-07-30 2020-07-30 Service method, device, equipment and storage medium based on microkernel model plug-in mode

Publications (1)

Publication Number Publication Date
WO2021139358A1 true WO2021139358A1 (en) 2021-07-15

Family

ID=73183835

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/125075 WO2021139358A1 (en) 2020-07-30 2020-10-30 Service method and apparatus based on micro-kernel model plug-in mode, device, and storage medium

Country Status (2)

Country Link
CN (1) CN111897599A (en)
WO (1) WO2021139358A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113918232A (en) * 2021-09-07 2022-01-11 深圳云天励飞技术股份有限公司 Method, device, server and storage medium for calling algorithm service

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929606A (en) * 2012-10-09 2013-02-13 曙光信息产业(北京)有限公司 Cloud-computing-based plug-in model of data mining system
US20180357552A1 (en) * 2016-01-27 2018-12-13 Bonsai AI, Inc. Artificial Intelligence Engine Having Various Algorithms to Build Different Concepts Contained Within a Same AI Model
CN109165055A (en) * 2018-08-30 2019-01-08 百度在线网络技术(北京)有限公司 A kind of component loading method, device, computer equipment and storage medium
CN110245031A (en) * 2019-06-03 2019-09-17 北京百度网讯科技有限公司 Platform and method during a kind of AI service is open
CN110489093A (en) * 2019-10-16 2019-11-22 鹏城实验室 A kind of lasting building method, device, terminal and storage medium towards AI application

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929606A (en) * 2012-10-09 2013-02-13 曙光信息产业(北京)有限公司 Cloud-computing-based plug-in model of data mining system
US20180357552A1 (en) * 2016-01-27 2018-12-13 Bonsai AI, Inc. Artificial Intelligence Engine Having Various Algorithms to Build Different Concepts Contained Within a Same AI Model
CN109165055A (en) * 2018-08-30 2019-01-08 百度在线网络技术(北京)有限公司 A kind of component loading method, device, computer equipment and storage medium
CN110245031A (en) * 2019-06-03 2019-09-17 北京百度网讯科技有限公司 Platform and method during a kind of AI service is open
CN110489093A (en) * 2019-10-16 2019-11-22 鹏城实验室 A kind of lasting building method, device, terminal and storage medium towards AI application

Also Published As

Publication number Publication date
CN111897599A (en) 2020-11-06

Similar Documents

Publication Publication Date Title
CN1318956C (en) System and method for software component plug-in framework
US8966026B2 (en) Systems and methods for extension of server management functions
CN102103567B (en) multiple versions of the data of virtual memory shared among isomerous processors
TWI713846B (en) Domain module computation unit, system containing a model of an enterprise, single board computational unit, grid of computational units, method to provide propagation traceability, and non-transitory computer program product
CN110275722A (en) Method, apparatus, equipment and storage medium for upgrade application
CN102073520A (en) Dynamic management system and method for C++ application program version
CN102365627A (en) A method for way allocation and way locking in a cache
CN101118503A (en) Concurrent physical processor reassignment
CN102103497A (en) Finite state machine actuating device and method, and method for establishing and using finite state machine
CN107632846A (en) Firmware upgrade method and device, Shelf management module
TW521210B (en) Modular computer system and related method
KR102607808B1 (en) Dynamic reallocating resources for optimized job performance in distributed heterogeneous computer system
CN101753619B (en) Method and system for extending service model
WO2021139358A1 (en) Service method and apparatus based on micro-kernel model plug-in mode, device, and storage medium
US10996876B2 (en) Systems and methods for dynamically modifying memory namespace allocation based on memory attributes and application requirements
US7739660B2 (en) Code management in a distributed software development environment
CN103530165B (en) A kind of java solution that is applied to Internet of Things industry
US20080028384A1 (en) Interconnection interface for flexible online/offline deployment of an n-layered software application
CN101542433A (en) Transparent replacement of a system processor
CN115357257B (en) Installation file generation method, system, computing device and storage medium
JP2014123249A (en) Information processor, program, and information processing method
US20050086665A1 (en) Autonomous device driver
CN115357433A (en) Database backup method, device, equipment and storage medium under container environment
CN110908644B (en) Configuration method and device of state node, computer equipment and storage medium
CN114817288A (en) Data processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20911650

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20911650

Country of ref document: EP

Kind code of ref document: A1