CN114168209A - Hardware operation method and device, storage medium and electronic equipment - Google Patents

Hardware operation method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114168209A
CN114168209A CN202111512364.4A CN202111512364A CN114168209A CN 114168209 A CN114168209 A CN 114168209A CN 202111512364 A CN202111512364 A CN 202111512364A CN 114168209 A CN114168209 A CN 114168209A
Authority
CN
China
Prior art keywords
hardware
file
operated
driver
control program
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.)
Pending
Application number
CN202111512364.4A
Other languages
Chinese (zh)
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.)
Zhejiang Guoli Network Security Technology Co ltd
Original Assignee
Zhejiang Guoli Network Security 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 Zhejiang Guoli Network Security Technology Co ltd filed Critical Zhejiang Guoli Network Security Technology Co ltd
Priority to CN202111512364.4A priority Critical patent/CN114168209A/en
Publication of CN114168209A publication Critical patent/CN114168209A/en
Pending legal-status Critical Current

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/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a hardware operation method and device, a storage medium and electronic equipment, wherein after a hardware driver and a hardware control program of hardware to be operated are loaded, an operation request aiming at the hardware to be operated is obtained; searching a conversion strategy corresponding to the hardware to be operated in a preset configuration file; converting the operation method and the operation object included in the operation request by using a conversion strategy to obtain a target method and a target object; based on the target object, searching a preset hardware driver corresponding to the target object through a configuration file; and calling a hardware driver to operate the hardware to be operated based on the target method. Because the conversion strategy corresponding to the hardware to be operated is configured in the configuration file in advance, after the operation request is received, the operation method and the operation object in the operation request are converted, so that the difference between different hardware operations is shielded, the unified calling of different hardware drivers is realized, the workload is small, and the operation is simple.

Description

Hardware operation method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of fault detection technologies, and in particular, to a hardware operation method and apparatus, a storage medium, and an electronic device.
Background
The device driver based on the basic hardware of the Linux operating system is divided into a kernel space and a user space, wherein the kernel space is mainly responsible for hardware access logic, and the user space is mainly responsible for method and access flow control. Under such a design flow, when an upper layer application needs to operate the underlying hardware, the invocation of a driver is necessarily involved. However, since different hardware and different drivers thereof cause differences in hardware operation, and unified invocation of different hardware drivers cannot be realized, how to realize unified invocation of different hardware drivers becomes a problem to be solved urgently.
In the prior art, hardware drivers are abstracted and repackaged, different chips are extracted from the same position to serve as a universal interface module, and the hardware drivers are called through the universal interface module. Because the hardware driver of each device driver needs to be re-packaged one by one, the required workload is large, the device belongs to code-level packaging, and the operation is complex.
Disclosure of Invention
The application provides a hardware operation method and device, a storage medium and electronic equipment, and aims to solve the problems that in the existing mode of abstracting and repackaging a hardware driver, the hardware driver of each device driver needs to be repackaged one by one, the required workload is large, the hardware driver belongs to code-level encapsulation, and the operation is complex.
In order to achieve the above object, the present application provides the following technical solutions:
a method of hardware operation, comprising:
under the condition that loading of a hardware driver and a hardware control program of a hardware to be operated is completed, acquiring an operation request aiming at the hardware to be operated; the operation request comprises an operation method and an operation object;
searching a conversion strategy corresponding to the hardware to be operated in a preset configuration file;
converting the operation method and the operation object by using the conversion strategy to obtain a target method and a target object;
based on the target object, searching a preset hardware driver corresponding to the target object through the configuration file;
and calling the hardware driver based on the target method so as to operate the hardware to be operated.
Optionally, the method includes a process of loading a hardware driver and a hardware control program of the hardware to be operated, where the process includes:
acquiring hardware identification information of hardware to be operated;
searching file position information of a hardware driver file and a hardware control program file corresponding to the hardware identification information in a preset configuration file;
determining the file positions of a hardware driver program file and a hardware control program file corresponding to the hardware identification information based on the file position information;
and loading a hardware driver, the hardware control program file and the hardware control program in the hardware driver file corresponding to the hardware identification information based on the determined file position.
Optionally, in the method, the converting the operation method and the operation object by using the conversion policy to obtain a target method and a target object includes:
judging whether the operation method and the operation object are in a preset parameter range;
and if the operation method and the method object are in a preset parameter range, converting the operation method and the operation object by using the conversion strategy to obtain a target method and a target object.
The above method, optionally, further includes:
if the operation method is not in the preset parameter range, taking the preset method as a target method;
and if the operation object is not in the preset parameter range, determining the preset object as the target object.
Optionally, in the method, the searching, based on the target object, a preset hardware driver corresponding to the target object through the configuration file includes:
searching a preset hardware driver corresponding to the hardware to be operated according to the configuration file;
and determining a hardware driver corresponding to the target object from hardware drivers corresponding to the hardware to be operated.
Optionally, in the method described above, the invoking the hardware driver based on the target method to operate the hardware to be operated includes:
judging whether a hardware control program corresponding to the target object exists or not according to the configuration file;
if the hardware control program corresponding to the target object exists, based on the target method, calling the hardware drive program and the hardware control program corresponding to the target object to operate the hardware to be operated;
and if the hardware control program corresponding to the target object does not exist, calling the hardware driving program based on the target method so as to operate the hardware to be operated.
A hardware operating device, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring an operation request aiming at the hardware to be operated under the condition that the loading of a hardware driver and a hardware control program of the hardware to be operated is finished; the operation request comprises an operation method and an operation object;
the first searching unit is used for searching a conversion strategy corresponding to the hardware to be operated in a preset configuration file;
the conversion unit is used for performing conversion processing on the operation method and the operation object by using the conversion strategy to obtain a target method and a target object;
the second searching unit is used for searching a preset hardware driving program corresponding to the target object through the configuration file based on the target object;
and the calling unit is used for calling the hardware driver based on the target method so as to operate the hardware to be operated.
Optionally, in the apparatus described above, when the obtaining unit is in a process of loading a hardware driver and a hardware control program of the hardware to be operated, the obtaining unit is specifically configured to:
acquiring hardware identification information of hardware to be operated;
searching file position information of a hardware driver file and a hardware control program file corresponding to the hardware identification information in a preset configuration file;
determining the file positions of a hardware driver program file and a hardware control program file corresponding to the hardware identification information based on the file position information;
and loading a hardware driver, the hardware control program file and the hardware control program in the hardware driver file corresponding to the hardware identification information based on the determined file position.
A storage medium storing a set of instructions, wherein the set of instructions, when executed by a processor, implement a method of hardware operation as described above.
An electronic device, comprising:
a memory for storing at least one set of instructions;
a processor for executing the set of instructions stored in the memory, the method of hardware operation as described above being implemented by executing the set of instructions.
Compared with the prior art, the method has the following advantages:
the application provides a hardware operation method and device, a storage medium and electronic equipment, wherein under the condition that loading of a hardware driver and a hardware control program of hardware to be operated is completed, an operation request aiming at the hardware to be operated is obtained; the operation request comprises an operation method and an operation object; searching a conversion strategy corresponding to the hardware to be operated in a preset configuration file; converting the operation method and the operation object by using a conversion strategy to obtain a target method and a target object; based on the target object, searching a preset hardware driver corresponding to the target object through a configuration file; and calling a hardware driver to operate the hardware to be operated based on the target method. Therefore, according to the scheme of the application, the conversion strategy corresponding to the hardware to be operated is configured in the configuration file in advance, and after the operation request is received, the operation method and the operation object in the operation request are converted, so that the difference between different hardware operations is shielded, the unified calling of different hardware drivers is realized, the hardware drivers driven by each type of equipment do not need to be encapsulated again one by one, the workload is reduced, and the operation is simpler.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a hardware operation interface architecture provided in the present application;
FIG. 2 is a flow chart of a method of hardware operation provided herein;
FIG. 3 is a flow chart of another method of operating a hardware device according to the present application;
FIG. 4 is a flow chart of another method of operating hardware according to the present application;
FIG. 5 is a flow chart of another method of operating hardware according to the present application;
FIG. 6 is a diagram illustrating a method of hardware operation according to the present application;
FIG. 7 is a schematic structural diagram of a hardware operating apparatus provided in the present application;
fig. 8 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the disclosure of the present application are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in the disclosure herein are exemplary rather than limiting, and those skilled in the art will understand that "one or more" will be understood unless the context clearly dictates otherwise.
The invention is operational with numerous general purpose or special purpose computing device environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multi-processor apparatus, distributed computing environments that include any of the above devices or equipment, and the like.
The embodiment of the present invention provides a hardware operation method, which may be applied to a Linux system, where a hardware operation interface architecture of the Linux system is shown in fig. 1, and includes application programs (e.g., APP1, APP2, APP3), hardware unified interface programs (e.g., HDW SDK, HDW CLI), hardware control programs (e.g., LED SDK, USB SDK, network card SDK), system kernel, hardware drivers (e.g., actions/drivers, src/Action), and hardware (e.g., LED, USB, network card). The application, the hardware unified interface and the hardware control program belong to a user mode of a device driver, and the linux kernel and the hardware drive program belong to a kernel mode of the device driver.
The method comprises the steps of setting a configuration file and an interface main program in a hardware unified interface program in advance. The configuration file may be in XML format. The configuration file needs to be placed in the same file system directory as the interface main program, and the interface main program hwface can find the hardware control program matched with the current hardware through the associated configuration of the hardware control program and the hardware drive program.
Illustratively, the calling format of the main program of the interface is: hwface-t < target > -m < Method > -p [ parameters ]. Wherein hwface is interface main program, t is operation object, m is operation method, p is operation parameter (optional) and output: the result of the operation will be output to the standard output in Json format.
The method comprises the following steps of configuring each configuration item in a configuration file in advance, and storing the configuration file to a default path after configuration of the configuration file is completed, wherein the default path can be as follows: the method comprises the following steps of/Opt/BaseSoft OS/HW _ IFACE/, wherein Opt is an optional item, BaseSoft OS is a basic software operating system, and IFACE is an interface.
Illustratively, the configuration items may be a hardware serial number, an LED driver module, a watchdog driver module, a bypass driver module, a hardware status driver module, an LED control command line, a watchdog control command line, a bypass control command line, and a hardware status control command line. Exemplary, the configuration items and the programs corresponding to the configuration items are as follows:
Figure BDA0003397249300000061
Figure BDA0003397249300000071
the file location information of the hardware control program file and the file location information of the hardware driver file of the hardware may be previously arranged in the configuration file.
In this embodiment, the hardware unified interface is implemented as a command line interface program in the form of a Linux command line, and provides standard command line parameters for the upper application program to operate the hardware. The hardware unified interface program associates different hardware drivers and hardware control programs to different hardware devices through configuration files, encapsulates the device operation of different hardware manufacturers, and provides a set of standard unified interfaces.
A method flowchart of the hardware operation method provided in the embodiment of the present application is shown in fig. 2, and specifically includes the following steps:
s201, under the condition that the loading of a hardware driver and a hardware control program of the hardware to be operated is completed, an operation request aiming at the hardware to be operated is obtained.
In this embodiment, when the loading of the hardware driver and the hardware control program of the hardware to be operated is completed, an operation request for the hardware to be operated is obtained, where the operation request includes an operation method and an operation object. Exemplary, the operation method and the operation object are shown in table 1:
Figure BDA0003397249300000072
Figure BDA0003397249300000081
Figure BDA0003397249300000091
TABLE 1 operating method and operation object example table
Optionally, the operation request may further include an operation parameter.
Referring to fig. 3, the process of loading the hardware driver and the hardware control program of the hardware to be operated specifically includes the following steps:
s301, acquiring hardware identification information of the hardware to be operated.
In this embodiment, hardware identification information of the hardware to be operated is obtained, where the hardware identification information may be a hardware serial number.
Specifically, hardware identification information input by a user is obtained, and the hardware to be operated is the hardware corresponding to the hardware identification information.
S302, file position information of a hardware driver file and a hardware control program file corresponding to the hardware identification information in the preset configuration file is searched.
In this embodiment, a configuration file is preset, and file location information of a hardware driver file of hardware and file location information of a hardware control program file are stored in the configuration file in advance. The hardware driver files and the hardware control program files of different hardware are stored in the configuration files in a correlated mode according to the file position information and the hardware identification information of the hardware. That is, the file location information of the hardware driver file and the hardware control program file corresponding to the hardware identification information can be found in the configuration file by the hardware identification information.
In this embodiment, a preset configuration file is traversed, and based on hardware identification information input by a user, file location information of a hardware driver file corresponding to the hardware identification is searched, and file location information of a hardware control program file corresponding to the hardware identification is searched.
S303, determining the file positions of the hardware driver file and the hardware control program file corresponding to the hardware identification information based on the file position information.
In this embodiment, the file location of the hardware driver file corresponding to the hardware identification information is determined based on the file location information of the hardware driver file, and the file location of the hardware control program file corresponding to the hardware identification information is determined based on the file location information of the hardware control program file.
S304, loading a hardware driver, a hardware control program file and a hardware control program in the hardware driver file corresponding to the hardware identification information based on the determined file position.
In this embodiment, the hardware driver file is loaded based on the file position of the hardware driver file, and the hardware control program file is loaded based on the file position of the hardware control program file.
In this embodiment, the configuration file is preset, the file location information of the hardware driver files and the hardware control program files of different hardware is configured in the configuration file in advance, and further, the file location information of the hardware driver files and the hardware control program files corresponding to the hardware identification information can be found in the configuration file through the hardware identification information.
S202, searching a conversion strategy corresponding to the hardware to be operated in a preset configuration file.
In this embodiment, the configuration file is pre-configured with conversion policies of different hardware, and the different conversion policies are stored in association with corresponding hardware identification information. The conversion strategy is used for converting the operation method, the operation object and the operation parameter input by the user so as to realize that the converted operation method, the converted operation object and the converted operation parameter can be called by the corresponding drive of the hardware.
In this embodiment, a conversion policy corresponding to the hardware to be operated in the preset configuration file is searched, specifically, a conversion policy corresponding to the hardware identification information in the preset configuration file is searched based on the hardware identification information of the hardware to be operated.
S203, converting the operation method and the operation object by using the conversion strategy to obtain a target method and a target object.
In this embodiment, the operation method and the operation object are converted by using the conversion policy, so as to obtain a target method corresponding to the operation method and a target object corresponding to the operation object.
Referring to fig. 4, the process of converting the operation method and the operation object by using the conversion policy to obtain the target method and the target object specifically includes the following steps:
s401, judging whether the operation method is in a preset parameter range, if so, executing S402, and if not, executing S403.
In this embodiment, a parameter range is preset, and the parameter range includes an operation method parameter range and an operation object parameter range.
In this embodiment, whether the operation method is within a preset parameter range is determined, and specifically, whether the operation method is within a preset parameter range of the operation method is determined.
S402, converting the operation method by using the conversion strategy to obtain the target method.
In this embodiment, if the operation method is within the preset parameter range, the operation method is converted by using the conversion policy to obtain the target method.
And S403, taking a preset method as a target method.
In this embodiment, if the operation method is not within the preset parameter range, the preset method is taken as the target method. The preset method is a method set manually, and can be modified according to requirements.
S404, judging whether the operation object is in a preset parameter range, if so, executing S405, and if not, executing S406.
In this embodiment, it is determined whether the operation object is within a preset parameter range, specifically, whether the operation object is within a preset parameter range of the operation object is determined.
S405, converting the operation object by using the conversion strategy to obtain the target object.
In this embodiment, if the operation object is within the preset parameter range, the conversion policy is used to perform conversion processing on the operation object, so as to obtain the target object.
And S406, determining the preset object as a target object.
In this embodiment, if the operation object is not within the preset parameter range, the preset object is taken as the target object. The preset object is an artificially set object and can be modified according to requirements.
In this embodiment, when the operation method and the operation object input by the user are within the parameter range, the hardware unified interface program converts the operation method and the operation object by using the conversion policy, and when the operation method and the operation object input by the user are beyond the parameter range, the hardware unified interface program reads the input and judges the input, and then takes the preset method and the preset object to take effect.
And S204, based on the target object, searching a preset hardware driver corresponding to the target object through the configuration file.
In this embodiment, based on the target object, the preset hardware driver corresponding to the target object is searched for through the configuration file, specifically, the preset hardware driver corresponding to the hardware to be operated is searched for through the configuration file, and the hardware driver corresponding to the target object is determined from the hardware driver corresponding to the hardware to be operated.
And S205, calling a hardware driver based on the target method to operate the hardware to be operated.
In this embodiment, based on the target method, the hardware driver is called, so that the hardware to be operated is operated.
With reference to fig. 5, based on the target method, a process of calling a target hardware driver to operate the hardware to be operated includes the following steps:
s501, judging whether a hardware control program corresponding to the target object exists or not through the configuration file, if so, executing S502, and if not, executing S503.
And S502, calling a hardware driver and a hardware control program corresponding to the target object based on the target method so as to operate the hardware to be operated.
In this embodiment, if there is a hardware control program corresponding to the target object, the hardware driver and the hardware control program corresponding to the target object are called based on the target method, so as to implement the operation on the hardware to be operated.
And S503, calling a hardware driver based on the target method to operate the hardware to be operated.
In this embodiment, if there is no hardware control program corresponding to the target object, the hardware driver is called based on the target method, so as to implement the operation on the hardware to be operated.
According to the hardware operation method provided by the embodiment of the application, the conversion strategy corresponding to the hardware to be operated is configured in the configuration file in advance, and after the operation request is received, the operation method and the operation object in the operation request are converted, so that the difference between different hardware operations is shielded, the unified calling of different hardware drivers is realized, the hardware drivers driven by each type of equipment do not need to be encapsulated again one by one, the workload is reduced, and the operation is simpler.
According to the hardware operation method provided by the embodiment of the application, on the premise that the original drive of hardware is not changed, the consistency of the upper operation interface is finally realized by designing the hardware unified interface program. The unified interface program of the hardware is introduced into the hardware in an xml configuration file mode, new hardware is introduced in the later stage, and the rapid adaptation can be realized only by introducing related resource information according to a template. Moreover, the hardware unified interface program designed by the application is the only interface combining with service requirements, independent maintenance for different devices is not needed, and the maintenance cost is greatly reduced.
The hardware operation method provided by the embodiment of the application is based on a hardware unified interface program, and also provides a unified command line packaging method synchronously, so that an example is provided for the standardized test of hardware before delivery.
Referring to fig. 6, the hardware operation method provided by the above embodiment of the present application is illustrated as follows:
firstly, a Load method (actually, a parameter of a CLI command line) of a "hardware unified interface program" is called in an upper application program or a system startup script, and various device drivers corresponding to current hardware are loaded through a preset XML configuration file.
Secondly, the upper layer application calls a hardware unified interface program to access the hardware through a command line, and transmits an operation method and an operation parameter. The hardware unified interface program acquires a hardware control program corresponding to the current hardware calling operation by inquiring a preset XML configuration file, and calls the hardware control program through a system command line to complete hardware operation and access. The 'hardware uniform interface program' can make proper conversion to the calling parameters, thereby shielding the difference between different hardware operations and forming uniform standard calling.
It should be noted that while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous.
It should be understood that the various steps recited in the method embodiments disclosed herein may be performed in a different order and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the disclosure is not limited in this respect.
Corresponding to the method described in fig. 1, an embodiment of the present application further provides a hardware operating apparatus, which is used for implementing the method in fig. 1 specifically, and a schematic structural diagram of the hardware operating apparatus is shown in fig. 7, and specifically includes:
an obtaining unit 701, configured to obtain an operation request for a hardware to be operated when a hardware driver and a hardware control program of the hardware to be operated are loaded; the operation request comprises an operation method and an operation object;
a first searching unit 702, configured to search a conversion policy corresponding to the hardware to be operated in a preset configuration file;
a conversion unit 703, configured to perform conversion processing on the operation method and the operation object by using the conversion policy to obtain a target method and a target object;
a second searching unit 704, configured to search, based on the target object, a preset hardware driver corresponding to the target object through the configuration file;
the invoking unit 705 is configured to invoke the hardware driver based on the target method, so as to operate the hardware to be operated.
The hardware operating device provided by the embodiment of the application configures a conversion strategy corresponding to hardware to be operated in a configuration file in advance, and after receiving an operation request, converts an operation method and an operation object in the operation request, so that differences among different hardware operations are shielded, unified calling of different hardware drivers is realized, hardware drivers driven by each type of equipment do not need to be encapsulated again one by one, and thus the workload is reduced and the operation is simpler.
In an embodiment of the present application, based on the foregoing scheme, when the obtaining unit 701 is in a process of loading a hardware driver and a hardware control program of a hardware to be operated, specifically configured to:
acquiring hardware identification information of hardware to be operated;
searching file position information of a hardware driver file and a hardware control program file corresponding to the hardware identification information in a preset configuration file;
determining the file positions of a hardware driver program file and a hardware control program file corresponding to the hardware identification information based on the file position information;
and loading a hardware driver, the hardware control program file and the hardware control program in the hardware driver file corresponding to the hardware identification information based on the determined file position.
In an embodiment of the present application, based on the foregoing scheme, the conversion unit 703 is specifically configured to:
judging whether the operation method and the operation object are in a preset parameter range;
and if the operation method and the method object are in a preset parameter range, converting the operation method and the operation object by using the conversion strategy to obtain a target method and a target object.
In an embodiment of the present application, based on the foregoing scheme, the conversion unit 703 is further configured to:
if the operation method is not in the preset parameter range, taking the preset method as a target method;
and if the operation object is not in the preset parameter range, determining the preset object as the target object.
In an embodiment of the present application, based on the foregoing scheme, the second searching unit 704 is specifically configured to:
searching a preset hardware driver corresponding to the hardware to be operated according to the configuration file;
and determining a hardware driver corresponding to the target object from hardware drivers corresponding to the hardware to be operated.
In an embodiment of the present application, based on the foregoing scheme, the invoking unit 705 is specifically configured to:
judging whether a hardware control program corresponding to the target object exists or not according to the configuration file;
if the hardware control program corresponding to the target object exists, based on the target method, calling the hardware drive program and the hardware control program corresponding to the target object to operate the hardware to be operated;
and if the hardware control program corresponding to the target object does not exist, calling the hardware driving program based on the target method so as to operate the hardware to be operated.
The embodiment of the present application further provides a storage medium, where the storage medium stores an instruction set, and when the instruction set is executed, the hardware operation method disclosed in any one of the above embodiments is executed.
An electronic device is further provided in the embodiment of the present application, and a schematic structural diagram of the electronic device is shown in fig. 8, and specifically includes a memory 801 for storing at least one set of instruction sets; a processor 802 for executing the set of instructions stored in the memory, the method of operation of the hardware as disclosed in any of the embodiments above being implemented by executing the set of instructions.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
While several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
The foregoing description is only exemplary of the preferred embodiments disclosed herein and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the disclosure. For example, the above features and (but not limited to) technical features having similar functions disclosed in the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A method of hardware operation, comprising:
under the condition that loading of a hardware driver and a hardware control program of a hardware to be operated is completed, acquiring an operation request aiming at the hardware to be operated; the operation request comprises an operation method and an operation object;
searching a conversion strategy corresponding to the hardware to be operated in a preset configuration file;
converting the operation method and the operation object by using the conversion strategy to obtain a target method and a target object;
based on the target object, searching a preset hardware driver corresponding to the target object through the configuration file;
and calling the hardware driver based on the target method so as to operate the hardware to be operated.
2. The method according to claim 1, wherein the process of loading the hardware driver and the hardware control program of the hardware to be operated comprises:
acquiring hardware identification information of hardware to be operated;
searching file position information of a hardware driver file and a hardware control program file corresponding to the hardware identification information in a preset configuration file;
determining the file positions of a hardware driver program file and a hardware control program file corresponding to the hardware identification information based on the file position information;
and loading a hardware driver, the hardware control program file and the hardware control program in the hardware driver file corresponding to the hardware identification information based on the determined file position.
3. The method according to claim 1, wherein the converting the operation method and the operation object by using the conversion policy to obtain a target method and a target object comprises:
judging whether the operation method and the operation object are in a preset parameter range;
and if the operation method and the method object are in a preset parameter range, converting the operation method and the operation object by using the conversion strategy to obtain a target method and a target object.
4. The method of claim 3, further comprising:
if the operation method is not in the preset parameter range, taking the preset method as a target method;
and if the operation object is not in the preset parameter range, determining the preset object as the target object.
5. The method according to claim 1, wherein the finding, based on the target object, a preset hardware driver corresponding to the target object through the configuration file comprises:
searching a preset hardware driver corresponding to the hardware to be operated according to the configuration file;
and determining a hardware driver corresponding to the target object from hardware drivers corresponding to the hardware to be operated.
6. The method of claim 1, wherein invoking the hardware driver to operate on the hardware to be operated based on the target method comprises:
judging whether a hardware control program corresponding to the target object exists or not according to the configuration file;
if the hardware control program corresponding to the target object exists, based on the target method, calling the hardware drive program and the hardware control program corresponding to the target object to operate the hardware to be operated;
and if the hardware control program corresponding to the target object does not exist, calling the hardware driving program based on the target method so as to operate the hardware to be operated.
7. A hardware operating apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring an operation request aiming at the hardware to be operated under the condition that the loading of a hardware driver and a hardware control program of the hardware to be operated is finished; the operation request comprises an operation method and an operation object;
the first searching unit is used for searching a conversion strategy corresponding to the hardware to be operated in a preset configuration file;
the conversion unit is used for performing conversion processing on the operation method and the operation object by using the conversion strategy to obtain a target method and a target object;
the second searching unit is used for searching a preset hardware driving program corresponding to the target object through the configuration file based on the target object;
and the calling unit is used for calling the hardware driver based on the target method so as to operate the hardware to be operated.
8. The apparatus according to claim 7, wherein the obtaining unit, during a process of loading a hardware driver and a hardware control program of the hardware to be operated, is specifically configured to:
acquiring hardware identification information of hardware to be operated;
searching file position information of a hardware driver file and a hardware control program file corresponding to the hardware identification information in a preset configuration file;
determining the file positions of a hardware driver program file and a hardware control program file corresponding to the hardware identification information based on the file position information;
and loading a hardware driver, the hardware control program file and the hardware control program in the hardware driver file corresponding to the hardware identification information based on the determined file position.
9. A storage medium storing a set of instructions, wherein the set of instructions, when executed by a processor, implement a method of hardware operation as claimed in any one of claims 1 to 6.
10. An electronic device, comprising:
a memory for storing at least one set of instructions;
a processor for executing a set of instructions stored in said memory, said set of instructions being executable to implement a method of hardware operation as claimed in any one of claims 1 to 6.
CN202111512364.4A 2021-12-07 2021-12-07 Hardware operation method and device, storage medium and electronic equipment Pending CN114168209A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111512364.4A CN114168209A (en) 2021-12-07 2021-12-07 Hardware operation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111512364.4A CN114168209A (en) 2021-12-07 2021-12-07 Hardware operation method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114168209A true CN114168209A (en) 2022-03-11

Family

ID=80485689

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111512364.4A Pending CN114168209A (en) 2021-12-07 2021-12-07 Hardware operation method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114168209A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116627514A (en) * 2023-05-29 2023-08-22 合芯科技有限公司 I2c equipment management method, device, equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1451119A (en) * 1999-12-30 2003-10-22 高通股份有限公司 Virtual device architecture for mobile telephones
CN105677345A (en) * 2016-01-04 2016-06-15 段利平 Switcher control method and device
CN105988850A (en) * 2015-05-12 2016-10-05 乐视移动智能信息技术(北京)有限公司 Startup control method and device of mobile terminal
CN106020807A (en) * 2016-05-13 2016-10-12 上海井蛙科技有限公司 Driver calling method and system
CN110175055A (en) * 2019-05-07 2019-08-27 成都交大光芒科技股份有限公司 A kind of call method of browser and fingerprint instrument based on service
CN110837446A (en) * 2018-08-16 2020-02-25 北京嘉楠捷思信息技术有限公司 Equipment management method and device applied to embedded system, medium and embedded equipment
CN111221571A (en) * 2018-11-26 2020-06-02 西安诺瓦星云科技股份有限公司 Peripheral driver manufacturing method, device and computer readable medium
CN111309386A (en) * 2020-01-19 2020-06-19 苏州浪潮智能科技有限公司 Switch hardware driving framework and switch

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1451119A (en) * 1999-12-30 2003-10-22 高通股份有限公司 Virtual device architecture for mobile telephones
CN105988850A (en) * 2015-05-12 2016-10-05 乐视移动智能信息技术(北京)有限公司 Startup control method and device of mobile terminal
CN105677345A (en) * 2016-01-04 2016-06-15 段利平 Switcher control method and device
CN106020807A (en) * 2016-05-13 2016-10-12 上海井蛙科技有限公司 Driver calling method and system
CN110837446A (en) * 2018-08-16 2020-02-25 北京嘉楠捷思信息技术有限公司 Equipment management method and device applied to embedded system, medium and embedded equipment
CN111221571A (en) * 2018-11-26 2020-06-02 西安诺瓦星云科技股份有限公司 Peripheral driver manufacturing method, device and computer readable medium
CN110175055A (en) * 2019-05-07 2019-08-27 成都交大光芒科技股份有限公司 A kind of call method of browser and fingerprint instrument based on service
CN111309386A (en) * 2020-01-19 2020-06-19 苏州浪潮智能科技有限公司 Switch hardware driving framework and switch

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116627514A (en) * 2023-05-29 2023-08-22 合芯科技有限公司 I2c equipment management method, device, equipment and storage medium
CN116627514B (en) * 2023-05-29 2024-04-26 合芯科技有限公司 I2c equipment management method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US11868785B2 (en) Application program page processing method and device
US10949237B2 (en) Operating system customization in an on-demand network code execution system
US8788787B2 (en) Systems, methods and architecture for facilitating software access to acceleration technology
US6272674B1 (en) Method and apparatus for loading a Java application program
US8839265B2 (en) Virtual environment for server applications, such as web applications
US9086924B2 (en) Executing a distributed java application on a plurality of compute nodes
US8555280B2 (en) Terminal device of non-android platform for executing android applications, and computer readable recording medium for storing program of executing android applications on non-android platform
US11301562B2 (en) Function execution based on data locality and securing integration flows
US20100205604A1 (en) Systems and methods for efficiently running multiple instances of multiple applications
US10140145B1 (en) Displaying guest operating system statistics in host task manager
EP3992796A1 (en) Inter-process communication method, apparatus and device
CN109358956B (en) Service calling method
CN108616384B (en) Centralized service management deployment tool and method
US7552434B2 (en) Method of performing kernel task upon initial execution of process at user level
CN114168209A (en) Hardware operation method and device, storage medium and electronic equipment
US20050246708A1 (en) Method of assigning virtual process identifier to process within process domain
US20030149967A1 (en) Information processing method and system
CN108228266B (en) Method and device for starting Fragment component between different plug-ins under Android plug-in framework
CN114816662A (en) Container arrangement method and system applied to Kubernetes
Sekigawa et al. Web Application-Based WebAssembly Container Platform for Extreme Edge Computing
CN112380023B (en) Distributed model calculation control method and device
US11385912B2 (en) System to enable a full desktop experience based on a mobile device
CN110520842B (en) Address space splitting system and method for traditional application compatibility
CN109901826B (en) Data processing method and device for Java program and electronic equipment
KR102485154B1 (en) Power Communication Service

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