CN104536926A - Control method and device of serial devices - Google Patents
Control method and device of serial devices Download PDFInfo
- Publication number
- CN104536926A CN104536926A CN201410805503.6A CN201410805503A CN104536926A CN 104536926 A CN104536926 A CN 104536926A CN 201410805503 A CN201410805503 A CN 201410805503A CN 104536926 A CN104536926 A CN 104536926A
- Authority
- CN
- China
- Prior art keywords
- equipment
- serial
- information
- status information
- interpolation
- 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
Links
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
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
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)
- Computer And Data Communications (AREA)
Abstract
The invention belongs to the technical field of information, and particularly relates to a control method and device of serial devices. The method comprises the steps that serial interface information is obtained, and a serial interface is determined according to the obtained serial interface information; requesting information of an added device is sent to the serial devices connected with the serial interface; when adding confirmation information returned by the serial devices is received within preset time, the serial devices are added, and device state information of the serial devices is obtained. The serial devices connected with the serial interface do not need to be manually added one by one, the serial devices are automatically and uniformly added, the device state information of the serial devices is uniformly obtained, and therefore the automation degree of management and control over the serial devices is improved, and time and material resources for managing and controlling the serial devices are greatly saved.
Description
Technical field
The invention belongs to areas of information technology, particularly relate to control method and the device of serial equipment.
Background technology
In order to carry out unified management to serial equipment, need serial equipment to add in system platform.In prior art, added to singly in system platform by serial equipment after determining the information such as the model of serial equipment and plane No. by artificial, it is slow to add speed, inefficiency.
Summary of the invention
Given this, embodiments provide a kind of control method and device of serial equipment, with solve existing add serial equipment to system platform time, slow, the inefficient problem of speed.
On the one hand, embodiments provide a kind of control method of serial equipment, comprising:
Obtain serial line interface information, with the described serial line interface information determination serial line interface according to acquisition;
Send the solicited message of interpolation equipment to the serial equipment be connected with described serial line interface;
When receiving the confirmation interpolation information that described serial equipment returns in Preset Time, adding described serial equipment, and obtaining the status information of equipment of described serial equipment.
Second aspect, embodiments provides a kind of control device of serial equipment, comprising:
Serial line interface information acquisition unit, for obtaining serial line interface information, with the described serial line interface information determination serial line interface according to acquisition;
Equipment adds request unit, for sending the solicited message of interpolation equipment to the serial equipment be connected with described serial line interface;
Status information of equipment acquiring unit, for when receiving the confirmation interpolation information that described serial equipment returns in Preset Time, adding described serial equipment, and obtaining the status information of equipment of described serial equipment.
The beneficial effect that the embodiment of the present invention compared with prior art exists is: the embodiment of the present invention is by obtaining serial line interface information, and the serial equipment that the solicited message sending interpolation equipment is extremely connected with serial line interface, when receiving the confirmation interpolation information that serial equipment returns in Preset Time, obtain the status information of equipment of serial equipment, add one by one without the need to the artificial serial equipment to being connected with serial line interface thus, and automatically unify to add to serial equipment, and the unified status information of equipment obtaining serial equipment, thus improve the automaticity carrying out managing control to serial equipment, greatly save time and manpower that management controls serial equipment.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the realization flow figure of the control method of the serial equipment that the embodiment of the present invention provides;
Fig. 2 is the realization flow figure of the control method of the serial equipment that another embodiment of the present invention provides;
Fig. 3 is the structured flowchart of the control device of the serial equipment that the embodiment of the present invention provides.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Fig. 1 shows the realization flow figure of the control method of the serial equipment that the embodiment of the present invention provides, and details are as follows:
In step S101, obtain serial line interface information, with the described serial line interface information determination serial line interface according to acquisition.
In embodiments of the present invention, by DLL (the Dynamic Link Library of operating system, dynamic link library) drive the COM (Cluster Communication Port, communication port) of file call operation system, i.e. serial line interface.
In step s 102, the solicited message of interpolation equipment is sent to the serial equipment be connected with described serial line interface.
After determining the serial line interface of operating system, the serial equipment that the solicited message sending interpolation equipment connects as serial line interface.Such as, the solicited message of adding equipment comprises hexadecimal string OOCC3131, and the solicited message of this interpolation equipment follows RS485 consensus standard.
In embodiments of the present invention, serial equipment may for barrier equipment, feel processor, information display screen, speech horn or card reader
In step s 103, when receiving the confirmation interpolation information that described serial equipment returns in Preset Time, adding described serial equipment, and obtaining the status information of equipment of described serial equipment.
Wherein, Preset Time can be 10 seconds, in this no limit.Confirm that interpolation information can comprise hexadecimal string 00000001.When receiving the confirmation interpolation information that serial equipment returns in Preset Time, show that serial equipment is in line states; When not receiving the confirmation interpolation information that serial equipment returns in Preset Time, show that serial equipment is in off-line state.
Preferably, described status information of equipment comprises equipment use status information and equipment running status information.
Wherein, equipment use status information refers to serial equipment and is in line states or serial equipment is in off-line state.Serial equipment is in line states and refers to serial equipment and enable, and serial equipment is in off-line state and refers to serial equipment not enabled.
Equipment running status information refers to serial equipment normal operation or serial equipment operation exception.
Preferably, after the status information of equipment of the described serial equipment of described acquisition, described method also comprises:
Described equipment use status information according to obtaining determines whether described serial equipment is enabled, if, described serial equipment whether operation exception is determined, if operation exception, to designated terminal transmitting apparatus abnormal information according to the described equipment running status information obtained.
As one embodiment of the present of invention, when enabling according to equipment use status information determination serial equipment, and during according to equipment running status information determination serial equipment operation exception, to designated terminal transmitting apparatus abnormal information, in time the equipment being in abnormal operating condition is rebuild to make keeper.
Preferably, after the described serial equipment of described interpolation, described method also comprises:
Obtain the device attribute information of described serial equipment.
Device attribute information comprises serial equipment numbering, serial equipment model, serial equipment plane No. and serial equipment type etc.Such as, serial equipment is numbered SB-001-01, and serial equipment model is JSDZ004, and serial equipment plane No. is 1, and serial equipment type is access control device.
Fig. 2 shows the realization flow figure of the control method of the serial equipment that another embodiment of the present invention provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.With reference to Fig. 2:
In step s 201, obtain serial line interface information, with the described serial line interface information determination serial line interface according to acquisition;
In step S202, send the solicited message of interpolation equipment to the serial equipment be connected with described serial line interface;
In step S203, judge whether to receive in Preset Time the confirmation that described serial equipment returns and add information, if so, perform step S204; If not, step S205 is performed;
In step S204, add described serial equipment, and obtain the status information of equipment of described serial equipment;
In step S205, send the solicited message of described interpolation equipment to described serial equipment with predeterminated frequency, until receive the described confirmation interpolation information that described serial equipment returns.
As one embodiment of the present of invention, sending the solicited message of interpolation equipment to the serial equipment is connected with serial line interface, the confirmation interpolation information that serial equipment returns if do not receive in Preset Time, then show that serial equipment is in off-line state.Afterwards, send the solicited message of interpolation equipment to serial equipment with predeterminated frequency, until serial equipment online after return and confirm interpolation information.
Should be understood that in embodiments of the present invention, the size of the sequence number of above-mentioned each process does not also mean that the priority of execution sequence, and the execution sequence of each process should be determined with its function and internal logic, and should not form any restriction to the implementation process of the embodiment of the present invention.
The embodiment of the present invention is by obtaining serial line interface information, and the serial equipment that the solicited message sending interpolation equipment is extremely connected with serial line interface, when receiving the confirmation interpolation information that serial equipment returns in Preset Time, obtain the status information of equipment of serial equipment, add one by one without the need to the artificial serial equipment to being connected with serial line interface thus, and automatically unify to add to serial equipment, and the unified status information of equipment obtaining serial equipment, thus improve the automaticity carrying out managing control to serial equipment, greatly save time and manpower that management controls serial equipment.
Fig. 3 shows the structured flowchart of the control device of the serial equipment that the embodiment of the present invention provides, and this device may be used for the control method of the serial equipment described in service chart 1 or Fig. 2.For convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.
With reference to Fig. 3, described device comprises:
Serial line interface information acquisition unit 31, for obtaining serial line interface information, with the described serial line interface information determination serial line interface according to acquisition;
Equipment adds request unit 32, for sending the solicited message of interpolation equipment to the serial equipment be connected with described serial line interface;
Status information of equipment acquiring unit 33, for when receiving the confirmation interpolation information that described serial equipment returns in Preset Time, adding described serial equipment, and obtaining the status information of equipment of described serial equipment.
Preferably, described status information of equipment comprises equipment use status information and equipment running status information.
Preferably, described device also comprises:
Device exception information transmitting element 34, for determining whether described serial equipment is enabled according to the described equipment use status information obtained, if, described serial equipment whether operation exception is determined according to the described equipment running status information obtained, if operation exception, to designated terminal transmitting apparatus abnormal information.
Preferably, described device also comprises:
Device attribute information acquisition unit 35, for when receiving the confirmation interpolation information that described serial equipment returns in Preset Time, obtains the device attribute information of described serial equipment.
Preferably, described device also comprises:
Equipment adds polling request unit 36, for when not receiving the described confirmation interpolation information that described serial equipment returns in described Preset Time, the solicited message of described interpolation equipment is sent to described serial equipment, until receive the described confirmation interpolation information that described serial equipment returns with predeterminated frequency.
The embodiment of the present invention is by obtaining serial line interface information, and the serial equipment that the solicited message sending interpolation equipment is extremely connected with serial line interface, when receiving the confirmation interpolation information that serial equipment returns in Preset Time, obtain the status information of equipment of serial equipment, add one by one without the need to the artificial serial equipment to being connected with serial line interface thus, and automatically unify to add to serial equipment, and the unified status information of equipment obtaining serial equipment, thus improve the automaticity carrying out managing control to serial equipment, greatly save time and manpower that management controls serial equipment.
Those of ordinary skill in the art can recognize, in conjunction with unit and the algorithm steps of each example of embodiment disclosed herein description, can realize with the combination of electronic hardware or computer software and electronic hardware.These functions perform with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can use distinct methods to realize described function to each specifically should being used for, but this realization should not thought and exceeds scope of the present invention.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the device of foregoing description and the specific works process of unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
In several embodiments that the application provides, should be understood that disclosed apparatus and method can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of unit or communication connection can be electrical, machinery or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.
If described function using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part of the part that technical scheme of the present invention contributes to prior art in essence in other words or this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform all or part of step of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, ROM (read-only memory) (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. various can be program code stored medium.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should described be as the criterion with the protection domain of claim.
Claims (10)
1. a control method for serial equipment, is characterized in that, comprising:
Obtain serial line interface information, with the described serial line interface information determination serial line interface according to acquisition;
Send the solicited message of interpolation equipment to the serial equipment be connected with described serial line interface;
When receiving the confirmation interpolation information that described serial equipment returns in Preset Time, adding described serial equipment, and obtaining the status information of equipment of described serial equipment.
2. the method for claim 1, is characterized in that, described status information of equipment comprises equipment use status information and equipment running status information.
3. method as claimed in claim 2, it is characterized in that, after the status information of equipment of the described serial equipment of described acquisition, described method also comprises:
Described equipment use status information according to obtaining determines whether described serial equipment is enabled, if, described serial equipment whether operation exception is determined, if operation exception, to designated terminal transmitting apparatus abnormal information according to the described equipment running status information obtained.
4. the method for claim 1, is characterized in that, after the described serial equipment of described interpolation, described method also comprises:
Obtain the device attribute information of described serial equipment.
5. the method as described in any one of Claims 1-4, is characterized in that, after the serial equipment that the solicited message of described transmission interpolation equipment is extremely connected with described serial line interface, described method also comprises:
When not receiving the described confirmation interpolation information that described serial equipment returns in described Preset Time, the solicited message of described interpolation equipment is sent to described serial equipment, until receive the described confirmation interpolation information that described serial equipment returns with predeterminated frequency.
6. a control device for serial equipment, is characterized in that, comprising:
Serial line interface information acquisition unit, for obtaining serial line interface information, with the described serial line interface information determination serial line interface according to acquisition;
Equipment adds request unit, for sending the solicited message of interpolation equipment to the serial equipment be connected with described serial line interface;
Status information of equipment acquiring unit, for when receiving the confirmation interpolation information that described serial equipment returns in Preset Time, adding described serial equipment, and obtaining the status information of equipment of described serial equipment.
7. device as claimed in claim 6, it is characterized in that, described status information of equipment comprises equipment use status information and equipment running status information.
8. device as claimed in claim 7, it is characterized in that, described device also comprises:
Device exception information transmitting element, for determining whether described serial equipment is enabled according to the described equipment use status information obtained, if, described serial equipment whether operation exception is determined according to the described equipment running status information obtained, if operation exception, to designated terminal transmitting apparatus abnormal information.
9. device as claimed in claim 6, it is characterized in that, described device also comprises:
Device attribute information acquisition unit, for when receiving the confirmation interpolation information that described serial equipment returns in Preset Time, obtains the device attribute information of described serial equipment.
10. the device as described in any one of claim 6 to 9, is characterized in that, described device also comprises:
Equipment adds polling request unit, for when not receiving the described confirmation interpolation information that described serial equipment returns in described Preset Time, the solicited message of described interpolation equipment is sent to described serial equipment, until receive the described confirmation interpolation information that described serial equipment returns with predeterminated frequency.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410805503.6A CN104536926B (en) | 2014-12-22 | 2014-12-22 | The control method and device of serial equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410805503.6A CN104536926B (en) | 2014-12-22 | 2014-12-22 | The control method and device of serial equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104536926A true CN104536926A (en) | 2015-04-22 |
CN104536926B CN104536926B (en) | 2018-05-01 |
Family
ID=52852456
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410805503.6A Active CN104536926B (en) | 2014-12-22 | 2014-12-22 | The control method and device of serial equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104536926B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106371847A (en) * | 2016-09-07 | 2017-02-01 | 湖北三江航天万峰科技发展有限公司 | Method and system for driving RS422 communication of CPCI (Compact Peripheral Component Interconnect) bus in Windows xp system |
CN108021398A (en) * | 2017-11-20 | 2018-05-11 | 河南思维轨道交通技术研究院有限公司 | Serial ports priority evaluation method and call method, storage medium |
CN108038072A (en) * | 2017-12-28 | 2018-05-15 | 深圳Tcl数字技术有限公司 | Cut-in method, terminal device and the computer-readable recording medium of serial equipment |
CN110134036A (en) * | 2019-04-26 | 2019-08-16 | 深圳市龙控智能技术有限公司 | A kind of method, monitoring system and the storage medium of serial port data acquisition poll |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1570899A (en) * | 2004-04-25 | 2005-01-26 | 赵红刚 | Method for automatic matching communication of computer and serial port external module |
CN1905562A (en) * | 2006-08-18 | 2007-01-31 | 杭州华为三康技术有限公司 | Method for determining need configurating link protocol of marginal apparatus serial slot |
CN101008930A (en) * | 2006-01-24 | 2007-08-01 | 中国科学院长春光学精密机械与物理研究所 | Method for automatically recognizing an equipment communicating with main control computer |
CN101047526A (en) * | 2007-03-30 | 2007-10-03 | 北京呼啦在线传媒科技有限公司 | Method for automatic identifying customer mobile terminal equipment model and providing service and content |
CN102279831A (en) * | 2011-08-09 | 2011-12-14 | 西安辉炜信息科技有限公司 | Automatic registering method of serial communication terminal |
-
2014
- 2014-12-22 CN CN201410805503.6A patent/CN104536926B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1570899A (en) * | 2004-04-25 | 2005-01-26 | 赵红刚 | Method for automatic matching communication of computer and serial port external module |
CN101008930A (en) * | 2006-01-24 | 2007-08-01 | 中国科学院长春光学精密机械与物理研究所 | Method for automatically recognizing an equipment communicating with main control computer |
CN1905562A (en) * | 2006-08-18 | 2007-01-31 | 杭州华为三康技术有限公司 | Method for determining need configurating link protocol of marginal apparatus serial slot |
CN101047526A (en) * | 2007-03-30 | 2007-10-03 | 北京呼啦在线传媒科技有限公司 | Method for automatic identifying customer mobile terminal equipment model and providing service and content |
CN102279831A (en) * | 2011-08-09 | 2011-12-14 | 西安辉炜信息科技有限公司 | Automatic registering method of serial communication terminal |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106371847A (en) * | 2016-09-07 | 2017-02-01 | 湖北三江航天万峰科技发展有限公司 | Method and system for driving RS422 communication of CPCI (Compact Peripheral Component Interconnect) bus in Windows xp system |
CN108021398A (en) * | 2017-11-20 | 2018-05-11 | 河南思维轨道交通技术研究院有限公司 | Serial ports priority evaluation method and call method, storage medium |
CN108038072A (en) * | 2017-12-28 | 2018-05-15 | 深圳Tcl数字技术有限公司 | Cut-in method, terminal device and the computer-readable recording medium of serial equipment |
CN108038072B (en) * | 2017-12-28 | 2021-11-09 | 深圳Tcl数字技术有限公司 | Access method of serial device, terminal device and computer readable storage medium |
CN110134036A (en) * | 2019-04-26 | 2019-08-16 | 深圳市龙控智能技术有限公司 | A kind of method, monitoring system and the storage medium of serial port data acquisition poll |
Also Published As
Publication number | Publication date |
---|---|
CN104536926B (en) | 2018-05-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102739453B (en) | Main/standby switching method, equipment and system | |
CN107911249B (en) | Method, device and equipment for sending command line of network equipment | |
CN105159122A (en) | Smart home control system and control method | |
US8375200B2 (en) | Embedded device and file change notification method of the embedded device | |
CN105446813A (en) | Resource distribution method and device | |
CN106873970B (en) | Installation method and device of operating system | |
CN105573819A (en) | Method for obtaining disk capacity information of virtual machine directly through host machine | |
CN104536926A (en) | Control method and device of serial devices | |
CN102387042B (en) | Automatic configuration method and system as well as network node | |
CN105049290A (en) | Method and device for monitoring page access | |
CN108268305A (en) | For the system and method for virtual machine scalable appearance automatically | |
CN104793982A (en) | Method and device for establishing virtual machine | |
CN104965727A (en) | Method and device for restarting server | |
CN105335309A (en) | Data transmission method and computer | |
CN104935660A (en) | System, method and device for developing and operating cloud program | |
CN108234551B (en) | Data processing method and device | |
CN102520982A (en) | Method and device of node hot plug | |
CN105224489A (en) | A kind of integrated management system of hardware device | |
CN108376110A (en) | A kind of automatic testing method, system and terminal device | |
CN105430028A (en) | Service calling method, service providing method, and node | |
CN105262604A (en) | Virtual machine migration method and equipment | |
CN103995745A (en) | IP hard disk task execution method and IP hard disk | |
CN105354332A (en) | Method and system for implementing mutual standby of database and middleware based on BCP (Batch Communications Program) | |
CN104506630A (en) | Method, server and system for generating authority data on basis of user roles | |
CN103108046A (en) | Cloud terminal virtual machine login method and cloud terminal virtual machine login device and cloud terminal virtual machine login system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |