CN113254029B - Peripheral interface setting method and device of terminal equipment and electronic equipment - Google Patents
Peripheral interface setting method and device of terminal equipment and electronic equipment Download PDFInfo
- Publication number
- CN113254029B CN113254029B CN202011629428.4A CN202011629428A CN113254029B CN 113254029 B CN113254029 B CN 113254029B CN 202011629428 A CN202011629428 A CN 202011629428A CN 113254029 B CN113254029 B CN 113254029B
- Authority
- CN
- China
- Prior art keywords
- peripheral interface
- equipment
- node identifier
- driver
- equipment node
- 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
Links
- 230000002093 peripheral effect Effects 0.000 title claims abstract description 158
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000004590 computer program Methods 0.000 claims description 17
- 238000009434 installation Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 9
- 238000012545 processing Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 5
- 230000009471 action Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/40—Bus structure
- G06F13/4063—Device-to-bus coupling
- G06F13/4068—Electrical coupling
- G06F13/4072—Drivers or receivers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4204—Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus
- G06F13/4221—Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being an input/output bus, e.g. ISA bus, EISA bus, PCI bus, SCSI bus
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0024—Peripheral component interconnect [PCI]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0042—Universal serial bus [USB]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the invention provides a peripheral interface setting method, a device, electronic equipment and a storage medium of terminal equipment, wherein the terminal equipment comprises a peripheral interface, the peripheral interface is provided with a corresponding equipment node identifier, and the method comprises the following steps: installing a device driver in the terminal device; updating the equipment node identifier of the peripheral interface into a designated equipment node identifier according to the equipment driver; and if the equipment node identification of the peripheral interface fails to update, linking the equipment node identification of the peripheral interface to the appointed equipment node identification. In the embodiment of the invention, the equipment node identifier of the peripheral interface is updated or linked to the appointed equipment node identifier, so that the application program can operate the peripheral interface of the terminal equipment through the appointed equipment node, and the compatibility and stability of the application program to the peripheral interface are realized.
Description
Technical Field
The present invention relates to the field of automation technologies, and in particular, to a method for setting a peripheral interface of a terminal device, an apparatus for setting a peripheral interface of a terminal device, an electronic device, and a storage medium.
Background
At present, domestic automation equipment, such as components of a financial self-service terminal in the financial industry, mostly realize domestic design and production, and drivers of related hardware equipment can be automatically developed in most domestic places, including industrial control hosts of domestic computers. Taking the whole machine main industrial control in the financial self-service terminal as an example, the applicable domestic processor mainly comprises a Loongson (MIPS architecture), (Alpha architecture), feiteng and Kunpeng (ARM architecture) and an X86 architecture.
For peripheral interfaces of the industrial control host, because there are many external interfaces on the industrial control host, for example, there may be multiple ps/2 interfaces, serial interfaces, wireless interfaces, USB interfaces, etc., so that an upper layer application program and a linux driver cannot set each peripheral interface name to a device node name, for example, a device node name of a serial interface may have ttyS0, ttyS1, or ttyxusb 1, ttyxusb 2, ttyxusb 3, … ….
However, in practical applications, many peripheral interfaces are often encountered, for example, there are 12 serial interfaces and 10 USB interfaces, and the device node names of each peripheral interface are different, which is also the case when an application program under one system architecture operates the peripheral interfaces, and since the peripheral interfaces are defined and differentiated in different system architectures, if multiple system architectures, for example, there are two system architectures including an ARM and a loongson, there are more device node names, so that the application program is not compatible with these peripheral interfaces.
Disclosure of Invention
In view of the foregoing, embodiments of the present invention are directed to providing a peripheral interface setting method of a terminal device and a peripheral interface setting apparatus of a corresponding terminal device, an electronic device, and a storage medium, which overcome or at least partially solve the foregoing problems.
In order to solve the above problems, an embodiment of the present invention discloses a method for setting a peripheral interface of a terminal device, where the terminal device includes a peripheral interface, and the peripheral interface has a corresponding device node identifier, and the method includes:
installing a device driver in the terminal device;
updating the equipment node identifier of the peripheral interface into a designated equipment node identifier according to the equipment driver;
and if the equipment node identification of the peripheral interface fails to update, linking the equipment node identification of the peripheral interface to the appointed equipment node identification.
Optionally, before the installation of the device driver in the terminal device, the method further includes:
inquiring original equipment drivers in the terminal equipment;
judging whether the original equipment driver is a designated equipment driver or not;
if the original device driver is not the appointed device driver, unbinding the original device driver and removing the original device node identifier of the peripheral interface.
Optionally, the linking the device node identifier of the peripheral interface to the designated device node identifier includes:
and linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier in a hard link mode.
Optionally, the linking the device node identifier of the peripheral interface to the designated device node identifier includes:
and linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier in a soft link mode.
Optionally, after the linking the device node identifier of the peripheral interface to the specified device node identifier, the method further comprises:
receiving a call instruction sent by an application program, wherein the call instruction comprises the designated equipment node identifier;
and calling the peripheral interface of the terminal equipment corresponding to the designated equipment node identifier according to the calling instruction.
The embodiment of the invention discloses a peripheral interface setting device of terminal equipment, wherein the terminal equipment comprises a peripheral interface, the peripheral interface is provided with a corresponding equipment node identifier, and the device comprises:
an installation module for installing a device driver in the terminal device;
the updating module is used for updating the equipment node identifier of the peripheral interface into a designated equipment node identifier according to the equipment driver;
and the link module is used for linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier if the equipment node identifier of the peripheral interface fails to be updated.
Optionally, the apparatus further comprises: the inquiry module is used for inquiring the original equipment driver in the terminal equipment; the judging module is used for judging whether the original equipment driver is a designated equipment driver or not; and the unbinding module is used for unbinding the original equipment driver and removing the original equipment node identifier of the peripheral interface if the original equipment driver is not the appointed equipment driver.
Optionally, the linking module includes: and the hard link sub-module is used for linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier in a hard link mode.
Optionally, the linking module includes: and the soft link sub-module is used for linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier in a soft link mode.
Optionally, the apparatus further comprises: the receiving module is used for receiving a calling instruction sent by an application program, wherein the calling instruction comprises the designated equipment node identification; and the access module is used for calling the peripheral interface of the terminal equipment corresponding to the designated equipment node identifier according to the calling instruction.
The embodiment of the invention discloses an electronic device, which comprises a processor, a memory and a computer program stored on the memory and capable of running on the processor, wherein the computer program realizes the steps of the peripheral interface setting method of the terminal device when being executed by the processor.
The embodiment of the invention discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program realizes the steps of the peripheral interface setting method of the terminal equipment when being executed by a processor.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, a device driver is installed in a terminal device, and a device node identifier of a peripheral interface is updated to a designated device node identifier according to the device driver, wherein if the update of the device node identifier of the peripheral interface fails, the device node identifier of the peripheral interface is linked to the designated device node identifier. In the embodiment of the invention, the equipment node identifier of the peripheral interface is updated or linked to the appointed equipment node identifier, so that the application program can operate the peripheral interface of the terminal equipment through the appointed equipment node, and the compatibility and stability of the application program to the peripheral interface are realized.
Drawings
Fig. 1 is a flowchart showing steps of an embodiment of a peripheral interface setting method of a terminal device according to the present invention;
fig. 2 is a flowchart showing steps of an embodiment of a peripheral interface setting method of another terminal device of the present invention;
FIG. 3 is a flow chart of a peripheral interface arrangement of the present invention;
FIG. 4 is a schematic flow diagram of a hard link of the present invention;
FIG. 5 is a flow chart of a soft link of the present invention;
fig. 6 is a block diagram showing the configuration of an embodiment of a peripheral interface setting apparatus of a terminal device according to the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
In a related scenario, the interface node operation (such as serial port 0: ttys 0) is usually performed for a specific peripheral interface, for example, a common function of file I/O (input/output) is an open function, which is used to open a peripheral interface, and returns an integer variable, where if the value of the integer variable is equal to-1, it indicates that an error occurs in opening the file, and if the value of the integer variable is greater than 0, this value represents the file descriptor fd.
As an example, the open function write may be if ((fd=open ("/dev/ttys 0", O_RDWR|O_NOCTTY|O_NDELAY) < 0) { perror ("open") }.
When the Linux operates the peripheral interface, basic details of the peripheral interface are shielded, the peripheral interface is only used as a file to operate, all operations are started by an open function, the open function is used for acquiring fd, and other operations in later stages are used for controlling fd to complete actual operation of the peripheral interface. open/dev/ttyS 0, representing serial port 1, so-called com1, followed by some control words. For example, intoen (const char, int oflag, …/, mode_tmode /).
However, in practical application, many peripheral interfaces, such as 12 serial ports, 10 USB ports and even more, are encountered, and if there are other system architectures, there are more peripheral interfaces, and in addition, when a general user processes one USB interface, there may be a problem that there is no permission modification.
Aiming at the problems, the core concept of the embodiment of the invention is that by unifying the equipment node names of the peripheral interfaces, when an upper application program calls the peripheral interfaces, the calling can be carried out through the unified equipment node names, and the application program does not need to modify the equipment node names, so that the application program has compatibility and stability under various system architectures.
Referring to fig. 1, a step flow chart of an embodiment of a peripheral interface setting method of a terminal device according to the present invention is shown, where the terminal device includes a peripheral interface, and the peripheral interface has a corresponding device node identifier, and the embodiment of the present invention may specifically include the following steps:
step 101, installing a device driver in the terminal device.
In Linux, a device node is created at/dev, which is a hub connecting the kernel and the user layer. In Linux, all device nodes are stored in a file form under a/dev directory and accessed in a file mode, the device nodes are abstractions of Linux kernel to devices, and one device node is a file. An application program may pass through a standardized set of operating devices. The device in which the application program can operate comprises a peripheral interface of the terminal device.
In the embodiment of the invention, the terminal equipment can be a financial self-service terminal and the like, and a plurality of peripheral interfaces can be included on the terminal equipment, for example, a plurality of ps/2 interfaces, serial interfaces, wireless interfaces, USB interfaces and the like can be included on the terminal equipment, the peripheral interfaces have corresponding equipment node identifiers (equipment node names), and an application program can access and operate the equipment through the equipment node identifiers.
In a specific implementation, a pre-written device driver may be installed in the terminal device, specifically, the device driver may be installed in a driver layer of the terminal device, and then installation compilation is performed.
Step 102, updating the equipment node identifier of the peripheral interface to a designated equipment node identifier according to the equipment driver.
In the embodiment of the invention, the pre-compiled device driver can be used for changing the device node identification of the peripheral interface and updating the device node identification from the original device node identification to the appointed device node identification. Specifically, the designated device node identifier may be generated by the device driver, and then the device node identifier of the peripheral interface is updated to the designated device node identifier.
Step 103, if the update of the equipment node identifier of the peripheral interface fails, linking the equipment node identifier of the peripheral interface to the designated equipment node identifier.
In particular implementations, many devices may complete device node identification updates, and then the application may use the updated designated device node identification to invoke the peripheral interface. Of course, many devices may not successfully complete the update of the device node identifier, and at this time, the device node identifier of the peripheral interface may be connected to the designated device node identifier, so that when the application program accesses the peripheral interface, the application program may access the peripheral interface through the designated device node identifier.
In the embodiment of the invention, a device driver is installed in a terminal device, and a device node identifier of a peripheral interface is updated to a designated device node identifier according to the device driver, wherein if the update of the device node identifier of the peripheral interface fails, the device node identifier of the peripheral interface is linked to the designated device node identifier. In the embodiment of the invention, the equipment node identifier of the peripheral interface is updated or linked to the appointed equipment node identifier, so that the application program can operate the peripheral interface of the terminal equipment through the appointed equipment node, and the compatibility and stability of the application program to the peripheral interface are realized.
Referring to fig. 2, a flowchart illustrating steps of another embodiment of a method for setting a peripheral interface of a terminal device according to the present invention, where the terminal device includes a peripheral interface, and the peripheral interface has a corresponding device node identifier, the embodiment of the present invention may specifically include the following steps:
and step 201, inquiring the original device driver in the terminal device.
Step 202, determining whether the original device driver is a designated device driver.
Step 203, if the original device driver is not the designated device driver, unbinding the original device driver and removing the original device node identifier of the peripheral interface.
In the embodiment of the invention, the original device driver in the terminal device can be queried first, if the original device driver is the appointed device driver, the correct device driver is used, the unbinding processing is not needed, if the original device driver is not the appointed device driver, the unbinding processing is needed, specifically, the unbinding processing is to unbinding the original device driver on the terminal device, so that the original device node identifier of the peripheral interface is not called by the application program any more.
As an example, assume Kernel driverinuse that xrerial represents the display of the native device driver by the lspci command of Linux using the correct device driver, wherein if Kernel driver inuse: the external-serial indicates that the original device driver is not used, and the original device driver needs to be unbinding if Kernel driverinuse:xrerial indicates that the correct device driver is used, and the original device driver does not need to be unbinding, and in addition, all peripheral interface information existing in the system can be listed.
Step 204, installing a device driver in the terminal device.
Step 205, updating the device node identifier of the peripheral interface to a designated device node identifier according to the device driver.
In the embodiment of the invention, when the original device driver is determined not to be the designated device driver, the device driver can be installed in the driving layer of the terminal device, and then the device driver is compiled and installed through a make command, so that the device driver can update the device node identifier of the peripheral interface to the designated device node identifier. For example, a device node identification of a specified serial interface may be generated by a device driver: ttyXR.
In the embodiment of the invention, the device node name is changed through a rule.d command of a Linux manager UDEV, and the device node program is as follows:
and step 206, if the update of the equipment node identifier of the peripheral interface fails, linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier in a hard link mode, or linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier in a soft link mode.
In a specific implementation, since many devices cannot successfully solve the device node identifier by means of rule.d, because rule.d is aimed at the management user and some general users cannot solve the problem, the embodiment of the invention further links the device node name of the peripheral interface to the designated device node name by means of hyperlink aiming at the peripheral interface which does not successfully change the device node name, so that the application program can access the peripheral interface through the designated device node name.
In the embodiment of the invention, the rights of the users are uniformly opened, for example, a USB interface rights management program can be uniformly opened:
#KERNEL=="*"
#/etc/udev/rules.d
#CRM-BRM
SUBSYSTEM=="usb",KERNEL=="*",MODE="0666"
through the codes, the authority of the used USB interface is increased, so that the names of the equipment nodes of peripheral interfaces such as the USB interface can be uniformly corrected.
Referring to fig. 3, a flow chart of a peripheral interface configuration of the present invention is shown, which specifically includes the following steps: step 301, unbinding an original device driver; step 302, checking the condition of unbinding the original device driver and PCI serial interface; step 302, after the original device driver is unbinding, installing the appointed device driver into a Linux driver layer; step 304, checking the device driver of the peripheral interface; step 305, the device node name of the peripheral interface is linked to the designated device node name in a linking manner.
Specifically, the linking manner may include both hard linking and soft linking.
Hard link (hard link):
wherein, a refers to the designated device node name of the peripheral interface, B refers to the device node name of the peripheral interface, a is the hard link of B (both a and B are file names), the inode node number in the directory entry of a is the same as the inode node number in the directory entry of B, i.e. one inode node corresponds to two different file names, the two file names point to the same file, and a and B are completely equal to the file system. If one of them is deleted, there is no effect on the other. Every time a file name is added, the number of links on the inode node is increased by one, every time a corresponding file name is deleted, the number of links on the inode node is reduced by one until the number is 0, and the inode node and the corresponding data block are recovered. And (3) injection: the file and the file name are different, rmA only deletes the file name a, and the data block (file) corresponding to a is only recovered by the system when the node link number of the inode is reduced to 0.
Soft link):
wherein a refers to a designated device node name of the peripheral interface, B refers to a device node name of the peripheral interface, a is a soft link of B (both a and B are file names), inode node numbers in a directory entry of a are different from inode node numbers in a directory entry of B, and a and B point to two different inodes and then to two different data blocks. But the only way to store B in a block of a is the pathname of B (from which the directory entry for B can be found). A and B are in a "master-slave" relationship, and if B is deleted, A still exists (because the two are different files), but points to an invalid link.
As a specific example, referring to fig. 4, there is shown a flow diagram of a hard link of the present invention, comprising the steps of:
step 401, installing equipment drivers;
step 402, generating designated device node names through a device driver, wherein the designated device node names are kept unchanged;
step 403, changing the device node name of the peripheral interface into a designated device node name through a rule.d command of the UDEV;
step 404, judging whether the device node name of the peripheral interface is changed to the designated device node name through a rule.d command of the UDEV, if not, executing step 405, and if so, executing step 406;
step 405, connecting the device node name of the peripheral interface to the designated device node name in a hard link manner;
step 406, end.
In the Linux system, a file (device is also a file operation) is divided into two parts: user data and metadata. Hard links (Hard links) Hard links commonly use one inode node number, except for file names.
Hard link characteristics: 1) Whether the source file (test file) is modified or the hard link file (test-hard file) is modified, the data in the other file is changed. 2) Whether deleting a source file or deleting a hard-linked file, this file can be accessed as long as there is still one file present. 3) Hard links do not create new inode information nor change the total number of inodes. 4) Hard links cannot be established across file systems (partitions) because the inode number is recalculated in a different file system. 5) Hard linking cannot link directories because if a hard link is established for a directory, not only does the directory itself need to be re-established, but all subfiles under the directory, including all subfiles in the subdirectory, need to be established, which is too complex for current Linux. 6) Hard links do not occupy inodes and blocks.
As a specific example, referring to fig. 5, a flow chart of a soft link of the present invention is shown, comprising the steps of:
step 501, installing a device driver;
step 502, generating designated device node names through a device driver, wherein the designated device node names are kept unchanged;
step 503, changing the device node name of the peripheral interface into a designated device node name through a rule.d command of the UDEV;
step 504, judging whether the device node name of the peripheral interface is changed to the designated device node name through the rule.d command of the UDEV, if not, executing step 505, and if so, executing step 506;
step 505, connecting the equipment node name of the peripheral interface to the designated equipment node name in a soft link mode;
step 506, end.
Characteristics of soft link: hard links can be considered as a file having two file names, while soft links are created by the system as a linked file pointing to the file to which it is directed, and soft links (symbolic links) overcome the disadvantages of hard links without any file system limitations, and any user can create symbolic links pointing to directories. And thus are now more widely used, with greater flexibility and even the possibility of linking files across different machines, different networks. A soft link is established as long as option-s is added after the ln command.
In the embodiment of the present invention, the device node name defined on the original system is linked to the designated device node name by means of hard link and/or soft link, for example, ttyXRUSB0 is uniformly linked to ttys12, and so on, so that the external device interface is defined as the same name symbol, the application program of the upper layer can call the corresponding peripheral device interface without modifying the program code, and the embodiment of the present invention can be compatible with various system architectures.
Step 207, receiving a call instruction sent by an application program, where the call instruction includes the specified device node identifier.
Step 208, calling the peripheral interface of the terminal equipment corresponding to the designated equipment node identifier according to the calling instruction.
In embodiments of the present invention, the application may invoke the peripheral interface by specifying the device node identification. Specifically, a call instruction may be generated that includes the specified device node identification, and the system will then call the corresponding peripheral interface in accordance with the specified device node identification. The application program can be compatible with the equipment node by uniformly correcting the equipment node identification of the peripheral interface, and the stability is realized by uniformly correcting the equipment node identification.
In summary, by applying the embodiment of the invention, a plurality of peripheral interfaces are managed rapidly and efficiently under a multi-system architecture, and the compatibility and stability are provided.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 6, there is shown a block diagram of an embodiment of a peripheral interface setting apparatus of a terminal device according to the present invention, where the terminal device includes a peripheral interface, and the peripheral interface has a corresponding device node identifier, and the embodiment of the present invention may specifically include the following modules:
an installation module 601 for installing a device driver in the terminal device;
an updating module 602, configured to update, according to the device driver, a device node identifier of the peripheral interface to a designated device node identifier;
and the linking module 603 is configured to link the device node identifier of the peripheral interface to the designated device node identifier if the update of the device node identifier of the peripheral interface fails.
In a preferred embodiment of the present invention, the apparatus may further comprise: the inquiry module is used for inquiring the original equipment driver in the terminal equipment; the judging module is used for judging whether the original equipment driver is a designated equipment driver or not; and the unbinding module is used for unbinding the original equipment driver and removing the original equipment node identifier of the peripheral interface if the original equipment driver is not the appointed equipment driver.
In a preferred embodiment of the present invention, the linking module 603 may include: and the hard link sub-module is used for linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier in a hard link mode.
In a preferred embodiment of the present invention, the linking module 603 may include: and the soft link sub-module is used for linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier in a soft link mode.
In a preferred embodiment of the present invention, the apparatus may further comprise: the receiving module is used for receiving a calling instruction sent by an application program, wherein the calling instruction comprises the designated equipment node identification; and the access module is used for calling the peripheral interface of the terminal equipment corresponding to the designated equipment node identifier according to the calling instruction.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The embodiment of the invention discloses an electronic device, which comprises a processor, a memory and a computer program stored on the memory and capable of running on the processor, wherein the computer program realizes the steps in the embodiment of the peripheral interface setting method of the terminal device when being executed by the processor.
The embodiment of the invention discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program realizes the steps in the embodiment of the peripheral interface setting method of the terminal equipment when being executed by a processor.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The above description of the present invention is a method for setting a peripheral interface of a terminal device, a device for setting a peripheral interface of a terminal device, an electronic device and a storage medium, and specific examples are applied to illustrate the principles and embodiments of the present invention, and the above description of the examples is only used to help understand the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.
Claims (8)
1. A peripheral interface setting method of a terminal device, wherein the terminal device includes a peripheral interface, the peripheral interface has a corresponding device node identifier, the method includes:
installing a device driver in the terminal device; the device driver is obtained by installing and compiling after being installed on a driving layer of the terminal device;
updating the equipment node identifier of the peripheral interface into a designated equipment node identifier according to the equipment driver;
if the equipment node identification of the peripheral interface fails to be updated, the equipment node identification of the peripheral interface is linked to the appointed equipment node identification;
wherein the linking the device node identifier of the peripheral interface to the designated device node identifier includes:
and linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier in a hard link mode.
2. The method of claim 1, wherein prior to said installing a device driver in said terminal device, said method further comprises:
inquiring original equipment drivers in the terminal equipment;
judging whether the original equipment driver is a designated equipment driver or not;
if the original device driver is not the appointed device driver, unbinding the original device driver and removing the original device node identifier of the peripheral interface.
3. The method of claim 1, wherein linking the device node identification of the peripheral interface to a specified device node identification comprises:
and linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier in a soft link mode.
4. A method according to any one of claims 1 to 3, wherein after said linking the device node identity of the peripheral interface to a specified device node identity, the method further comprises:
receiving a call instruction sent by an application program, wherein the call instruction comprises the designated equipment node identifier;
and calling the peripheral interface of the terminal equipment corresponding to the designated equipment node identifier according to the calling instruction.
5. A peripheral interface setting apparatus of a terminal device, wherein the terminal device includes a peripheral interface having a corresponding device node identifier, the apparatus comprising:
an installation module for installing a device driver in the terminal device; the device driver is obtained by installing and compiling after being installed on a driving layer of the terminal device;
the updating module is used for updating the equipment node identifier of the peripheral interface into a designated equipment node identifier according to the equipment driver;
the link module is used for linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier if the equipment node identifier of the peripheral interface fails to be updated;
wherein, the link module includes:
and the hard link sub-module is used for linking the equipment node identifier of the peripheral interface to the appointed equipment node identifier in a hard link mode.
6. The apparatus of claim 5, wherein the apparatus further comprises:
the inquiry module is used for inquiring the original equipment driver in the terminal equipment;
the judging module is used for judging whether the original equipment driver is a designated equipment driver or not;
and the unbinding module is used for unbinding the original equipment driver and removing the original equipment node identifier of the peripheral interface if the original equipment driver is not the appointed equipment driver.
7. An electronic device comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, which when executed by the processor, implements the steps of the peripheral interface setup method of a terminal device according to any of claims 1 to 4.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium stores thereon a computer program which, when executed by a processor, implements the steps of the peripheral interface setting method of a terminal device according to any of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011629428.4A CN113254029B (en) | 2020-12-30 | 2020-12-30 | Peripheral interface setting method and device of terminal equipment and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011629428.4A CN113254029B (en) | 2020-12-30 | 2020-12-30 | Peripheral interface setting method and device of terminal equipment and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113254029A CN113254029A (en) | 2021-08-13 |
CN113254029B true CN113254029B (en) | 2024-02-02 |
Family
ID=77181405
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011629428.4A Active CN113254029B (en) | 2020-12-30 | 2020-12-30 | Peripheral interface setting method and device of terminal equipment and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113254029B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106372521A (en) * | 2016-09-28 | 2017-02-01 | 珠海市魅族科技有限公司 | Data operation method and device |
CN107566543A (en) * | 2017-08-28 | 2018-01-09 | 沈阳东软医疗系统有限公司 | A kind of node identification method to set up and device |
CN107577502A (en) * | 2017-07-28 | 2018-01-12 | 捷开通讯(深圳)有限公司 | The compatibility method of terminal and its fingerprint module, storage device |
CN107613020A (en) * | 2017-10-16 | 2018-01-19 | 北京东土科技股份有限公司 | A kind of device management method and device |
WO2018215957A1 (en) * | 2017-05-25 | 2018-11-29 | XM Ltd. | Verifying success of compromising a network node during penetration testing of a networked system |
CN109739447A (en) * | 2018-12-19 | 2019-05-10 | 深圳怡化电脑股份有限公司 | Middleware and its communication means, middleware layer, storage medium and terminal device |
CN110502350A (en) * | 2019-07-11 | 2019-11-26 | 平安普惠企业管理有限公司 | Call method, device, terminal and the computer readable storage medium of node |
CN111177709A (en) * | 2019-12-31 | 2020-05-19 | 全球能源互联网研究院有限公司 | Execution method and device of terminal trusted component and computer equipment |
-
2020
- 2020-12-30 CN CN202011629428.4A patent/CN113254029B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106372521A (en) * | 2016-09-28 | 2017-02-01 | 珠海市魅族科技有限公司 | Data operation method and device |
WO2018215957A1 (en) * | 2017-05-25 | 2018-11-29 | XM Ltd. | Verifying success of compromising a network node during penetration testing of a networked system |
CN107577502A (en) * | 2017-07-28 | 2018-01-12 | 捷开通讯(深圳)有限公司 | The compatibility method of terminal and its fingerprint module, storage device |
CN107566543A (en) * | 2017-08-28 | 2018-01-09 | 沈阳东软医疗系统有限公司 | A kind of node identification method to set up and device |
CN107613020A (en) * | 2017-10-16 | 2018-01-19 | 北京东土科技股份有限公司 | A kind of device management method and device |
CN109739447A (en) * | 2018-12-19 | 2019-05-10 | 深圳怡化电脑股份有限公司 | Middleware and its communication means, middleware layer, storage medium and terminal device |
CN110502350A (en) * | 2019-07-11 | 2019-11-26 | 平安普惠企业管理有限公司 | Call method, device, terminal and the computer readable storage medium of node |
CN111177709A (en) * | 2019-12-31 | 2020-05-19 | 全球能源互联网研究院有限公司 | Execution method and device of terminal trusted component and computer equipment |
Non-Patent Citations (1)
Title |
---|
基于MC13224芯片的WSN节点操作系统设计与实现;兰斌;《cnki优秀硕士学位论文全文库 信息科技辑》(第01期);第I140-161页 * |
Also Published As
Publication number | Publication date |
---|---|
CN113254029A (en) | 2021-08-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9218137B2 (en) | System and method for providing data migration services | |
US5694540A (en) | Automated software regression test and compilation system | |
JP5007046B2 (en) | Maintaining component-based software products | |
US8156485B2 (en) | Method and apparatus for creating a pluggable, prioritized configuration engine to be used for configuring a software during installation, update and new profile creation | |
US7475396B2 (en) | Method and apparatus for defining, building and deploying pluggable and independently configurable install components | |
US20190114165A1 (en) | Using semantic annotations to control compatibility behaviors | |
US20130054531A1 (en) | Database cloning | |
CN109766330B (en) | Data slicing method and device, electronic equipment and storage medium | |
US7904901B1 (en) | System and method for controlling installed third party software components | |
US9032394B1 (en) | Deploying drivers for an operating system on a computing device | |
US20040098419A1 (en) | Method and apparatus for a migration assistant | |
US20160328230A1 (en) | Software dependency shading | |
CN106406919A (en) | Terminal device pre-loaded application management method and terminal device | |
US10248409B1 (en) | Limiting the effects of source code patches on corresponding native-code patches | |
CN111104151B (en) | Shell script-based Git code simplification management method | |
US7716664B2 (en) | Metadata-based application model for large applications | |
US10146520B1 (en) | Updating a running application on a computing device | |
US8738569B1 (en) | Systematic verification of database metadata upgrade | |
US20160147547A1 (en) | Metadata-based class loading using a content repository | |
CN113254029B (en) | Peripheral interface setting method and device of terminal equipment and electronic equipment | |
US8997077B1 (en) | Systems and methods for remediating a defective uninstaller during an upgrade procedure of a product | |
US20060048137A1 (en) | Method and apparatus for cloning an ORACLE RDBMS software | |
CN108694048B (en) | Method for realizing batch publishing service | |
CN116049000A (en) | Environment parameter configuration method, device, equipment, storage medium and product | |
CN100504787C (en) | Virtual executing method for installing software, and system |
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 |