CN107885691A - Serial data transmission method, distributed apparatus and main frame - Google Patents
Serial data transmission method, distributed apparatus and main frame Download PDFInfo
- Publication number
- CN107885691A CN107885691A CN201711162380.9A CN201711162380A CN107885691A CN 107885691 A CN107885691 A CN 107885691A CN 201711162380 A CN201711162380 A CN 201711162380A CN 107885691 A CN107885691 A CN 107885691A
- Authority
- CN
- China
- Prior art keywords
- serial
- data
- serial port
- operating system
- host computer
- 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.)
- Pending
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/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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/382—Information transfer, e.g. on bus using universal interface adapter
- G06F13/385—Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0002—Serial port, e.g. RS232C
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
Abstract
The present invention relates to field of data transmission, specifically, there is provided a kind of serial data transmission method, distributed apparatus and main frame.This method is applied to distributed apparatus, and distributed apparatus includes control logic unit and multiple operating systems and corresponding operating system serial ports, control logic unit are connected with a main frame, and this method includes:The serial port of host computer data that control logic unit Receiving Host is sent, serial port of host computer data include identifying corresponding to multiple operating system serial ports;Control logic unit is based on mark and sends serial port of host computer data to operating system serial ports corresponding with mark.Serial data that the present invention is sent by control logic unit to main frame and reception is received and transmitted, the multiple operating system serial ports that can lead in too small amount of externally serial ports connection distributed apparatus, and multiple operating system serial ports are monitored and operated simultaneously, the panel space that serial ports takes is saved, help is provided for device miniaturization.
Description
Technical field
The present invention relates to field of data transmission, in particular to a kind of serial data transmission method, distributed apparatus and
Main frame.
Background technology
Multiple operating systems are included inside distributed apparatus or multi-CPU system, each operating system is corresponding on panel
One serial ports, for the less equipment of panel, it is understood that there may be panel space is insufficient, it is necessary to which what substantial amounts of serial ports was connected with main frame asks
Topic.
The content of the invention
It is above-mentioned to improve it is an object of the invention to provide a kind of serial data transmission method, distributed apparatus and main frame
The problem of.
To achieve these goals, the technical scheme that the embodiment of the present invention uses is as follows:
In a first aspect, the embodiments of the invention provide a kind of serial data transmission method, methods described is applied to distribution
Equipment, the distributed apparatus include control logic unit and multiple business unit, the operating system of each business unit
Serial ports is connected with the control logic unit, and the control logic unit is connected by equipment of serial with a main frame, methods described
Including:The control logic unit receives the serial port of host computer data of the main frame transmission, the main frame by the equipment of serial
Serial data includes unique mark corresponding with the operating system serial ports;The control logic unit is based on the unique mark
The serial port of host computer data are sent to operating system serial ports corresponding with the unique mark.
Further, the control logic unit be based on the unique mark by the serial port of host computer data send to institute
Operating system serial ports corresponding to mark is stated, including:
The control logic unit identifies the unique mark in the serial port of host computer data, from the serial port of host computer data
Extraction character data is distributed to each operating system serial ports corresponding to each unique mark after each unique mark.
Further, methods described also includes:What the control logic unit reception any operation system serial ports was sent sets
Standby serial data;The control logic unit encapsulates corresponding with any operation system serial ports in the equipment of serial data
Unique mark;The control logic unit sends the equipment of serial data after encapsulation to institute by the equipment of serial
State main frame.
Further, encapsulated in the control logic unit in the equipment of serial data and any operation system
Unique mark corresponding to serial ports, is specifically included:The control logic unit is according to the connection position of any operation system serial ports
Put, determine unique mark corresponding to any operation system serial ports;The control logic unit is in the equipment of serial data
Each character before, encapsulate corresponding with any operation system serial ports unique mark.
Further, methods described also includes:Set the baud rate of each operating system serial ports identical, and set described in setting
The baud rate of standby serial ports is more than or equal to the sum of the baud rate of all operating system serial ports;Or each operating system serial ports is set
Baud rate it is identical with the baud rate of the equipment of serial.
Second aspect, the embodiments of the invention provide a kind of distributed apparatus, the distributed apparatus includes a control
Logic unit and multiple business unit, the operating system serial ports of each business unit are connected with the control logic unit,
The control logic unit is connected by an equipment of serial with main frame;The control logic unit includes serial port module, is used for
The serial port of host computer data of the main frame transmission are received by the equipment of serial, the serial port of host computer data include and the operation
Unique mark corresponding to system serial ports, the serial port module are used to send the serial port of host computer data based on the unique mark
To operating system serial ports corresponding with the unique mark.
Further, the control logic unit includes distribution module, the distribution module and each operating system
Serial ports is all connected with, and the distribution module is specifically used for identifying the unique mark in the serial port of host computer data, from the main frame string
Extraction character data is distributed to each operating system serial ports corresponding to the unique mark after each unique mark in mouth data.
Further, the control logic unit also includes package module, and the package module is with each operation
System serial ports is all connected with, and the package module is used to receive the equipment of serial data that any operation system serial ports is sent, and is set described
Unique mark corresponding with any operation system serial ports is added in standby serial data, the equipment of serial data of unique mark will be added
Send to the equipment of serial.
Further, the package module is specifically used for the link position according to any operation system serial ports, it is determined that
Unique mark corresponding to any operation system serial ports;Each character of the control logic unit in the serial data
Before, encapsulate unique mark corresponding with any operation system serial ports.
The third aspect, the embodiments of the invention provide a kind of serial data transmission method, methods described is applied to main frame, institute
Stating main frame includes serial port of host computer and data processing module, and the data processing module includes multiple virtual serial port units, the master
Machine serial ports is connected with a distributed apparatus, the operating system of each business unit of each virtual serial port unit and distributed apparatus
Serial ports corresponds, and methods described includes:The serial port of host computer receives the equipment of serial data that the distributed apparatus is sent, institute
Stating equipment of serial data includes mark corresponding with the multiple virtual serial port unit;The serial port of host computer will based on the mark
The equipment of serial data are sent to the virtual serial port unit.
Further, methods described also includes:The serial port of host computer receives the master that the multiple virtual serial port unit is sent
Machine serial data;The serial port of host computer sends the serial port of host computer data to the distributed apparatus, the serial port of host computer number
According to including mark corresponding with the virtual serial port unit.
Fourth aspect, the embodiment of the present invention additionally provide a kind of main frame, and the main frame includes data processing module and main frame
Serial ports, the data processing module include multiple virtual serial port units, and the serial port of host computer can be connected with distributed apparatus;Each
The operating system serial ports of each business unit of virtual serial port unit and distributed apparatus corresponds;The serial port of host computer by with
It is set to and receives the equipment of serial data that the distributed apparatus is sent, the equipment of serial data includes the multiple virtual serial port
The mark of virtual serial port unit in unit;The serial port of host computer is configured as sending out the equipment of serial data based on the mark
Deliver to the virtual serial port unit corresponding with the mark.
Further, the serial port of host computer is additionally configured to receive the serial port of host computer that the multiple virtual serial port unit is sent
Data;The serial port of host computer is configured as sending the serial port of host computer data to the distributed apparatus, the serial port of host computer
Data include mark corresponding with the virtual serial port unit.
Serial data transmission method, distributed apparatus and main frame provided in an embodiment of the present invention, pass through control logic unit
To main frame send serial data and need to main frame send serial data be received and transmitted, it is too small amount of right to lead to
Multiple operating system serial ports in outer serial ports connection distributed apparatus, and multiple operating system serial ports are monitored and operated simultaneously, save
The panel space that about serial ports takes, help is provided for device miniaturization.
To enable the above objects, features and advantages of the present invention to become apparent, preferred embodiment cited below particularly, and coordinate
Appended accompanying drawing, is described in detail below.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by embodiment it is required use it is attached
Figure is briefly described, it will be appreciated that the following drawings illustrate only certain embodiments of the present invention, therefore be not construed as pair
The restriction of scope, for those of ordinary skill in the art, on the premise of not paying creative work, can also be according to this
A little accompanying drawings obtain other related accompanying drawings.
Fig. 1~Fig. 5 is distributed apparatus provided in an embodiment of the present invention interacts schematic diagram with main-machine communication.
Fig. 6, Fig. 7 are the flows of the serial data transmission method provided in an embodiment of the present invention applied to distributed apparatus
Figure.
Fig. 8~Figure 10 is the flow chart of the serial data transmission method provided in an embodiment of the present invention applied to main frame.
Icon:100- distributed apparatus;110- control logic units;111- serial port modules;112- package modules;113- points
Send out module;120- operating system serial ports;200- main frames;210- data processing modules;211- virtual serial port units;212- encapsulation is single
Member;213- distribution modules;220- serial port of host computer.
Embodiment
Below in conjunction with accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Ground describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.Generally exist
The component of the embodiment of the present invention described and illustrated in accompanying drawing can be configured to arrange and design with a variety of herein.Cause
This, the detailed description of the embodiments of the invention to providing in the accompanying drawings is not intended to limit claimed invention below
Scope, but it is merely representative of the selected embodiment of the present invention.Based on embodiments of the invention, those skilled in the art are not doing
The every other embodiment obtained on the premise of going out creative work, belongs to the scope of protection of the invention.
It should be noted that:Similar label and letter represents similar terms in following accompanying drawing, therefore, once a certain Xiang Yi
It is defined, then it further need not be defined and explained in subsequent accompanying drawing in individual accompanying drawing.
Fig. 1 is refer to, is that distributed apparatus 100 provided in an embodiment of the present invention interacts schematic diagram with what main frame 200 communicated.
In the present embodiment, distributed apparatus 100 may be, but not limited to, router, interchanger etc., and main frame 200 may be, but not limited to,
PC, notebook, intelligent terminal etc..In the present embodiment, (in general distributed apparatus 100 includes control logic unit 110
Main Processor Unit positioned at distributed apparatus is MPU) and multiple business unit for possessing operating system (refer generally to distributed apparatus
LPU), each business unit includes operating system serial ports 120, and the operating system serial ports 120 of each business unit corresponds to respectively
There is operating system, to receive the data of operating system, or to operating system send data.The operating system string of each business unit
Mouth 120 is connected with control logic unit 110, and control logic unit 110 can be connected by equipment of serial with main frame 200.At this
In embodiment, control logic unit 110 can be PLD.Main frame 200 includes data processing module 210 and main frame
Serial ports 220, data processing module 210 include multiple virtual serial port units 211.The serial port of host computer 220 can be used for setting with distribution
Standby 100 control logic unit 110 connects, available for receiving serial data that distributed apparatus 100 sends or to distribution
Equipment 100 sends serial data.
It should be noted that in the present embodiment, each virtual serial port unit 211 can be each with distributed apparatus 100
The operating system serial ports 120 of business unit corresponds, and is grasped for example, the virtual serial port unit A in virtual serial port unit 211 is corresponding
Make the operating system serial ports A in system serial ports 120.In some variant embodiments, for example, the quantity of virtual serial port unit 211 with
The quantity of operating system serial ports 120 is inconsistent, but virtual serial port unit 211 is corresponding with the part of operating system serial ports 120.Example
Such as, virtual serial port unit 211 includes 1,2,3, and operating system serial ports 120 includes 1,2,3,4,5,6, virtual serial port unit 211
1st, 1,2, No. 3 of 2, No. 3 respective operations system serial ports 120,4,5, No. 6 and virtual serial port unit 211 of operating system serial ports 120
Do not correspond to.
When main frame 200 needs to send serial data to distributed apparatus 100, for example, main frame 200 is needed to business unit
A operating system A sends serial data, and serial port of host computer 220 receives virtual serial port unit A in multiple virtual serial port units 211 and sent out
The serial port of host computer data gone out, serial port of host computer 220 send serial port of host computer data to distributed apparatus 100, serial port of host computer packet
Include unique mark corresponding with virtual serial port unit A.Wherein, the unique mark can be added to master by data processing module 210
Machine serial data.
In the present embodiment, each virtual serial port unit 211 of main frame 200 has unique mark, distributed apparatus 100
Each operating system serial ports 120 be also corresponding with mark, mutually corresponding to virtual serial port unit 211 and operating system serial ports
120 unique mark is identical, such as unique mark corresponding to virtual serial port unit A is:0xf1, then with A pairs of virtual serial port unit
The operating system serial ports A answered unique mark corresponds to:0xf1.
Control logic unit 110 in distributed apparatus 100 is used for what is sent by equipment of serial Receiving Host serial ports 220
Serial port of host computer data, it is readily appreciated that, serial port of host computer data include an operating system string in multiple operating system serial ports 120
The unique mark of mouth, 0xf1 is identified as corresponding to operating system serial ports A.Control logic unit 110 is based on the unique mark will be main
Machine serial data is sent to operating system serial ports corresponding with mark.By above-mentioned process, that is, complete a main frame 200 to point
The serial data of cloth equipment 100 is sent.
When distributed apparatus 100 needs to send serial data to the virtual serial port unit of main frame 200, control logic unit
110 receive the equipment of serial data that multiple operating system serial ports 120 send by equipment of serial, and control logic unit 110 passes through
Equipment of serial, which sends equipment of serial data to the serial port of host computer 220 of main frame 200, equipment of serial data, to be included and operating system string
Unique mark corresponding to mouthful.It is readily appreciated that, in the example of the above embodiments, operating system serial ports A unique mark is:
0xf1, the unique mark are simultaneously the mark of virtual serial port unit.
Serial port of host computer 220 is used for the equipment of serial data for receiving the transmission of control logic unit 110, based on equipment of serial data
In unique mark equipment of serial data are sent to virtual serial port unit corresponding with unique mark.By above-mentioned process,
A distributed apparatus 100 is completed to send to the serial data of main frame 200.
By setting control logic unit 110 to complete the reception and transmission of serial data on distributed apparatus 100,
Multiple operating system serial ports 120 share the equipment of serial of a control logic unit 110, include in control logic unit 110
One serial port module, for example, refer to Fig. 2, in this illustration, multiple operating system serial ports 120 pass through a serial port module 111
Communicated with main frame 200, a corresponding physical serial interface is set on panel without each operating system serial ports 120, saved
The space of panel shared by serial ports.
Fig. 2 is refer to, control logic unit 110 includes serial port module 111, serial port module 111 and each operating system string
Mouth 120 is all connected with, and serial port module 111 can be used for being connected with the serial port of host computer 220 of main frame 200.Receive and lead in distributed apparatus 100
During the serial data that machine 200 is sent, serial port module 111 is used for the serial data that Receiving Host 200 is sent, in distributed apparatus
100 to main frame 200 send serial data when, serial port module 111 be used for receive the equipment string that multiple operating system serial ports 120 are sent
Mouth data, equipment of serial data are sent to main frame 200, equipment of serial data and uniquely marked including corresponding with operating system serial ports
Know.It should be noted that serial port module 111 receives the serial data of operating system serial ports 120, can receive multiple behaviour simultaneously
Make the serial data or receive the serial ports number that multiple operating system serial ports 120 are sent successively that system serial ports 120 sends
According to the present embodiment is not limited this.
In this embodiment, all operating system serial ports 120 of distributed apparatus 100 and serial port module 111 are initial
Same serial port baud rate is turned to, such as the baud rate of operating system serial ports 120 is 921600, the baud rate of serial port module 111
For 921600.The tagged equipment of serial data of band that serial port module 111 is sent to serial port of host computer 220, the mark can be by
Operating system serial ports adds before equipment of serial data are sent in equipment of serial data, for example, operating system serial ports A is corresponding
Operating system A need the data that send to be:
0x32 0x33 0x34
Data after operating system serial ports A is packaged to above-mentioned data are:
0xf1 0x32 0xf1 0x33 0xf1 0x34, wherein operating system serial ports are to data according to " mark+character "
Serial port module 111 is sent to after form encapsulation to be transmitted.
Either, Fig. 3 is refer to, control logic unit 110 also includes package module 112, package module 113 and serial ports mould
Block 111 and multiple operating system serial ports 120 are all connected with.Package module 112 is used to receive the equipment string that operating system serial ports is sent
Mouth data, encapsulate unique mark corresponding with any operation system serial ports in equipment of serial data, will add unique mark
Equipment of serial data are sent to serial port module 111 by equipment of serial, then are sent by serial port module 111 to serial port of host computer 220.Its
In, package module 112 is determined corresponding to any operation system serial ports 120 according to the link position of any operation system serial ports 120
Unique mark;For package module 112 before each character of equipment of serial data, encapsulation is corresponding with any operation system serial ports 120
Unique mark.For example, the data that operating system A corresponding to operating system serial ports A needs to send are:
0x32 0x33 0x34
Package module 112 sends data after encapsulating:
0xf1 0x32 0xf1 0x33 0xf1 0x34.Form of the package module 112 to data according to " mark+character "
Serial port module 111 is sent to after encapsulation to be transmitted.
The setting of package module 112, operating system serial ports 120 can be substituted to be packaged data, alleviate operation system
The workload of system serial ports 120.
In the example of fig. 3, all operating system serial ports 120 of distributed apparatus 100 are initialized as same serial ports baud
Rate, such as the baud rate of operating system serial ports 120 is 9600, the baud rate of serial port module 111 is according to operating system serial ports 120
Quantity is configured, in order to ensure the maximum output input capability of operating system serial ports 120, in the present embodiment, serial port module
111 baud rate can be set:X≥A×B
Wherein, X is the baud rate of serial port module 111;A is the baud rate of operating system serial ports 120;C is operating system string
The quantity of mouth 120.
For example, in the example of the present embodiment, the baud rate of operating system serial ports 120 is 9600, operating system serial ports 120
Number be 3, then baud rate >=9600 of serial port module 111 × 3=28800.
In the serial port of host computer data that the Receiving Host serial ports 220 of serial port module 111 is sent, serial port module 111 can be by master
Machine serial data is sent to each operating system serial ports 120 according to mark, is judging to be identified as operation by operating system serial ports 120
System serial ports in itself corresponding mark when, serial port of host computer data are uploaded to the operation of business unit corresponding to operating system serial ports
System, for example, operating system serial ports A receives following data:0xf0 0x32 0xf1 0x33 0xf2 0x34, because operation
0xf1 is identified as corresponding to system serial ports A, so the upper strata that data 0x33 is sent to operating system A by operating system serial ports A is soft
Part.
Either, Fig. 4 is refer to, control logic unit 110 also includes distribution module 113, distribution module 113 and serial ports mould
Block 111 and multiple operating system serial ports 120 are all connected with, and in this illustration, serial port module 111 is used to send serial port of host computer data
To distribution module 113, distribution module 113 is used to identify the unique mark in serial port of host computer data, every from serial port of host computer data
Character data is extracted after individual unique mark, operation system corresponding with unique mark is determined from multiple operating system serial ports 120
System serial ports 120, serial port of host computer data are sent to operating system serial ports 120 corresponding with mark.For example, distribution module 113 connects
Receive following data:0xf1 0x33 0xf2 0x34 0xf3 0x35
Wherein, 0xf1 is unique mark corresponding to operating system serial ports A, and 0xf2 is unique corresponding to operating system serial ports B
Mark, 0xf3 is unique mark corresponding to operating system serial ports C, and 0x33 is sent to operating system serial ports A by distribution module 113,
By 0x34 to operating system serial ports B, 0x35 is sent to operating system serial ports C.
The setting of distribution module 113, operating system serial ports 120 can be substituted to unseal and identify data, alleviated
The workload of operating system serial ports 120.
In the example of fig. 4, all operating system serial ports 120 of distributed apparatus 100 are initialized as same serial ports baud
Rate, such as the baud rate of operating system serial ports 120 is 9600, the baud rate of serial port module 111 is according to operating system serial ports 120
Quantity is configured, in order to ensure the maximum output input capability of operating system serial ports 120, in the present embodiment, serial port module
111 baud rate can be set:X≥2×A×B
Wherein, X is the baud rate of serial port module 111;A is the baud rate of operating system serial ports 120;C is operating system string
The quantity of mouth 120.
For example, in the example of the present embodiment, the baud rate of operating system serial ports 120 is 9600, operating system serial ports 120
Number be 3, then baud rate >=2 × 9600 of serial port module 111 × 3=57600.
It should be noted that in other embodiments, control logic unit 110 can also only include the He of serial port module 111
Distribution module 113, without including package module 112, the embodiment of the present invention is not limited this.
Fig. 5 is refer to, data processing module 210 can also include encapsulation unit 212 and Dispatching Unit 213, encapsulation unit
212 are all connected with each virtual serial port unit 211 and serial port of host computer 220, Dispatching Unit 213 and each virtual serial port unit 211
It is all connected with serial port of host computer 220.Encapsulation unit 212 can be used for needing to send serial data to distributed apparatus 100 in main frame 200
When, the serial data sent to virtual serial port unit 211 is packaged, for example, virtual serial port unit 211 is by serial port of host computer data
Send to encapsulation unit 212, encapsulation unit 212 adds mark corresponding with virtual serial port unit in serial port of host computer data, will
The serial port of host computer data added after mark are sent to serial port of host computer 220.Dispatching Unit 213 can be used for needing to receive in main frame 200
During the serial data that distributed apparatus 100 is sent, the serial data received to serial port of host computer 220 carries out deblocking distribution, for example, point
Bill member 213, which identifies, has mark in the equipment of serial data that serial port of host computer 220 receives, then sends the equipment of serial data
To virtual serial port unit corresponding with mark.
More than, it is distributed apparatus and main frame provided in an embodiment of the present invention, the distributed apparatus passes through control logic list
The serial data and need to be received and transmitted the serial data that main frame is sent that member is sent to main frame, can lead to too small amount of
Multiple operating system serial ports in external serial ports connection distributed apparatus, and multiple operating system serial ports are monitored and operated simultaneously,
The panel space that serial ports takes is saved, provides help for device miniaturization, the main frame fictionalizes multiple by data processing module
It is corresponding that virtual serial port unit and multiple operating system serial ports of distributed apparatus carry out matching, with carry out the transmission of serial data and
Receive.
Fig. 6 is refer to, the embodiment of the present invention additionally provides a kind of serial data transmission method, and this method is applied to this implementation
The distributed apparatus 100 that example provides, is repeated no more to the composition of distributed apparatus 100 herein.This method comprises the following steps:
Step S610, the serial port of host computer data that control logic unit is sent by equipment of serial Receiving Host.
Serial port of host computer data include unique mark corresponding with multiple operating system serial ports.
Serial port of host computer data are sent to described and uniquely marked by step S620, control logic unit based on the unique mark
Operating system serial ports corresponding to knowledge.
Control logic unit can send serial port of host computer data to each operating system serial ports, by each operating system serial ports
Voluntarily judge whether serial port of host computer data are the serial data needed in itself, if it is, receiving and being uploaded to corresponding operation
System.Or control logic unit determines operating system serial ports corresponding with mark from multiple operating system serial ports, by master
Machine serial data is sent to operating system serial ports corresponding with mark.
In embodiments of the present invention, step S610 and step S620 can be performed by control logic unit.
Fig. 7 is refer to, the serial data transmission method also includes:
Step S710, control logic unit receive the equipment of serial data that any operation system serial ports is sent.
Step S720, control logic unit will encapsulate and any operation system serial ports in the equipment of serial data
Corresponding unique mark.
Step S730, control logic unit by the equipment of serial data after encapsulation by the equipment of serial send to
The main frame.
Equipment of serial data include mark corresponding with operating system serial ports.
Control logic unit sends equipment of serial data to before main frame, is added in equipment of serial data and operation system
Unite and identified corresponding to serial ports, or, operating system serial ports adds mark corresponding with operating system serial ports in equipment of serial data
Knowledge is then forwarded to control logic unit.
Fig. 8 is refer to, the serial data transmission method also includes:
Step S810, set the baud rate of each operating system serial ports identical, and set the baud rate of equipment of serial to be more than
Or the sum of the baud rate equal to all operating system serial ports;Or the baud rate and equipment of serial of each operating system serial ports are set
Baud rate it is identical.
Because above-mentioned steps S610, S620, S710, S720, S730, S810 can be performed by control logic unit, preceding
State when being illustrated to distributed apparatus that the composition to control logic unit and operation principle are made that explanation, do not do herein
Repeat.
The embodiment of the present invention also provides a kind of computer-readable storage medium, and the storage medium is arranged in distributed apparatus, should
Storage medium includes one group of instruction, when executed, causes at least one computing device embodiment of the present invention to provide
Serial data transmission method.
Fig. 9 is refer to, the embodiment of the present invention additionally provides one kind and additionally provides a kind of serial data transmission method, this method
The main frame 200 provided applied to the present embodiment, is repeated no more to the composition of main frame 200 herein.This method comprises the following steps:
Step S910, serial port of host computer receive the equipment of serial data that distributed apparatus is sent.
Equipment of serial data include identifying corresponding to multiple virtual serial port units.
Step S920, serial port of host computer are based on mark and send equipment of serial data to virtual serial port list corresponding with mark
Member.
Figure 10 is refer to, the serial data transmission method also includes:
Step S1010, serial port of host computer receive the serial port of host computer data that multiple virtual serial port units are sent.
Step S1020, serial port of host computer send serial port of host computer data to distributed apparatus.
Serial port of host computer data include mark corresponding with virtual serial port unit.The mark can be by data processing module 210
Add serial port of host computer data.
Because above-mentioned steps S910, S920, S1010, S1020 can be performed by the modules in main frame 200, foregoing
The composition to main frame 200 and operation principle are made that explanation when being illustrated to main frame 200, do not repeat herein.
The embodiment of the present invention also provides a kind of computer-readable storage medium, and the storage medium is arranged in main frame, and the storage is situated between
Matter includes one group of instruction, when executed, causes at least one computing device serial ports provided in an embodiment of the present invention
Data transmission method.
In summary, the embodiments of the invention provide a kind of serial data transmission method, distributed apparatus, main frame and calculating
Machine storage medium.When main frame and distributed apparatus carry out data interaction, the serial ports that is sent by control logic unit to main frame
Data and the serial data for needing main frame to receive are received and transmitted, and can be led to too small amount of externally serial ports connection distribution and be set
Standby interior multiple operating system serial ports, and multiple operating system serial ports are monitored and operated simultaneously, it is empty to save the panel that serial ports takes
Between, provide help for device miniaturization.
In several embodiments provided herein, it should be understood that disclosed apparatus and method, can also pass through
Other modes are realized.Device embodiment described above is only schematical, for example, flow chart and block diagram in accompanying drawing
Show the device of multiple embodiments according to the present invention, method and computer program product architectural framework in the cards,
Function and operation.At this point, each square frame in flow chart or block diagram can represent the one of a module, program segment or code
Part, a part for the module, program segment or code include one or more and are used to realize holding for defined logic function
Row instruction.It should also be noted that at some as in the implementation replaced, the function that is marked in square frame can also with different from
The order marked in accompanying drawing occurs.For example, two continuous square frames can essentially perform substantially in parallel, they are sometimes
It can perform in the opposite order, this is depending on involved function.It is it is also noted that every in block diagram and/or flow chart
The combination of individual square frame and block diagram and/or the square frame in flow chart, function or the special base of action as defined in performing can be used
Realize, or can be realized with the combination of specialized hardware and computer instruction in the system of hardware.
In addition, each functional module in each embodiment of the present invention can integrate to form an independent portion
Point or modules individualism, can also two or more modules be integrated to form an independent part.
If the function is realized in the form of software function module and is used as independent production marketing or in use, can be with
It is stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially in other words
The part to be contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter
Calculation machine software product is stored in a storage medium, including some instructions are causing a computer equipment (can be
People's computer, server, or network equipment etc.) perform all or part of step of each embodiment methods described of the present invention.
And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), arbitrary access are deposited
Reservoir (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.Need
Illustrate, herein, be such as used merely to second or the like relational terms by an entity or operation with it is another
Individual entity or operation make a distinction, and not necessarily require or imply these entities or exist between operating any this actual
Relation or order.Moreover, term " comprising ", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion,
So that process, method, article or equipment including a series of elements not only include those key elements, but also including not having
The other element being expressly recited, or also include for this process, method, article or the intrinsic key element of equipment.Do not having
There is the key element in the case of more limiting, limited by sentence "including a ...", it is not excluded that including the mistake of the key element
Other identical element in journey, method, article or equipment also be present.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area
For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies
Change, equivalent substitution, improvement etc., should be included in the scope of the protection.It should be noted that:Similar label and letter exists
Similar terms is represented in following accompanying drawing, therefore, once being defined in a certain Xiang Yi accompanying drawing, is then not required in subsequent accompanying drawing
It is further defined and explained.
Claims (13)
1. a kind of serial data transmission method, it is characterised in that methods described is applied to distributed apparatus, the distributed apparatus
Including control logic unit and multiple business unit, the operating system serial ports and the control logic list of each business unit
Member connection, the control logic unit are connected by equipment of serial with a main frame, and methods described includes:
The control logic unit receives the serial port of host computer data of the main frame transmission, the main frame string by the equipment of serial
Mouth data include unique mark corresponding with the operating system serial ports;
The control logic unit be based on the unique mark by the serial port of host computer data send to the unique mark pair
The operating system serial ports answered.
2. serial data transmission method according to claim 1, it is characterised in that the control logic unit is based on described
Unique mark sends the serial port of host computer data to operating system serial ports corresponding with the mark, including:
The control logic unit identifies the unique mark in the serial port of host computer data, each from the serial port of host computer data
Character data is extracted after unique mark and is distributed to each operating system serial ports corresponding to each unique mark.
3. serial data transmission method according to claim 1, it is characterised in that methods described also includes:
The control logic unit receives the equipment of serial data that any operation system serial ports is sent;
The control logic unit encapsulates corresponding with any operation system serial ports unique in the equipment of serial data
Mark;
The control logic unit sends the equipment of serial data after encapsulation to the main frame by the equipment of serial.
4. serial data transmission method according to claim 3, it is characterised in that in the control logic unit described
Unique mark corresponding with any operation system serial ports is encapsulated in equipment of serial data, is specifically included:
The control logic unit determines any operation system string according to the link position of any operation system serial ports
Unique mark corresponding to mouthful;The control logic unit encapsulates and described before each character of the equipment of serial data
Unique mark corresponding to one operating system serial ports.
5. the serial data transmission method according to any claim in claim 1-4, it is characterised in that methods described is also wrapped
Include:
Set the baud rate of each operating system serial ports identical, and set the baud rate of the equipment of serial to be more than or equal to and own
The sum of the baud rate of operating system serial ports;Or
Set the baud rate of each operating system serial ports identical with the baud rate of the equipment of serial.
6. a kind of distributed apparatus, it is characterised in that the distributed apparatus includes a control logic unit and multiple business
Unit, the operating system serial ports of each business unit are connected with the control logic unit, and the control logic unit leads to
An equipment of serial is crossed to be connected with main frame;
The control logic unit includes serial port module, for receiving the main frame string of the main frame transmission by the equipment of serial
Mouth data, the serial port of host computer data include unique mark corresponding with the operating system serial ports, the serial port module, are used for
The serial port of host computer data are sent to operating system serial ports corresponding with the unique mark based on the unique mark.
7. distributed apparatus according to claim 6, it is characterised in that the control logic unit includes distribution module,
The distribution module is all connected with each operating system serial ports, and the distribution module is specifically used for identifying the main frame
Unique mark in serial data, extracted from the serial port of host computer data after each unique mark character data be distributed to it is described
Each operating system serial ports corresponding to unique mark.
8. distributed apparatus according to claim 6, it is characterised in that the control logic unit also includes Encapsulation Moulds
Block, the package module are all connected with each operating system serial ports, and the package module is used to receive any operation system
The equipment of serial data that serial ports is sent, added in the equipment of serial data corresponding only with any operation system serial ports
One mark, the equipment of serial data for adding unique mark are sent to the equipment of serial.
9. distributed apparatus according to claim 8, it is characterised in that the package module is specifically used for being appointed according to described
The link position of one operating system serial ports, determine unique mark corresponding to any operation system serial ports;The control logic
Unit encapsulates unique mark corresponding with any operation system serial ports before each character of the serial data.
10. a kind of serial data transmission method, it is characterised in that methods described is applied to main frame, and the main frame includes main frame string
Mouth and data processing module, the data processing module include multiple virtual serial port units, the serial port of host computer and a distribution
Equipment connects, and the operating system serial ports of each business unit of each virtual serial port unit and distributed apparatus corresponds, institute
The method of stating includes:
The serial port of host computer receives the equipment of serial data that the distributed apparatus is sent, and the equipment of serial data include and institute
State and identified corresponding to multiple virtual serial port units;
The serial port of host computer is based on the mark and sends the equipment of serial data to the virtual serial port unit.
11. serial data transmission method according to claim 10, it is characterised in that methods described also includes:
The serial port of host computer receives the serial port of host computer data that the multiple virtual serial port unit is sent;
The serial port of host computer sends the serial port of host computer data to the distributed apparatus, the serial port of host computer data include with
Identified corresponding to the virtual serial port unit.
12. a kind of main frame, it is characterised in that the main frame includes data processing module and serial port of host computer, the data processing mould
Block includes multiple virtual serial port units, and the serial port of host computer can be connected with distributed apparatus;Each virtual serial port unit and distribution
The operating system serial ports of each business unit of formula equipment corresponds;
The serial port of host computer is configured as receiving the equipment of serial data that the distributed apparatus is sent, the equipment of serial data
Including mark corresponding with the multiple virtual serial port unit;
The serial port of host computer is configured as sending the equipment of serial data to corresponding with the mark based on the mark
The virtual serial port unit.
13. main frame according to claim 12, it is characterised in that the serial port of host computer is additionally configured to receive the multiple
The serial port of host computer data that virtual serial port unit is sent;
The serial port of host computer is configured as sending the serial port of host computer data to the distributed apparatus, the serial port of host computer number
According to including mark corresponding with the virtual serial port unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711162380.9A CN107885691A (en) | 2017-11-21 | 2017-11-21 | Serial data transmission method, distributed apparatus and main frame |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711162380.9A CN107885691A (en) | 2017-11-21 | 2017-11-21 | Serial data transmission method, distributed apparatus and main frame |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107885691A true CN107885691A (en) | 2018-04-06 |
Family
ID=61777787
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711162380.9A Pending CN107885691A (en) | 2017-11-21 | 2017-11-21 | Serial data transmission method, distributed apparatus and main frame |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107885691A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110032532A (en) * | 2019-03-15 | 2019-07-19 | 北京控制工程研究所 | A kind of master-slave mode serial port communication method based on Interruption triggering |
CN111638944A (en) * | 2020-06-01 | 2020-09-08 | 浙江大学 | Serial port virtualization optimization method for mixed kernel operating system |
CN111694695A (en) * | 2020-04-13 | 2020-09-22 | 新华三信息技术有限公司 | Serial port information acquisition method and server |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101308480A (en) * | 2008-06-18 | 2008-11-19 | 嘉兴闻泰通讯科技有限公司 | Method for host serial simultaneously connecting multiple asynchronous serial equipment |
CN101470688A (en) * | 2007-12-28 | 2009-07-01 | 希姆通信息技术(上海)有限公司 | Method for implementing multi-function by single-terminal serial port |
CN105243039A (en) * | 2015-11-13 | 2016-01-13 | 上海斐讯数据通信技术有限公司 | Serial port communication system and method |
CN105868149A (en) * | 2016-03-24 | 2016-08-17 | 杭州昆海信息技术有限公司 | A serial port information transmission method and device |
-
2017
- 2017-11-21 CN CN201711162380.9A patent/CN107885691A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101470688A (en) * | 2007-12-28 | 2009-07-01 | 希姆通信息技术(上海)有限公司 | Method for implementing multi-function by single-terminal serial port |
CN101308480A (en) * | 2008-06-18 | 2008-11-19 | 嘉兴闻泰通讯科技有限公司 | Method for host serial simultaneously connecting multiple asynchronous serial equipment |
CN105243039A (en) * | 2015-11-13 | 2016-01-13 | 上海斐讯数据通信技术有限公司 | Serial port communication system and method |
CN105868149A (en) * | 2016-03-24 | 2016-08-17 | 杭州昆海信息技术有限公司 | A serial port information transmission method and device |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110032532A (en) * | 2019-03-15 | 2019-07-19 | 北京控制工程研究所 | A kind of master-slave mode serial port communication method based on Interruption triggering |
CN110032532B (en) * | 2019-03-15 | 2021-02-09 | 北京控制工程研究所 | Master-slave serial port communication method based on timing interrupt triggering |
CN111694695A (en) * | 2020-04-13 | 2020-09-22 | 新华三信息技术有限公司 | Serial port information acquisition method and server |
CN111638944A (en) * | 2020-06-01 | 2020-09-08 | 浙江大学 | Serial port virtualization optimization method for mixed kernel operating system |
CN111638944B (en) * | 2020-06-01 | 2023-04-18 | 浙江大学 | Serial port virtualization optimization method for mixed kernel operating system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104345717A (en) | Intelligent remote data acquisition system based on Internet of Things | |
CN107885691A (en) | Serial data transmission method, distributed apparatus and main frame | |
CN107770298B (en) | Method and device for transmitting data | |
CN103546354B (en) | Based on the communication means that the RS485 of Internet of Things electric power temperature measuring equipment is compatible with CAN | |
CN104967686B (en) | A kind of structure face type 3S intelligent service shops system and its design method | |
CN103490962A (en) | Internet of Things access platform system and Internet of Things access method | |
CN105162673A (en) | Data transmission interface and method | |
CN110190887A (en) | Earth station, Unmanned Aerial Vehicle Data Transmission system and method and storage medium | |
CN102621921A (en) | Programmer for electric energy meters | |
CN107819659A (en) | A kind of intelligent level UNICOM communication network based on SPI | |
CN108134812A (en) | Data processing method and device | |
CN103117881A (en) | Resource management system of Internet of Things | |
CN103905410A (en) | Multi-channel communication protocol converter capable of converting user-defined protocol to Modbus protocol | |
CN107612612A (en) | Satellite TT&C system | |
CN107132799A (en) | A kind of apparatus and method of many MCU data interactions intelligent acquisitions | |
CN102984258A (en) | Internet of things data transmission method and adapter | |
CN102739788B (en) | A kind of field device communicating method based on EIB agreement | |
CN107465601A (en) | Pushed information processing method and processing device | |
CN107861724B (en) | Scripted coding method for fast adapting DLMS/COSEM object | |
CN102857375B (en) | A kind of method for managing and explaining communication protocol | |
CN107229591A (en) | Multi-serial communication method and device | |
CN206021155U (en) | A kind of fusion architecture server | |
CN107342924A (en) | CAN nonpolarity communication means and device, electronic equipment | |
CN108153260A (en) | A kind of Discrete Intelligence manufacture system control terminal based on internet | |
CN107220154A (en) | The system for managing multiple address identical two-wire serial interface optical modules |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180406 |
|
RJ01 | Rejection of invention patent application after publication |