CN108038072B - Access method of serial device, terminal device and computer readable storage medium - Google Patents
Access method of serial device, terminal device and computer readable storage medium Download PDFInfo
- Publication number
- CN108038072B CN108038072B CN201711471031.5A CN201711471031A CN108038072B CN 108038072 B CN108038072 B CN 108038072B CN 201711471031 A CN201711471031 A CN 201711471031A CN 108038072 B CN108038072 B CN 108038072B
- Authority
- CN
- China
- Prior art keywords
- serial port
- public resource
- current public
- pcmcia
- port equipment
- 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
Images
Classifications
-
- 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/382—Information transfer, e.g. on bus using universal interface adapter
- G06F13/385—Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
-
- 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)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Systems (AREA)
Abstract
The invention discloses an access method of a serial device, a terminal device and a computer readable storage medium, wherein the method comprises the following steps: when receiving an access request of the USB serial port equipment, the terminal equipment judges whether the current public resource is occupied by the PCMCIA serial port equipment, wherein the current public resource is a system resource capable of supporting the USB serial port equipment and the PCMCIA serial port equipment; and when the current public resource is not occupied by the PCMCIA serial port equipment, distributing the control right of the current public resource to the USB serial port equipment so as to realize the access of the USB serial port equipment. The invention allows the USB serial device to access when the occupation state meets the preset condition by judging the occupation state of the current public resource, thereby realizing the access of compatible USB serial device and PCMCIA serial device.
Description
Technical Field
The present invention relates to the field of data compatibility technologies, and in particular, to an access method for a serial device, a terminal device, and a computer-readable storage medium.
Background
At present, with the technical development of conditional access modules, a conditional access module conforming to the Personal Computer Memory Card International Association (PCMCIA) gradually updates a Universal Serial Bus (USB) conditional access module, and a problem that a USB conditional access module and a PCMCIA conditional access module coexist in the market soon, a host cannot be compatible with the USB conditional access module and the PCMCIA conditional access module simultaneously, or a new generation of USB conditional access module cannot be used by a host receiving the existing PCMCIA interface conditions occurs.
Disclosure of Invention
The invention mainly aims to provide an access method of a serial port device, a terminal device and a computer readable storage medium, and aims to solve the technical problem that the terminal device in the prior art cannot meet the access requirement of a USB serial port device under PCMCIA interface conditions.
In order to achieve the above object, the present invention provides an access method for a serial device, which comprises the following steps:
when receiving an access request of the USB serial port equipment, the terminal equipment judges whether the current public resource is occupied by the PCMCIA serial port equipment, wherein the current public resource is a system resource capable of supporting the USB serial port equipment and the PCMCIA serial port equipment;
and when the current public resource is not occupied by the PCMCIA serial port equipment, distributing the control right of the current public resource to the USB serial port equipment so as to realize the access of the USB serial port equipment.
Preferably, after the current public resource is not occupied by the PCMCIA serial device, the control right of the current public resource is allocated to the USB serial device to implement the access of the USB serial device, the method includes:
and when a pulling-out request of the USB serial port equipment is received, releasing the control right of the USB serial port equipment to the current public resource.
Preferably, after the determining whether the current public resource is occupied by the PCMCIA serial device when the access request of the USB serial device is received, the method further includes:
and when the current public resource is occupied by the PCMCIA serial port equipment, judging whether to distribute the control right of the current public resource to the USB serial port equipment according to a preset judgment rule.
Preferably, when the current public resource is occupied by a PCMCIA serial device, whether to allocate the control right of the current public resource to the USB serial device is determined according to a preset determination rule, which specifically includes:
and when the current public resource is occupied by the PCMCIA serial port equipment and a preset judgment rule is a preemption priority rule, generating a feedback message of request failure and sending the feedback message to the USB serial port equipment.
Preferably, when the current public resource is occupied by a PCMCIA serial device, whether to allocate the control right of the current public resource to the USB serial device is determined according to a preset determination rule, which specifically includes:
and when the current public resource is occupied by the PCMCIA serial port equipment and a preset judgment rule is a PCMCIA serial port priority rule, generating a feedback message of request failure, and sending the feedback message to the USB serial port equipment.
Preferably, when the current public resource is occupied by a PCMCIA serial device, whether to allocate the control right of the current public resource to the USB serial device is determined according to a preset determination rule, which specifically includes:
and when the current public resource is occupied by the PCMCIA serial port equipment and a preset judgment rule is a USB serial port equipment priority rule, calling a switching program so that the switching program releases the control right of the PCMCIA serial port equipment occupying the current public resource and distributes the control right of the current public resource to the USB serial port equipment.
Preferably, when receiving an access request of the USB serial device, the terminal device determines whether the current public resource is occupied by the PCMCIA serial device, and specifically includes:
and when an access request of the USB serial port equipment is received, acquiring the occupation identifier of the current public resource, and judging whether the current public resource is occupied by the PCMCIA serial port equipment or not according to the occupation identifier.
Preferably, when the terminal device receives an access request of the USB serial device, before determining whether the current public resource is occupied by the PCMCIA serial device, the method further includes:
and when the current public resource is occupied, setting an occupation identifier for the current public resource according to the serial port type of the serial port equipment occupying the current public resource.
In addition, to achieve the above object, the present invention further provides a terminal device, including: the access program of the serial device is configured to implement the steps of the access method of the serial device.
In addition, in order to achieve the above object, the present invention further provides a computer-readable storage medium, where an access program of a serial device is stored, and when the access program of the serial device is executed by a processor, the steps of the access method of the serial device as described above are implemented.
The invention provides an access method of serial port equipment, which is characterized in that when terminal equipment receives an access request of USB serial port equipment, whether current public resources are occupied by PCMCIA serial port equipment or not is judged, and the current public resources are system resources capable of supporting the USB serial port equipment and the PCMCIA serial port equipment; and when the current public resource is not occupied by the PCMCIA serial port equipment, distributing the control right of the current public resource to the USB serial port equipment so as to realize the access of the USB serial port equipment. The invention allows the USB serial device to access when the occupation state meets the preset condition by judging the occupation state of the current public resource, thereby realizing the access of compatible USB serial device and PCMCIA serial device.
Drawings
Fig. 1 is a schematic structural diagram of a terminal device in a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a first embodiment of an access method of a serial device according to the present invention;
FIG. 3 is a schematic view of the process of accessing the USB serial device and the PCMCIA serial device according to the present invention;
fig. 4 is a flowchart illustrating an access method of a serial device according to a second embodiment of the present invention;
FIG. 5 is a schematic drawing showing the process of pulling out the USB serial device and the PCMCIA serial device according to the present invention;
fig. 6 is a schematic flowchart of an access method of a serial device according to a third embodiment of the present invention;
FIG. 7 is a schematic diagram of a data processing flow under preemption-priority rules in accordance with the present invention;
FIG. 8 is a schematic diagram of the data processing flow under the PCMCIA serial port priority rule of the present invention;
FIG. 9 is a schematic diagram of a data processing flow under the USB serial port priority rule of the present invention;
fig. 10 is a flowchart illustrating an access method for a serial device according to a fourth embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a terminal device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the terminal device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the terminal device configuration shown in fig. 1 is not intended to be limiting of the terminal device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and an access program of a serial device therein.
In the terminal device shown in fig. 1, the network interface 1004 is mainly used for connecting a server and performing data communication with the server; the user interface 1003 is mainly used for connecting a user terminal and performing data communication with the terminal; the terminal device of the present invention calls the access program of the serial device stored in the memory 1005 through the processor 1001, and executes the following operations:
when an access request of the USB serial port equipment is received, judging whether the current public resource is occupied by the PCMCIA serial port equipment, wherein the current public resource is a system resource capable of supporting the USB serial port equipment and the PCMCIA serial port equipment;
and when the current public resource is not occupied by the PCMCIA serial port equipment, distributing the control right of the current public resource to the USB serial port equipment so as to realize the access of the USB serial port equipment.
Further, the processor 1001 may call an access program of the serial device stored in the memory 1005, and further perform the following operations:
and when a pulling-out request of the USB serial port equipment is received, releasing the control right of the USB serial port equipment to the current public resource.
Further, the processor 1001 may call an access program of the serial device stored in the memory 1005, and further perform the following operations:
and searching the current judgment rule in a preset storage area.
Further, the processor 1001 may call an access program of the serial device stored in the memory 1005, and further perform the following operations:
and when the judgment rule is searched in a preset storage area and is a preemption priority rule and the current public resource is occupied by PCMCIA serial port equipment, generating a feedback message of request failure and sending the feedback message to the USB serial port equipment.
Further, the processor 1001 may call an access program of the serial device stored in the memory 1005, and further perform the following operations:
when the judgment rule is found in the preset storage area and is a PCMCIA serial port priority rule and the current public resource is occupied by PCMCIA serial port equipment, generating a feedback message of request failure, and sending the feedback message of request failure to the USB serial port equipment.
Further, the processor 1001 may call an access program of the serial device stored in the memory 1005, and further perform the following operations:
when the judgment rule is searched in the preset storage area and is the priority rule of the USB serial port equipment and the current public resource is occupied by the PCMCIA serial port equipment, calling a switching program so that the switching program releases the control right of the PCMCIA serial port equipment for occupying the current public resource and distributes the control right of the current public resource to the USB serial port equipment.
Further, the processor 1001 may call an access program of the serial device stored in the memory 1005, and further perform the following operations:
and when an access request of the USB serial port equipment is received, acquiring the occupation identifier of the current public resource, and judging whether the current public resource is occupied by the PCMCIA serial port equipment or not according to the occupation identifier.
Further, the processor 1001 may call an access program of the serial device stored in the memory 1005, and further perform the following operations:
and when the current public resource is occupied, setting an occupation identifier for the current public resource according to the serial port type of the serial port equipment occupying the current public resource.
According to the scheme, when the terminal equipment displays the target object to be processed in the display interface, the current voice information is collected; extracting audio features in the current voice information, and determining a velocity vector of the target object to be processed according to the audio features; extracting the time length in the audio features, and determining displacement information of the target to be processed according to the time length and the velocity vector; and adjusting the position of the target object to be processed in the display interface according to the displacement information. In this embodiment, a speed vector is obtained by extracting audio features in the voice information, and displacement information of the target object to be processed is obtained according to the speed vector, so that interaction with the target object is realized through voice.
Based on the hardware structure, the embodiment of the access method of the serial device is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating an access method of a serial device according to a first embodiment of the present invention. In a first embodiment, the access method of the serial device includes the following steps:
step S10, when the terminal device receives the access request of the USB serial port device, judging whether the current public resource is occupied by the PCMCIA serial port device, wherein the current public resource is a system resource capable of supporting the USB serial port device and the PCMCIA serial port device;
it should be noted that the USB serial device may be a serial device that satisfies a USB bus protocol, such as a USB interface type video card, and may also be other USB serial devices, which is not limited in this embodiment, where the PCMCIA is the personal computer memory card international association, and this organization is responsible for establishing a standard for the PCMCIA device, and the PCMCIA defines three different types of cards, and their lengths and widths are all 85.6 × 54mm, and are different only in thickness. Type I is the earliest PC card, 3.3mm thick is mainly used for RAM and ROM, Type II increases the thickness to 5.0mm, and the application range is greatly expanded to include most modems and fax modems, local area network adapters and other electrical equipment; type III further increases the thickness to 10.5mm, which is mainly used for a rotating storage device, such as a hard disk, in this embodiment, the PCMCIA serial device can meet a PCMCIA protocol serial device, such as a PCMCIA interface Type video card, and can also be used for other PCMCIA serial devices, which is not limited in this embodiment.
It can be understood that the current common resource may be a system resource capable of supporting a USB serial device and a PCMCIA serial device, such as an input/output channel, an interface interaction resource, and may also be another system resource, which is not limited in this embodiment.
And step S20, when the current public resource is not occupied by PCMCIA serial port equipment, distributing the control right of the current public resource to the USB serial port equipment to realize the access of the USB serial port equipment.
It should be noted that, the terminal device manages the control right of the common resource according to the control principle, and in this embodiment, the input and output resources of the signal received by the terminal device and the conditional resource related to interface interaction in the system are unified to determine the common resource.
In this embodiment, when the USB serial device or the PCMCIA serial device accesses the host, the host obtains the access signal and applies for the control right to the shared resource control module. The shared resource control module can manage the control right according to the control principle, and the USB serial port device or the PCMCIA serial port device finishes all functions of conditional access after acquiring the control right.
As shown in fig. 3, a schematic diagram of a procedure for accessing a USB serial device and a PCMCIA serial device is shown, when a PCMCIA serial device accesses, it receives an access message of the PCMCIA serial device, applies a control right to a public resource, receives an occupation situation of the current public resource, determines whether to receive a control right request of the PCMCIA serial device according to the occupation situation, discards the access message of the PCMCIA serial device when the access request of the control right of the PCMCIA serial device is not accepted, and when the access request of the control right of the PCMCIA serial device is accepted, it sends the access message of the PCMCIA serial device continuously, and makes the PCMCIA serial device continuously complete a processing procedure of the PCMCIA serial device.
Correspondingly, when the USB serial port equipment is accessed, the USB serial port equipment access information is received, the control right is applied, the terminal equipment receives the occupation condition of the current public resource, whether the control right request of the USB serial port equipment is received or not is judged and determined according to the occupation condition, when the access request of the control right of the USB serial port equipment is not accepted, the access information of the USB serial port equipment is discarded, when the access request of the control right of the USB serial port equipment is accepted, the access information of the USB serial port equipment is sent continuously, and the USB serial port equipment is made to continue to complete the processing flow of the USB serial port equipment.
In the specific implementation, the public resource of the terminal equipment is correspondingly managed, and when the access request of the PCMCIA serial port equipment or the USB serial port equipment is obtained, whether the control right of the public resource is distributed to the PCMCIA serial port equipment or the USB serial port equipment is judged according to the access request, so that the access of the PCMCIA serial port equipment or the USB serial port equipment is realized.
According to the scheme provided by the embodiment, when receiving an access request of the USB serial port device, the terminal device judges whether the current public resource is occupied by the PCMCIA serial port device, wherein the current public resource is a system resource capable of supporting the USB serial port device and the PCMCIA serial port device; and when the current public resource is not occupied by the PCMCIA serial port equipment, distributing the control right of the current public resource to the USB serial port equipment so as to realize the access of the USB serial port equipment. According to the embodiment, the access of the USB serial device is allowed when the occupation state meets the preset condition by judging the occupation state of the current public resource, so that the access of the compatible USB serial device and the compatible PCMCIA serial device is realized.
Further, as shown in fig. 4, a second embodiment of the access method of a serial device according to the present invention is proposed based on the first embodiment, and in this embodiment, after step S20, the method further includes:
and step S30, when the pull-out request of the USB serial port equipment is received, releasing the control right of the USB serial port equipment to the current public resource.
It should be noted that the pull-out request of the USB serial device may be a request for detecting that the USB serial device is pulled out, and when the bottom layer of the android system detects that the serial device in the interface is pulled out, the pull-out message is sent to the application layer of the android system, so as to obtain the pull-out request of the serial device, and perform corresponding processing.
In a specific implementation, when an access request of a USB serial device is received and a current public resource meets a preset condition, the control right of the public resource is allocated to the USB serial device, and accordingly, when a pull-out request of the USB serial device is detected, the control right of the USB serial device can be released.
As shown in fig. 5, a schematic flow chart of extracting the USB serial device and the PCMCIA serial device is shown, when the PCMCIA serial device is extracted, the system receives the extraction message of the PCMCIA serial device and applies for releasing the control right to the public resource, the public resource releases the control right of the PCMCIA serial device according to the received release request, accordingly, when the USB serial device is extracted, the system receives the extraction message of the USB serial device and applies for releasing the control right to the public resource, and the public resource releases the control right of the USB serial device according to the received release request, so that when the USB serial device is extracted, the control right of the serial device is released, thereby avoiding waste caused by occupation of the public resource and normal operation of the maintenance system.
According to the scheme provided by the embodiment, when the serial device is pulled out, the control right releasing request sent by the serial device can be received, and the control right of the serial device is released according to the control right releasing request, so that the waste of public resources is avoided, and the normal operation of a system is maintained.
Further, as shown in fig. 6, a third embodiment of the access method of a serial device according to the present invention is proposed based on the first embodiment, and in this embodiment, after step S10, the method further includes:
and step S101, when the current public resource is occupied by the PCMCIA serial port equipment, judging whether to distribute the control right of the current public resource to the USB serial port equipment according to a preset judgment rule.
It should be noted that the preset determination rule is a preemption priority rule, a PCMCIA serial port priority rule and a USB serial port device priority rule, the preemption limit rule is that as long as the public resource is in an occupied state, other serial port devices are not allowed to access, the PCMCIA serial port priority rule is that as long as the PCMCIA serial port has a control right, the USB serial port device is not allowed to access, and as long as the USB serial port device has a control right, the PCMCIA serial port is not allowed to access.
Further, the step S101 specifically includes:
and step S102, when the current public resource is occupied by the PCMCIA serial port equipment and a preset judgment rule is a preemption priority rule, generating a feedback message of request failure, and sending the feedback message to the USB serial port equipment.
In this embodiment, the preset determination rule is a pre-preemption priority rule, and under the condition of the pre-preemption priority rule and under the condition that the current public resource is occupied, a request message of request failure is returned to the later-applied access application, that is, the later-accessed serial device is not allowed to access.
Fig. 7 is a schematic diagram of a data processing flow under the preemption priority rule. Under the condition that the public resource is occupied, neither PCMCIA serial port equipment nor USB serial port equipment receives an access request, and returns a feedback message of failed request, and under the condition that the public resource is unoccupied, the public resource is distributed to the requested serial port equipment, and the public resource is marked to be in an occupied state.
Further, the step S101 specifically includes:
and step S103, when the current public resource is occupied by the PCMCIA serial port equipment and the preset judgment rule is the PCMCIA serial port priority rule, generating a feedback message of request failure, and sending the feedback message to the USB serial port equipment.
In this embodiment, the preset determination rule is a PCMCIA serial port priority rule, and under the condition of the PCMCIA serial port priority rule, under the condition that the current public resource is occupied by the PCMCIA serial port device, when accessing the USB serial port device, a request message of a request failure is returned, that is, the USB serial port device is not allowed to access, so that normal operation of the PCMCIA serial port device is ensured.
Fig. 8 is a schematic diagram of a data processing flow under the PCMCIA serial port priority rule. When the PCMCIA serial port equipment requests the control right and under the condition that the current public resource is occupied by the USB serial port equipment, the USB serial port equipment is called to be pulled out, the current public resource is marked to be occupied by the PCMCIA serial port equipment, the control right of the current public resource is distributed to the PCMCIA serial port equipment, a feedback request which is successfully applied is returned, and the feedback request is sent to the PCMCIA serial port equipment.
Correspondingly, when the USB serial port equipment requests the control right and the current public resource is not occupied by the PCMCIA serial port equipment, the current public resource is marked as the occupation of the USB serial port equipment, the control right of the current public resource is distributed to the USB serial port equipment, a feedback request which is successfully applied is returned, and the feedback request is sent to the USB serial port equipment.
When the USB serial port equipment requests the control right and under the condition that the current public resource is occupied by PCMCIA serial port equipment, returning a feedback message of request failure and sending the feedback message to the USB serial port equipment;
when the USB serial port equipment requests the control right and under the condition that the current public resource is not occupied by PCMCIA serial port equipment, the current public resource is marked as occupied by the USB serial port equipment, the control right of the current public resource is distributed to the USB serial port equipment, a feedback request which is successfully applied is returned, and the feedback request is sent to the USB serial port equipment.
Further, the step S101 specifically includes:
and step S104, when the current public resource is occupied by the PCMCIA serial port equipment and the preset judgment rule is the priority rule of the USB serial port equipment, calling a switching program so that the switching program releases the control right of the PCMCIA serial port equipment occupying the current public resource and distributes the control right of the current public resource to the USB serial port equipment.
Fig. 9 is a schematic diagram of a data processing flow under the USB serial port priority rule. When the USB serial port equipment requests the control right, and under the condition that the current public resource is occupied by the PCMCIA serial port equipment, the PCMCIA serial port equipment is called to be pulled out, the current public resource is marked to be occupied by the USB serial port equipment, the control right of the current public resource is distributed to the USB serial port equipment, a feedback request which is applied successfully is returned, the feedback request is sent to the USB serial port equipment, under the condition that the current public resource is not occupied by the PCMCIA serial port equipment, the current public resource is marked to be occupied by the USB serial port equipment, the control right of the current public resource is distributed to the USB serial port equipment, the feedback request which is applied successfully is returned, and the feedback request is sent to the USB serial port equipment.
Correspondingly, when the PCMCIA serial port equipment requests the control right and the current public resource is not occupied by the USB serial port equipment, marking the current public resource as the PCMCIA serial port equipment, distributing the control right of the current public resource to the PCMCIA serial port equipment, returning a feedback request which is successfully applied, and sending the feedback request to the PCMCIA serial port equipment;
when the PCMCIA serial port equipment requests the control right and under the condition that the current public resource is occupied by the USB serial port equipment, returning a feedback message of request failure and sending the feedback message to the PCMCIA serial port equipment.
According to the scheme provided by the embodiment, the terminal device determines the control right of the current public resource according to the preset judgment rule and the occupation condition of the current public resource, so that the current public resource is effectively distributed according to the preset judgment rule, and the normal operation of the serial device is ensured under the condition of not wasting the public resource.
Further, as shown in fig. 10, a fourth embodiment of the access method of a serial device according to the present invention is proposed based on the first embodiment, the second embodiment and the third embodiment, in this embodiment, based on the first embodiment, the description is made, and the step S10 specifically includes:
and step S105, judging whether the identifier of the current public resource is obtained or not when the access request of the USB serial port equipment is received, and judging whether the current public resource is occupied by the PCMCIA serial port equipment or not according to the identifier.
It should be noted that the identifier may be a corresponding identifier according to the serial port type of the currently occupied public resource, and it is determined whether the current public resource is occupied through the identifier, that is, when the identifier of the current public resource is obtained, it indicates that the current public resource is already occupied, and when the identifier of the current public resource is not obtained, it indicates that the current public resource is not occupied, so that whether the current public resource is occupied can be determined through the identifier.
Further, before the step S105, the method further includes:
and step S106, when the current public resource is occupied, identifying the current public resource according to the serial port type of the serial port equipment occupying the current public resource.
According to the scheme provided by the embodiment, the terminal equipment judges whether the current public resource is occupied or not by judging whether the identifier of the current public resource is acquired or not, so that the occupation state of the current public resource can be judged through simple identifier information, and the system processing efficiency is improved.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where an access program of a serial device is stored in the computer-readable storage medium, and when executed by a processor, the access program of the serial device implements the following operations:
when an access request of the USB serial port equipment is received, judging whether the current public resource is occupied by the PCMCIA serial port equipment, wherein the current public resource is a system resource capable of supporting the USB serial port equipment and the PCMCIA serial port equipment;
and when the current public resource is not occupied by the PCMCIA serial port equipment, distributing the control right of the current public resource to the USB serial port equipment so as to realize the access of the USB serial port equipment.
Further, when executed by the processor, the access program of the serial device further implements the following operations:
and when a pulling-out request of the USB serial port equipment is received, releasing the control right of the USB serial port equipment to the current public resource.
Further, when executed by the processor, the access program of the serial device further implements the following operations:
and when the current public resource is occupied by the PCMCIA serial port equipment, judging whether to distribute the control right of the current public resource to the USB serial port equipment according to a preset judgment rule.
Further, when executed by the processor, the access program of the serial device further implements the following operations:
and when the current public resource is occupied by the PCMCIA serial port equipment and a preset judgment rule is a preemption priority rule, generating a feedback message of request failure and sending the feedback message to the USB serial port equipment.
Further, when executed by the processor, the access program of the serial device further implements the following operations:
and when the current public resource is occupied by the PCMCIA serial port equipment and a preset judgment rule is a PCMCIA serial port priority rule, generating a feedback message of request failure, and sending the feedback message to the USB serial port equipment.
Further, when executed by the processor, the access program of the serial device further implements the following operations:
and when the current public resource is occupied by the PCMCIA serial port equipment and a preset judgment rule is a USB serial port equipment priority rule, calling a switching program so that the switching program releases the control right of the PCMCIA serial port equipment occupying the current public resource and distributes the control right of the current public resource to the USB serial port equipment.
Further, when executed by the processor, the access program of the serial device further implements the following operations:
when an access request of the USB serial port equipment is received, whether the identification of the current public resource is obtained or not is judged, and whether the current public resource is occupied by the PCMCIA serial port equipment or not is judged according to the identification.
Further, when executed by the processor, the access program of the serial device further implements the following operations:
and when the current public resource is occupied, identifying the current public resource according to the serial port type of the serial port equipment occupying the current public resource.
According to the scheme, when the terminal device receives an access request of the USB serial port device, whether the current public resource is occupied by the PCMCIA serial port device or not is judged, wherein the current public resource is a system resource capable of supporting the USB serial port device and the PCMCIA serial port device; and when the current public resource is not occupied by the PCMCIA serial port equipment, distributing the control right of the current public resource to the USB serial port equipment so as to realize the access of the USB serial port equipment. According to the embodiment, the access of the USB serial device is allowed when the occupation state meets the preset condition by judging the occupation state of the current public resource, so that the access of the compatible USB serial device and the compatible PCMCIA serial device is realized.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a computer-readable storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, and includes several instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. An access method of a serial device is characterized by comprising the following steps:
when receiving an access request of the USB serial port equipment, the terminal equipment judges whether the current public resource is occupied by the PCMCIA serial port equipment, wherein the current public resource is a system resource capable of supporting the USB serial port equipment and the PCMCIA serial port equipment;
when the current public resource is not occupied by PCMCIA serial port equipment, the control right of the current public resource is distributed to the USB serial port equipment, and an access request of the USB serial port equipment is continuously sent out to realize the access of the USB serial port equipment;
and when the current public resource is occupied by PCMCIA serial port equipment, discarding the access request of the USB serial port equipment.
2. The method for accessing the serial port device according to claim 1, wherein after the current public resource is not occupied by the PCMCIA serial port device, the control right of the current public resource is allocated to the USB serial port device, and the access request of the USB serial port device is continuously issued to realize the access of the USB serial port device, the method comprises:
and when a pulling-out request of the USB serial port equipment is received, releasing the control right of the USB serial port equipment to the current public resource.
3. The method for accessing a serial device according to claim 1, wherein after determining whether the current public resource is occupied by the PCMCIA serial device when receiving the access request of the USB serial device, the method further comprises:
and when the current public resource is occupied by the PCMCIA serial port equipment, judging whether to distribute the control right of the current public resource to the USB serial port equipment according to a preset judgment rule.
4. The method according to claim 3, wherein when the current public resource is occupied by a PCMCIA serial device, determining whether to allocate the control right of the current public resource to the USB serial device according to a preset determination rule includes:
and when the current public resource is occupied by the PCMCIA serial port equipment and a preset judgment rule is a preemption priority rule, generating a feedback message of request failure and sending the feedback message to the USB serial port equipment.
5. The method according to claim 3, wherein when the current public resource is occupied by a PCMCIA serial device, determining whether to allocate the control right of the current public resource to the USB serial device according to a preset determination rule includes:
and when the current public resource is occupied by the PCMCIA serial port equipment and a preset judgment rule is a PCMCIA serial port priority rule, generating a feedback message of request failure, and sending the feedback message to the USB serial port equipment.
6. The method according to claim 3, wherein when the current public resource is occupied by a PCMCIA serial device, determining whether to allocate the control right of the current public resource to the USB serial device according to a preset determination rule includes:
and when the current public resource is occupied by the PCMCIA serial port equipment and a preset judgment rule is a USB serial port equipment priority rule, calling a switching program so that the switching program releases the control right of the PCMCIA serial port equipment occupying the current public resource and distributes the control right of the current public resource to the USB serial port equipment.
7. The method according to any one of claims 1 to 6, wherein the determining, when the terminal device receives an access request from the USB serial device, whether the current public resource is occupied by the PCMCIA serial device specifically includes:
and when an access request of the USB serial port equipment is received, acquiring the occupation identifier of the current public resource, and judging whether the current public resource is occupied by the PCMCIA serial port equipment or not according to the occupation identifier.
8. The method for accessing a serial device according to claim 7, wherein when the terminal device receives the access request from the USB serial device, before determining whether the current public resource is occupied by the PCMCIA serial device, the method further comprises:
and when the current public resource is occupied, setting an occupation identifier for the current public resource according to the serial port type of the serial port equipment occupying the current public resource.
9. A terminal device, characterized in that the terminal device comprises: memory, a processor and an access program of a serial device stored on the memory and operable on the processor, the access program of the serial device being configured to implement the steps of the access method of the serial device according to any one of claims 1 to 8.
10. A computer-readable storage medium, in which an access program of a serial device is stored, and when the access program of the serial device is executed by a processor, the steps of the access method of the serial device according to any one of claims 1 to 8 are implemented.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711471031.5A CN108038072B (en) | 2017-12-28 | 2017-12-28 | Access method of serial device, terminal device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711471031.5A CN108038072B (en) | 2017-12-28 | 2017-12-28 | Access method of serial device, terminal device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108038072A CN108038072A (en) | 2018-05-15 |
CN108038072B true CN108038072B (en) | 2021-11-09 |
Family
ID=62098675
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711471031.5A Active CN108038072B (en) | 2017-12-28 | 2017-12-28 | Access method of serial device, terminal device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108038072B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113127286B (en) * | 2019-12-30 | 2023-01-20 | 深圳Tcl新技术有限公司 | Data acquisition method and device for multi-serial port communication, intelligent terminal and storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1402471A (en) * | 2001-08-13 | 2003-03-12 | 华为技术有限公司 | Network processor thread scheduling method |
CN1538767A (en) * | 2003-10-24 | 2004-10-20 | 大唐移动通信设备有限公司 | Method and device for realizing resource seizing based on priority of radio link |
CN1620036A (en) * | 2003-11-20 | 2005-05-25 | 华为技术有限公司 | Method of distributing ABIS interface band width resource |
CN2899305Y (en) * | 2006-02-20 | 2007-05-09 | 南京联创通信科技有限公司 | Universal extended cheap special network router of wireless virtual |
CN201563134U (en) * | 2009-12-24 | 2010-08-25 | 华为终端有限公司 | Gateway device and adapter |
CN202077054U (en) * | 2011-04-29 | 2011-12-14 | 周云波 | Serial port control system based on instant communication software |
CN104536926A (en) * | 2014-12-22 | 2015-04-22 | 深圳市科漫达智能管理科技有限公司 | Control method and device of serial devices |
CN105868132A (en) * | 2016-04-29 | 2016-08-17 | 优利德科技(中国)有限公司 | USB communication based modular function expansion method and system for digital oscilloscope |
CN106781681A (en) * | 2017-02-28 | 2017-05-31 | 中原工学院 | A kind of parking position intelligent detecting, far management system based on cloud management |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6148354A (en) * | 1999-04-05 | 2000-11-14 | M-Systems Flash Disk Pioneers Ltd. | Architecture for a universal serial bus-based PC flash disk |
US20020071424A1 (en) * | 2000-12-12 | 2002-06-13 | Chiu King W. | Packet voice telephony apparatus and method |
US6889058B2 (en) * | 2001-04-20 | 2005-05-03 | Sony Corporation | Set up logic for dual interface wireless IP communication device |
CN1367438B (en) * | 2002-02-09 | 2012-02-08 | 深圳市朗科科技股份有限公司 | Semiconductor storage method for supporting several interfaces and device |
US8245058B2 (en) * | 2010-04-16 | 2012-08-14 | Sunix Co., Ltd. | Serial port connector with power output function |
CN102387507B (en) * | 2010-09-01 | 2016-06-29 | 中兴通讯股份有限公司 | The management method of a kind of multimode co-transmission transmission resource and device |
CN105592066B (en) * | 2015-11-05 | 2019-01-08 | 新华三技术有限公司 | resource access control method and device |
CN107291495A (en) * | 2017-06-01 | 2017-10-24 | 努比亚技术有限公司 | A kind of shared resource loading method, terminal and computer-readable recording medium |
-
2017
- 2017-12-28 CN CN201711471031.5A patent/CN108038072B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1402471A (en) * | 2001-08-13 | 2003-03-12 | 华为技术有限公司 | Network processor thread scheduling method |
CN1538767A (en) * | 2003-10-24 | 2004-10-20 | 大唐移动通信设备有限公司 | Method and device for realizing resource seizing based on priority of radio link |
CN1620036A (en) * | 2003-11-20 | 2005-05-25 | 华为技术有限公司 | Method of distributing ABIS interface band width resource |
CN2899305Y (en) * | 2006-02-20 | 2007-05-09 | 南京联创通信科技有限公司 | Universal extended cheap special network router of wireless virtual |
CN201563134U (en) * | 2009-12-24 | 2010-08-25 | 华为终端有限公司 | Gateway device and adapter |
CN202077054U (en) * | 2011-04-29 | 2011-12-14 | 周云波 | Serial port control system based on instant communication software |
CN104536926A (en) * | 2014-12-22 | 2015-04-22 | 深圳市科漫达智能管理科技有限公司 | Control method and device of serial devices |
CN105868132A (en) * | 2016-04-29 | 2016-08-17 | 优利德科技(中国)有限公司 | USB communication based modular function expansion method and system for digital oscilloscope |
CN106781681A (en) * | 2017-02-28 | 2017-05-31 | 中原工学院 | A kind of parking position intelligent detecting, far management system based on cloud management |
Also Published As
Publication number | Publication date |
---|---|
CN108038072A (en) | 2018-05-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107679718B (en) | List allocation method, apparatus and computer-readable storage medium | |
EP3073777A1 (en) | Management method for embedded universal integrated circuit card, related device and system | |
CN102883449B (en) | A kind of realize the method for data sharing, associated terminal and system | |
CN108039969B (en) | Network automatic configuration method, device, system, storage medium and target computer | |
CN110932994B (en) | Data traffic processing method and device, electronic equipment and storage medium | |
CN108804938B (en) | Authority detection method and device, electronic equipment and readable storage medium | |
CN110324184B (en) | Service capacity expansion and migration method, device, system, equipment and readable storage medium | |
CN107818023B (en) | Thread-based message processing method, intelligent device and storage medium | |
EP3667489A1 (en) | Method and device for managing application program | |
CN107995286B (en) | Automatic service starting and stopping method based on dubbo platform, server and storage medium | |
CN113612861B (en) | Remote access method, system and computer readable storage medium | |
CN110868339A (en) | Node distribution method and device, electronic equipment and readable storage medium | |
CN111787522B (en) | Radio resource control RRC state maintenance method, terminal and storage medium | |
CN104363501A (en) | Icon classification management method and system and player terminal | |
CN108038072B (en) | Access method of serial device, terminal device and computer readable storage medium | |
CN111338710A (en) | Application program control method and device, electronic equipment and storage medium | |
EP3267655A1 (en) | Multi-terminal interaction relation maintenance system and method | |
CN105808299A (en) | External device automatic mounting and informing control method and system | |
US20110263295A1 (en) | System and method for providing a smart card-based widget service, and smart card for the same | |
CN112019770A (en) | Board card resource allocation method and device, video wall and readable storage medium | |
CN109743416B (en) | CDN domain name scheduling method, device, computer readable storage medium and system | |
CN111930482A (en) | Task processing method, device and equipment based on node cluster and storage medium | |
CN107679871B (en) | List management method, device, system and computer readable storage medium | |
CN114726905B (en) | Method, device, equipment and storage medium for accessing Tbox network into Android system | |
CN105791164B (en) | Network resource allocation method 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 |