CN111124713B - Equipment system function calling method, device, terminal equipment and storage medium - Google Patents

Equipment system function calling method, device, terminal equipment and storage medium Download PDF

Info

Publication number
CN111124713B
CN111124713B CN201911348980.3A CN201911348980A CN111124713B CN 111124713 B CN111124713 B CN 111124713B CN 201911348980 A CN201911348980 A CN 201911348980A CN 111124713 B CN111124713 B CN 111124713B
Authority
CN
China
Prior art keywords
target
processing engine
application component
end application
calling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911348980.3A
Other languages
Chinese (zh)
Other versions
CN111124713A (en
Inventor
周向菁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Antutu Technology Co ltd
Original Assignee
Beijing Antutu Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Antutu Technology Co ltd filed Critical Beijing Antutu Technology Co ltd
Priority to CN201911348980.3A priority Critical patent/CN111124713B/en
Publication of CN111124713A publication Critical patent/CN111124713A/en
Application granted granted Critical
Publication of CN111124713B publication Critical patent/CN111124713B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/541Interprogram communication via adapters, e.g. between incompatible applications

Abstract

The application provides a device system function calling method, a device, terminal equipment and a storage medium, wherein the method comprises the following steps: acquiring target model parameters sent by a front-end application component through a first preset interface; determining a target processing engine to be loaded according to the type of the current equipment; loading the target processing engine and a target model corresponding to the target model parameters by calling a system loading function of the target processing engine; returning a loading completion message to the front-end application component through the first preset interface; acquiring a data processing request which is sent by a front-end application component and comprises target data to be processed through a second preset interface; calling an operation function of a target processing engine by taking target data as parameters, so as to process the target data by utilizing a target model and obtain a processing result; and returning the processing result to the front-end application component through a second preset interface. The method can realize the adaptation of the front-end application component and the terminal equipment using different AI chips, and reduce the development difficulty of the application APP.

Description

Equipment system function calling method, device, terminal equipment and storage medium
Technical Field
The present disclosure relates to the field of computer applications, and in particular, to a method, an apparatus, a terminal device, and a storage medium for calling a device system function.
Background
With the rapid development of computer technology and internet technology, artificial intelligence (Artificial Intelligence, AI) is being applied on terminal devices.
At present, each System on Chip (SoC) manufacturer produces an own AI Chip, so that the development difficulty of the application APP with the AI function, which is universal on terminal equipment using AI chips of different brands, is greatly increased while the brands of the AI chips are enriched.
Disclosure of Invention
The application provides a device system function calling method, a device, terminal equipment and a storage medium, which are used for solving the technical problem that the development difficulty of application APP with AI functions, which is universal on terminal equipment using AI chips of different brands, is high because of more AI chips in the related technology.
In one aspect, an embodiment of the present application provides a method for calling a device system function, including:
the bottom layer processing component acquires target model parameters sent by the front-end application component through a first preset interface;
determining a target processing engine to be loaded according to the type of the current equipment;
Loading the target processing engine and a target model corresponding to the target model parameters by calling a system loading function of the target processing engine;
returning a loading completion message to the front-end application component through the first preset interface;
acquiring a data processing request sent by the front-end application component through a second preset interface, wherein the data processing request comprises target data to be processed;
calling an operation function of the target processing engine by taking the target data as a parameter so as to process the target data by utilizing the target model and obtain a processing result;
and returning the processing result to the front-end application component through the second preset interface.
According to the equipment system function calling method, the target model parameters sent by the front-end application component are obtained through the bottom layer processing component through the first preset interface, the target processing engine to be loaded is determined according to the type of the equipment where the front-end application component is currently located, the target processing engine and the target model corresponding to the target model parameters are loaded through the system loading function of the target processing engine, the loading completion message is returned to the front-end application component through the first preset interface, the data processing request sent by the front-end application component is obtained through the second preset interface, the data processing request comprises target data to be processed, the running function of the target processing engine is called by taking the target data as parameters, the target data is processed by the target model, the processing result is obtained, and the processing result is returned to the front-end application component through the second preset interface. The method comprises the steps of determining a target processing engine to be loaded according to the type of equipment, acquiring target model parameters through a first preset interface, loading the target processing engine and a target model corresponding to the target model parameters through a system loading function of the target processing engine, acquiring a data processing request through a second preset interface, and calling an operation function of the target processing engine to process target data in the data processing request by using the target model. In addition, through setting different first preset interfaces and second preset interfaces, different preset interfaces are called at different stages, and flexible use of the interfaces is realized.
As another optional implementation manner of an embodiment of an aspect of the present application, after the obtaining a target model parameter sent by a front-end application component, the method further includes:
determining a target hardware resource to be initialized according to the type of the current equipment;
calling an initialization function of the target processing engine to initialize the target hardware resource;
the loading the target processing engine includes:
and loading the target processing engine in the target hardware resource.
As another optional implementation manner of an embodiment of an aspect of the present application, after returning the processing result to the front-end application component, the method further includes:
and if the hardware resource release request sent by the front-end application component through the third preset interface is obtained, calling a resource release function in the target processing engine to release the target hardware resource.
As another optional implementation manner of an embodiment of an aspect of the present application, before determining, according to a type of a device at which the target processing engine is currently located, the method further includes:
and packaging the processing engines corresponding to the different types of equipment.
As another optional implementation manner of an embodiment of an aspect of the present application, before loading the target processing engine and the target model corresponding to the target model parameter, the method further includes:
Training an initial model based on preset open source software and a preset open source data set;
and respectively converting the initial model into target models corresponding to various types of equipment by using model conversion tools of various equipment manufacturers.
In another aspect, an embodiment of the present application provides a device system function calling apparatus, including:
the first acquisition module is used for acquiring target model parameters sent by the front-end application component through a first preset interface;
the determining module is used for determining a target processing engine to be loaded according to the type of the equipment currently located;
the loading module is used for loading the target processing engine and the target model corresponding to the target model parameters by calling a system loading function of the target processing engine;
the first feedback module is used for returning a loading completion message to the front-end application component through the first preset interface;
the second acquisition module is used for acquiring a data processing request sent by the front-end application component through a second preset interface, wherein the data processing request comprises target data to be processed;
the calling module is used for calling an operation function of the target processing engine by taking the target data as parameters so as to process the target data by utilizing the target model and obtain a processing result;
And the second feedback module is used for returning the processing result to the front-end application component through the second preset interface.
According to the device system function calling device, the target model parameters sent by the front-end application component are obtained through the bottom layer processing component through the first preset interface, the target processing engine to be loaded is determined according to the type of the device where the front-end application component is currently located, the target processing engine and the target model corresponding to the target model parameters are loaded through the system loading function of the target processing engine, the loading completion message is returned to the front-end application component through the first preset interface, the data processing request sent by the front-end application component is obtained through the second preset interface, the data processing request comprises target data to be processed, the running function of the target processing engine is called by taking the target data as parameters, the target data is processed by the target model, the processing result is obtained, and the processing result is returned to the front-end application component through the second preset interface. The method comprises the steps of determining a target processing engine to be loaded according to the type of equipment, acquiring target model parameters through a first preset interface, loading the target processing engine and a target model corresponding to the target model parameters through a system loading function of the target processing engine, acquiring a data processing request through a second preset interface, and calling an operation function of the target processing engine to process target data in the data processing request by using the target model. In addition, through setting different first preset interfaces and second preset interfaces, different preset interfaces are called at different stages, and flexible use of the interfaces is realized.
As another optional implementation manner of the embodiment of another aspect of the present application, the apparatus further includes:
the initialization module is used for determining a target hardware resource to be initialized according to the type of the equipment at present; calling an initialization function of the target processing engine to initialize the target hardware resource;
the loading module is specifically configured to:
and loading the target processing engine in the target hardware resource.
As another optional implementation manner of the embodiment of another aspect of the present application, the apparatus further includes:
and the resource release module is used for calling a resource release function in the target processing engine to release the target hardware resource when the hardware resource release request sent by the front-end application component through the third preset interface is acquired.
As another optional implementation manner of the embodiment of another aspect of the present application, the apparatus further includes:
and the packaging module is used for packaging the processing engines corresponding to the different types of equipment.
As another optional implementation manner of the embodiment of another aspect of the present application, the apparatus further includes:
the conversion module is used for training an initial model based on preset open source software and a preset open source data set; and respectively converting the initial model into target models corresponding to various types of equipment by using model conversion tools of various equipment manufacturers.
In another aspect, an embodiment of the present application proposes a terminal device, including a processor and a memory;
wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for implementing the device system function calling method as described in the above embodiment.
Another aspect of the present application provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a device system function calling method as described in the above embodiments.
Additional aspects and advantages of the application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flowchart of a method for calling a device system function according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for calling a device system function according to another embodiment of the present application;
FIG. 3 is a schematic structural diagram of a device system function calling apparatus according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a device system function calling apparatus according to another embodiment of the present application;
FIG. 5 is a schematic structural diagram of a device system function calling apparatus according to another embodiment of the present application; and
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and intended for the purpose of explaining the present application and are not to be construed as limiting the present application.
The following describes a device system function calling method, a device, a terminal device, and a storage medium according to embodiments of the present application with reference to the accompanying drawings.
AI is a technical science that studies, develops theories, methods, techniques and applications for simulating, extending and expanding human intelligence. AI is widely used in a number of fields involving machine translation, intelligent control, language and image processing.
At present, in terminal equipment, AI is rapidly developed in hardware and software application of the terminal equipment, and SoC manufacturers such as high-pass, huacheng, apple, concurrency and the like all produce own AI chips and integrate the AI chips on own integrated chips for sale. Each manufacturer has its own AI software development kit (Software Development Kit, SDK) to fully exploit its AI-accelerated hardware capabilities, but this also greatly increases the difficulty of developing an application APP with AI functionality that is generic on terminal devices using AI chips of different brands.
In view of the above problems, the present application provides a method for invoking a device system function, by determining a target processing engine to be loaded according to a device type, acquiring a target model parameter through a first preset interface, loading the target processing engine and a target model corresponding to the target model parameter through a system loading function of the target processing engine, acquiring a data processing request through a second preset interface, invoking an operation function of the target processing engine to process target data in the data processing request by using the target model, implementing that the first preset interface and the second preset interface are used as unified external interfaces of different processing engines to interface with a front end application component, invoking the matched processing engine by the unified external interfaces according to the type of a terminal device, thereby implementing the adaptation of the front end application component and the terminal device using different AI chips, and a developer does not need to develop a corresponding application APP for the terminal device having different AI chips, thereby reducing the development difficulty and development cycle of the application APP.
Fig. 1 is a schematic flow chart of a device system function calling method according to an embodiment of the present application, where the method may be executed by a terminal device, specifically, by a bottom layer processing component in the terminal device, or may be executed by a device system function calling apparatus according to an embodiment of the present application, and the device system function calling apparatus according to an embodiment of the present application may be configured in any terminal device, for example, a smart phone, a tablet computer, a personal digital assistant, a wearable device, etc., which is not limited in this application. The following embodiments will take an example of executing the device system function call method proposed in the present application by the underlying processing component of the terminal device to explain the present application.
As shown in fig. 1, the device system function call method may include the steps of:
step 101, obtaining target model parameters sent by a front-end application component through a first preset interface.
The method comprises the steps that a bottom layer processing component obtains target model parameters sent by a front-end application component through a first preset interface. The first preset interface is a pre-created unified external interface, and the first preset interface can be an initialization external interface and is marked as InitAI ().
In this embodiment, the front-end application component is an application APP installed in a terminal device, and may be an application APP with an AI function, such as a voice noise reduction APP, an image recognition APP, and the like. The target model parameters are related to the front-end application component and are used for matching a target model required by the front-end application component in operation, for example, if the front-end application component is a voice noise reduction APP, the target model parameters are parameters for matching a noise reduction network model.
It should be noted that, the target model parameters may be configured in advance according to the target model corresponding to the front-end application component, and the target model parameters may be obtained and sent to the bottom layer processing component when the front-end application component is started, or may be generated and sent when the front-end application component is started, which is not limited in this application.
Step 102, determining a target processing engine to be loaded according to the type of the current equipment.
The type of the current device may be, but is not limited to, the type of the AI chip used by the current device, for example, classifying different AI chips by using the brands of the AI chips; the target processing engine may be an AI SDK.
In this embodiment, the underlying processing component may determine the target processing engine to be loaded according to the type of the device currently located, and the type of the device currently located may be determined by acquiring the brand of the AI chip used by the device currently located.
As an example, a correspondence between a type of a device and a processing engine may be pre-established, and when the obtained brand of an AI chip used by the device currently located is brand a, the type of the device currently located may be determined to be brand a, and then, by querying the pre-established correspondence between the type of the device and the processing engine, a target processing engine corresponding to the brand a may be determined.
For example, assuming that an AI chip used by a certain terminal device is an AI chip produced by hua, it may be determined that the type of the terminal device is hua, and the corresponding target processing engine is HIAI.
Since the processing engines that need to be loaded when running the same APP may be different when the same brand of AI chip is applied to different devices, such as the same brand of smart phone and tablet computer, in one possible implementation of this embodiment of the present application, the type of device currently located may include the brand of AI chip used and the type of device currently located, where the type of device includes smart phone, tablet phone, notebook computer, and so on. And further determining a target processing engine to be loaded according to the type of the equipment currently located.
Step 103, loading the target processing engine and the target model corresponding to the target model parameters by calling a system loading function of the target processing engine.
Step 104, returning a loading completion message to the front-end application component through the first preset interface.
In this embodiment, after the target processing engine to be loaded is determined, the target processing engine and the target model corresponding to the target model parameter may be loaded by calling a system loading function of the target processing engine, and after loading is completed, a loading completion message is returned to the front end application component through the first preset interface.
Step 105, obtaining, through a second preset interface, a data processing request sent by the front-end application component, where the data processing request includes target data to be processed.
The second preset interface is a pre-established unified external interface, and the second preset interface can be an operation external interface and is recorded as RunAI ().
In this embodiment, after receiving the loading completion message sent by the bottom layer processing component, the front end application component may call the second preset interface to perform data processing, and specifically, the front end application component may send a data processing request to the bottom layer processing component through the second preset interface to perform data processing, where the data processing request includes target data to be processed. The underlying processing component may obtain the data processing request through a second preset interface.
And 106, calling an operation function of the target processing engine by taking the target data as a parameter, so as to process the target data by utilizing the target model, and obtaining a processing result.
In this embodiment, after the bottom layer processing component obtains the data processing request sent by the front end application component, target data to be processed is obtained from the data processing request, and then an operation function of the target processing engine is called with the target data as a parameter to operate a target model, and the target model is used to process the target data, so as to obtain a processing result. When the target model is operated to process the target data, the target data is used as the input of the target model, the target data is input into the target model, and the target model outputs the processing result.
And step 107, returning the processing result to the front-end application component through a second preset interface.
In this embodiment, after the bottom layer processing component obtains the processing result corresponding to the target data, the processing result may be returned to the front end application component through the second preset interface.
In the embodiment of the application, the different first preset interfaces and the second preset interfaces are set, and the different preset interfaces are called at different stages, so that flexible use of the interfaces can be realized. For example, the front-end application component may call the second preset interface multiple times after calling the first preset interface once to process the data in batches.
For example, assuming that the front-end application component is a voice noise reduction APP, when noise reduction processing is required for a voice signal, the voice noise reduction APP calls a first preset interface InitAI () to initialize a corresponding AI processing engine, where the AI processing engine may determine according to a type of a device in which the voice noise reduction APP is located, and loads a noise reduction network model. And then, calling a second preset interface RunAI () to perform noise reduction processing on the voice signal, and obtaining the voice data after the processing is completed. Furthermore, the voice noise reduction APP can analyze the processed voice data and play the voice after noise reduction. If the number of the voice signals to be noise reduced is multiple, the front-end application component can call the second preset interface RunAI () for noise reduction processing on the voice signals after calling the first preset interface InitAI (), without calling the first preset interface InitAI () each time, which is beneficial to improving the data processing efficiency.
According to the equipment system function calling method, the target model parameters sent by the front-end application component are obtained through the bottom layer processing component through the first preset interface, the target processing engine to be loaded is determined according to the type of the equipment where the front-end application component is currently located, the target processing engine and the target model corresponding to the target model parameters are loaded through the system loading function of the target processing engine, the loading completion message is returned to the front-end application component through the first preset interface, the data processing request sent by the front-end application component is obtained through the second preset interface, the data processing request comprises target data to be processed, the running function of the target processing engine is called by taking the target data as parameters, the target data is processed by the target model, the processing result is obtained, and the processing result is returned to the front-end application component through the second preset interface. Therefore, the external interface and the front-end application component are uniformly docked by using the first preset interface and the second preset interface as different processing engines, the uniform external interface calls the matched processing engine according to the type of the terminal equipment, so that the front-end application component is matched with the terminal equipment using different AI chips, a developer does not need to develop corresponding application APP aiming at the terminal equipment with different AI chips, and the development difficulty and the development period of the application APP are reduced. In addition, through setting different first preset interfaces and second preset interfaces, different preset interfaces are called at different stages, and flexible use of the interfaces is realized.
Because different types of device running environments, software and hardware configurations and the like may have certain differences, for the same front-end application component, when the devices in which the front-end application component is located are different, the hardware resources required for running the front-end application component may also have differences. Therefore, in one possible implementation manner of the embodiment of the present application, after the target model parameter sent by the front-end application component is obtained, the target hardware resource to be initialized may be further determined according to the type of the device where the front-end application component is currently located, where the target hardware resource may be, for example, a memory, a required processor thread, required hardware, etc., and an initialization function of the target processing engine is called to initialize the target hardware resource. For example, for an image processing APP installed in a certain brand of smart phone, the target hardware resources required for the APP may include the amount of memory required to be occupied, the threads required, the hardware support required for image processing, and the like. In the embodiment of the present application, when the target processing engine is loaded, the target processing engine may be loaded in the determined target hardware resource. Therefore, the target processing engine can be ensured to be supported by the hardware of the equipment, and the normal operation of the target processing engine is ensured.
Further, on the basis of the foregoing embodiment, after the bottom layer processing component returns the processing result to the front end application component, if a hardware resource release request sent by the front end application component through the third preset interface is obtained, a resource release function in the target processing engine is called, and the target hardware resource is released. The third preset interface is a pre-created unified external interface, and the third preset interface can be a resource release corresponding interface, which is marked as ReleaseAI ().
As an example, when the front-end application component exits, the third preset interface may be called to send a hardware resource release request, and after the bottom processing component obtains the hardware resource release request, a resource release function in the target processing engine is called to release a target hardware resource occupied by the front-end application component during operation, so as to release the occupation of the hardware resource of the device, ensure smooth operation of the device, avoid a blocking phenomenon caused by too high occupation of the hardware resource of the device, and reduce power consumption of the device.
Fig. 2 is a flowchart of a device system function calling method according to another embodiment of the present application. As shown in fig. 2, the device system function calling method may include the following steps:
Step 200, obtaining target model parameters sent by a front-end application component through a first preset interface.
And step 201, packaging processing engines corresponding to different types of devices.
The different types of devices and the corresponding processing engines thereof can be all AI brands and corresponding AI processing engines existing in the market, and can be expanded according to the development of future AI brands.
In this embodiment, processing engines corresponding to different types of devices may be packaged in advance, so as to provide conditions for determining corresponding target processing engines according to the type of the device currently located.
For example, for the high-pass SNPE, HIAI, samsung EDEN, concurrency NeuroPilot, and google TFLite currently available on the market, the processing engine may be downloaded and packaged. Specifically, for high-pass SNPE, HIAI, mars EDEN, co-mingled NeuroPilot and Google TFLite, SNPEWrapper class, HIAIWrapper class, EDENWrapper class, neuroPilotWrapper class and TFLiteWrapper class are encapsulated, respectively.
Step 202, determining a target processing engine to be loaded according to the type of the current equipment.
Step 203, training an initial model based on the preset open source software and the preset open source data set.
The initial model can be a neural network model, and models with different functions such as a voice recognition model, an image recognition model, a voice noise reduction model and the like can be obtained through training based on preset open source software and an open source data set.
As an example, according to the actual model requirement, corresponding open source software and open source data sets can be obtained from the network as preset open source software and preset open source data sets, and then the initial model is trained by using the preset open source software and the preset open source data sets, so as to obtain the required model.
For example, if the image recognition model needs to be obtained through training, the artificial intelligent library Tensorflow of Google can be obtained from the network as preset open source software, the data set ImageNet is used as a preset open source data set, and the neural network model is trained to obtain the image recognition model.
And 204, converting the initial model into each target model corresponding to each type of equipment by using a model conversion tool of each equipment manufacturer.
In this embodiment, after training an initial model based on preset open source software and a preset open source data set to obtain a trained initial model, the initial model may be further converted into each target model corresponding to each type of device by using a model conversion tool of each device manufacturer.
For example, the trained initial model may be converted according to a model conversion tool of the AI SDK provided by each equipment manufacturer, so as to obtain each target model corresponding to each type of equipment.
It should be noted that, the step of encapsulating the processing engines corresponding to the different types of devices in step 201 and the step of training the initial model and converting to each target model corresponding to each type of device in step 203-step 204 may be completed in advance, and the embodiment is only executed by step 201 before step 202, and steps 203-step 204 are executed by way of example and not by way of limitation of the application before step 205.
Step 205, loading the target processing engine and the target model corresponding to the target model parameters by calling the system loading function of the target processing engine.
Step 206, returning a loading completion message to the front-end application component through the first preset interface.
Step 207, obtaining, through a second preset interface, a data processing request sent by the front-end application component, where the data processing request includes target data to be processed.
And step 208, calling an operation function of the target processing engine by taking the target data as a parameter, so as to process the target data by utilizing the target model, and obtaining a processing result.
Step 209, returning the processing result to the front-end application component through the second preset interface.
In this embodiment, the descriptions of step 205 to step 209 may be referred to the descriptions of step 103 to step 107 in the foregoing embodiments, and will not be repeated here.
According to the equipment system function calling method, the processing engines corresponding to different types of equipment are packaged, the initial model is trained based on preset open source software and a preset open source data set, and the model conversion tools of all equipment manufacturers are utilized to convert the initial model into all target models corresponding to all types of equipment, so that software developers can use the equipment system function calling method conveniently, the application range of developed products is wider, the target models corresponding to all types of equipment can be obtained by training the general initial model and then converting the general initial model, the target models do not need to be trained for all processing engines, and the time cost is saved; the method comprises the steps of determining a target processing engine to be loaded according to the type of equipment, acquiring target model parameters through a first preset interface, loading the target processing engine and a target model corresponding to the target model parameters through a system loading function of the target processing engine, acquiring a data processing request through a second preset interface, and calling an operation function of the target processing engine to process target data in the data processing request by using the target model.
In order to achieve the above embodiments, an embodiment of the present application provides an apparatus system function calling device.
Fig. 3 is a schematic structural diagram of an apparatus system function calling device according to an embodiment of the present application.
As shown in fig. 3, the device system function calling means 30 includes: the system comprises a first acquisition module 310, a determination module 320, a loading module 330, a first feedback module 340, a second acquisition module 350, a calling module 360 and a second feedback module 370.
The first obtaining module 310 is configured to obtain, through a first preset interface, a target model parameter sent by the front-end application component.
A determining module 320, configured to determine a target processing engine to be loaded according to a type of a device currently located.
The loading module 330 is configured to load the target processing engine and the target model corresponding to the target model parameter by calling a system loading function of the target processing engine.
The first feedback module 340 is configured to return a loading completion message to the front-end application component through the first preset interface.
The second obtaining module 350 is configured to obtain, through a second preset interface, a data processing request sent by the front-end application component, where the data processing request includes target data to be processed.
And the calling module 360 is used for calling the running function of the target processing engine by taking the target data as parameters so as to process the target data by utilizing the target model and obtain a processing result.
And the second feedback module 370 is configured to return the processing result to the front-end application component through a second preset interface.
In one possible implementation manner of the embodiment of the present application, as shown in fig. 4, on the basis of the embodiment shown in fig. 3, the device system function calling apparatus 30 further includes:
the initialization module 300 is configured to determine a target hardware resource to be initialized according to a type of a device in which the device is currently located; and calling an initialization function of the target processing engine to initialize the target hardware resource.
In this embodiment, the loading module 330 is specifically configured to load the target processing engine in the target hardware resource.
Therefore, the target processing engine can be ensured to be supported by the hardware of the equipment, and the normal operation of the target processing engine is ensured.
As shown in fig. 3, the device system function calling apparatus 30 further includes:
the resource release module 380 is configured to, when a hardware resource release request sent by the front-end application component through the third preset interface is obtained, call a resource release function in the target processing engine, and release the target hardware resource.
Therefore, occupation of hardware resources of the equipment can be relieved, smooth operation of the equipment is guaranteed, a clamping phenomenon caused by too high occupation of the hardware resources of the equipment is avoided, and power consumption of the equipment is reduced.
In one possible implementation manner of the embodiment of the present application, as shown in fig. 5, on the basis of the embodiment shown in fig. 3, the device system function calling apparatus 30 further includes:
the encapsulation module 390 is configured to encapsulate processing engines corresponding to different types of devices.
The conversion module 3100 is configured to train an initial model based on preset open source software and a preset open source data set; and converting the initial model into each target model corresponding to each type of equipment by using a model conversion tool of each equipment manufacturer.
Therefore, the processing engines corresponding to different types of equipment are packaged, the initial model is trained based on preset open source software and a preset open source data set, and the model conversion tools of all equipment manufacturers are utilized to convert the initial model into all target models corresponding to all types of equipment respectively, so that the application range of a developed product is wider, the target models corresponding to all types of equipment are obtained through reconversion of the initial model which is universal in training, the target models do not need to be trained for all processing engines, and the time cost is saved.
It should be noted that the foregoing explanation of the embodiment of the device system function calling method is also applicable to the device system function calling apparatus of this embodiment, and the implementation principle is similar, which is not repeated here.
According to the device system function calling device, the target model parameters sent by the front-end application component are obtained through the bottom layer processing component through the first preset interface, the target processing engine to be loaded is determined according to the type of the device where the front-end application component is currently located, the target processing engine and the target model corresponding to the target model parameters are loaded through the system loading function of the target processing engine, the loading completion message is returned to the front-end application component through the first preset interface, the data processing request sent by the front-end application component is obtained through the second preset interface, the data processing request comprises target data to be processed, the running function of the target processing engine is called by taking the target data as parameters, the target data is processed by the target model, the processing result is obtained, and the processing result is returned to the front-end application component through the second preset interface. Therefore, the external interface and the front-end application component are uniformly docked by using the first preset interface and the second preset interface as different processing engines, the uniform external interface calls the matched processing engine according to the type of the terminal equipment, so that the front-end application component is matched with the terminal equipment using different AI chips, a developer does not need to develop corresponding application APP aiming at the terminal equipment with different AI chips, and the development difficulty and the development period of the application APP are reduced. In addition, through setting different first preset interfaces and second preset interfaces, different preset interfaces are called at different stages, and flexible use of the interfaces is realized.
In order to achieve the above embodiments, the embodiments of the present application further provide a terminal device.
Fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
As shown in fig. 6, the terminal apparatus 200 includes:
the memory 210 and the processor 220, the bus 230 connecting the different components (including the memory 210 and the processor 220), the memory 210 stores a computer program, and the processor 220 implements the device system function calling method described in the embodiments of the present application when executing the program.
Bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Terminal device 200 typically includes a variety of computer-readable media. Such media can be any available media that is accessible by terminal device 200 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 210 may also include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 240 and/or cache memory 250. Terminal device 200 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 260 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in fig. 6, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 230 via one or more data medium interfaces. Memory 210 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the present application.
Program/utility 280 having a set (at least one) of program modules 270 may be stored in, for example, memory 210, such program modules 270 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 270 generally perform the functions and/or methods in the embodiments described herein.
Terminal device 200 can also communicate with one or more external devices 290 (e.g., keyboard, pointing device, display 291, etc.), one or more devices that enable a user to interact with the terminal device 200, and/or any device (e.g., network card, modem, etc.) that enables the terminal device 200 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 292. Also, terminal device 200 can communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, via network adapter 293. As shown in fig. 6, the network adapter 293 communicates with other modules of the terminal device 200 over the bus 230. It should be appreciated that although not shown in fig. 6, other hardware and/or software modules may be used in connection with terminal device 200, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processor 220 executes various functional applications and data processing by running programs stored in the memory 210.
It should be noted that, the implementation process and the technical principle of the terminal device in this embodiment refer to the foregoing explanation of the device system function calling method in this embodiment, and are not repeated herein.
According to the terminal equipment provided by the embodiment of the application, the method for calling the equipment system function can be executed, the target processing engine to be loaded is determined according to the type of equipment, the target model parameters are acquired through the first preset interface, the target processing engine and the target model corresponding to the target model parameters are loaded through the system loading function of the target processing engine, the data processing request is acquired through the second preset interface, the running function of the target processing engine is called to process the target data in the data processing request by utilizing the target model, the first preset interface and the second preset interface are used as the unified external interface of different processing engines to be in butt joint with the front-end application component, the unified external interface is used for calling the matched processing engine according to the type of the terminal equipment, so that the front-end application component is matched with the terminal equipment using different AI chips, and developers do not need to develop corresponding application APPs (application APP) aiming at the terminal equipment with different AI chips, and the development difficulty and development cycle of the application APPs are reduced. In addition, through setting different first preset interfaces and second preset interfaces, different preset interfaces are called at different stages, and flexible use of the interfaces is realized.
In order to implement the above-described embodiments, the embodiments of the present application also propose a non-transitory computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the device system function calling method according to the above-described embodiments.
In order to implement the above embodiments, an embodiment of a further aspect of the present application provides a computer program, which when executed by a processor, implements the device system function calling method described in the embodiments of the present application.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless explicitly defined otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and additional implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present application.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As with the other embodiments, if implemented in hardware, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like. Although embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives, and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.

Claims (8)

1. A method for calling a device system function, comprising:
the method comprises the steps that a bottom layer processing component obtains target model parameters sent by a front-end application component through a first preset interface, wherein the target model parameters are configured by a target model corresponding to the front-end application component, and the front-end application component comprises an application APP with an AI function;
determining a target processing engine to be loaded according to the type of the current equipment, wherein processing engines corresponding to different types of equipment are pre-packaged in the current equipment;
training an initial model based on preset open source software and a preset open source data set;
converting the initial model into target models corresponding to various types of equipment by using model conversion tools of equipment manufacturers;
Loading the target processing engine and a target model corresponding to the target model parameters by calling a system loading function of the target processing engine;
returning a loading completion message to the front-end application component through the first preset interface;
acquiring a data processing request sent by the front-end application component through a second preset interface, wherein the data processing request comprises target data to be processed;
calling an operation function of the target processing engine by taking the target data as a parameter so as to process the target data by utilizing the target model and obtain a processing result;
and returning the processing result to the front-end application component through the second preset interface.
2. The method of claim 1, wherein after the obtaining the target model parameters sent by the front-end application component, further comprises:
determining a target hardware resource to be initialized according to the type of the current equipment;
calling an initialization function of the target processing engine to initialize the target hardware resource;
the loading the target processing engine includes:
and loading the target processing engine in the target hardware resource.
3. The method of claim 2, wherein after the returning the processing result to the front-end application component, further comprising:
and if the hardware resource release request sent by the front-end application component through the third preset interface is obtained, calling a resource release function in the target processing engine to release the target hardware resource.
4. A device system function calling apparatus, comprising:
the first acquisition module is used for acquiring target model parameters sent by the front-end application component through a first preset interface, wherein the target model parameters are configured by a target model corresponding to the front-end application component, and the front-end application component comprises an application APP with an AI function;
the determining module is used for determining a target processing engine to be loaded according to the type of the equipment at present, wherein the processing engines corresponding to the equipment of different types are pre-packaged in the equipment at present;
the conversion module is used for training an initial model based on preset open source software and a preset open source data set; converting the initial model into target models corresponding to various types of equipment by using model conversion tools of equipment manufacturers;
The loading module is used for loading the target processing engine and the target model corresponding to the target model parameters by calling a system loading function of the target processing engine;
the first feedback module is used for returning a loading completion message to the front-end application component through the first preset interface;
the second acquisition module is used for acquiring a data processing request sent by the front-end application component through a second preset interface, wherein the data processing request comprises target data to be processed;
the calling module is used for calling an operation function of the target processing engine by taking the target data as parameters so as to process the target data by utilizing the target model and obtain a processing result;
and the second feedback module is used for returning the processing result to the front-end application component through the second preset interface.
5. The apparatus as recited in claim 4, further comprising:
the initialization module is used for determining a target hardware resource to be initialized according to the type of the equipment at present; calling an initialization function of the target processing engine to initialize the target hardware resource;
The loading module is specifically configured to:
and loading the target processing engine in the target hardware resource.
6. The apparatus as recited in claim 5, further comprising:
and the resource release module is used for calling a resource release function in the target processing engine to release the target hardware resource when the hardware resource release request sent by the front-end application component through the third preset interface is acquired.
7. A terminal device comprising a processor and a memory;
wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for implementing the device system function call method according to any one of claims 1 to 3.
8. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the device system function call method of any of claims 1-3.
CN201911348980.3A 2019-12-24 2019-12-24 Equipment system function calling method, device, terminal equipment and storage medium Active CN111124713B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911348980.3A CN111124713B (en) 2019-12-24 2019-12-24 Equipment system function calling method, device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911348980.3A CN111124713B (en) 2019-12-24 2019-12-24 Equipment system function calling method, device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111124713A CN111124713A (en) 2020-05-08
CN111124713B true CN111124713B (en) 2024-03-26

Family

ID=70500774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911348980.3A Active CN111124713B (en) 2019-12-24 2019-12-24 Equipment system function calling method, device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111124713B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112966824A (en) * 2021-01-28 2021-06-15 北京百度网讯科技有限公司 Deployment method and device of inference library and electronic equipment
CN115843054A (en) * 2021-09-18 2023-03-24 维沃移动通信有限公司 Parameter selection method, parameter configuration method, terminal and network side equipment
CN113971192A (en) * 2021-10-22 2022-01-25 北京火山引擎科技有限公司 Data processing method and device, readable medium and electronic equipment
CN114374601A (en) * 2021-12-28 2022-04-19 海南视联大健康智慧医疗科技有限公司 Method and device for determining configuration information
CN114510298B (en) * 2022-04-20 2022-08-02 科大讯飞股份有限公司 Intelligent engine access and call method and related platform, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101272481A (en) * 2008-04-02 2008-09-24 武汉大学 Video monitoring front end equipment access method
CN102546208A (en) * 2010-12-13 2012-07-04 北大方正集团有限公司 Device management method, system and device management server
CN102646082A (en) * 2012-02-24 2012-08-22 深圳市长宇电器有限公司 Method and device for connecting various kinds of external equipment to embedded type platform
CN103577227A (en) * 2013-10-25 2014-02-12 北京奇虎科技有限公司 Method for loading plug-ins, browser and server
CN108304182A (en) * 2018-02-14 2018-07-20 飞天诚信科技股份有限公司 A kind of implementation method and device of the control for supporting nested window

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8873750B2 (en) * 2013-03-14 2014-10-28 International Business Machines Corporation Instruction for performing a pseudorandom number generate operation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101272481A (en) * 2008-04-02 2008-09-24 武汉大学 Video monitoring front end equipment access method
CN102546208A (en) * 2010-12-13 2012-07-04 北大方正集团有限公司 Device management method, system and device management server
CN102646082A (en) * 2012-02-24 2012-08-22 深圳市长宇电器有限公司 Method and device for connecting various kinds of external equipment to embedded type platform
CN103577227A (en) * 2013-10-25 2014-02-12 北京奇虎科技有限公司 Method for loading plug-ins, browser and server
CN108304182A (en) * 2018-02-14 2018-07-20 飞天诚信科技股份有限公司 A kind of implementation method and device of the control for supporting nested window

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Design and Implementation of Intelligent Diagnostic System Based on AI-ESTATE";Jin Luo等;《2011 Fourth International Conference on Information and Computing》;第237-240页 *
"安卓应用加固评估系统的研究与实现";魏国斌;《中国优秀硕士学位论文全文数据库 信息科技辑》;I138-41页 *

Also Published As

Publication number Publication date
CN111124713A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN111124713B (en) Equipment system function calling method, device, terminal equipment and storage medium
US9727436B2 (en) Adding a profiling agent to a virtual machine to permit performance and memory consumption analysis within unit tests
US20150310159A1 (en) Computer-implemented verification system for performing a functional verification of an integrated circuit
US9678767B2 (en) Unified extensible firmware interface (UEFI) driver and protocol
JP2006525575A (en) Off-device class / resource loading method, system, and computer program product for debugging Java applications in Java microdevices
EP2850529A2 (en) System and methods for generating and managing a virtual device
KR20080023728A (en) Selective pre-compilation of virtual code to enhance emulator performance
JPH11513512A (en) Method of manufacturing digital signal processor
US10866881B1 (en) Firmware debug trace capture
CN103488513B (en) Equipment plug and play general drive method
US10496423B2 (en) Method for opening up data and functions of terminal application based on reconstruction technology
WO2023201893A1 (en) Computing task scheduling method and apparatus, electronic device, and readable storage medium
US7539992B2 (en) Scheduling method, program product for use in such method, and task scheduling apparatus
CN112434478B (en) Method for simulating virtual interface of logic system design and related equipment
US10795704B2 (en) Serialization of objects to java bytecode
JP2006221630A (en) Log acquisition method and program, and storage medium
WO2017107824A1 (en) Application program running method and apparatus
TW202403541A (en) System, method and device for introducing applet into third-party APP and medium
CN114115850A (en) Code generation method and device
CN110465093B (en) Method and device for analyzing inclusion redundant resources based on Unity
CN114385507A (en) Software test case generation method
US10372661B1 (en) Firmware debug trace capture using serial peripheral interface
CN111290701B (en) Data read-write control method, device, medium and electronic equipment
US11789762B2 (en) Application deployment using reduced overhead bytecode
US8135943B1 (en) Method, apparatus, and computer-readable medium for generating a dispatching function

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant