CN103049401A - Method, system and control device for controlling peripheral serial device - Google Patents

Method, system and control device for controlling peripheral serial device Download PDF

Info

Publication number
CN103049401A
CN103049401A CN2011103142532A CN201110314253A CN103049401A CN 103049401 A CN103049401 A CN 103049401A CN 2011103142532 A CN2011103142532 A CN 2011103142532A CN 201110314253 A CN201110314253 A CN 201110314253A CN 103049401 A CN103049401 A CN 103049401A
Authority
CN
China
Prior art keywords
serial
serial port
port
equipment
virtual
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.)
Granted
Application number
CN2011103142532A
Other languages
Chinese (zh)
Other versions
CN103049401B (en
Inventor
樊季林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Kangjia Intelligent Terminal Technology Co Ltd
Original Assignee
Konka Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Konka Group Co Ltd filed Critical Konka Group Co Ltd
Priority to CN201710923154.1A priority Critical patent/CN107729264B/en
Priority to CN201110314253.2A priority patent/CN103049401B/en
Publication of CN103049401A publication Critical patent/CN103049401A/en
Application granted granted Critical
Publication of CN103049401B publication Critical patent/CN103049401B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

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 a method for controlling a peripheral serial device. The method comprises steps of converting a physical serial port of the peripheral serial device to a virtual serial port of a control device in accordance with preset serial port configuration information; receiving the control information of the operation for the virtual serial port of the control device; and converting the operation for the virtual serial port, which corresponds to the control information, to the operation for the physical serial port of the peripheral serial device. The invention also discloses the method, a system and the control device for controlling the peripheral serial device. According to the embodiment, the physical serial port of the peripheral serial device is converted to the virtual serial port of the control device, the operation of the control device for the virtual serial port can be converted to the operation for the serial port of the peripheral serial device, and the control device can control the peripheral serial device.

Description

A kind of method, system and opertaing device of controlling peripheral serial equipment
Technical field
The present invention relates to the serial communication field, particularly, relate in particular to a kind of method, system and opertaing device of controlling peripheral serial equipment.
Background technology
Based on the peripheral serial equipment of serial communication, all need to connect by serial ports (physical serial interface or virtual serial port) and opertaing device, thereby realize the serial communication between opertaing device and the peripheral serial equipment.
In existing, for the peripheral serial equipment that carries out serial communication by physical serial interface, it normally is driving of this periphery serial equipment exploitation, opertaing device installed should the driving of periphery serial equipment after, just can carry out serial communication by the physical serial interface of its physical serial interface and peripheral serial equipment, and then control peripheral serial equipment.For example, the developer develops the driving of a bar code scan equipment, opertaing device has been installed the driver of this bar code scan equipment, just can carry out serial communication by the physical serial interface of physical serial interface and this bar code scan equipment, such as carrying out bar code scan operation etc.In existing, opertaing device is generally the equipment that is built-in with the WINCE system, such as PDA etc.
In existing, for the peripheral serial equipment that carries out serial communication by virtual serial port and opertaing device, its normally with third-party control devices on slogan be that the virtual serial port of 1-9 carries out serial communication.Opertaing device is that the virtual serial port of 1-9 connects by remote desktop RDP agreement and third-party control devices upper end slogan, realizes the serial communication with peripheral serial equipment, and then realizes that opertaing device is to the control of peripheral serial equipment.
Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, opertaing device provides a kind of method, system and opertaing device of controlling peripheral serial equipment, so that can be realized control to peripheral serial equipment by arbitrary virtual serial port of controlling its virtual serial port or control third-party control devices.
In order to address the above problem, the present invention proposes a kind of method of controlling peripheral serial equipment, comprising:
According to default serial ports configuration information, the physical serial interface of peripheral serial equipment is converted to arbitrary virtual serial port of opertaing device;
The control information that reception operates the virtual serial port of described opertaing device;
The operation to described virtual serial port that described control information is corresponding converts the operation to the physical serial interface of described peripheral serial equipment to.
A kind of method of controlling peripheral serial equipment comprises:
According to default serial ports configuration information, convert third-party control devices middle-end slogan to arbitrary virtual serial port that third-party control devices middle-end slogan is less than or equal to thresholding greater than arbitrary virtual serial port of thresholding; Described third-party control devices and peripheral serial equipment carry out serial communication by described port numbers greater than arbitrary virtual serial port of thresholding; Arbitrary virtual serial port that opertaing device and described third-party control devices middle-end slogan are less than or equal to thresholding connects;
The control information that arbitrary virtual serial port that receiving control apparatus transmits, that described third-party control devices middle-end slogan is less than or equal to thresholding operates;
The operation that described third-party control devices middle-end slogan is less than or equal to arbitrary virtual serial port of thresholding that described control information is corresponding converts to the operation of described third-party control devices middle-end slogan greater than arbitrary virtual serial port of thresholding, controls described peripheral serial equipment.
Correspondingly, the invention provides a kind of opertaing device, comprising:
Receiver module be used for to receive the control information that the virtual serial port to described opertaing device operates;
Modular converter is used for the serial ports of peripheral serial equipment being converted to the virtual serial port of opertaing device according to default serial ports configuration information; And also be used for converting the operation to described virtual serial port corresponding to described control information that described receiver module receives to the physical serial interface of described peripheral serial equipment operation.
At last, the present invention also provides a kind of system that controls peripheral serial equipment, comprising:
Opertaing device is used for the serial ports of peripheral serial equipment being converted to the virtual serial port of opertaing device according to default serial ports configuration information; The control information that reception operates the virtual serial port of described opertaing device; And the operation to described virtual serial port that described control information is corresponding converts the operation to the physical serial interface of described peripheral serial equipment to;
Peripheral serial equipment is used for the control information that receiving control apparatus transmits and responds the operation to described virtual serial port corresponding to described control information, and by its physical serial interface operating result returned to opertaing device.
Beneficial effect of the present invention:
By according to default serial ports configuration information, the physical serial interface of peripheral serial equipment is converted to the virtual serial port of opertaing device; Perhaps convert third-party control devices middle-end slogan to arbitrary virtual serial port that third-party control devices middle-end slogan is less than or equal to thresholding greater than arbitrary virtual serial port of thresholding, wherein, third-party control devices carries out serial communication by its port numbers greater than arbitrary virtual serial port and the peripheral serial equipment of thresholding, opertaing device utilizes RDP, and the arbitrary virtual serial port that is less than or equal to thresholding with described third-party control devices middle-end slogan connects; So design, opertaing device all can be converted to operation to the serial ports of peripheral serial equipment to the operation of its virtual serial port or the operation that third-party control devices middle-end slogan is less than or equal to arbitrary virtual serial port of thresholding, and then realizes that opertaing device is to the control of described peripheral serial equipment.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, the below will do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art, apparently, accompanying drawing in the following describes only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the method flow diagram of the peripheral serial equipment of control of the invention process one;
Fig. 2 is the method flow diagram of the peripheral serial equipment of control of the invention process two;
Fig. 3 is the method flow diagram of the peripheral serial equipment of control of the invention process three;
Fig. 4 is the method flow diagram of the peripheral serial equipment of control of the invention process four;
Fig. 5 is the structural representation of the opertaing device of the embodiment of the invention five;
Fig. 6 is the structural representation of the modular converter of the embodiment of the invention five;
Fig. 7 is the system schematic of the peripheral serial equipment of control of the embodiment of the invention six.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making all other embodiment that obtain under the creative work prerequisite.
In existing, if when peripheral serial equipment carries out serial communication by physical serial interface and opertaing device, all needing application developer is driving of this periphery serial equipment exploitation.Application developer need to relate to a lot of details when the driving of the peripheral serial equipment of exploitation, for example, how the how initialization of peripheral serial equipment receives and send data, how to resolve and encapsulated data packet, how to manage its power supply so that power saving etc.Therefore, for application developer, it needs to be grasped enough ins and outs, and needs the long construction cycle of cost can develop the driving that is suitable for some concrete peripheral serial communication equipment.
Just think, if the manufacturer of peripheral serial equipment or third party developer make a virtual serial port with driving corresponding to peripheral serial communication equipment and are loaded by the operating system of opertaing device, so, then shielded all ins and outs to this periphery serial equipment bottom operation, and its ins and outs are finished by the driving of virtual serial port.Like this, for application developer, its need then can be realized the control to this periphery serial equipment by the virtual serial port on the control opertaing device, and do not spend the bottom operation of being concerned about this periphery serial equipment.And all application developer all can be controlled peripheral serial equipment by the virtual serial port of controlling on this opertaing device.
According to above-mentioned design, as shown in Figure 1, be a kind of method of controlling peripheral serial equipment of the embodiment of the invention one, comprising:
S11, basis are preset the serial ports configuration information, the physical serial interface of peripheral serial equipment are converted to the virtual serial port of opertaing device;
Virtual serial port refers to opertaing device under the condition that does not increase any hardware, by certain operation, sets up VSP (the Virtual Serial Port: virtual serial port) of peripheral serial equipment in its operating system.So, application developer can use virtual serial port and peripheral serial equipment to carry out serial communication as the standard serial port that uses operating system.Virtual serial port is equivalent to set up the data link of an endless between opertaing device and peripheral serial equipment, application developer can think that peripheral serial equipment is directly connected on the opertaing device.
In this step, opertaing device can convert the physical serial interface of peripheral serial equipment to the virtual serial port of opertaing device according to default serial ports virtual information.So, application developer namely can be exchanged into the operation of the physical serial interface of externally enclosing serial equipment to the operation of this opertaing device virtual serial port.
Peripheral serial equipment can carry out the equipment of serial communication based on physical serial interface and opertaing device for all, such as bar code scan equipment etc.In existing, when opertaing device converted the physical serial interface of bar code scan equipment to virtual serial port on the opertaing device, application developer can realize the control to peripheral serial equipment by the virtual serial port on the control opertaing device.Wherein, opertaing device can be PDA etc.
S12, receive the control information that the virtual serial port to described opertaing device operates;
In this step, the operation that the control information that application developer is inputted at opertaing device is corresponding comprises the operations such as access to the virtual serial port of described opertaing device, reading and writing.
S13, the operation to described virtual serial port that described control information is corresponding convert the operation to the physical serial interface of described peripheral serial equipment to.
Among the step S13, opertaing device also sends this control information to described peripheral serial equipment by described virtual serial port after the control information that has received the application developer input.Peripheral serial equipment responds the operation to the virtual serial port of described opertaing device corresponding to described control information, and operating result is returned to opertaing device.So, namely can the operation to described the above virtual serial port of opertaing device that described control information is corresponding convert the operation to the physical serial interface of described peripheral serial equipment to.
In step S11-S13, convert the virtual serial port of opertaing device to by the physical serial interface with peripheral serial equipment, like this then so that application developer all can convert operation to peripheral serial equipment to the operation of the virtual serial port of opertaing device.Therefore, all application developer are by the described virtual serial port on the control opertaing device, can realize the control to peripheral serial equipment, such as access, the peripheral serial ports opertaing device of reading and writing etc., and the realization that does not spend the bottom operation of being concerned about this periphery serial equipment is (such as the how initialization of: peripheral serial equipment, how to receive and to send the realization of the bottom operations such as data), thereby reduced the development amount of application developer, and also so that this virtual serial port has certain versatility and ease for operation.
As shown in Figure 2, be a kind of method of controlling peripheral serial equipment of the embodiment of the invention two, comprising:
S21, the default serial ports configuration information of reception;
In the specific implementation, convert in the physical serial interface with peripheral serial equipment before the virtual serial port of opertaing device, also need to receive the default serial ports configuration information that the developer imports, described default serial ports configuration information specifically comprises: the physical serial interface of the configuration file of the log-on message of the described virtual serial port that the developer arranges, the described virtual serial port of configuration and default described peripheral serial equipment converts the driver of the virtual serial port of described opertaing device to.
Wherein, described opertaing device is built-in with operating system, and described basis is preset the serial ports configuration information, converts the physical serial interface of peripheral serial equipment the virtual serial port of opertaing device to, specifically comprises:
At first, the log-on message that the operating system basis receives, the title of the driving of the loading sequence of the virtual serial port that identification need to load, port numbers and correspondence.The driving name of the correspondence of the virtual serial port that for example, need to load is called: VirualCom.dll, port numbers is 9.
What need explanation a bit is, the operating system in the embodiment of the invention can be existing all operations system, Windows series operating system for example, the operating system of Vista series etc.
Need explanation on the other hand, the developer is when arranging the log-on message of described virtual serial port, and employed development language does not have clear and definite restriction, for example can be C language, C Plus Plus, assembly language etc.In embodiments of the present invention, described developer all refers to manufacturer or the third party developer of peripheral serial equipment, is not application developer.
Secondly, described operating system is according to the configuration file of developer's configuration, for example, bib configuration file according to this virtual serial port of developer configuration, the physical serial interface that loads described peripheral serial equipment converts the driver of the virtual serial port of described opertaing device to, in order to when operating system generates, guarantee to comprise in this operating system this driver.What need explanation a bit is, the developer is when the configuration file of this virtual serial port of configuration, and employed development language does not have clear and definite restriction, for example can be C language, C Plus Plus, assembly language etc.
At last, the physical serial interface of the described peripheral serial equipment of described operating system converts the driver of the virtual serial port of described opertaing device to, finishes the physical serial interface of described peripheral serial equipment to the conversion of the virtual serial port of opertaing device.
Need to prove that when the developer converted the driver of virtual serial port of opertaing device in the physical serial interface of default peripheral serial equipment, employed development language did not have clear and definite restriction, can be C language, C Plus Plus, assembly language etc.
For example, when the physical serial interface of presetting peripheral serial equipment with C Plus Plus converts the driver of virtual serial port of opertaing device to, developer (manufacturer or the third party developer that comprise peripheral serial equipment, be different from application developer) can finish with the COM_Init function initialization of peripheral serial equipment, open the physical serial interface of peripheral serial equipment with the COM_Open function, and pass through the control information of to the periphery serial equipment transmission of this physical serial interface application developer input.For example, also control the closing of physical serial interface of peripheral serial equipment with the COM_Close function; Finish communication baud rate to physical serial interface with the COM_IOControl function, parity bit, the setting of data bit, hardware flow and device power supply (DPS) management can be encapsulated in this function some control functions of peripheral serial equipment certainly.Unload peripheral serial equipment with the COM_Deinit function, come the encapsulation of paired data bag and given peripheral serial equipment Packet Generation with COM_Write.Come reading and resolving of paired data bag with the COM_Read function, and transferred data to opertaing device.
S22, basis are preset the serial ports configuration information, the physical serial interface of peripheral serial equipment are converted to the virtual serial port of opertaing device;
S23, receive the control information that the virtual serial port to described opertaing device operates;
S24, the operation to described virtual serial port that described control information is corresponding convert the operation to the physical serial interface of described peripheral serial equipment to.
Wherein, the operation of step S22-S24 is identical with the operation of embodiment one step S11-S13, be not repeated in this description at this.
In embodiment one and this enforcement, peripheral serial equipment can carry out the equipment of serial communication based on physical serial interface and opertaing device for all, such as bar code scan equipment etc.When the developer converted the physical serial interface of bar code scan equipment to virtual serial port on the opertaing device, application developer can realize the control to bar code scan equipment by the described virtual serial port on the control opertaing device.So, all application developer do not spend the realization of the bottom operation of being concerned about this virtual serial port when exploitation is changed the application of bar code scan equipment, thereby have reduced the workload of application developer yet.
In the prior art, for the peripheral serial equipment that carries out serial communication by virtual serial port (such as bluetooth equipment etc.), it is that the virtual serial port of 1-9 carries out serial communication with third-party control devices (as the bluetooth equipment of WINCE system, the bluetooth equipment of Windows mobile system are housed) upper end slogan normally.Opertaing device (such as PC etc.) is by RDP(Remote Desktop Protocol: RDP) connect with third-party control devices, be the virtual serial port of 1-9 by control third-party control devices upper end slogan, and then control peripheral serial equipment.Yet, for port numbers third-party control devices very in short supply (as the bluetooth equipment of WINCE system, the bluetooth equipment of Windows mobile system etc. are housed), the port numbers that itself and peripheral serial equipment carry out the virtual serial port of communication may not be the interior arbitrary port numbers of 1-9, but port numbers is greater than 9 port numbers.At this moment, when PC connects when the bluetooth equipment of WINCE is housed by the RDP agreement, because its bluetooth equipment upper end slogan that can only find to be equipped with WINCE system, Windows mobile system is the arbitrary serial ports between the 1-9, so this moment, PC can not connect with peripheral serial equipment, controlled peripheral serial equipment.Thus, the present invention also provides a kind of method of controlling peripheral serial equipment, as shown in Figure 3, is a kind of method of controlling peripheral serial equipment of the embodiment of the invention three, comprising:
S31, according to default serial ports configuration information, convert third-party control devices middle-end slogan to arbitrary virtual serial port that third-party control devices middle-end slogan is less than or equal to thresholding greater than arbitrary virtual serial port of thresholding; Described third-party control devices and peripheral serial equipment carry out serial communication by described port numbers greater than arbitrary virtual serial port of thresholding; Control connects with arbitrary virtual serial port that described third-party control devices middle-end slogan is less than or equal to thresholding;
Virtual serial port described in this step, the virtual serial port described in is identical with implementing, and no longer is repeated in this description at this.Thresholding described in this step, when the arbitrary virtual serial port that refers to opertaing device and third-party control devices connects, the maximum port numbers that this arbitrary virtual serial port is corresponding.
In the specific implementation, peripheral serial equipment can carry out the equipment of serial communication, for example bluetooth equipment A based on virtual serial port and third-party control devices for all.Third-party control devices is the equipment that is built-in with operating system, as the bluetooth equipment B of Wince system or windows mobile system is housed.If two bluetooth equipments connect by the serial port protocol of bluetooth, suppose that bluetooth equipment B use side slogan is that 12 bluetooth serial ports and bluetooth equipment A carry out serial communication.And opertaing device can be PC, and it connects by RDP and bluetooth equipment B.Owing to can only find the arbitrary serial ports of bluetooth equipment B middle-end slogan between 0 to 9 at the PC end.That is to say that 9 are connect with the opertaing device maximum port numbers corresponding to virtual port of time use of third-party control devices, namely 9 is thresholding.Because can't find port numbers on the PC and be 12 bluetooth serial ports, so just have no idea to access bluetooth equipment B.If PC is wanted to visit the bluetooth equipment A that connects with bluetooth equipment B by RDP, then need by in port numbers of bluetooth equipment B interpolation being the arbitrary virtual serial port between 0 to 9.Specific practice is exactly to be bluetooth equipment B upper end slogan that 12 bluetooth serial ports converts the arbitrary virtual serial port of bluetooth equipment B upper end slogan between 0 to 9 to, suppose with regard to virtual for virtual serial port 9, all be that the operation of 9 virtual serial port all can all transform bluetooth equipment upper end slogan to bluetooth equipment B upper end slogan are the operation of 12 bluetooth serial ports so, and PC just can be that 9 virtual serial port is controlled bluetooth equipment A by the port numbers of controlling bluetooth equipment B like this.
The control information that arbitrary virtual serial port that S32, receiving control apparatus transmit, that described third-party control devices middle-end slogan is less than or equal to thresholding operates;
In this step, application developer is input control information on opertaing device, and it is transferred to third-party control devices.Wherein, the operation corresponding to control information of application developer input comprises the operations such as reading and writing, control.
S33, the operation that described third-party control devices middle-end slogan is less than or equal to arbitrary virtual serial port of thresholding that described control information is corresponding convert to the operation of described third-party control devices middle-end slogan greater than arbitrary virtual serial port of thresholding, control described peripheral serial equipment.
Among the step S33, application developer is input control information on opertaing device, and it is transferred to third-party control devices.Such as, third-party control devices received described port numbers is the control information of 1 to 9 arbitrary virtual serial port after, be that arbitrary virtual serial port, the port numbers of 1-9 sends peripheral serial equipment to greater than arbitrary virtual serial port of 9 by port numbers successively with this control information.Peripheral serial equipment respond described control information corresponding be the operation of arbitrary virtual serial port of 1-9 to described third-party control devices middle-end slogan, and operating result is returned to third-party control devices.Third-party control devices also sends it to opertaing device after receiving described operating result.
In step S31-S33, convert third-party control devices middle-end slogan to arbitrary virtual serial port that third-party control devices middle-end slogan is less than or equal to thresholding greater than arbitrary virtual serial port of thresholding, so that the operation that third-party control devices upper end slogan be less than or equal to the arbitrary virtual serial port of thresholding on of application developer by opertaing device input all can convert to the operation of third-party control devices upper end slogan greater than arbitrary virtual serial port of thresholding, and then be converted to operation to the virtual serial port of peripheral serial equipment.So, so that opertaing device can be realized the control to peripheral serial equipment by the arbitrary virtual serial port on the third-party control devices.
As shown in Figure 4, be a kind of method of controlling peripheral serial equipment of the embodiment of the invention four, comprising:
S41, the default serial ports configuration information of reception;
In the specific implementation, opertaing device middle-end slogan is converted to before arbitrary virtual serial port that opertaing device middle-end slogan is less than or equal to thresholding greater than arbitrary virtual serial port of thresholding, also comprise receiving default serial ports configuration information, described default serial ports configuration information specifically comprises:
Log-on message, configuration described that the third-party control devices upper end slogan that the developer arranges is less than or equal to arbitrary virtual serial port of thresholding is less than or equal to the configuration file of arbitrary virtual serial port of thresholding and default described port numbers and converts the driver that described port numbers is less than or equal to arbitrary virtual serial port of thresholding to greater than arbitrary virtual serial port of thresholding.
Wherein, described third-party control devices is built-in with operating system, such as the WINC system, or the Windows system, convert opertaing device middle-end slogan to arbitrary virtual serial port that opertaing device middle-end slogan is less than or equal to thresholding greater than arbitrary virtual serial port of thresholding, be specially:
At first, the log-on message that the operating system basis receives, the title of the driving of the loading sequence of the virtual serial port that identification need to load, port numbers and correspondence.The driving name of the correspondence of the virtual serial port that for example, need to load is called: VirualCom.dll, port numbers is 9.When this was in the port numbers that virtual serial port is set, it was the arbitrary virtual serial port that is less than or equal to thresholding that port numbers can only be set, and was arbitrary virtual serial port between the 1-9 such as port numbers.
What need explanation a bit is, the developer is when arranging the log-on message of the described arbitrary virtual serial port that is less than or equal to thresholding, and employed development language does not have clear and definite restriction, for example can be C language, C Plus Plus, assembly language etc.In embodiments of the present invention, described developer all refers to manufacturer or the third party developer of peripheral serial equipment, is not application developer.
Secondly, operating system is according to described configuration file, loads described port numbers and converts the driver that described port numbers is less than or equal to arbitrary virtual serial port of thresholding to greater than arbitrary virtual serial port of thresholding.For example, operating system is the bib configuration file (wherein 9 are thresholding) of 9 virtual serial port according to the port numbers of developer configuration, the loading end slogan is the driver that 12 virtual serial port converts 9 virtual serial ports to, in order to when operating system generates, guarantee to comprise in this operating system this driver.What need explanation a bit is, when the developer was less than or equal to the configuration file of arbitrary virtual serial port of thresholding in configuration, employed development language did not have clear and definite restriction, for example can be C language, C Plus Plus, assembly language etc.
At last, the described port numbers that the described developer of described operating system presets converts the driver that described port numbers is less than or equal to arbitrary virtual serial port of thresholding to greater than arbitrary virtual serial port of thresholding, finishes described port numbers and converts the conversion that described port numbers is less than or equal to arbitrary virtual serial port of thresholding to greater than arbitrary virtual serial port of thresholding.
Wherein, when the developer converted described port numbers to and is less than or equal to the driver of arbitrary virtual serial port of thresholding greater than arbitrary virtual serial port of thresholding in default described port numbers, employed development language did not have clear and definite restriction, for example can be the C language, C Plus Plus, assembly language etc.
For example, when presetting the arbitrary virtual serial port of described port numbers greater than thresholding with C Plus Plus and convert described port numbers to and be less than or equal to the driver of arbitrary virtual serial port of thresholding, developer (manufacturer or the third party developer that comprise peripheral serial equipment, be different from application developer) can finish with the COM_Init function initialization of peripheral serial equipment, open virtual serial port corresponding to peripheral serial equipment with the COM_Open function, and pass through the control information of to the periphery serial equipment transmission of this virtual serial port application developer input.For example, also control the closing of virtual serial port of peripheral serial equipment with the COM_Close function; Finish communication baud rate to virtual serial port with the COM_IOControl function, parity bit, the setting of data bit, hardware flow and device power supply (DPS) management can be encapsulated in this function some control functions of peripheral serial equipment certainly.Unload peripheral serial equipment with the COM_Deinit function, come the encapsulation of paired data bag and given peripheral serial equipment Packet Generation with COM_Write.Come reading and resolving of paired data bag with the COM_Read function, and transferred data to opertaing device.
S42, according to default serial ports configuration information, convert third-party control devices middle-end slogan to arbitrary virtual serial port that third-party control devices middle-end slogan is less than or equal to thresholding greater than arbitrary virtual serial port of thresholding; Described third-party control devices and peripheral serial equipment carry out serial communication by described port numbers greater than arbitrary virtual serial port of thresholding; Arbitrary virtual serial port that opertaing device and described third-party control devices middle-end slogan are less than or equal to thresholding connects;
The control information that arbitrary virtual serial port that S43, receiving control apparatus transmit, that described third-party control devices middle-end slogan is less than or equal to thresholding operates;
S44, the operation that described third-party control devices middle-end slogan is less than or equal to arbitrary virtual serial port of thresholding that described control information is corresponding convert to the operation of described third-party control devices middle-end slogan greater than arbitrary virtual serial port of thresholding, control described peripheral serial equipment.
Wherein, the operation of step S42-S44 is identical with the operation of embodiment three step S31-S33, be not repeated in this description at this.
In the present embodiment, third-party control devices is according to the default serial ports configuration information that receives, convert its upper end slogan to arbitrary virtual serial port that port numbers is less than or equal to thresholding greater than arbitrary virtual serial port of thresholding, so that the operation that third-party control devices upper end slogan be less than or equal to the arbitrary virtual serial port of thresholding on of application developer by opertaing device input all can convert to the operation of third-party control devices upper end slogan greater than arbitrary virtual serial port of thresholding, and then be converted to operation to the virtual serial port of peripheral serial equipment.So, so that opertaing device can be realized the control to peripheral serial equipment by the arbitrary virtual serial port on the third-party control devices, such as access, the peripheral serial ports opertaing device of read-write etc.
Correspondingly, as shown in Figure 5, the embodiment of the invention five also discloses a kind of opertaing device, comprising:
Receiver module 51 be used for to receive the control information that the virtual serial port to described opertaing device operates; Wherein, the operation that the control information that application developer is inputted at opertaing device is corresponding comprises the operations such as access, reading and writing.The described virtual serial port of inventive embodiments, the virtual serial port described in is identical with implementing, and no longer describes at this.
Wherein, described receiver module 51 also is used for receiving default serial ports configuration information, and described default serial ports configuration information specifically comprises for the developer presets:
The log-on message of described virtual serial port;
The configuration file of described virtual serial port;
The physical serial interface of described peripheral serial equipment converts the driver of the virtual serial port of described opertaing device to.Wherein, when the developer should preset the serial ports configuration information in configuration, employed development language did not have clear and definite restriction, for example can be C language, C Plus Plus, assembly language etc.
Modular converter 52 is used for the serial ports of peripheral serial equipment being converted to the virtual serial port of opertaing device according to default serial ports configuration information; So, application developer namely can be exchanged into the operation of the physical serial interface of externally enclosing serial equipment to the operation of this virtual serial port.
Modular converter 52 also is used for converting the operation to described virtual serial port corresponding to described control information that receiver module 51 receives to the physical serial interface of described peripheral serial equipment operation.
In the specific implementation, as shown in Figure 6, modular converter 52 comprises:
Log-on message recognition unit 61 is used for according to described log-on message, and identification needs loading sequence, the port numbers of the described virtual port of loading and drives title; For example, log-on message recognition unit 61, the driving name of the correspondence of the virtual serial port that need to load is called: VirualCom.dll, port numbers is 9.Herein, during the port numbers of the virtual serial port of developer after conversion is set, unqualified to port numbers.
Driver record unit 62 is used for according to described configuration information, and the physical serial interface that loads described peripheral serial equipment is transformed into the driver of the virtual serial port of described opertaing device; For example, driver record unit 62 is the bib configuration file (wherein 9 are thresholding) of 9 virtual serial port according to the port numbers of developer's configuration, the loading end slogan is the driver that 12 virtual serial port converts 9 virtual serial ports to, in order to when operating system generates, guarantee to comprise in this operating system this driver.
Driver operation unit is used for moving described driver, the physical serial interface of described peripheral serial equipment is converted to the virtual serial port of opertaing device.
Wherein, need to prove, the developer is when presetting described driver with C Plus Plus, the manufacturer of peripheral serial equipment or the initialization that third party developer's (being different from application developer) can finish with the COM_Init function peripheral serial equipment, open the physical serial interface of peripheral serial equipment with the COM_Open function, and pass through the control information of to the periphery serial equipment transmission of this physical serial interface application developer input.For example, also control the closing of physical serial interface of peripheral serial equipment with the COM_Close function; Finish communication baud rate to physical serial interface with the COM_IOControl function, parity bit, the setting of data bit, hardware flow and device power supply (DPS) management can be encapsulated in this function some control functions of peripheral serial equipment certainly.Unload peripheral serial equipment with the COM_Deinit function, come the encapsulation of paired data bag and given peripheral serial equipment Packet Generation with COM_Write.Come reading and resolving of paired data bag with the COM_Read function, and transferred data to opertaing device.
Transmit-Receive Unit 62 is used for sending described control information to described peripheral serial equipment by described virtual serial port; And be used for receiving described peripheral serial equipment and respond the operating result that returns after the operation to described virtual serial port corresponding to described control information.
In the present embodiment, under the effect of modular converter, the operation to the virtual serial port of described opertaing device corresponding to the control information of the application developer input that receiver module is received converts the operation to peripheral serial equipment to.So, all application developer are by the virtual serial port on the control opertaing device, can realize the control to peripheral serial equipment, such as access, the peripheral serial ports opertaing device of reading and writing etc., and the realization that does not spend the bottom operation of being concerned about this periphery serial equipment is (such as the how initialization of: peripheral serial equipment, how to receive and to send the realization of the bottom operations such as data), reduced the workload of application developer, and also so that this virtual serial port has certain versatility and ease for operation.
At last, as shown in Figure 7, the invention also discloses a kind of system that controls peripheral serial equipment, comprising:
Opertaing device 71 is used for the serial ports of peripheral serial equipment being converted to the virtual serial port of opertaing device according to default serial ports configuration information; The control information that reception operates the virtual serial port of described opertaing device; And the operation to described virtual serial port that described control information is corresponding converts the operation to the physical serial interface of described peripheral serial equipment to;
Peripheral serial equipment 72 is used for the control information that receiving control apparatus transmits and responds the operation to described virtual serial port corresponding to described control information, and by its physical serial interface operating result returned to opertaing device.
The system of the peripheral serial equipment of the control of present embodiment, the operation of application developer on the virtual serial port of opertaing device convert the physical serial interface of peripheral serial equipment the virtual serial port of opertaing device to by opertaing device, so that all can convert the operation to peripheral serial equipment to.So, all application developer are by the described virtual serial port on the control opertaing device, can realize the control to peripheral serial equipment, such as access, the peripheral serial ports opertaing device of read-write etc., and the realization that does not spend the bottom operation of being concerned about this periphery serial equipment is (such as the how initialization of: peripheral serial equipment, how to receive and to send the realization of the bottom operations such as data), thereby reduced the development amount of application developer, and also so that this virtual serial port has certain versatility and ease for operation.
More than the embodiment of the invention is provided, be described in detail, used specific case herein principle of the present invention and embodiment set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (12)

1. a method of controlling peripheral serial equipment is characterized in that, comprising:
According to default serial ports configuration information, the physical serial interface of peripheral serial equipment is converted to the virtual serial port of opertaing device;
The control information that reception operates the virtual serial port of described opertaing device;
The operation to described virtual serial port that described control information is corresponding converts the operation to the physical serial interface of described peripheral serial equipment to.
2. the method for claim 1 is characterized in that, described physical serial interface with peripheral serial equipment converts to before the virtual serial port of opertaing device, also comprises receiving default serial ports configuration information, and described default serial ports configuration information comprises:
The log-on message of described virtual serial port;
The configuration file of described virtual serial port;
The physical serial interface of described peripheral serial equipment converts the driver of the virtual serial port of described opertaing device to.
3. method as claimed in claim 2 is characterized in that, described opertaing device is built-in with operating system, and described basis is preset the serial ports configuration information, converts the physical serial interface of peripheral serial equipment the virtual serial port of opertaing device to, comprising:
Described operating system is identified loading sequence, the port numbers of described virtual port and is driven title according to described log-on message;
Described operating system is according to described configuration file, and the physical serial interface that loads described peripheral serial equipment converts the driver of the virtual serial port of described opertaing device to;
The described driver of described operating system converts the physical serial interface of described peripheral serial equipment to the virtual serial port of opertaing device.
4. such as each described method of claim 1-3, it is characterized in that the operation to described virtual serial port that described control information is corresponding converts the operation to the physical serial interface of described peripheral serial equipment to, comprising:
Send described control information to described peripheral serial equipment by described virtual serial port;
Receive described peripheral serial equipment and respond the operating result that returns after the operation to described virtual serial port corresponding to described control information.
5. a method of controlling peripheral serial equipment is characterized in that, comprising:
According to default serial ports configuration information, convert third-party control devices middle-end slogan to arbitrary virtual serial port that third-party control devices middle-end slogan is less than or equal to thresholding greater than arbitrary virtual serial port of thresholding; Described third-party control devices and peripheral serial equipment carry out serial communication by described port numbers greater than arbitrary virtual serial port of thresholding; Arbitrary virtual serial port that opertaing device and described third-party control devices middle-end slogan are less than or equal to thresholding connects;
The control information that arbitrary virtual serial port that receiving control apparatus transmits, that described third-party control devices middle-end slogan is less than or equal to thresholding operates;
The operation that described third-party control devices middle-end slogan is less than or equal to arbitrary virtual serial port of thresholding that described control information is corresponding converts to the operation of described third-party control devices middle-end slogan greater than arbitrary virtual serial port of thresholding, controls described peripheral serial equipment.
6. method as claimed in claim 4, it is characterized in that, opertaing device middle-end slogan is converted to before arbitrary virtual serial port that opertaing device middle-end slogan is less than or equal to thresholding greater than arbitrary virtual serial port of thresholding, also comprise receiving default serial ports configuration information, described default serial ports configuration information comprises:
The described log-on message that is less than or equal to arbitrary virtual serial port of thresholding;
The described configuration file that is less than or equal to arbitrary virtual serial port of thresholding;
Described port numbers converts the driver that described port numbers is less than or equal to arbitrary virtual serial port of thresholding to greater than arbitrary virtual serial port of thresholding.
7. method as claimed in claim 6, it is characterized in that, the built-in operating system of described third-party control devices describedly converts third-party control devices middle-end slogan to arbitrary virtual serial port that third-party control devices middle-end slogan is less than or equal to thresholding greater than arbitrary virtual serial port of thresholding, comprising:
Described operating system is identified described loading sequence, port numbers and the driving title that is less than or equal to arbitrary virtual port of thresholding according to described log-on message;
Described operating system is according to described configuration file, loads described port numbers and converts the driver that described port numbers is less than or equal to arbitrary virtual serial port of thresholding to greater than arbitrary virtual serial port of thresholding;
The described driver of described operating system converts third-party control devices middle-end slogan to arbitrary virtual serial port that third-party control devices middle-end slogan is less than or equal to thresholding greater than arbitrary virtual serial port of thresholding.
8. such as each described method of claim 5-7, it is characterized in that, the operation to being less than or equal to arbitrary virtual serial port of thresholding in the described third-party control devices that described control information is corresponding converts to the operation of described third-party control devices middle-end slogan greater than arbitrary virtual serial port of thresholding, and then control described peripheral serial equipment, comprising:
With described control information successively by described port numbers be less than or equal to arbitrary virtual serial port of thresholding, described port numbers sends described peripheral serial equipment to greater than arbitrary virtual serial port of thresholding;
Receive described peripheral serial equipment and respond the operating result that returns after the operation to arbitrary virtual serial port of being less than or equal to thresholding in the described third-party control devices corresponding to described control information, and send described operating result to described opertaing device.
9. an opertaing device is characterized in that, comprising:
Receiver module be used for to receive the control information that the virtual serial port to described opertaing device operates;
Modular converter is used for the serial ports of peripheral serial equipment being converted to the virtual serial port of opertaing device according to default serial ports configuration information; And also be used for converting the operation to described virtual serial port corresponding to described control information that described receiver module receives to the physical serial interface of described peripheral serial equipment operation.
10. opertaing device as claimed in claim 9 is characterized in that, described receiver module also is used for receiving default serial ports configuration information, and described default serial ports configuration information comprises:
The log-on message of described virtual serial port;
The configuration file of described virtual serial port;
The physical serial interface of described peripheral serial equipment converts the driver of the virtual serial port of described opertaing device to.
11. opertaing device as claimed in claim 9 is characterized in that, described modular converter comprises:
The log-on message recognition unit is used for according to described log-on message, identifies loading sequence, the port numbers of described virtual port and drives title;
Driver record unit is used for according to described configuration information, and the physical serial interface that loads described peripheral serial equipment is transformed into the driver of the virtual serial port of described opertaing device;
Driver operation unit is used for moving described driver, the physical serial interface of described peripheral serial equipment is converted to the virtual serial port of opertaing device;
Transmit-Receive Unit is used for sending described control information to described peripheral serial equipment by described virtual serial port; And be used for receiving described peripheral serial equipment and respond the operating result that returns after the operation to described virtual serial port corresponding to described control information.
12. a system that controls peripheral serial equipment is characterized in that, comprising:
Opertaing device is used for the serial ports of peripheral serial equipment being converted to the virtual serial port of opertaing device according to default serial ports configuration information; The control information that reception operates the virtual serial port of described opertaing device; And the operation to described virtual serial port that described control information is corresponding converts the operation to the physical serial interface of described peripheral serial equipment to;
Peripheral serial equipment is used for the control information that receiving control apparatus transmits and responds the operation to described virtual serial port corresponding to described control information, and by its physical serial interface operating result returned to opertaing device.
CN201110314253.2A 2011-10-17 2011-10-17 A kind of method, system and control device for controlling peripheral serial equipment Active CN103049401B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710923154.1A CN107729264B (en) 2011-10-17 2011-10-17 Method for controlling peripheral serial port equipment
CN201110314253.2A CN103049401B (en) 2011-10-17 2011-10-17 A kind of method, system and control device for controlling peripheral serial equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110314253.2A CN103049401B (en) 2011-10-17 2011-10-17 A kind of method, system and control device for controlling peripheral serial equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN201710923154.1A Division CN107729264B (en) 2011-10-17 2011-10-17 Method for controlling peripheral serial port equipment

Publications (2)

Publication Number Publication Date
CN103049401A true CN103049401A (en) 2013-04-17
CN103049401B CN103049401B (en) 2018-02-06

Family

ID=48062048

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201110314253.2A Active CN103049401B (en) 2011-10-17 2011-10-17 A kind of method, system and control device for controlling peripheral serial equipment
CN201710923154.1A Active CN107729264B (en) 2011-10-17 2011-10-17 Method for controlling peripheral serial port equipment

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201710923154.1A Active CN107729264B (en) 2011-10-17 2011-10-17 Method for controlling peripheral serial port equipment

Country Status (1)

Country Link
CN (2) CN103049401B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021136A (en) * 2016-05-09 2016-10-12 广州广电运通金融电子股份有限公司 Serial port mapping method and device based on Linux or Unix kernel operating system
CN106201974A (en) * 2016-08-29 2016-12-07 深圳市华阳信通科技发展有限公司 A kind of serial data order keeping method and system
CN113064842A (en) * 2021-04-09 2021-07-02 艾体威尔电子技术(北京)有限公司 Self-adaptive switching system and method for physical serial port and virtual serial port

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113360443B (en) * 2021-05-31 2022-07-08 浪潮电子信息产业股份有限公司 Serial port card communication realization method, device, equipment and readable storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100574023B1 (en) * 2004-01-20 2006-04-26 삼성전자주식회사 The device of transferring printing data using multiplex virtual connections and method thereof
CN1332291C (en) * 2005-11-25 2007-08-15 北京中星微电子有限公司 Virtual serial port device
CN101470688A (en) * 2007-12-28 2009-07-01 希姆通信息技术(上海)有限公司 Method for implementing multi-function by single-terminal serial port
CN101630370B (en) * 2008-07-14 2012-07-18 中兴通讯股份有限公司 Method for controlling radio frequency identification system and radio frequency identification system
CN101340459A (en) * 2008-08-07 2009-01-07 中兴通讯股份有限公司 Remote control method based on Bluetooth
CN101621440B (en) * 2009-05-22 2011-08-10 浙江天正电气股份有限公司 Remote multi-path serial port communication mapping system
CN101894041A (en) * 2010-07-15 2010-11-24 中兴通讯股份有限公司 Multivirtual serial port system and communication method thereof

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021136A (en) * 2016-05-09 2016-10-12 广州广电运通金融电子股份有限公司 Serial port mapping method and device based on Linux or Unix kernel operating system
CN106021136B (en) * 2016-05-09 2019-01-01 广州广电运通金融电子股份有限公司 A kind of serial-port mapping method and device based on Linux or Unix kernel operating system
CN106201974A (en) * 2016-08-29 2016-12-07 深圳市华阳信通科技发展有限公司 A kind of serial data order keeping method and system
CN113064842A (en) * 2021-04-09 2021-07-02 艾体威尔电子技术(北京)有限公司 Self-adaptive switching system and method for physical serial port and virtual serial port
CN113064842B (en) * 2021-04-09 2024-06-07 艾体威尔电子技术(北京)有限公司 Physical serial port and virtual serial port self-adaptive switching system and method

Also Published As

Publication number Publication date
CN103049401B (en) 2018-02-06
CN107729264B (en) 2020-06-16
CN107729264A (en) 2018-02-23

Similar Documents

Publication Publication Date Title
CN103049401A (en) Method, system and control device for controlling peripheral serial device
CN104503378A (en) Robot and household electrical appliance control method based on robot
CN101232310A (en) Blue tooth module, blue tooth equipment and information processing method thereof
CN205680208U (en) A kind of single node bluetooth controlled in wireless self-help terminal equipment
CN105808396A (en) Chip debugging device, debugging method and SOC (System of Chip) chip system
CN110457244B (en) Serial port communication mode conversion method, system and processor
CN105306323A (en) Method and device for CAN bus communication
EP3247048B1 (en) System and method for embedded operating system achieving bluetooth slave device function
CN104407956A (en) IIC bus experimental facility debugged by serial port
CN101276509A (en) Method and system for controlling equipment by remote control
CN102202132A (en) Method, system and equipment for initializing networking equipment
CN103533716A (en) Control method, controlled equipment and control equipment based on Bluetooth communication technology
CN102621898A (en) Digital household appliance control apparatus, control method and control system thereof
CN100413359C (en) Mobile terminal and starting method thereof
CN104008641B (en) Mobile terminal, card reader, mobile terminal audio communication method and mobile terminal voice communication system
CN103488601B (en) A kind of clock delay, data access method, system and equipment
CN203754167U (en) Handheld terminal for elevator debugging and maintenance
CN110515662A (en) Long-range control method, system, equipment and the readable storage medium storing program for executing of dual-system device
CN203554485U (en) CAN bus test equipment
CN102541797B (en) Realizing method and system supporting multiple main machine interfaces
CN108196866B (en) Firmware updating method and device
CN102932475A (en) Software design framework of gateway for internet of things
CN105791413A (en) Data transmission method and terminal device
CN101325614B (en) Method for controlling multiplexing of wireless data unit port and system
CN216252836U (en) Communication signal conversion device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20190313

Address after: 644000 Sichuan Yibin Port-Lingang Economic and Technological Development Zone

Patentee after: Sichuan Kangjia Intelligent Terminal Technology Co., Ltd.

Address before: 518053 Kangjia Group, Overseas Chinese Town, Nanshan District, Shenzhen City, Guangdong Province

Patentee before: Konka Group Co., Ltd.

TR01 Transfer of patent right