CN113190261B - Device driving configuration method, device driving method, device and terminal device - Google Patents

Device driving configuration method, device driving method, device and terminal device Download PDF

Info

Publication number
CN113190261B
CN113190261B CN202010037121.9A CN202010037121A CN113190261B CN 113190261 B CN113190261 B CN 113190261B CN 202010037121 A CN202010037121 A CN 202010037121A CN 113190261 B CN113190261 B CN 113190261B
Authority
CN
China
Prior art keywords
instruction
physical
physical equipment
atomic
characteristic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010037121.9A
Other languages
Chinese (zh)
Other versions
CN113190261A (en
Inventor
王庆华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN202010037121.9A priority Critical patent/CN113190261B/en
Publication of CN113190261A publication Critical patent/CN113190261A/en
Application granted granted Critical
Publication of CN113190261B publication Critical patent/CN113190261B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The application is applicable to the technical field of device driving, and provides a device driving configuration method, a device driving method, a device and terminal equipment, wherein the device driving configuration method comprises the steps of classifying physical equipment according to logic functions to obtain logic equipment corresponding to the physical equipment; acquiring an instruction set of a physical device; wherein the instruction set includes all instructions of the physical device; configuring one-to-one atomic instruction interfaces for each instruction to form an atomic instruction interface set; and (3) combining the atomic instruction interface sets of all the physical devices in the same logic device to form a compound instruction interface set. When the SP is maintained, the drive interface of each physical device is not required to be modified, and only the composite instruction interface set of the logic device is required to be logically modified, so that the effects of reducing the code version and reducing the maintenance difficulty are realized.

Description

Device driving configuration method, device driving method, device and terminal device
Technical Field
The application belongs to the technical field of device driving, and particularly relates to a device driving configuration method, a device driving method, a device and terminal equipment.
Background
In the prior art SP (Service Provider) architecture hierarchy, each physical device is designed as an SP module. If two physical devices are required to cooperatively operate to form a group of coherent operation and interaction, the financial self-service terminal control software is required to realize the operation, and one physical device corresponds to one SP module, so that the operation is not easy to realize in an SP layer, and a plurality of additional problems can be caused. If the logic of calling and processing the instruction of the hardware device in the SP interface of a certain logic device needs to be adjusted or modified, each physical device module of the device related to the logic needs to be modified or modified, so that a plurality of module code versions are updated, the modification difficulty and workload are increased, and the greater cost is brought to the subsequent software maintenance.
Disclosure of Invention
The embodiment of the application provides a device driving configuration method, a device driving device and terminal equipment, which can solve the problem that a plurality of code versions are generated in an SP operation and maintenance process.
In a first aspect, an embodiment of the present application provides a device driver configuration method, including:
classifying physical equipment according to logic functions to obtain logic equipment corresponding to the physical equipment;
Acquiring an instruction set of the physical equipment; wherein the instruction set includes all instructions of the physical device;
configuring one-to-one atomic instruction interfaces for each instruction to form an atomic instruction interface set;
and the atomic instruction interface sets of all the physical devices in the same logic device are combined to form a compound instruction interface set.
In a possible implementation manner of the first aspect, the classifying the physical device according to a logic function to obtain a logic device corresponding to the physical device includes:
in the case where the physical device has a plurality of logical functions, the physical device belongs to a plurality of logical devices.
In a possible implementation manner of the first aspect, the merging the atomic instruction interface sets of all physical devices in the same logical device to form a composite instruction interface set includes:
and under the condition that two physical devices in the same logic device have the same atomic instruction interface, unifying the same atomic instruction interface into one atomic instruction interface.
In a second aspect, an embodiment of the present application provides a device driving method, including:
Acquiring parameter information and service flow of physical equipment;
determining a composite instruction interface set corresponding to physical equipment according to parameter information of the physical equipment;
determining a plurality of target atomic instruction interfaces in the composite instruction interface set according to the business flow;
and driving the physical equipment through the determined multiple target atomic instruction interfaces.
In a possible implementation manner of the second aspect, the acquiring physical parameter information includes:
sequentially sending a plurality of characteristic instruction sequences to the physical equipment;
acquiring response information returned by the physical equipment for executing each characteristic instruction sequence;
and determining parameter information of the physical equipment according to the response information.
In a possible implementation manner of the second aspect, the determining, according to the service flow, a plurality of target atomic instruction interfaces in the composite instruction interface set includes:
according to the business flow, determining a plurality of target atomic instruction interfaces which are needed to be used in the compound instruction interface set;
and sequencing the determined multiple target atomic instruction interfaces according to the business flow.
In a third aspect, an embodiment of the present application provides a device driver configuration apparatus, including:
The classification module is used for classifying the physical equipment according to the logic function to obtain logic equipment corresponding to the physical equipment;
the instruction set acquisition module is used for acquiring an instruction set of the physical equipment; wherein the instruction set includes all instructions of the physical device;
the atomic instruction interface set construction module is used for configuring one-to-one atomic instruction interfaces for each instruction to form an atomic instruction interface set;
and the compound instruction interface set construction module is used for carrying out union on the atomic instruction interface sets of all the physical devices in the same type of logic device to form a compound instruction interface set.
In a fourth aspect, an embodiment of the present application provides a device driving apparatus, including:
the parameter information and business process acquisition module is used for acquiring the parameter information and business process of the physical equipment;
the composite instruction interface set determining module is used for determining a composite instruction interface set corresponding to the physical equipment according to the parameter information of the physical equipment;
the target atomic instruction interface acquisition module is used for determining a plurality of target atomic instruction interfaces in the compound instruction interface set according to the business flow;
And the driving module is used for driving the physical equipment through the determined multiple target atomic instruction interfaces.
In a fifth aspect, embodiments of the present application provide a terminal 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 described above when executing the computer program.
In a sixth aspect, embodiments of the present application provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the method described above.
In a seventh aspect, embodiments of the present application provide a computer program product for causing a terminal device to perform the above-described method when the computer program product is run on the terminal device.
It will be appreciated that the advantages of the second to seventh aspects may be found in the relevant description of the first aspect, and are not described here again.
Compared with the prior art, the embodiment of the application has the beneficial effects that:
according to the embodiment of the application, the physical equipment is classified according to logic functions to form logic equipment; then obtaining an instruction set of the physical equipment, wherein the instruction set comprises all instructions of the physical equipment; configuring a corresponding atomic instruction interface for each instruction to form an atomic instruction interface set, wherein each atomic instruction interface comprises a unique instruction; and finally, the atomic instruction interface sets of all the physical devices in the same logic device are combined to form a compound instruction interface set. When the SP is maintained, the drive interface of each physical device is not required to be modified, and only the composite instruction interface set of the logic device is required to be logically modified, so that the effects of reducing the code version and reducing the maintenance difficulty are realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required for the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a device driver configuration method according to an embodiment of the present application;
FIG. 2 is a flow chart of a device driving method according to an embodiment of the present application;
FIG. 3 is a flow chart of a device driving method according to an embodiment of the present application;
FIG. 4 is a flow chart of a device driving method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a device driver configuration apparatus provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a device driving apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a terminal device provided in 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 configurations, 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 should 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 any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In addition, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Reference in the 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 application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
In the SP architecture hierarchy of the prior art, each physical device is designed as an SP module. If two physical devices are required to cooperatively operate to form a group of coherent operation and interaction, the financial self-service terminal control software is required to realize the operation, and one physical device corresponds to one SP module, so that the operation is not easy to realize in an SP layer, and a plurality of additional problems can be caused. If the logic of calling and processing the instruction of the hardware device in the SP interface of a certain logic device needs to be adjusted or modified, each physical device module of the device related to the logic needs to be modified or modified, so that a plurality of module code versions are updated, the modification difficulty and workload are increased, and the greater cost is brought to the subsequent software maintenance.
According to the embodiment of the application, the physical equipment is classified according to logic functions to form logic equipment; then, acquiring an instruction set of the physical device, wherein the instruction set can comprise all instructions of the physical device; configuring a corresponding atomic instruction interface for each instruction to form an atomic instruction interface set, wherein each atomic instruction interface comprises a unique instruction; and finally, the atomic instruction interface sets of all the physical devices in the same logic device are combined to form a compound instruction interface set. When the SP is maintained, the drive interface of each physical device is not required to be modified, and only the composite instruction interface set of the logic device is required to be logically modified, so that the effects of reducing the code version and reducing the maintenance difficulty are realized.
Fig. 1 shows a flow chart of a device driver configuration method according to an embodiment of the present application, which may include, by way of example and not limitation, the following steps:
s101, classifying the physical devices according to the logic functions to obtain the logic devices corresponding to the physical devices.
Specifically, the physical devices may be categorized into corresponding logical devices according to the design of the logical devices by WOSA (Windows Open System Architecture ) protocol according to the logical functions that the physical devices are capable of providing.
In one embodiment of the present application, for a physical device having multiple logical device functions, the physical device is divided according to the multiple logical devices according to the total function of the physical device, and the physical device is simultaneously attributed to the multiple logical devices. For the logic device which is not designed by the WOSA protocol, the commonality extraction can be carried out according to the function of the physical device, and the logic device of the physical device is designed.
S102, acquiring an instruction set of the physical equipment.
Wherein the instruction set includes all instructions of the physical device.
Specifically, all executable instructions of the physical device may be obtained through the instructional material of the physical device, forming an instruction set.
S103, configuring one-to-one atomic instruction interfaces for each instruction to form an atomic instruction interface set.
Specifically, the SP system or the device driver interacts with the physical device once to form software function interfaces, called atomic instruction interfaces, each of which only includes a corresponding instruction. And configuring a corresponding atomic instruction interface for each instruction in the instruction set of the physical equipment to form an atomic instruction interface set.
S104, the atomic instruction interface sets of all physical devices in the same logic device are combined to form a compound instruction interface set.
Specifically, an atomic instruction interface set corresponding to the physical device is obtained through step S103, and then the atomic instruction interface sets of all the physical devices belonging to the same logic device are combined to form a composite instruction interface set.
Exemplary, physical device A, physical device B and physical device C belong to the same logical device, and the atomic instruction interface set of physical device A is U A = { a1, a2, a3, a4, a5}, the atomic instruction interface set of physical device B is U B = { b1, b2, b3, b4, b5}, atomic instruction interface set of physical device C is U B = { c1, c2, c3, c4, c5}, the complex instruction interface set corresponding to the logic device is { a1, a2, a3, a4, a5, b1, b2, b3, b4, b5, c1, c2, c3, c4, c5}.
In one embodiment of the present application, in the case where two physical devices in the same logical device have the same atomic instruction interface, the same atomic instruction interface is unified into one atomic instruction interface.
Specifically, the same logic device may include a plurality of physical devices, and if the plurality of physical devices have the same atomic instruction interfaces, the same atomic instruction interfaces are unified into one atomic instruction interface, and the unified atomic instruction interface may drive the physical devices to execute corresponding actions.
The logic device is a printing device, the printing device includes a printing device a, a printing device B, and a printing device C, and the printing interfaces of the three printing devices may be unified as an atomic instruction interface (r), and the atomic instruction interface (r) may drive the printing device a, the printing device B, and the printing device C to perform printing actions.
According to the device driving configuration method, through designing the composite instruction interface set of the logic device, when the SP is maintained, the driving interface of each physical device is not required to be modified, and only the composite instruction interface set of the logic device is required to be logically modified, so that the effects of reducing code version and maintenance difficulty are achieved, and the operation and maintenance cost is reduced.
Fig. 2 shows a schematic flow chart of a device driving method according to an embodiment of the present application, which may include, by way of example and not limitation, the following steps:
s201, acquiring parameter information and business processes of the physical equipment.
For example, referring to fig. 3, acquiring parameter information of a physical device may include:
and S2011, sequentially sending a plurality of characteristic instruction sequences to the physical equipment.
Specifically, each characteristic command sequence can be correctly executed by a unique physical device, and because the communication modes between different physical devices and the server are different, in order to ensure that the physical devices can receive the characteristic command sequences, the characteristic command sequences can be sent to the physical devices in a plurality of communication modes, and the communication modes can be selected from USB communication, serial port communication, wireless 2.4G communication, wireless Bluetooth communication, wireless 433 communication, wireless zegbee communication, wireless WiFi communication and other communication modes.
For example, referring to fig. 4, step S2011 may specifically include:
s20111, acquiring a physical device identification instruction.
Specifically, the physical device identification instruction may be automatically generated by an external device or may be generated by a manual input.
S20112, determining a plurality of communication modes and a plurality of characteristic instruction sequences according to the physical equipment identification instruction.
Specifically, a plurality of communication modes and a plurality of characteristic instruction sequences can be stored in a database in advance, and when the physical equipment is identified, the required plurality of communication modes and the required plurality of characteristic instruction sequences are called in the database. The selected plurality of characteristic instruction sequences can be all characteristic instruction sequences in a database or part of characteristic instruction sequences; likewise, the selected multiple communication modes can be all data communication modes in the database, or can be partial communication modes.
When the physical device is a printer of a certain brand and model, the communication mode and the feature instruction sequence corresponding to the printer can be selected, namely, part of the communication modes and part of the feature instruction sequences in the database are selected, and the speed of identifying the physical device can be improved because the number of the selected communication modes and the number of the feature instruction sequences are small.
Meanwhile, when the physical equipment is identified, all communication modes and characteristic instruction sequences in the database can be selected, and the mode has the advantage that all the physical equipment can be identified.
And S20113, sequentially sending all characteristic instruction sequences to the physical equipment in each communication mode.
Specifically, the method that multiple communication modes and multiple characteristic instruction sequences are combined one by one sends the characteristic instruction sequences to the physical equipment, so that each characteristic instruction sequence can be received by the physical equipment, and the phenomenon that the physical equipment cannot recognize because the physical equipment does not receive the corresponding characteristic instruction sequences and cannot return response information or the returned response information is not matched with preset response information can be prevented.
Illustratively, the plurality of communication modes respectively include: communication mode a, communication mode B, and communication mode C, the plurality of characteristic instruction sequences each include: a characteristic instruction sequence a, a characteristic instruction sequence b and a characteristic instruction sequence c. When a characteristic instruction sequence is sent to the physical equipment, 9 combinations are formed by three communication modes and three characteristic instruction sequences, and the characteristic instruction sequence a is sent to the physical equipment in a communication mode A, a communication mode B and a communication mode C respectively; the characteristic instruction sequence B is sent to the physical equipment in a communication mode A, a communication mode B and a communication mode C respectively; and transmitting the characteristic instruction sequence C to the physical device in a communication mode A, a communication mode B and a communication mode C respectively. The characteristic instruction sequences are sent to the physical equipment in a mode of combining a plurality of communication modes and a plurality of characteristic instruction sequences one by one.
The feature instruction sequence sent to the physical device in step S2011) can be correctly executed by the physical device with only the device brand and model, for example, the feature instruction sequence includes a plurality of instructions that can be executed by the physical device, and the feature instruction sequence and the parameter information of the physical device are in a one-to-one correspondence relationship, so that the corresponding parameter information can be obtained as long as the physical device can correctly execute the feature instruction sequence, thereby realizing the identification of the physical device.
In one embodiment of the present application, an instruction set of the physical device is obtained in step S102, and then a plurality of instructions in the instruction set are selected to form a characteristic instruction sequence.
Specifically, selecting the characteristic instruction sequences formed by the instructions in the instruction set of the physical equipment needs to refer to the instruction sets of other physical equipment, so that the instructions in the characteristic instruction sequences corresponding to each physical equipment cannot be identical to the instructions in the instruction sets of other physical equipment, and the created characteristic instruction sequences can be ensured to be correctly executed by the unique physical equipment.
Illustratively, three printers are exemplified, printer A has an executable instruction set { a, B, g, h, i, j, k }, printer B has an instruction set { a, B, C, d, e, f, g, h }, and printer C has an instruction set { C, d, e, f, g, h, i, j, k }.
In this embodiment, it may be determined that the characteristic instruction sequence of the printer a is { a, h, i }, the printer B cannot execute the instruction i, and the printer C cannot execute the instruction a; determining that the characteristic instruction sequence of the printer B is { a, d }, the printer A cannot execute the instruction d, and the printer C cannot execute the instruction a; the characteristic instruction sequence of the printer C is determined as { d, i }, the printer a cannot execute the instruction d, and the printer B cannot execute the instruction i.
Respectively sending characteristic instruction sequences { a, h, i }, { a, d } and { d, i } to the physical equipment, and if the physical equipment successfully executes the characteristic instruction sequences { a, h, i }, determining that the physical equipment is a printer A; if the physical equipment executes the characteristic instruction sequence { a, d } successfully, determining that the physical equipment is a printer B; if the physical device executes the characteristic instruction sequence { d, i } successfully, the physical device is determined to be the printer C. The automatic identification of the equipment is realized through the method.
When the instruction is selected, the instruction with high success rate and high execution speed of the physical equipment is selected, so that the identification speed of the physical equipment is improved. Meanwhile, other physical devices cannot damage or generate side effects when executing the selected instruction, so that the other physical devices cannot damage when executing the instruction.
In one embodiment of the present application, the service flow obtained in step S201 may be command information of the physical device, where the command information may control the physical device to perform a series of actions to meet the actual service requirement.
And S2012, response information returned by the physical equipment for executing each characteristic instruction sequence is acquired.
Specifically, each characteristic instruction sequence executed by the physical device returns a response message, and the response message may be a level signal (high-low level) or a code. After receiving the response information, matching the received response information with preset response information, judging whether the execution result of the feature instruction sequence executed by the physical equipment is correct or not, and when the response information is successfully matched with the preset response information, indicating that the feature instruction sequence executed by the physical equipment is successful, otherwise, failing to execute the feature instruction sequence by the physical equipment.
S2013, determining parameter information of the physical equipment according to the response information.
In one embodiment of the present application, when the response information is successfully matched with the preset response information, determining a feature instruction sequence corresponding to the response information as a target feature instruction sequence, traversing a database according to the target feature instruction sequence, and determining parameter information of the physical device.
Specifically, if the response information is successfully matched with the preset response information, the physical equipment is indicated to be capable of executing the characteristic instruction sequence, the characteristic instruction sequence which is successfully executed by the physical equipment is determined to be used as the target characteristic instruction sequence, and then corresponding parameter information is found in the database according to the target characteristic instruction sequence, so that the determination of the parameter information of the physical equipment is completed.
For example, step S2013 may specifically include:
and A, acquiring preset response information, parameter information and characteristic instruction sequences of the physical equipment.
And B, associating and storing preset response information, parameter information and characteristic instruction sequences corresponding to the same physical equipment.
Specifically, the preset response information, parameter information and characteristic instruction sequences of the physical equipment are associated and then stored, and identification data of the physical equipment is established in advance to provide data for physical equipment identification.
S202, determining a composite instruction interface set corresponding to the physical equipment according to the parameter information of the physical equipment.
Specifically, parameter information corresponding to the physical device and associated information of the logic device can be established in the database in advance, the attribution logic device is determined according to the parameter information of the physical device, and then a compound instruction interface set corresponding to the logic device is determined.
S203, determining a plurality of target atomic instruction interfaces in the composite instruction interface set according to the business flow.
Specifically, by analyzing the business flow, the atomic instruction interfaces needed to be used are determined in the compound instruction interface set, and the atomic instruction interfaces are ordered according to the business flow requirements to form a driver for controlling the physical equipment.
S204, driving the physical device through the determined multiple target atomic instruction interfaces.
Specifically, a plurality of target atomic instruction interfaces are determined in step S203, and are sequenced according to the logic requirements of the service flow, and instructions are sent to the physical device according to the sequence through the plurality of atomic instruction interfaces, so as to drive the physical device to act, thereby realizing the service requirements.
In order to clearly illustrate the operation of the device driving method, a specific embodiment will be described below.
Taking two printers as examples, namely a first printer and a second printer, wherein the instruction set of the first printer is shown in table 1, and the instruction set of the second printer is shown in table 2.
Table 1 instruction set of printer a
Instructions for Brief description of the drawings Function type
D Knowing whether the printer is currently in the form of paper Detection of
P Performing a printing operation Printing
K Pad print data command Data
M Pad print execution buffered print command Data
Q Flushing print buffer data commands Data
I Detecting whether parts of the printer are normal Printing
F Quick line change Paper feeding device
W Setting word spacing Word spacing
E Setting the color of a printed character Printing
V Take version number Version number
Table 2 instruction set of Printer B
Instructions for Brief description of the drawings Function type
D Knowing whether the printer is currently in the form of paper Detection of
P Performing a printing operation Printing
I Detecting whether parts of the printer are normal Printing
C Detecting black strips and cutting paper Paper cutting
W Setting word spacing Word spacing
F Quick line change Paper feeding device
L Setting row spacing Line spacing
G Quick paper feeding Paper feeding device
B Printing bitmaps Printing
V Take version number Version number
The instruction set of the first printer and the instruction set of the second printer can be obtained from the tables 1 and 2, the atomic instruction interfaces are configured for each instruction of the first printer and the second printer to form respective corresponding atomic instruction interface sets, and then the atomic instruction interfaces of the two printers are combined to form a union set to form a composite instruction interface set. The formed composite instruction interface set comprises:
1) Detecting whether paper exists in the current state of the printer (common to A and B);
2) Performing a printing operation (a-b sharing);
3) Detecting whether each part of the printer is normal (common to A and B);
4) Quick line feed (common to both a and b);
5) Setting row spacing (no second for a);
6) Setting the color (presence or absence of a first) of the printed character;
7) Setting a word pitch (common to A and B);
8) Slice version number (shared by A and B);
9) Printing a bitmap (A has no B);
10 Fast paper feeding (no second one);
11 Filling in a print data command (presence or absence of a b);
12 Filling print execution buffer print command (presence or absence of a) or not;
13 A print buffer data command (a presence or absence of b);
14 Black bars were detected and cut (no b for a).
When the first printer or the second printer is driven, the needed atomic instruction interfaces can be selected from 14 atomic instruction interfaces in the composite instruction interface set according to the business flow, and the first printer or the second printer is driven by sequencing according to the business flow.
For example, the printer B is driven to print, and the following instructions can be selected from the composite instruction interface set of the logic device:
0) Printing is started;
1) Setting a word interval;
2) Setting row spacing;
3) Detecting whether each part of the printer is normal;
4) Detecting whether paper exists in the current state of the printer;
5) Performing a printing operation;
6) And (5) finishing printing.
When driving a plurality of printing devices, if a certain atomic instruction interface does not exist in the composite instruction interface set of the logic device, the code of the composite instruction interface set can be modified, and the corresponding atomic instruction interface is added to meet the driving of the physical device. And each physical device does not need to be modified by codes, so that the generation of code versions is reduced, and the maintenance difficulty is reduced.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not limit the implementation process of the embodiment of the present application in any way.
Corresponding to the device driving configuration method described in the above embodiments, fig. 5 shows a schematic structural diagram of the device driving configuration apparatus provided in the embodiment of the present application, and for convenience of explanation, only the portion relevant to the embodiment of the present application is shown.
Referring to fig. 5, the device driver configuration apparatus in the embodiment of the present application may include a classification module 51, an instruction set acquisition module 52, an atomic instruction interface set building module 53, and a compound instruction interface set building module 54.
The classification module 51 is configured to classify physical devices according to logic functions, so as to obtain logic devices corresponding to the physical devices;
an instruction set acquisition module 52, configured to acquire an instruction set of the physical device; wherein the instruction set includes all instructions of the physical device;
an atomic instruction interface set construction module 53, configured to configure an atomic instruction interface corresponding to each instruction one by one, so as to form an atomic instruction interface set;
and the compound instruction interface set construction module 54 is configured to perform union on atomic instruction interface sets of all physical devices in the same logic device to form a compound instruction interface set.
Alternatively, the classification module 51 may include a classification unit.
The classification unit is configured to, when the physical device has a plurality of logic functions, make the physical device belong to a plurality of logic devices.
Alternatively, the compound instruction interface set building block 54 may include an atomic instruction interface unifying unit.
The atomic instruction interface unifying unit is used for unifying the same atomic instruction interface into one atomic instruction interface under the condition that two physical devices in the same logic device have the same atomic instruction interface.
Fig. 6 shows a schematic structural diagram of the device driving apparatus provided in the embodiment of the present application, corresponding to the device driving method described in the above embodiment, and only the portion relevant to the embodiment of the present application is shown for convenience of explanation.
Referring to fig. 6, the device driver in the embodiment of the present application may include a parameter information and business process acquiring module 61, a compound instruction interface set determining module 62, a target atomic instruction interface acquiring module 63, and a driver module 64.
The parameter information and service flow obtaining module 61 is configured to obtain parameter information and service flow of the physical device;
the compound instruction interface set determining module 62 is configured to determine a compound instruction interface set corresponding to a physical device according to parameter information of the physical device;
a target atomic instruction interface obtaining module 63, configured to determine a plurality of target atomic instruction interfaces in the composite instruction interface set according to the service flow;
a driving module 64, configured to drive the physical device through the determined multiple target atomic instruction interfaces.
Alternatively, the parameter information and business process acquiring module 61 may include a feature instruction sequence transmitting unit, a response information acquiring unit, and a parameter information acquiring unit.
The physical equipment comprises a characteristic instruction sequence sending unit, a characteristic instruction sequence sending unit and a characteristic instruction sequence sending unit, wherein the characteristic instruction sequence sending unit is used for sequentially sending a plurality of characteristic instruction sequences to the physical equipment;
the response information acquisition unit is used for acquiring response information returned by the physical equipment for executing each characteristic instruction sequence;
and the parameter information acquisition unit is used for determining the parameter information of the physical equipment according to the response information.
Alternatively, the target atomic instruction interface acquiring module 63 may include a target atomic instruction interface determining unit and an ordering unit.
The target atomic instruction interface determining unit is used for determining a plurality of target atomic instruction interfaces needed to be used in the compound instruction interface set according to the business flow;
and the ordering unit is used for ordering the determined multiple target atomic instruction interfaces according to the business flow.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein again.
The device driver configuration apparatus shown in fig. 5 and the device driver apparatus shown in fig. 6 may be software units, hardware units, or units combined with each other, which are built into the existing terminal device, may be integrated into the terminal device as separate components, or may exist as separate terminal devices.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a 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 process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Fig. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 7, the terminal device 7 of this embodiment may include: at least one processor 70 (only one processor 70 is shown in fig. 7), a memory 71 and a computer program 72 stored in the memory 71 and executable on the at least one processor 70, the processor 70, when executing the computer program 72, performing the steps of any of the various method embodiments described above, e.g. steps S101 to S104 in the embodiment shown in fig. 1, and steps S201 to 204 in the embodiment shown in fig. 2. Alternatively, the processor 70, when executing the computer program 72, performs the functions of the modules/units of the apparatus embodiments described above, such as the functions of the modules 51 to 54 shown in fig. 5, and the functions of the modules 61 to 64 shown in fig. 6.
By way of example, the computer program 72 may be partitioned into one or more modules/units that are stored in the memory 71 and executed by the processor 70 to complete the present invention. The one or more modules/units may be a series of instruction segments of the computer program 72 capable of performing a specific function for describing the execution of the computer program 72 in the terminal device 7.
The terminal device 7 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The terminal device 7 may include, but is not limited to, a processor 70, a memory 71. It will be appreciated by those skilled in the art that fig. 7 is merely an example of the terminal device 7 and is not limiting of the terminal device 7, and may include more or fewer components than shown, or may combine certain components, or different components, such as may also include input-output devices, network access devices, etc.
The processor 70 may be a central processing unit (Central Processing Unit, CPU) and the processor 70 may be other general purpose processors, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may in some embodiments be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7. The memory 71 may in other embodiments also be an external storage device of the terminal device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the terminal device 7. The memory 71 is used for storing an operating system, application programs, boot loader (BootLoader), data, other programs, etc., such as program code of the computer program 72. The memory 71 may also be used for temporarily storing data that has been output or is to be output.
The present embodiments also provide a computer readable storage medium storing a computer program 72, which computer program 72, when executed by a processor 70, implements steps that may be implemented in the various method embodiments described above.
Embodiments of the present application provide a computer program product which, when run on a mobile terminal, causes the mobile terminal to perform steps that may be performed in the various method embodiments described above.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. With this understanding, the present application implements all or part of the flow of the method of the above-described embodiments, and may be implemented by a computer program 72 to instruct related hardware, where the computer program 72 may be stored in a computer readable storage medium, and the computer program 72, when executed by the processor 70, may implement the steps of the method embodiments described above. The computer program 72 comprises computer program code, which may be in the form of source code, object code, executable files, or some intermediate form, among others. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a terminal device, a recording medium, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
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 solution. 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 manners. For example, the apparatus/network device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (9)

1. A device driver configuration method, comprising:
classifying physical equipment according to logic functions to obtain logic equipment corresponding to the physical equipment;
acquiring an instruction set of the physical equipment; wherein the instruction set includes all instructions of the physical device;
Selecting a plurality of instruction component characteristic instruction sequences in an instruction set of the physical device; each of the characteristic sequences of instructions being capable of being correctly executed by a unique physical device;
configuring one-to-one atomic instruction interfaces for each instruction to form an atomic instruction interface set;
and the atomic instruction interface sets of all the physical devices in the same logic device are combined to form a compound instruction interface set.
2. The device driving configuration method according to claim 1, wherein the classifying the physical devices according to the logic functions to obtain the logic devices corresponding to the physical devices, includes:
in the case where the physical device has a plurality of logical functions, the physical device belongs to a plurality of logical devices.
3. The device driver configuration method of claim 1, wherein the merging the atomic instruction interface sets of all physical devices in the same logical device to form a composite instruction interface set includes:
and under the condition that two physical devices in the same logic device have the same atomic instruction interface, unifying the same atomic instruction interface into one atomic instruction interface.
4. A device driving method, characterized by comprising:
acquiring parameter information and service flow of physical equipment;
determining a composite instruction interface set corresponding to physical equipment according to parameter information of the physical equipment;
determining a plurality of target atomic instruction interfaces in the composite instruction interface set according to the business flow;
driving the physical device through the determined multiple target atomic instruction interfaces;
the obtaining physical parameter information includes:
sequentially sending a plurality of characteristic instruction sequences to the physical equipment; the characteristic instruction sequences are instruction sequences formed by selecting a plurality of instructions in an instruction set of the physical equipment, and each characteristic instruction sequence can be correctly executed by the unique physical equipment;
acquiring response information returned by the physical equipment for executing each characteristic instruction sequence;
and determining parameter information of the physical equipment according to the response information.
5. The device driving method according to claim 4, wherein determining a plurality of target atomic instruction interfaces in the composite instruction interface set according to the business process includes:
according to the business flow, determining a plurality of target atomic instruction interfaces which are needed to be used in the compound instruction interface set;
And sequencing the determined multiple target atomic instruction interfaces according to the business flow.
6. A device driver configuration apparatus, comprising:
the classification module is used for classifying the physical equipment according to the logic function to obtain logic equipment corresponding to the physical equipment;
the instruction set acquisition module is used for acquiring an instruction set of the physical equipment; wherein the instruction set includes all instructions of the physical device;
selecting a plurality of instruction component characteristic instruction sequences in an instruction set of the physical device; each of the characteristic sequences of instructions being capable of being correctly executed by a unique physical device;
the atomic instruction interface set construction module is used for configuring one-to-one atomic instruction interfaces for each instruction to form an atomic instruction interface set;
and the compound instruction interface set construction module is used for carrying out union on the atomic instruction interface sets of all the physical devices in the same type of logic device to form a compound instruction interface set.
7. A device driving apparatus, comprising:
the parameter information and business process acquisition module is used for acquiring the parameter information and business process of the physical equipment;
the composite instruction interface set determining module is used for determining a composite instruction interface set corresponding to the physical equipment according to the parameter information of the physical equipment;
The target atomic instruction interface acquisition module is used for determining a plurality of target atomic instruction interfaces in the compound instruction interface set according to the business flow;
the driving module is used for driving the physical equipment through the determined multiple target atomic instruction interfaces;
the parameter information and business flow acquisition module comprises a characteristic instruction sequence sending unit, a response information acquisition unit and a parameter information acquisition unit;
the characteristic instruction sequence sending unit is used for sequentially sending a plurality of characteristic instruction sequences to the physical equipment; the characteristic instruction sequences are instruction sequences formed by selecting a plurality of instructions in an instruction set of the physical equipment, and each characteristic instruction sequence can be correctly executed by the unique physical equipment;
the response information acquisition unit is used for acquiring response information returned by the physical equipment for executing each characteristic instruction sequence;
and the parameter information acquisition unit is used for determining the parameter information of the physical equipment according to the response information.
8. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 5 when executing the computer program.
9. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method according to any one of claims 1 to 5.
CN202010037121.9A 2020-01-14 2020-01-14 Device driving configuration method, device driving method, device and terminal device Active CN113190261B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010037121.9A CN113190261B (en) 2020-01-14 2020-01-14 Device driving configuration method, device driving method, device and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010037121.9A CN113190261B (en) 2020-01-14 2020-01-14 Device driving configuration method, device driving method, device and terminal device

Publications (2)

Publication Number Publication Date
CN113190261A CN113190261A (en) 2021-07-30
CN113190261B true CN113190261B (en) 2024-03-29

Family

ID=76972471

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010037121.9A Active CN113190261B (en) 2020-01-14 2020-01-14 Device driving configuration method, device driving method, device and terminal device

Country Status (1)

Country Link
CN (1) CN113190261B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115048157B (en) * 2022-08-12 2022-11-11 南方电网数字电网研究院有限公司 Independent controllable power distribution control module based on special chip

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1737779A (en) * 2005-09-08 2006-02-22 中国工商银行 Method and system for expanding peripherals
CN103577327A (en) * 2013-11-13 2014-02-12 北京像素软件科技股份有限公司 Method and device for processing disassembling results
CN105740176A (en) * 2016-01-31 2016-07-06 吴林 Universal digital modeling method for hardware device
CN108415785A (en) * 2018-03-07 2018-08-17 深圳市证通电子股份有限公司 Self-aided terminal SP implementation methods, terminal device and readable storage medium storing program for executing

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070156587A1 (en) * 2000-01-06 2007-07-05 Super Talent Electronics Inc. Content Protection Using Encryption Key Embedded with Content File
US8281084B2 (en) * 2003-01-13 2012-10-02 Emlilex Design & Manufacturing Corp. Method and interface for access to memory within a first electronic device by a second electronic device
JP2006285464A (en) * 2005-03-31 2006-10-19 Hitachi Ltd Computer system, storage, and device control method
US20140297922A1 (en) * 2013-03-29 2014-10-02 Nitin V. Sarangdhar Method and apparatus for managing serial peripheral interface (spi) flash

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1737779A (en) * 2005-09-08 2006-02-22 中国工商银行 Method and system for expanding peripherals
CN103577327A (en) * 2013-11-13 2014-02-12 北京像素软件科技股份有限公司 Method and device for processing disassembling results
CN105740176A (en) * 2016-01-31 2016-07-06 吴林 Universal digital modeling method for hardware device
CN108415785A (en) * 2018-03-07 2018-08-17 深圳市证通电子股份有限公司 Self-aided terminal SP implementation methods, terminal device and readable storage medium storing program for executing

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
Building automation systems: Concepts and technology review;Pedro Domingues 等;《Computer Standards & Interfaces》;20160331;第45卷;1-12 *
基于FPGA和ARM的现场总线设备;廖世高等;《计算机工程》;20110228(第04期);255-257+266 *
基于Linux抄表集中器硬件设计与实现;吴辉;《中国优秀硕士学位论文全文数据库(工程科技Ⅱ辑)》;20150315(第03期);C042-1184 *
基于嵌入式系统的网络化高速数据采集平台的设计;阳军;《中国优秀硕士学位论文全文数据库(信息科技辑)》;20180515(第05期);I140-259 *
星载软件中间件基本服务层的建模与实现;陈洲;《中国优秀硕士学位论文全文数据库(工程科技Ⅱ辑)》;20180115(第01期);C031-441 *

Also Published As

Publication number Publication date
CN113190261A (en) 2021-07-30

Similar Documents

Publication Publication Date Title
CN111045933B (en) Regression strategy updating method and device, storage medium and terminal equipment
CN112597153B (en) Block chain-based data storage method, device and storage medium
CN104503840A (en) Method and device for optimizing terminal resources
CN113190261B (en) Device driving configuration method, device driving method, device and terminal device
CN111796937B (en) Memory-based resource allocation method, computer equipment and storage medium
EP3722945A1 (en) Program operation system and program operation method
CN116185588A (en) Task scheduling method and device, electronic equipment and readable storage medium
CN109327499B (en) Service interface management method and device, storage medium and terminal
CN116089477B (en) Distributed training method and system
CN114745452B (en) Equipment management method and device and electronic equipment
CN113190277A (en) Equipment identification method, equipment identification device and terminal equipment
CN115643172A (en) Abnormity detection method, abnormity detection device, terminal equipment and storage medium
CN112667631B (en) Automatic editing method, device, equipment and storage medium for business field
CN114598547A (en) Data analysis method applied to network attack recognition and electronic equipment
CN108460078B (en) Auxiliary function execution method and device, storage medium and terminal
CN113723555A (en) Abnormal data detection method and device, storage medium and terminal
CN115687223A (en) Method and device for serial port communication of embedded equipment, embedded equipment and storage medium
CN112783450A (en) Self-service information reading, distributing and printing method and device for delivery documents
CN112650523A (en) Data distribution method, device and equipment for gray scale release
CN112184027A (en) Task progress updating method and device and storage medium
CN111679799A (en) Voucher printing method and device
CN110716778A (en) Application compatibility testing method, device and system
CN114707954B (en) Information management method and system of enterprise intelligent platform
CN113190185A (en) Application program and physical equipment matching method and device and terminal equipment
CN113792014B (en) Nuclear power station file management method and device, 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
GR01 Patent grant
GR01 Patent grant