CN112860601A - Method and device for calling device driving function, computer device and system - Google Patents

Method and device for calling device driving function, computer device and system Download PDF

Info

Publication number
CN112860601A
CN112860601A CN201911099295.1A CN201911099295A CN112860601A CN 112860601 A CN112860601 A CN 112860601A CN 201911099295 A CN201911099295 A CN 201911099295A CN 112860601 A CN112860601 A CN 112860601A
Authority
CN
China
Prior art keywords
message
equipment
instruction
device driver
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.)
Pending
Application number
CN201911099295.1A
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.)
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Shenzhen Yihua Financial Intelligent Research Institute
Original Assignee
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Shenzhen Yihua Financial Intelligent Research Institute
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 Shenzhen Yihua Computer Co Ltd, Shenzhen Yihua Time Technology Co Ltd, Shenzhen Yihua Financial Intelligent Research Institute filed Critical Shenzhen Yihua Computer Co Ltd
Priority to CN201911099295.1A priority Critical patent/CN112860601A/en
Publication of CN112860601A publication Critical patent/CN112860601A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application is suitable for the technical field of financial self-service equipment, and provides a method for calling an equipment driving function, which comprises the following steps: calling an interface of a virtual device driver, and receiving a request instruction, wherein the virtual device driver is a device driver of first equipment; packaging the request instruction according to the message format of the first equipment to obtain a first instruction message; inquiring a preset instruction mapping table to obtain an execution message of second equipment corresponding to the first instruction message, wherein the second equipment and the first equipment are the same type of equipment and have the same type of driving function, and the instruction mapping table records the mapping relation between the message of the first equipment and the message of the second equipment; and sending the execution message to the second equipment according to the communication protocol of the second equipment so as to enable the second equipment to execute according to the execution message.

Description

Method and device for calling device driving function, computer device and system
Technical Field
The application belongs to the technical field of financial self-service equipment, and particularly relates to a method, a device, computer equipment and a system for calling an equipment driving function.
Background
Currently, in the market, financial institutions require that the equipment of various manufacturers can be connected with each other to form a complete financial equipment machine. In order to combine financial peripherals from different manufacturers into a complete financial device, two aspects are considered, namely hardware interconnection and software interconnection. In order to deal with the problem of software interconnection in the financial industry, microsoft corporation, several large financial peripheral manufacturers, and several large banking institutions are discussed together, and finally a set of software technical specification WOSA (Windows Open System Architecture) is defined.
In order to meet the WOSA, the conventional drive method based on the WOSA standard is implemented according to the WOSA protocol for each hardware device, so a device driver must strictly master the WOSA protocol standard (logical device characteristics), and simultaneously, the device driver needs to be very familiar with the device characteristics and the device instructions, so that device driver software meeting the requirements can be developed, which results in long development period and high development cost of the device driver.
Therefore, finding a method capable of quickly implementing device driver invocation of a financial device becomes an urgent problem to be solved by those skilled in the art.
Disclosure of Invention
The embodiment of the application provides a method and a device for calling a device driving function, computer equipment and a system, and can solve the problems of long development period and high cost of device driving.
In a first aspect, an embodiment of the present application provides a method for calling a device driver function, including:
calling an interface of a virtual device driver, and receiving a request instruction, wherein the virtual device driver is a device driver of first equipment;
packaging the request instruction according to the message format of the first equipment to obtain a first instruction message;
inquiring a preset instruction mapping table to obtain an execution message of second equipment corresponding to the first instruction message, wherein the second equipment and the first equipment are the same type of equipment and have the same type of driving function, and the instruction mapping table records the mapping relation between the message of the first equipment and the message of the second equipment;
and sending the execution message to the second equipment according to the communication protocol of the second equipment so as to enable the second equipment to execute according to the execution message.
Therefore, the function driving and calling of the second equipment can be completed by utilizing the equipment driver of the first equipment, the equipment driver of another kind of equipment can be conveniently and rapidly developed under the condition of the existing equipment drivers of the same kind of equipment, the development period of the equipment driver is greatly shortened, and the development cost is reduced.
Preferably, after sending the execution packet to the second device according to the communication protocol of the second device, so that the second device executes according to the execution packet, the method further includes:
receiving a second result message returned by the second equipment;
inquiring the instruction mapping table to obtain a first result message of the first equipment corresponding to the second result message;
and analyzing the first result message according to the message format of the first equipment, and returning an analysis result to an interface driven by the virtual equipment.
The result message returned by the second device can be converted into the message format of the first device through the instruction mapping table, so that result feedback is completed through the interface.
Preferably, the instruction mapping table is preset by the following steps:
acquiring an instruction message set of a device driver of the first device, and recording the instruction message set as a first set;
acquiring an instruction message set of the device driver of the second device, and recording the instruction message set as a second set;
inquiring messages with the same functions as the messages in the second set aiming at the messages in the first set, and recording the messages as mapping messages;
establishing a mapping relation between each message and the mapping message;
and recording the mapping relation corresponding to each message in the first set on a table to generate an instruction mapping table.
Therefore, the instruction mapping tables of two devices of the same type can be automatically preset, the generation efficiency of the instruction mapping tables is greatly improved, and the development efficiency of device drivers is further improved.
Preferably, the mapping relationship between the message of the first device and the message of the second device recorded in the instruction mapping table is one-to-one or one-to-many, so that the mapping relationship between the message of the first device and the message of the second device is more flexible, and the instruction mapping table can be applied to development scenes of more device drivers.
Preferably, the interface driven by the virtual device is an atomic instruction interface, and the device driving interface of the second device is an atomic instruction interface or a sequential instruction interface, so that instruction mapping between the first device and the second device is more accurate.
In a second aspect, an embodiment of the present application provides an apparatus for invoking a device driver function, including:
the command receiving module is used for calling an interface of a virtual device driver and receiving a request command, wherein the virtual device driver is a device driver of the first device;
the first message encapsulation module is used for encapsulating the request instruction according to the message format of the first equipment to obtain a first instruction message;
the execution message query module is used for querying a preset instruction mapping table to obtain an execution message of second equipment corresponding to the first instruction message, the second equipment and the first equipment are the same type of equipment and have the same type of driving function, and the instruction mapping table records the mapping relation between the message of the first equipment and the message of the second equipment;
and the execution message sending module is used for sending the execution message to the second equipment according to the communication protocol of the second equipment so as to enable the second equipment to execute according to the execution message.
In a third aspect, an embodiment of the present application provides a system for calling a device driver function, where the calling system implements a method for calling the device driver function during operation, and/or the calling system includes a device for calling the device driver function.
In a fourth aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method for calling the device driver function when executing the computer program.
In a fifth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the method for invoking the device driver function described above.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a diagram of an application environment of a method for invoking a device driver function according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for invoking a device driver function according to an embodiment of the present application;
fig. 3 is a schematic flowchart illustrating a method for calling a device driver function in an application scenario in which an instruction mapping table is preset;
fig. 4 is a schematic flowchart illustrating a method for calling a device driver function in an application scenario to return an execution result according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an instruction format of a brand printer in an application scenario;
FIG. 6 is a schematic structural diagram of a device driver function invoking apparatus according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a computer device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The method for calling the device driving function can be applied to the application environment shown in fig. 1, wherein the financial self-service device can communicate with the server through a network. The server can be implemented by an independent server or a server cluster composed of a plurality of servers, and the financial self-service device includes a plurality of hardware devices, such as a printer, a scanner, a password keyboard, a card reader, and the like.
The application provides a method for calling an equipment driving function, which can realize that the drive of equipment A in financial self-service equipment and the like are replaced by the drive of equipment B, and achieve the same technical effect of the drive of the equipment B, wherein the equipment A and the equipment B belong to hardware equipment in the financial self-service equipment, the equipment A and the equipment B are the same type of equipment, for example, the equipment A is a printer, for a certain financial self-service equipment, the equipment B is hardware equipment actually installed on the financial self-service equipment, the equipment A is equipment of the same type as the equipment B, and the equipment A does not need to be actually installed on the financial self-service equipment.
It can be known that, when the a device and the B device belong to the same class of devices, from the perspective of application software, the a device and the B device have the same function, for example, in the WOSA protocol, a cycle core device is a class of devices, a cycle core developed by a happy company and a cycle core developed by a radio and television communication company all belong to cycle core products, and the functions provided are the same with respect to a cross-platform application system.
For the convenience of understanding, the theoretical basis of the calling method of the device driving function provided by the present application is first set forth below. It is known that the functions of the equipment used, i.e. the functions of the equipment for performing the business process, are identical for financial businesses, i.e. the functions of so-called logical equipment, for each brand of equipment of the same type or for equipment of different manufacturers. Therefore, if a certain type of equipment already has equipment of one brand or manufacturer and realizes stable SP (service pack), based on the technology, the instructions of the equipment of other brands or manufacturers of the type of equipment can be functionally mapped and correspond to the instructions of the equipment which realizes SP, so that the conversion of the instructions in the form can be realized, and the SP drive of the equipment of other brands or manufacturers of the type of equipment can be realized.
For example, for the above-mentioned a device and B device, from the software perspective, the transmitted instruction execution command and the received instruction execution result are both in the instruction format of the a device, and then actually the hardware device is the B device, and both the received instruction format and the returned instruction execution result are both in the instruction format of the B device. Therefore, the method also realizes that the B device provides hardware functions similar to the A device in a proxy mode, and realizes the calling of the hardware functions of the B device on the basis of the driving logic of the A device.
On the basis of the above theory, for convenience of understanding, the method for calling the device driver function provided by the present application is specifically described below by an embodiment. In an embodiment, as shown in fig. 2, a method for invoking a device driver function is provided, which is described by taking the financial self-service device in fig. 1 as an example, and includes the following steps:
101. calling an interface of a virtual device driver, and receiving a request instruction, wherein the virtual device driver is a device driver of first equipment;
in the embodiment of the application, the financial self-service device calls the function of the second device by using the device driver of the first device, wherein, except that the first device and the second device are similar devices with the same function, the first device and the second device and the driving interfaces of the first device and the second device have the following defined relationship:
1) the corresponding relationship between the driving interface and the hardware instruction is 1:1 for the first device, 1:1 for the second device, or 1: n, and the n instructions should be sequential execution instructions and not be able to be executed in other logical forms such as select or branch. That is, the instructions of the first device are all atomic instruction interfaces, and the second device may be an atomic instruction interface or a sequential instruction interface.
2) The instruction execution result of the first device may be 1: n maps the result of the execution of the instructions by the second device.
On this basis, when the financial self-service device needs to drive the second device, the interface of the virtual device driver can be called to receive the request instruction, wherein the virtual device driver is the device driver of the first device. The request instruction can be sent to the self-service financial device by other servers or terminals, or can be generated by the user operating on the self-service financial device, for example, the user can input the request instruction through an operating keyboard of the self-service financial device.
As can be seen from the above, in this embodiment, the virtual device driver interface is an atomic command interface, and the device driver interface of the second device is an atomic command interface or a sequential command interface.
102. Packaging the request instruction according to the message format of the first equipment to obtain a first instruction message;
it can be understood that the financial self-service device receives the request instruction through the interface of the virtual device driver, and at this time, the financial self-service device uses the virtual device driver, so that the virtual device driver encapsulates the request instruction according to the message format of the first device to obtain the first instruction message.
103. Inquiring a preset instruction mapping table to obtain an execution message of second equipment corresponding to the first instruction message, wherein the second equipment and the first equipment are the same type of equipment and have the same type of driving function, and the instruction mapping table records the mapping relation between the message of the first equipment and the message of the second equipment;
in this embodiment, an instruction mapping table is provided in advance on the financial self-service device, and the instruction mapping table records a mapping relationship between a message of the first device and a message of the second device. Therefore, the financial self-service device may query the instruction mapping table to obtain an execution message of the second device corresponding to the first instruction message, so as to determine the execution message suitable for the second device, so as to drive the second device to work in subsequent steps.
It is understood that the instruction mapping table needs to be preset, and the presetting process of the instruction mapping table will be described in detail below. Further, as shown in fig. 3, the instruction mapping table may be preset by:
201. acquiring an instruction message set of a device driver of the first device, and recording the instruction message set as a first set;
202. acquiring an instruction message set of the device driver of the second device, and recording the instruction message set as a second set;
203. inquiring messages with the same functions as the messages in the second set aiming at the messages in the first set, and recording the messages as mapping messages;
204. establishing a mapping relation between each message and the mapping message;
205. and recording the mapping relation corresponding to each message in the first set on a table to generate an instruction mapping table.
For step 201 and 202, first, an instruction packet set of the device driver of the first device may be obtained and recorded as a first set, and an instruction packet set of the device driver of the second device may be obtained and recorded as a second set.
As for step 203, it can be understood that each packet in the first set necessarily corresponds to one packet function, and the packet functions of the first device and the second device are the same, so that a packet with the same function as each packet can be queried from the second set and recorded as a mapping packet.
For steps 204 and 205, after finding the mapping packet corresponding to each packet in the first set, a mapping relationship between each packet and the mapping packet can be established. After the mapping relations corresponding to all the messages in the first set are established and obtained, the mapping relations are recorded on the table, and the instruction mapping table can be obtained.
It can be seen that, in the specific application scenario, in the instruction mapping table, a packet mapping relationship between the first device and the second device may be 1:1 or 1: n, and mapping relation. The following table one is a format of an instruction mapping table in an application scenario:
watch 1
Figure BDA0002269344050000091
104. And sending the execution message to the second equipment according to the communication protocol of the second equipment so as to enable the second equipment to execute according to the execution message.
It can be understood that, after the execution message is obtained, the financial self-service device may send the execution message to the second device according to the communication protocol of the second device, so that the second device executes according to the execution message, and it is known that, since the execution message corresponds to the first instruction message, an operation function of the second device executing the execution message is consistent with a function of the first instruction message executed on the first device, so that the financial self-service device implements the same-function driving of the second device through a device driver of the first device.
On the other hand, there may be a case that the message conversion is invalid or an error occurs, which may cause the second device to be unable to execute the execution message, and therefore, if information that the execution message is incorrect is fed back by the second device, the server may generate alarm information that the instruction mapping table is incorrect, and send the alarm information to the designated terminal. It can be understood that the designated terminal can be a personal computer, a mobile phone, etc. of a maintenance person, so that the maintenance person can know that the instruction mapping table has an error and perform maintenance processing in time at the first time.
In view of that some execution operations may need to return the execution result after the second device executes, in this embodiment, the returned execution result may also be converted and returned by the device driver of the first device. Specifically, as shown in fig. 4, after sending the execution packet to the second device according to the communication protocol of the second device, so that the second device executes according to the execution packet, the method may further include:
301. receiving a second result message returned by the second equipment;
302. inquiring the instruction mapping table to obtain a first result message of the first equipment corresponding to the second result message;
303. and analyzing the first result message according to the message format of the first equipment, and returning an analysis result to an interface driven by the virtual equipment.
In step 301, after the second device executes the execution message, if there is an execution result, the second device generates a second result message, and then returns the second result message to the financial self-service device.
For step 302, after the financial self-service device receives the second result message, it can be known in the same way that the instruction mapping table may be queried to obtain the first result message of the first device corresponding to the second result message.
In step 303, finally, the financial self-service device parses the first result message according to the message format of the first device to obtain a parsing result, and returns the parsing result to the interface driven by the virtual device to complete the feedback work of the execution result.
In order to facilitate understanding of the method for calling the device driver function provided in the present application, a specific application scenario is described as an example.
In a specific application scenario, the printer device class used by the financial self-service device is according to the number of interfaces and the number of device instructions of 1:1, and the virtual device instruction (i.e. the device instruction/message of the first device) and the actual device instruction (i.e. the device instruction/message of the second device) of 1: 1.
And calling a printer equipment interface getAppersStatus () by the application program to acquire the paper state of the printer, namely whether paper exists or not.
The following is an instruction format of the inquiry paper status of a certain brand printer a (as a virtual device) as follows:
Figure BDA0002269344050000111
the following is a format of one instruction in an instruction set of a certain brand of printer B (as an actual device), see fig. 5.
The function of the instruction is to detect a status command, and the driver interface is to acquire the status of the hardware device.
The format is as follows: ETB + D
Without parameters
Note that (1) the command header ETB is hexadecimal 17, as follows.
(2) '+' here merely means a connection, which does not exist in the actual command, as follows.
The functions are as follows: whether the current state of the printer has paper and printing color is known. The "DE 2" code is actively sent to the host every 1 minute when the printer is paperless.
And returning a value:
(1) dsm represents that the current printer works normally, m is a binary code of 1 byte, the current printing color of the printer is contained, and the specific meaning is that the meaning of each bit of m shown in the following figure 5 is checked.
(2) Dem indicates a printer failure, and a specific failure request looks at the respective bit significances of m shown in fig. 5 below.
Description of the drawings: the last digit of the returned value is a hexadecimal number, as follows.
Examples are: commanding ETBD
The first condition is as follows: returning to Ds0, it indicates that the printer is operating normally with the operating mode being character mode and the print color being black.
Case two: returning to De2, no print paper is indicated.
Description of the drawings: the last digit of the returned value is a hexadecimal number, as follows.
The format of the instruction mapping table between a brand of printer a and a brand of printer B is shown in table two below:
watch two
Figure BDA0002269344050000121
In the embodiment of the application, firstly, an interface of a virtual device driver is called, and a request instruction is received, wherein the virtual device driver is a device driver of a first device; then, packaging the request instruction according to the message format of the first equipment to obtain a first instruction message; then, inquiring a preset instruction mapping table to obtain an execution message of second equipment corresponding to the first instruction message, wherein the second equipment and the first equipment are the same type of equipment and have the same type of driving function, and the instruction mapping table records the mapping relation between the message of the first equipment and the message of the second equipment; and finally, sending the execution message to the second equipment according to the communication protocol of the second equipment so as to enable the second equipment to execute according to the execution message. Therefore, the function driving and calling of the second equipment can be completed by utilizing the equipment driver of the first equipment, the equipment driver of another kind of equipment can be conveniently and rapidly developed under the condition of the existing equipment drivers of the same kind of equipment, the development period of the equipment driver is greatly shortened, and the development cost is reduced.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
In an embodiment, a device for calling a device driver function is provided, where the device for calling a device driver function corresponds to the method for calling a device driver function in the foregoing embodiment one to one. As shown in fig. 6, the calling device of the device driver function includes an instruction receiving module 401, a first packet encapsulating module 402, an execution packet querying module 403, and an execution packet sending module 404. The functional modules are explained in detail as follows:
an instruction receiving module 401, configured to invoke an interface of a virtual device driver, and receive a request instruction, where the virtual device driver is a device driver of a first device;
a first packet encapsulation module 402, configured to encapsulate the request instruction according to the packet format of the first device, so as to obtain a first instruction packet;
an execution message query module 403, configured to query a preset instruction mapping table to obtain an execution message of a second device corresponding to the first instruction message, where the second device and the first device are devices of the same type and have the same type of driving function, and the instruction mapping table records a mapping relationship between a message of the first device and a message of the second device;
an execution packet sending module 404, configured to send the execution packet to the second device according to a communication protocol of the second device, so that the second device executes according to the execution packet.
Further, the device driver function invoking means may further include:
a return message receiving module, configured to receive a second result message returned by the second device;
a result message query module, configured to query the instruction mapping table to obtain a first result message of the first device corresponding to the second result message;
and the analysis returning module is used for analyzing the first result message according to the message format of the first equipment and returning the analysis result to the interface driven by the virtual equipment.
Further, the instruction mapping table may be preset by:
a first set obtaining module, configured to obtain a set of instruction packets of a device driver of the first device, and record the set as a first set;
a second set obtaining module, configured to obtain a set of instruction packets of a device driver of the second device, and record the set as a second set;
a mapping message query module, configured to query, for each message in the first set, a message having the same function as each message in the second set, and record the message as a mapping message;
a mapping relation establishing module, configured to establish a mapping relation between each packet and the mapping packet;
and the mapping table generating module is used for recording the mapping relation corresponding to each message in the first set on a table and generating an instruction mapping table.
Further, the interface of the virtual device driver may be an atomic instruction interface, and the device driver interface of the second device may be an atomic instruction interface or a sequential instruction interface.
The specific definition of the device driver function invoking means may refer to the above definition of the device driver function invoking method, which is not described herein again. The modules in the device driver function calling device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a device driver function calling system is provided, which implements the steps of the device driver function calling method in the above embodiments when running, such as steps 101 to 104 shown in fig. 2. Alternatively, the calling system includes any one of the calling apparatuses of the device driver functions in the foregoing embodiments, such as the modules 401 to 404 shown in fig. 6. To avoid repetition, further description is omitted here.
In one embodiment, a computer device is provided, as shown in fig. 7, and includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the method for invoking the device driver function in the above embodiments are implemented, for example, steps 101 to 104 shown in fig. 2. Alternatively, the processor, when executing the computer program, implements the functions of the modules/units of the apparatus for calling the device driver function in the above-described embodiments, such as the functions of the modules 401 to 404 shown in fig. 6. To avoid repetition, further description is omitted here.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method for calling the device driver function in the above-described embodiments, such as steps 101 to 104 shown in fig. 2. Alternatively, the computer program, when executed by the processor, implements the functions of the modules/units of the device driver function invoking apparatus in the above-described embodiments, such as the functions of the modules 401 to 404 shown in fig. 6. To avoid repetition, further description is omitted here.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for invoking a device driver function, comprising:
calling an interface of a virtual device driver, and receiving a request instruction, wherein the virtual device driver is a device driver of first equipment;
packaging the request instruction according to the message format of the first equipment to obtain a first instruction message;
inquiring a preset instruction mapping table to obtain an execution message of second equipment corresponding to the first instruction message, wherein the second equipment and the first equipment are the same type of equipment and have the same type of driving function, and the instruction mapping table records the mapping relation between the message of the first equipment and the message of the second equipment;
and sending the execution message to the second equipment according to the communication protocol of the second equipment so as to enable the second equipment to execute according to the execution message.
2. The method for invoking the device driver function according to claim 1, wherein after sending the execution packet to the second device according to the communication protocol of the second device, so that the second device executes according to the execution packet, further comprising:
receiving a second result message returned by the second equipment;
inquiring the instruction mapping table to obtain a first result message of the first equipment corresponding to the second result message;
and analyzing the first result message according to the message format of the first equipment, and returning an analysis result to an interface driven by the virtual equipment.
3. The method for calling the device driver function according to claim 1, wherein the instruction mapping table is preset by:
acquiring an instruction message set of a device driver of the first device, and recording the instruction message set as a first set;
acquiring an instruction message set of the device driver of the second device, and recording the instruction message set as a second set;
inquiring messages with the same functions as the messages in the second set aiming at the messages in the first set, and recording the messages as mapping messages;
establishing a mapping relation between each message and the mapping message;
and recording the mapping relation corresponding to each message in the first set on a table to generate an instruction mapping table.
4. The method for invoking a device driver function according to claim 1, wherein a mapping relationship between the message of the first device and the message of the second device recorded in the command mapping table is one-to-one or one-to-many.
5. The method for invoking the device driver function according to claim 1, wherein after sending the execution packet to the second device according to the communication protocol of the second device, further comprising:
if receiving information that the second equipment feeds back the execution message is wrong, generating alarm information that the instruction mapping table is wrong;
and sending the alarm information to a specified terminal.
6. The method for calling the device driver function according to any one of claims 1 to 5, wherein the interface of the virtual device driver is an atomic instruction interface, and the device driver interface of the second device is an atomic instruction interface or a sequential instruction interface.
7. An apparatus for invoking a device driver function, comprising:
the command receiving module is used for calling an interface of a virtual device driver and receiving a request command, wherein the virtual device driver is a device driver of the first device;
the first message encapsulation module is used for encapsulating the request instruction according to the message format of the first equipment to obtain a first instruction message;
the execution message query module is used for querying a preset instruction mapping table to obtain an execution message of second equipment corresponding to the first instruction message, the second equipment and the first equipment are the same type of equipment and have the same type of driving function, and the instruction mapping table records the mapping relation between the message of the first equipment and the message of the second equipment;
and the execution message sending module is used for sending the execution message to the second equipment according to the communication protocol of the second equipment so as to enable the second equipment to execute according to the execution message.
8. Calling system of a device driver function, characterized in that the calling system implements a calling method of a device driver function according to any of claims 1 to 6 when running and/or the calling system comprises a calling means of a device driver function according to claim 7.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for calling the device driver function according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements a method of calling the device driver function according to any one of claims 1 to 6.
CN201911099295.1A 2019-11-12 2019-11-12 Method and device for calling device driving function, computer device and system Pending CN112860601A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911099295.1A CN112860601A (en) 2019-11-12 2019-11-12 Method and device for calling device driving function, computer device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911099295.1A CN112860601A (en) 2019-11-12 2019-11-12 Method and device for calling device driving function, computer device and system

Publications (1)

Publication Number Publication Date
CN112860601A true CN112860601A (en) 2021-05-28

Family

ID=75984266

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911099295.1A Pending CN112860601A (en) 2019-11-12 2019-11-12 Method and device for calling device driving function, computer device and system

Country Status (1)

Country Link
CN (1) CN112860601A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1305148A (en) * 1999-11-01 2001-07-25 城市集团发展中心有限公司 Method and system for obtaining equipment service on self operating type financial transaction terminal
CN102292698A (en) * 2009-02-04 2011-12-21 思杰系统有限公司 Methods and systems for automated management of virtual resources in a cloud computing environment
CN103095609A (en) * 2013-01-09 2013-05-08 大唐软件技术股份有限公司 Access adaptive method and device based on Internet of things terminals
CN104348835A (en) * 2014-10-29 2015-02-11 中国建设银行股份有限公司 Message transmission method, self-service equipment and message transmission system
CN104636076A (en) * 2013-11-15 2015-05-20 中国电信股份有限公司 Distributed block device driving method and system for cloud storage
WO2016145797A1 (en) * 2015-07-20 2016-09-22 中兴通讯股份有限公司 Smart home control method, device and system
US20180197170A1 (en) * 2015-09-08 2018-07-12 Alibaba Group Holding Limited Method and device for implementing service function
CN109976173A (en) * 2019-03-18 2019-07-05 中国联合网络通信集团有限公司 Control method, device, equipment and the readable storage medium storing program for executing of smart home device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1305148A (en) * 1999-11-01 2001-07-25 城市集团发展中心有限公司 Method and system for obtaining equipment service on self operating type financial transaction terminal
CN102292698A (en) * 2009-02-04 2011-12-21 思杰系统有限公司 Methods and systems for automated management of virtual resources in a cloud computing environment
CN103095609A (en) * 2013-01-09 2013-05-08 大唐软件技术股份有限公司 Access adaptive method and device based on Internet of things terminals
CN104636076A (en) * 2013-11-15 2015-05-20 中国电信股份有限公司 Distributed block device driving method and system for cloud storage
CN104348835A (en) * 2014-10-29 2015-02-11 中国建设银行股份有限公司 Message transmission method, self-service equipment and message transmission system
WO2016145797A1 (en) * 2015-07-20 2016-09-22 中兴通讯股份有限公司 Smart home control method, device and system
US20180197170A1 (en) * 2015-09-08 2018-07-12 Alibaba Group Holding Limited Method and device for implementing service function
CN109976173A (en) * 2019-03-18 2019-07-05 中国联合网络通信集团有限公司 Control method, device, equipment and the readable storage medium storing program for executing of smart home device

Similar Documents

Publication Publication Date Title
CN106375458B (en) Service calling system, method and device
US6687762B1 (en) Network operating system adapted for simultaneous use by different operating systems
WO2021008413A1 (en) Fault prompting method for internet of things device, and related apparatus
CN104252339A (en) Method and device for developing interface layers and realizing data interaction of interface layers
CN113422686B (en) Gateway layer authentication method, system, electronic device and storage medium
CN112422588B (en) Internet of things equipment information processing method and system
CN111061685A (en) Log query method and device, node equipment and storage medium
CN102779071A (en) Method, device and system for calling software interface
CN111552568A (en) Cloud service calling method and device
EP2442487B1 (en) Location processing method
CN101571811A (en) Information transmission method and device thereof
CN101902458B (en) Interprocess communication method across host machine, device thereof and system thereof
CN101246564A (en) Assets management system based on web service for defining assets with XML
CN111845143B (en) Method and device for printing by handheld device
CN112860601A (en) Method and device for calling device driving function, computer device and system
CN114615321A (en) Traffic processing method and device
CN112529642B (en) Invoice management method, system, equipment and storage medium based on block chain
CN114430392A (en) Method and terminal for connecting Intel network card with Switch to expand internet access
CN109582481B (en) Transmission method, device and equipment of call result and storage medium
CN113177202A (en) Data calling method and system, double-chip sales terminal and readable storage medium
CN113114737B (en) Information sending method and device and server
CN111711660B (en) Method, device, equipment and storage medium for communication between electronic equipment
CN113556399B (en) Message pushing device, system, method, electronic equipment and storage medium
CN116132214A (en) Event transmission method, device, equipment and medium based on event bus model
CN118101838A (en) Third party service protocol answering substituting realization method, terminal equipment and storage medium

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