CN103166821A - Method, device and system capable of achieving serial port communication - Google Patents

Method, device and system capable of achieving serial port communication Download PDF

Info

Publication number
CN103166821A
CN103166821A CN2011104123350A CN201110412335A CN103166821A CN 103166821 A CN103166821 A CN 103166821A CN 2011104123350 A CN2011104123350 A CN 2011104123350A CN 201110412335 A CN201110412335 A CN 201110412335A CN 103166821 A CN103166821 A CN 103166821A
Authority
CN
China
Prior art keywords
equipment
place
serial bus
universal serial
interrupt
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
Application number
CN2011104123350A
Other languages
Chinese (zh)
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.)
Shenzhen Huawei Agisson Electric Co Ltd
Original Assignee
Shenzhen Huawei Agisson Electric 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 Shenzhen Huawei Agisson Electric Co Ltd filed Critical Shenzhen Huawei Agisson Electric Co Ltd
Priority to CN2011104123350A priority Critical patent/CN103166821A/en
Publication of CN103166821A publication Critical patent/CN103166821A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Bus Control (AREA)

Abstract

The invention discloses a method, a device and a system capable of achieving serial port communication and belongs to the communication technical field. The method comprises the following steps: each slave device in place is ascertained through a control bus and a serial bus; each interrupt request sent by each slave device in place is received through the control bus; when the interrupt request of only one slave device in place is received at present, the serial bus is assigned to the slave device, in place, which sends the interrupt request at present; when the interrupt requests of a plurality of slave devices in place are received at present, a corresponding interrupt priority level of each of slave devices in place is ascertained and the serial bus is assigned to one of the slave devices in place according to the interrupt priority levels of the plurality of slave devices in place; and data communication is conducted through the serial bus and the slave device, in place, which the serial bus is assigned to. According to the technical scheme, device identification (ID) is not brought in, so that a series of problems which are caused by setting of the device ID in the prior art can be solved, processing efficiency of a primary device is improved and shared serial bus conflicts can not be caused.

Description

Realize method, the equipment and system of serial communication
Technical field
The present invention relates to communication technical field, particularly a kind of method, equipment and system of realizing serial communication.
Background technology
At present, main equipment is mainly managed connected from equipment by universal serial bus, and different from equipment according to identifying from the device id of equipment, wherein, universal serial bus for connected all share from equipment, weld the modes such as resistance or software configuration by toggle switch, choosing from the device id of equipment and determine.When main equipment is connected when communicating from equipment, main equipment includes from the data message of the device id of equipment to connected the transmission from equipment; So, after receiving the data message that main equipment sends, if the device id in received data message is not identical with the device id of self, abandon this data message from equipment, otherwise, this data message received.
Above-mentioned basis is identified different problems below the technology existence of equipment from the device id of equipment:
1, when the mode by toggle switch realizes from the arranging of the device id of equipment, because the reliability of toggle switch is relatively poor, easily cause arranging of device id wrong, thus the identification error when having identification from equipment.
2, realize that from the device id of equipment be when arranging when the mode of welding resistance by choosing, same type need to use different inventories to manage and distinguish from equipment, will cause the cost of production and processing and management cost higher.
3, when the mode that configures by software realized from the arranging of the device id of equipment, the software configuration easily made mistakes, and causes arranging of device id wrong, thus the identification error when having identification from equipment.
4, stagger the time when the device id from equipment sets out, the difficulty of malfunction elimination is larger.
5, main equipment and when communicating from equipment, communication data comprises the information of device id due to needs, this will cause the expense of communication protocol of device interior larger, thereby cause the efficient of transfer of data low.
Above-mentioned in prior art, main equipment is managed connected from equipment by different universal serial bus because being provided with the problem of drawing from the device id of equipment in order to solve, and specific implementation is as follows:
On hardware was realized, main equipment designed the interface of universal serial bus according to connected quantity from equipment, so that each can use respectively one group of universal serial bus and main equipment to communicate from equipment; On software was realized: main equipment was identified and operates different from equipment by different universal serial bus.
Although main equipment is managed by different universal serial bus and has connectedly been solved because arranging from the device id of equipment to cause it is problem from equipment,, but there is following problem in this technical scheme:
1, each uses respectively one group of universal serial bus to communicate by letter with main equipment from equipment, causes main equipment with too complicated from the equipment room wiring, is unsuitable for communicating by letter between remote equipment.
2, because main equipment need to design the interface of universal serial bus according to connected quantity from equipment, what get that main equipment manages is confined to the interface of the universal serial bus of main equipment from number of devices.
3, main equipment according to design the quantity of universal serial bus from the quantity of equipment, can't use shared bus, and like this, main equipment will be expanded more serial bus interface, and hardware cost is higher.
Summary of the invention
In order to solve the problems of the technologies described above, the embodiment of the present invention provides a kind of method, equipment and system of realizing serial communication.Described technical scheme is as follows:
A kind of method that realizes serial communication, described method comprises:
Determine that by control bus and universal serial bus each is in place from equipment;
Receive described each interrupt requests from the equipment transmission in place by described control bus;
If currently only receive an interrupt requests that sends from equipment in place, universal serial bus is distributed to the in place from equipment of current transmission interrupt requests;
If currently receive a plurality of interrupt requests that send from equipment in place, determine described a plurality of in place from interrupt priority level corresponding to equipment, according to described a plurality of in place from interrupt priority level corresponding to equipment with universal serial bus distribute to described a plurality of from equipment one in place in place from equipment;
By described universal serial bus be assigned the in place of described universal serial bus and carry out data communication from equipment.
A kind of main equipment, described main equipment comprises: determination module, receiver module, the first distribution module, the second distribution module and data communication module;
Described determination module is used for determining that by control bus and universal serial bus each is in place from equipment;
Described receiver module is used for receiving described each interrupt requests from the equipment transmission in place by described control bus;
Described the first distribution module if be used for the current interrupt requests that sends from equipment in place that only receives, is distributed to universal serial bus the in place from equipment of current transmission interrupt requests;
Described the second distribution module, if be used for current a plurality of interrupt requests from the equipment transmission in place that receive, determine described a plurality of in place from interrupt priority level corresponding to equipment, according to described a plurality of in place from interrupt priority level corresponding to equipment with universal serial bus distribute to described a plurality of from equipment one in place in place from equipment;
Described data communication module, be used for by described universal serial bus be assigned the in place of described universal serial bus and carry out data communication from equipment.
A kind of system that realizes serial communication, described system comprises: main equipment and a plurality of from equipment, described a plurality ofly be connected with described main equipment with same control bus by same serial bus respectively from equipment;
Described main equipment is used for determining that by control bus and universal serial bus each is in place from equipment;
Describedly be used for by described control bus to described main equipment transmission interrupt requests from equipment;
described main equipment receives described each interrupt requests from the equipment transmission in place by described control bus, if currently only receive an interrupt requests that sends from equipment in place, universal serial bus is distributed to the in place from equipment of current transmission interrupt requests, if currently receive a plurality of interrupt requests that send from equipment in place, determine described a plurality of in place from interrupt priority level corresponding to equipment, according to described a plurality of in place from interrupt priority level corresponding to equipment with universal serial bus distribute to described a plurality of from equipment one in place in place from equipment,
Described main equipment be used for by described universal serial bus be assigned the in place of described universal serial bus and carry out data communication from equipment.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is: at first, the technical program is not introduced device id, can overcome the series of problems that causes because device id is set in prior art; Secondly, can come initiatively to send to main equipment the right to use that interrupt requests is applied for universal serial bus by control bus from equipment, avoid main equipment initiatively to go poll whether to apply for universal serial bus from equipment, thereby improved the treatment effeciency of main equipment; Moreover a plurality of during from equipment application universal serial bus when having simultaneously, main equipment is managed by interrupt priority level and is from the devices allocation universal serial bus, can not cause shared universal serial bus conflict.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, during the below will describe embodiment, the accompanying drawing of required use is done to introduce simply, apparently, accompanying drawing in the following describes is only 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 a kind of method flow diagram of realizing serial communication that provides in the embodiment of the present invention 1;
Fig. 2 is a kind of system schematic that realizes serial communication that provides in the embodiment of the present invention 2;
Fig. 3 is a kind of system schematic that realizes serial communication that provides in the embodiment of the present invention 2;
Fig. 4 is a kind of method flow diagram of realizing serial communication that provides in the embodiment of the present invention 2;
Fig. 5 is a kind of main equipment that provides in the embodiment of the present invention 3;
Fig. 6 is a kind of main equipment that provides in the embodiment of the present invention 3.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Embodiment 1
Referring to Fig. 1, a kind of method that realizes serial communication, method specifically comprises following operation:
Step 101: determine that by control bus and universal serial bus each is in place from equipment;
Step 102: receive each interrupt requests from the equipment transmission in place by control bus;
Step 103: if currently only receive an interrupt requests that sends from equipment in place, universal serial bus is distributed to the in place from equipment of current transmission interrupt requests;
Step 104: if currently receive a plurality of interrupt requests that send from equipment in place, determine a plurality of in place from interrupt priority level corresponding to equipment, according to a plurality of in place from interrupt priority level corresponding to equipment with universal serial bus distribute to a plurality of from equipment one in place in place from equipment;
Step 105: by universal serial bus be assigned the in place of universal serial bus and carry out data communication from equipment.
At first, the technical program is not introduced device id, can overcome the series of problems that causes because device id is set in prior art; Secondly, can come initiatively to send to main equipment the right to use that interrupt requests is applied for universal serial bus by control bus from equipment, avoid main equipment initiatively to go poll whether to apply for universal serial bus from equipment, thereby improved the treatment effeciency of main equipment; Moreover a plurality of during from equipment application universal serial bus when having simultaneously, main equipment is managed by interrupt priority level and is from the devices allocation universal serial bus, can not cause shared universal serial bus conflict.
Embodiment 2
Referring to Fig. 2, be a kind of system that realizes serial communication that the embodiment of the present invention provides, this system comprises: main equipment 101 and from equipment 201, from equipment 202 ..., from equipment 20N altogether N from equipment, wherein, N is the integer more than or equal to 2; In the embodiment of the present invention, above-mentioned N can be connected with main equipment 101 with same control bus by same universal serial bus respectively from equipment.
In the embodiment of the present invention, universal serial bus is specifically as follows RS232, RS485 or RS422, and generally, this universal serial bus is used at main equipment and from the transmission of data between equipment, can comprise receive path RXD and sendaisle TXD.Wherein, RS232, RS485 or RS422 are EIA (Electronic Industry Association, EIA) a kind of serial physical interface of formulating, RS refers to the abbreviation of English Recommendation Criterion (proposed standard), and 232,485 or 422 is identification number.
In the embodiment of the present invention, control bus specifically can only include a holding wire, is used at main equipment and from transmission of control signals between equipment, as interrupt request singal etc.
referring to Fig. 3, in the embodiment of the present invention, main equipment 101 comprises central processing unit CPU (Central Processing Unit, CPU) module 1011, serial bus interface IP 1012 and control processing module 1013, wherein, CPU module 2011 is connected with control processing module 1013 with serial bus interface IP 1012 by the CPU internal bus respectively, and CPU module 2011 is controlled serial bus interface IP 1012 by the CPU internal bus and is realized and data communication from equipment, and control by CPU content bus and control processing module 1013 realizations from the control of equipment and interrupt processing.
Introduce in detail internal structure from equipment from equipment 201 as example take above-mentioned N from equipment, other, just repeat no more with identical from equipment 201 from the internal structure of equipment.Particularly, comprise CPU module 2011, control logic module 2012 and serial bus interface IP 2013 from equipment 201, wherein, CPU module 2011 is connected with control logic module 2013 with serial bus interface IP 2012 by the CPU internal bus respectively.
In the embodiment of the present invention, above-mentioned N is connected with the control processing module 2013 of main equipment 101 inside by same control bus respectively from the Logic control module of device interior, and the individual serial bus interface IP from device interior of above-mentioned N is connected with the serial bus interface IP 2012 of main equipment 101 inside by same universal serial bus respectively.
In the embodiment of the present invention, controlling processing module 103 and control logic module 2012 specifically can be by CPLD (Complex Program Logic Device, programmable logic device) realize, wherein, control processing module 103 and comprise and enable control register and OIER.
Based on above-described system, main equipment just can be identified according to control bus different from equipment, and universal serial bus can use for all sharing from equipment, particularly:
Main equipment is used for determining that by control bus and universal serial bus each is in place from equipment; Be used for sending interrupt requests by control bus to main equipment from equipment; Main equipment receives each interrupt requests from the equipment transmission in place by control bus, if currently only receive an interrupt requests that sends from equipment in place, universal serial bus is distributed to the in place from equipment of current transmission interrupt requests, if currently receive a plurality of interrupt requests that send from equipment in place, determine a plurality of in place from interrupt priority level corresponding to equipment, according to a plurality of in place from interrupt priority level corresponding to equipment with universal serial bus distribute to a plurality of from equipment one in place in place from equipment; Main equipment be used for by universal serial bus be assigned the in place of universal serial bus and carry out data communication from equipment.
Like this, main equipment just can be controlled from equipment by control bus and universal serial bus, and also can come the active reporting oneself state by control bus from equipment, use with the application universal serial bus, make at any time, can not cause because of using from the equipment application universal serial bus of sharing the conflict of universal serial bus, and the realization of said system can't increase the difficulty of software treatment mechanism.In addition, in system described above, main equipment is managed and is controlled from equipment by universal serial bus and control bus, be not limited to the serial bus quantity of main equipment and main equipment is managed from number of devices, and do not need to distinguish from equipment by the device id from equipment, thereby can avoid the series of problems that causes from the device id of equipment because arranging.
Below, describe in conjunction with specific embodiments a kind of method that realizes serial communication based on the above system in detail, referring to Fig. 4, described method specifically comprises following operation:
Step 301: main equipment shielding be connected respectively from the interrupt requests of equipment;
particularly, in main equipment the CPU module by internal bus control OIER in processing module shield be connected respectively from the interrupt requests of equipment, in the embodiment of the present invention, be respectively arranged with in interrupt register be connected with main equipment respectively from interruption flag corresponding to equipment, , the CPU module sends the disable interrupts enable command by the content bus to the OIER of controlling in processing module, each value of interrupting the permission flag in OIER is set to 0, mask connect respectively from the interrupt requests of equipment, with forbid that the CPU resume module is connected with main equipment respectively from the interrupt requests of equipment.
The step of this step for selecting to carry out, why to shield be connected respectively from the interrupt requests of equipment, be for main equipment when the execution in step 202, operation described in treatment step 202 that can be single, and the impact from the interrupt requests of equipment that can not be subject to for example connecting, to improve the treatment effeciency of step 202.
Step 302: main equipment determines that by control bus and universal serial bus each is in place from equipment;
Particularly, main equipment is determined each in place comprising from equipment by control bus and universal serial bus:
Respectively with connect respectively from equipment as current to be inquired from equipment, carry out following operation:
Enable control bus and current to be inquired communicating from equipment, particularly, in main equipment, the CPU module sends and enables control command to the control register that enables of controlling in processing module, be set to 1 with enabling in control register the sign value that enables to control flag from equipment current to be inquired, allow a signal to send to by control bus current to be inquired from equipment, make main equipment to be enabled to communicate by letter from equipment room with current to inquire by control bus;
Sent handshake to current to inquire from equipment by universal serial bus;
If receive the confirmation signal that returns from equipment current to be inquired, judge current to be inquired to have entered the wait communication state from equipment, just can waiting for this, main equipment carries out data communication from equipment under communication state;
If do not receive the confirmation signal that returns from equipment current to be inquired, finish and this current communication from equipment to be confirmed.
This step is a safeguard measure; to select the step carried out; further confirm whether each in place has carried out from equipment the preparation of carrying out data communication with main equipment; with prevent some or a plurality of from equipment because for example equipment fault or human factor and disconnect with main equipment between be connected, thereby can't carry out with main equipment the situation of follow-up data communication.
Step 303: main equipment remove to connect respectively from the shielding of the interrupt requests of equipment, in order to receive each interrupt requests that sends from equipment in place by control bus;
particularly, in main equipment the CPU module by internal bus control in processing module the OIER removal to be connected respectively from the shielding of the interrupt requests of equipment, in the embodiment of the present invention, be respectively arranged with in interrupt register be connected with main equipment respectively from interruption flag corresponding to equipment, , the CPU module sends permission interruption enable command by the content bus to the OIER of controlling in processing module, it is 1 that each in OIER interrupt allowed the value position of sign, removal to connect respectively from the shielding of the interrupt requests of equipment, allow that the CPU resume module is connected with main equipment respectively from the interrupt requests of equipment.
The step of this step for selecting to carry out, when step 201 was carried out, correspondingly, this step just need to be performed, certainly, when step 201 is not carried out, correspondingly, the needs that this step just is not performed.
Step 304: main equipment receives each interrupt requests from the equipment transmission in place by control bus;
Particularly, when in place will carry out data communication with main equipment from equipment the time, to send interrupt requests to main equipment by control bus, the request main equipment distributes universal serial bus for it, wherein, this terminal request also comprises the information of requested service type to some extent, and for example, institute's requested service is data service or call business etc.
Step 305: main equipment is inquired about current other interrupt requests that sends from equipment in place that whether also receives when receiving first by the interrupt requests that sends from equipment in place,
If currently only receive an interrupt requests that sends from equipment in place, execution in step 306;
If currently receive a plurality of interrupt requests that send from equipment in place, execution in step 307;
For example, main equipment also receives the interrupt requests that sends from equipment B and C in place simultaneously when receiving first by the interrupt requests that sends from device A in place.
Step 306: main equipment is distributed to the in place from equipment of current transmission interrupt requests, execution in step 309 with universal serial bus;
Step 307: main equipment is determined described a plurality of interrupt priority level from equipment in place;
Particularly, main equipment can determine that described a plurality of interrupt priority level from equipment in place comprises by following dual mode:
Mode one, respectively determine a plurality of in place from interruption flag corresponding to equipment, inquire about according to described a plurality of interruption flags from equipment in place the corresponding relation that interrupts between flag and interrupt priority level, obtain described a plurality of interrupt priority level from equipment in place.
In the embodiment of the present invention, OIER setting in control processing module in main equipment connect to some extent respectively from the interruption flag of equipment, this interrupt flag user ID send interrupt requests from equipment, and main equipment pre-establishes and stores the corresponding relation that interrupts between flag and interrupt priority level, as the interrupt priority level that interrupts flag 1 correspondence be 1, the interrupt priority level that interrupts flag 2 correspondences is 2 and to interrupt interrupt priority level corresponding to flag be 3 etc.
Mode two, determine described a plurality of requested service types that comprise in place respectively from the interrupt requests that equipment sends; According to corresponding relation between described request type of service query requests type of service and interrupt priority level, obtain described a plurality of interrupt priority level from equipment in place.
In the embodiment of the present invention, main equipment pre-establishes and stores by corresponding relation between requested service type and interrupt priority level, be that the corresponding interrupt priority level of data service is 3 as the requested service type, the requested service type is that the corresponding interrupt priority level of call business is 10 etc.
Step 308: main equipment is distributed to described a plurality of from equipment one in place from equipment according to described a plurality of interrupt priority levels from equipment in place with universal serial bus;
This step specifically comprises: universal serial bus is distributed to the highest in place from equipment of described a plurality of interrupt priority level from equipment in place.
Step 309: main equipment by described universal serial bus be assigned the in place of described universal serial bus and carry out data communication from equipment.
At first, the technical program is not introduced device id, can overcome the series of problems that causes because device id is set in prior art; Secondly, can come initiatively to send to main equipment the right to use that interrupt requests is applied for universal serial bus by control bus from equipment, avoid main equipment initiatively to go poll whether to apply for universal serial bus from equipment, thereby improved the treatment effeciency of main equipment; Moreover a plurality of during from equipment application universal serial bus when having simultaneously, main equipment is managed by interrupt priority level and is from the devices allocation universal serial bus, can not cause shared universal serial bus conflict.
Embodiment 3
Referring to 5, a kind of main equipment, this main equipment comprises: determination module 401, receiver module 402, the first distribution module 403, the second distribution module 404 and data communication module 405;
Determination module 401 is used for determining that by control bus and universal serial bus each is in place from equipment;
Receiver module 402 is used for receiving each interrupt requests from the equipment transmission in place by control bus;
The first distribution module 403 if be used for the current interrupt requests that sends from equipment in place that only receives, is distributed to universal serial bus the in place from equipment of current transmission interrupt requests;
The second distribution module 404, if be used for current a plurality of interrupt requests from the equipment transmission in place that receive, determine a plurality of in place from interrupt priority level corresponding to equipment, according to a plurality of in place from interrupt priority level corresponding to equipment with universal serial bus distribute to a plurality of from equipment one in place in place from equipment;
Data communication module 405, be used for by universal serial bus be assigned the in place of universal serial bus and carry out data communication from equipment.
In the embodiment of the present invention, determination module 401 comprises:
Control unit, be used for respectively with connect respectively from equipment as current to be inquired from equipment, the notice inquiry unit carries out work;
Inquiry unit, be used for enabling control bus and current to be inquired communicating from equipment, and sent handshake to current to inquire from equipment by universal serial bus, if receive the confirmation signal that returns from equipment current to be inquired, judge and current to be inquired entered the wait communication state from equipment, if do not receive the confirmation signal that returns from equipment current to be inquired, finish and the communication from equipment current to be inquired.
In Fig. 6, the embodiment of the present invention,, main equipment also comprises:
Interruption masking module 406, be used for that shielding connects respectively from the interrupt requests of equipment;
Correspondingly, main equipment also comprises:
The interruption module 407 of deshielding, be used for removing to connect respectively from the shielding of the interrupt requests of equipment, in order to receive each interrupt requests that sends from equipment in place by control bus.
In the embodiment of the present invention, the second distribution module 404, concrete be used for determining a plurality of in place during from interrupt priority level corresponding to equipment, determine respectively to state a plurality of in place from interruption flag corresponding to equipment, a plurality ofly in place interrupt corresponding relation between flag and interrupt priority level from interruption flag inquiry corresponding to equipment according to described, obtain described a plurality of in place from interrupt priority level corresponding to equipment; Perhaps
The second distribution module 404 concrete is used for determining a plurality of in place during from interrupt priority level corresponding to equipment, determines respectively the requested service type that comprises in described a plurality of interrupt requests that sends from equipment in place; According to corresponding relation between described request type of service query requests type of service and interrupt priority level, obtain described a plurality of in place from interrupt priority level corresponding to equipment.
The second distribution module 404, concrete be used for according to a plurality of in place from interrupt priority level corresponding to equipment with universal serial bus distribute to a plurality of from equipment one in place in place from equipment the time, universal serial bus is distributed to the highest in place from equipment of described a plurality of interrupt priority level from equipment in place.
At first, the technical program is not introduced device id, can overcome the series of problems that causes because device id is set in prior art; Secondly, can come initiatively to send to main equipment the right to use that interrupt requests is applied for universal serial bus by control bus from equipment, avoid main equipment initiatively to go poll whether to apply for universal serial bus from equipment, thereby improved the treatment effeciency of main equipment; Moreover a plurality of during from equipment application universal serial bus when having simultaneously, main equipment is managed by interrupt priority level and is from the devices allocation universal serial bus, can not cause shared universal serial bus conflict.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can come the relevant hardware of instruction to complete by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
The above is only preferred embodiment of the present invention, and is in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, is equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (15)

1. a method that realizes serial communication, is characterized in that, described method comprises:
Determine that by control bus and universal serial bus each is in place from equipment;
Receive described each interrupt requests from the equipment transmission in place by described control bus;
If currently only receive an interrupt requests that sends from equipment in place, universal serial bus is distributed to the in place from equipment of current transmission interrupt requests;
If currently receive a plurality of interrupt requests that send from equipment in place, determine described a plurality of in place from interrupt priority level corresponding to equipment, according to described a plurality of in place from interrupt priority level corresponding to equipment with universal serial bus distribute to described a plurality of from equipment one in place in place from equipment;
By described universal serial bus be assigned the in place of described universal serial bus and carry out data communication from equipment.
2. method according to claim 1, is characterized in that, describedly determines each in place comprising from equipment by control bus and universal serial bus:
Respectively with connect respectively from equipment as current to be inquired from equipment, carry out following operation:
Enable described control bus and described current to be inquired communicating from equipment, afterwards, current to be inquired send handshake from equipment by described universal serial bus to described;
If receive the described current confirmation signal that returns from equipment to be inquired, judge describedly currently to be inquired to have entered the wait communication state from equipment;
If do not receive the confirmation signal that returns from equipment described to be inquired, finish and described current communication from equipment to be inquired.
3. method according to claim 1 and 2, is characterized in that, describedly determines that by control bus and universal serial bus each is in place before equipment, and described method also comprises:
Shielding connect respectively from the interrupt requests of equipment;
Correspondingly, determine that by control bus and universal serial bus each is in place after equipment, described method also comprises:
Removal to connect respectively from the shielding of the interrupt requests of equipment, in order to receive described each interrupt requests that sends from equipment in place by described control bus.
4. method according to claim 1, is characterized in that, described definite described a plurality of in place comprising from interrupt priority level corresponding to equipment:
Determine respectively described a plurality of in place from interruption flag corresponding to equipment, a plurality ofly in place interrupt corresponding relation between flag and interrupt priority level from interruption flag inquiry corresponding to equipment according to described, obtain described a plurality of in place from interrupt priority level corresponding to equipment; Perhaps
Determine respectively the requested service type that comprises in described a plurality of interrupt requests that sends from equipment in place; According to corresponding relation between described request type of service query requests type of service and interrupt priority level, obtain described a plurality of in place from interrupt priority level corresponding to equipment.
5. method according to claim 1, is characterized in that, describedly a plurality ofly in place from interrupt priority level corresponding to equipment, universal serial bus distributed to described a plurality of in place comprising from equipment from equipment in place according to described:
Universal serial bus is distributed to the highest in place from equipment of described a plurality of interrupt priority level from equipment in place.
6. a main equipment, is characterized in that, described main equipment comprises: determination module, receiver module, the first distribution module, the second distribution module and data communication module;
Described determination module is used for determining that by control bus and universal serial bus each is in place from equipment;
Described receiver module is used for receiving described each interrupt requests from the equipment transmission in place by described control bus;
Described the first distribution module if be used for the current interrupt requests that sends from equipment in place that only receives, is distributed to universal serial bus the in place from equipment of current transmission interrupt requests;
Described the second distribution module, if be used for current a plurality of interrupt requests from the equipment transmission in place that receive, determine described a plurality of in place from interrupt priority level corresponding to equipment, according to described a plurality of in place from interrupt priority level corresponding to equipment with universal serial bus distribute to described a plurality of from equipment one in place in place from equipment;
Described data communication module, be used for by described universal serial bus be assigned the in place of described universal serial bus and carry out data communication from equipment.
7. main equipment according to claim 6, is characterized in that, described determination module comprises:
Control unit, be used for respectively with connect respectively from equipment as current to be inquired from equipment, the notice inquiry unit carries out work;
Described inquiry unit, be used for enabling described control bus and described current to be inquired communicating from equipment, and current to be inquired send handshake from equipment by described universal serial bus to described, if receive the described current response signal of returning from equipment to be inquired, judge and describedly currently to be inquired entered the wait communication state from equipment, if do not receive the confirmation signal that returns from equipment described to be inquired, finish and described current communication from equipment to be inquired.
8. according to claim 6 or 7 described main equipments, is characterized in that, described main equipment also comprises:
The interruption masking module, be used for that shielding connects respectively from the interrupt requests of equipment;
Correspondingly, described main equipment also comprises:
The interruption module of deshielding, be used for removing to connect respectively from the shielding of the interrupt requests of equipment, in order to receive described each interrupt requests that sends from equipment in place by described control bus.
9. main equipment according to claim 6, it is characterized in that, described the second distribution module, concrete be used for determining described a plurality of in place during from interrupt priority level corresponding to equipment, determine respectively described a plurality of in place from interruption flag corresponding to equipment, a plurality ofly in place interrupt corresponding relation between flag and interrupt priority level from interruption flag inquiry corresponding to equipment according to described, obtain described a plurality of in place from interrupt priority level corresponding to equipment; Perhaps
Described the second distribution module concrete is used for determining described a plurality of in place during from interrupt priority level corresponding to equipment, determines respectively the requested service type that comprises in described a plurality of interrupt requests that sends from equipment in place; According to corresponding relation between described request type of service query requests type of service and interrupt priority level, obtain described a plurality of in place from interrupt priority level corresponding to equipment.
10. main equipment according to claim 6, it is characterized in that, described the second distribution module, concrete be used for according to described a plurality of in place from interrupt priority level corresponding to equipment with universal serial bus distribute to described a plurality of from equipment one in place in place from equipment the time, universal serial bus is distributed to the highest in place from equipment of described a plurality of interrupt priority level from equipment in place.
11. a system that realizes serial communication is characterized in that, described system comprises: main equipment and a plurality of from equipment, described a plurality ofly be connected with described main equipment with same control bus by same serial bus respectively from equipment;
Described main equipment is used for determining that by control bus and universal serial bus each is in place from equipment;
Describedly be used for by described control bus to described main equipment transmission interrupt requests from equipment;
described main equipment receives described each interrupt requests from the equipment transmission in place by described control bus, if currently only receive an interrupt requests that sends from equipment in place, universal serial bus is distributed to the in place from equipment of current transmission interrupt requests, if currently receive a plurality of interrupt requests that send from equipment in place, determine described a plurality of in place from interrupt priority level corresponding to equipment, according to described a plurality of in place from interrupt priority level corresponding to equipment with universal serial bus distribute to described a plurality of from equipment one in place in place from equipment,
Described main equipment be used for by described universal serial bus be assigned the in place of described universal serial bus and carry out data communication from equipment.
12. system according to claim 11 is characterized in that, described a plurality of being connected with described main equipment with same control bus by same serial bus respectively from equipment comprises:
Described a plurality of control logic module in equipment is connected with control processing module in described main equipment by same control bus respectively;
Described a plurality of serial bus interface module in equipment is connected with serial bus interface module in described main equipment by same universal serial bus respectively.
13. system according to claim 11 is characterized in that, described universal serial bus is specially RS232, RS485 or RS422.
14. system according to claim 12 is characterized in that, described control processing module comprises OIER and controls enable register.
15. system according to claim 12 is characterized in that, described control processing module is specifically realized by programmable logic device (CPLD).
CN2011104123350A 2011-12-12 2011-12-12 Method, device and system capable of achieving serial port communication Pending CN103166821A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011104123350A CN103166821A (en) 2011-12-12 2011-12-12 Method, device and system capable of achieving serial port communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011104123350A CN103166821A (en) 2011-12-12 2011-12-12 Method, device and system capable of achieving serial port communication

Publications (1)

Publication Number Publication Date
CN103166821A true CN103166821A (en) 2013-06-19

Family

ID=48589573

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011104123350A Pending CN103166821A (en) 2011-12-12 2011-12-12 Method, device and system capable of achieving serial port communication

Country Status (1)

Country Link
CN (1) CN103166821A (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103106113A (en) * 2013-02-25 2013-05-15 广东威创视讯科技股份有限公司 Interrupt event processing method and processing equipment
CN103559159A (en) * 2013-10-25 2014-02-05 华为技术有限公司 Information processing method and electronic device
CN105512070A (en) * 2015-12-02 2016-04-20 中国电子科技集团公司第四十一研究所 Control system based on serial bus
CN106953896A (en) * 2017-02-21 2017-07-14 深圳市智物联网络有限公司 The data transmission method and adapter of adapter
CN106951391A (en) * 2017-02-15 2017-07-14 合肥芯荣微电子有限公司 Point-to-point interconnection bus access mask system and method in a kind of chip
CN103685578B (en) * 2014-01-08 2017-08-04 珠海全志科技股份有限公司 The data transmission method of master-slave equipment
CN107179792A (en) * 2017-05-15 2017-09-19 成都猎曲科技有限公司 Plant growth intelligent management system based on RS232 networkings
CN108390807A (en) * 2018-02-11 2018-08-10 宁波工程学院 A kind of SCM Based multi computer communication method
CN110445700A (en) * 2019-08-14 2019-11-12 深圳市优必选科技股份有限公司 Slave communication system, method and terminal device
CN110620609A (en) * 2019-08-28 2019-12-27 无锡睿思凯科技股份有限公司 Data communication method, main equipment and system
CN111124962A (en) * 2019-11-13 2020-05-08 苏州浪潮智能科技有限公司 TF (Transflash) card slot multiplexing method and system based on server PCH (physical channel) and BMC (baseboard management controller)
CN111245635A (en) * 2018-11-29 2020-06-05 山东新北洋信息技术股份有限公司 System with master and slave devices and ID number setting method of slave device thereof
CN111444124A (en) * 2020-03-25 2020-07-24 苏州琅润达检测科技有限公司 Serial port shunting device with high-frequency autonomous request
CN112639753A (en) * 2018-08-30 2021-04-09 高通股份有限公司 Aggregated inband interruption
CN113138949A (en) * 2021-04-29 2021-07-20 上海阵量智能科技有限公司 Interrupt controller, interrupt control method, chip, computer device, and medium
CN115118758A (en) * 2022-05-20 2022-09-27 武汉小安信息科技有限公司 Module communication method, master communication module, slave communication module and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101261613A (en) * 2007-03-09 2008-09-10 南京理工大学 Image processor team interface bus
CN101281511A (en) * 2007-04-02 2008-10-08 成都方程式电子有限公司 On-chip bus system
CN102045227A (en) * 2009-10-19 2011-05-04 索尼公司 Communication centralized control system and communication centralized control method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101261613A (en) * 2007-03-09 2008-09-10 南京理工大学 Image processor team interface bus
CN101281511A (en) * 2007-04-02 2008-10-08 成都方程式电子有限公司 On-chip bus system
CN102045227A (en) * 2009-10-19 2011-05-04 索尼公司 Communication centralized control system and communication centralized control method

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103106113A (en) * 2013-02-25 2013-05-15 广东威创视讯科技股份有限公司 Interrupt event processing method and processing equipment
CN103559159A (en) * 2013-10-25 2014-02-05 华为技术有限公司 Information processing method and electronic device
CN103685578B (en) * 2014-01-08 2017-08-04 珠海全志科技股份有限公司 The data transmission method of master-slave equipment
CN105512070A (en) * 2015-12-02 2016-04-20 中国电子科技集团公司第四十一研究所 Control system based on serial bus
CN105512070B (en) * 2015-12-02 2018-07-06 中国电子科技集团公司第四十一研究所 A kind of control system based on universal serial bus
CN106951391A (en) * 2017-02-15 2017-07-14 合肥芯荣微电子有限公司 Point-to-point interconnection bus access mask system and method in a kind of chip
CN106951391B (en) * 2017-02-15 2020-02-11 合肥芯荣微电子有限公司 System and method for shielding access of point-to-point interconnection bus in chip
CN106953896A (en) * 2017-02-21 2017-07-14 深圳市智物联网络有限公司 The data transmission method and adapter of adapter
CN106953896B (en) * 2017-02-21 2020-05-01 深圳市智物联网络有限公司 Data transmission method of adapter and adapter
CN107179792A (en) * 2017-05-15 2017-09-19 成都猎曲科技有限公司 Plant growth intelligent management system based on RS232 networkings
CN108390807A (en) * 2018-02-11 2018-08-10 宁波工程学院 A kind of SCM Based multi computer communication method
CN112639753A (en) * 2018-08-30 2021-04-09 高通股份有限公司 Aggregated inband interruption
CN112639753B (en) * 2018-08-30 2022-08-16 高通股份有限公司 Aggregated inband interruption
CN111245635A (en) * 2018-11-29 2020-06-05 山东新北洋信息技术股份有限公司 System with master and slave devices and ID number setting method of slave device thereof
CN110445700A (en) * 2019-08-14 2019-11-12 深圳市优必选科技股份有限公司 Slave communication system, method and terminal device
CN110620609A (en) * 2019-08-28 2019-12-27 无锡睿思凯科技股份有限公司 Data communication method, main equipment and system
CN111124962A (en) * 2019-11-13 2020-05-08 苏州浪潮智能科技有限公司 TF (Transflash) card slot multiplexing method and system based on server PCH (physical channel) and BMC (baseboard management controller)
CN111444124A (en) * 2020-03-25 2020-07-24 苏州琅润达检测科技有限公司 Serial port shunting device with high-frequency autonomous request
CN113138949A (en) * 2021-04-29 2021-07-20 上海阵量智能科技有限公司 Interrupt controller, interrupt control method, chip, computer device, and medium
CN115118758A (en) * 2022-05-20 2022-09-27 武汉小安信息科技有限公司 Module communication method, master communication module, slave communication module and electronic equipment

Similar Documents

Publication Publication Date Title
CN103166821A (en) Method, device and system capable of achieving serial port communication
US10411971B2 (en) Method for unified communication of server, baseboard management controller, and server
CN105847456B (en) A kind of RS485 distributes address methods, devices and systems automatically
AU765511B2 (en) Electronic device with USB interface
EP2720111B1 (en) Computer system, connection device, power supply control method, and power supply control program recording medium
CN107111588A (en) The data transfer of PCIe protocol is used via USB port
CN101150439A (en) A method, system and device for realizing master/slave switching
CN102571996B (en) IP (Internet Protocol) address assignment method, IP address assignment device and network system
CN102322672A (en) Method for controlling multiple air-conditioned indoor units by using single wire control device
CN103634150A (en) Redundant high-safety CAN (controller area network) bus communication system and communication method thereof
CN102143138A (en) Method and device for configuring virtual local area network (VLAN) in live migration process of virtual machine
EP2717533A1 (en) Method, network card and hard disk card for accessing to shut-down hard disk
CN103490931B (en) The unbroken method and apparatus of agreement in a kind of non-interrupting service escalation process
CN106603359B (en) The communicating control method and device of PLC system
CN102025616A (en) Method, device and switch for realizing BFD (Bidirectional Forwarding Detection)
CN104899170A (en) Distributed intelligent platform management bus (IPMB) connection method and ATCA (Advanced Telecom Computing Architecture) machine frame
CN110769405A (en) Network distribution method of Bluetooth mesh network
CN106788948A (en) A kind of multi-host communication mechanism based on half-duplex operation
CN104144130A (en) Virtual machine system interconnection method and system and access switch
CN105550078B (en) A kind of active and standby free switching 1553B bus interface boards
JPS58502027A (en) Peripherals adapted to monitor low data rate serial input/output interfaces
CN109245911B (en) Method and device for realizing BRAS hot standby and computer readable storage medium
CN111092419B (en) Information protection substation and priority response method thereof for master station command
CN110053650B (en) Automatic train operation system, automatic train operation system architecture and module management method of automatic train operation system
CN101127642B (en) Serial interface management device and method for communication system devices

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned
AD01 Patent right deemed abandoned

Effective date of abandoning: 20170111