CN105591854A - Interaction method, device and system based serial bus - Google Patents

Interaction method, device and system based serial bus Download PDF

Info

Publication number
CN105591854A
CN105591854A CN201510505082.XA CN201510505082A CN105591854A CN 105591854 A CN105591854 A CN 105591854A CN 201510505082 A CN201510505082 A CN 201510505082A CN 105591854 A CN105591854 A CN 105591854A
Authority
CN
China
Prior art keywords
control command
slave
main frame
command word
word
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
CN201510505082.XA
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.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201510505082.XA priority Critical patent/CN105591854A/en
Publication of CN105591854A publication Critical patent/CN105591854A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention provides an interaction method, an interaction device and an interaction system based a serial bus. The interaction method comprises the steps of: receiving a request message sent by a host; sending a response message to the host, and generating a control command word; receiving a control command word reading command sent by the host; and sending the control command word to the host, so that the host can perform corresponding operation according to the control command word. By adopting the interaction method, the interaction device and the interaction system, operation control on the host can be achieved by a slave.

Description

A kind of exchange method, device and system based on universal serial bus
Technical field
The present invention relates to network communications technology field, relate in particular to a kind of exchange method based on universal serial bus,Device and system.
Background technology
Universal serial bus kind more and application extremely extensive, in nearly all electronic equipment all more or lessRelate to universal serial bus. In some universal serial bus, as I2C bus (Inter-IntegratedCircuitBus, I2C bus), (SerialPeripheralInterfaceBus, Serial Peripheral Interface (SPI) is total for spi busLine), 1-wire bus (monobus) etc., battery limits are divided into main frame and slave. Carrying out when mutual,Main frame is in leading position, and main frame can or be controlled slave and enter to slave data writing, reading out dataOther operations of row.
Visible, in the existing interaction schemes based on universal serial bus, slave can not be read and write main frameOperate or send other operational orders.
Summary of the invention
The invention provides a kind of exchange method, device and system based on universal serial bus, existing to solveIn interaction schemes based on universal serial bus, slave can not carry out read-write operation or send other operations main frameThe problem of order.
According to the first aspect of the embodiment of the present invention, a kind of exchange method based on universal serial bus is provided, shouldFor comprising the system of main frame and slave, described main frame is connected by described universal serial bus with slave, the partyMethod comprises:
The request message that Receiving Host sends;
Send response message to described main frame, and generate control command word;
Receive the control command word reading command that described main frame sends;
Send described control command word to described main frame, so that described main frame enters according to described control command wordRow corresponding operating.
According to the second aspect of the embodiment of the present invention, a kind of exchange method based on universal serial bus is provided, shouldFor comprising the system of main frame and slave, described main frame is connected by described universal serial bus with slave, the partyMethod comprises:
Send request message to slave;
Receive the response message that described slave sends;
Send control command word reading command to described slave;
Receive the control command word that described slave sends;
Carry out corresponding operating according to described control command word.
According to the third aspect of the embodiment of the present invention, a kind of interactive device based on universal serial bus is provided, shouldBe used for the slave of the system that comprises main frame and slave, described main frame and slave connect by described universal serial busConnect, this device comprises:
Receiving element, the request message sending for Receiving Host;
Transmitting element, for sending response message to described main frame;
Generation unit, for generating control command word;
Described receiving element, the control command word reading command also sending for receiving described main frame;
Described transmitting element, also for send described control command word to described main frame, so that described main frameCarry out corresponding operating according to described control command word.
According to the fourth aspect of the embodiment of the present invention, a kind of interactive device based on universal serial bus is provided, shouldBe used for the main frame of the system that comprises main frame and slave, described main frame and slave connect by described universal serial busConnect, this device comprises:
Transmitting element, for sending request message to slave;
Receiving element, the response message sending for receiving described slave;
Described transmitting element, also for sending control command word reading command to described slave;
Described receiving element, the control command word also sending for receiving described slave;
Processing unit, for carrying out corresponding operating according to described control command word.
According to the 5th aspect of the embodiment of the present invention, provide a kind of interactive system based on universal serial bus to compriseMain frame and slave, described main frame is connected by described universal serial bus with slave; Wherein:
Described main frame, for sending request message to slave;
Described slave, the request message sending for receiving described main frame, sends response report to described main frameLiterary composition, and generate control command word;
Described main frame, the response message also sending for receiving described slave, and send control to described slaveCommand word reading command processed;
Described slave, the control command word reading command also sending for receiving described main frame, and to describedMain frame sends described control command word;
Described main frame, the control command word also sending for receiving described slave, and according to described control lifeMake word carry out corresponding operating.
The application embodiment of the present invention, by sending request message to slave, triggers slave and returns to response message,And then, send control command word reading command to this slave, and carry out according to the control command word receivingCorresponding operating, has realized the operation control of slave to main frame.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of a kind of exchange method based on universal serial bus of providing of the embodiment of the present invention;
Fig. 2 is the flow process signal of the exchange method of the another kind that provides of the embodiment of the present invention based on universal serial busFigure;
Fig. 3 is the flow process signal of the exchange method of the another kind that provides of the embodiment of the present invention based on universal serial busFigure;
Fig. 4 A is the block diagram of a kind of interactive system based on universal serial bus of providing of the embodiment of the present invention;
Fig. 4 B is the operational flowchart of a kind of slave B main control system A of providing of the embodiment of the present invention;
Fig. 5 is the structural representation of a kind of interactive device based on universal serial bus of providing of the embodiment of the present invention;
Fig. 6 is the structural representation of the interactive device of the another kind that provides of the embodiment of the present invention based on universal serial busFigure;
Fig. 7 is the structural representation of the interactive device of the another kind that provides of the embodiment of the present invention based on universal serial busFigure;
Fig. 8 is the structural representation of the interactive device of the another kind that provides of the embodiment of the present invention based on universal serial busFigure;
Fig. 9 is the structural representation of the interactive device based on universal serial bus that provides of the embodiment of the present invention;
Figure 10 is that the structure of the interactive device of the another kind that provides of the embodiment of the present invention based on universal serial bus is shownIntention;
Figure 11 is that the structure of the interactive device of the another kind that provides of the embodiment of the present invention based on universal serial bus is shownIntention;
Figure 12 is the framework signal of a kind of interactive system based on universal serial bus of providing of the embodiment of the present inventionFigure.
Detailed description of the invention
In order to make those skilled in the art person understand better the technical scheme in the embodiment of the present invention, and makeAbove-mentioned purpose, the feature and advantage of the embodiment of the present invention can become apparent more, below in conjunction with accompanying drawing pairIn the embodiment of the present invention, technical scheme is described in further detail.
Refer to Fig. 1, the stream of a kind of exchange method based on universal serial bus providing for the embodiment of the present inventionJourney schematic diagram, wherein, the method can be applied to the system that comprises main frame and slave, this main frame and slaveConnect by universal serial bus, as shown in Figure 1, should can comprise following by the exchange method based on universal serial busStep:
The request message that step 101, Receiving Host send.
In the embodiment of the present invention, above-mentioned main frame and slave can be equipment independently, can be also in equipmentFunctional entity or module or chip etc., the embodiment of the present invention is follow-up no longer to be repeated.
In the embodiment of the present invention, the executive agent of said method can be slave or the slave in said systemIn control module, as CPU (CenterProcessUnit, central processing unit), for ease of understand andDescribe, below taking the executive agent of said method the slave in said system as example.
In the embodiment of the present invention, main frame can send request message to slave, and this request message is for triggeringThe slave that has pair main frame to carry out demand for control carries out corresponding control operation to main frame.
Alternatively, main frame can send request message to slave by the mode of poll.
In the embodiment of the present invention, slave can be according to the self-demand control request whether Receiving Host sendsMessage, in the time that slave determines that self need to control main frame, can control self Receiving Host transmissionRequest message; In the time that slave determines that self does not need main frame to control, can control and self not connectReceive the request message that main frame sends.
As the optional embodiment of one, in the time that the address of slave is hardware address, can be by controllingThe reception control that whether enables the request message of realizing main frame transmission of serial line interface.
Correspondingly, in this embodiment, in above-mentioned steps 101, the request message that Receiving Host sendsBefore, can also comprise:
Control serial line interface in enabled state.
Concrete, in this embodiment, in the time that the address of slave is hardware address, if slave is SPIDevice or part I2C device, slave can, by the enabled state of control self serial line interface, be controlledThe request message whether Receiving Host sends.
Wherein, when the serial line interface of slave is during in enabled state, slave can receive by serial line interfaceThe request message that main frame sends; When the serial line interface of slave is during in enabled state not, slave will can not connectReceive the request message that main frame sends.
Thereby, in this embodiment, in the time that slave has main control system and carries out the demand of corresponding operating,Can control self serial line interface in enabled state.
Alternatively, in this embodiment, slave control self serial line interface, can in enabled stateComprise the following steps:
11), judge that whether self serial line interface is in enabled state;
12) if in, keep this serial line interface in enabled state;
13) otherwise, enable this serial line interface.
As the optional embodiment of another kind, in the time that the address of slave is software address, can be by repairingThe software address that changes slave is realized the reception control of the request message of main frame transmission.
Correspondingly, in this embodiment, in above-mentioned steps 101, the request message that Receiving Host sendsBefore, can also comprise:
Default address is revised as in the address of slave; This default address is that the main frame of making an appointment sends requestThe destination address of message.
Concrete, in this embodiment, in the time that the address of slave is software address, if slave is 1-wireDevice or part I2C device, the main frame of can having made an appointment sends request the destination address of message, as 0xFF,0xEE etc.; In the time that slave has main control system and carries out the demand of corresponding operating, slave can be by the ground of selfDefault address is revised as in location, so that slave can receive the request message that main frame sends; Otherwise, slaveSelf address can be revised as to other address outside default address so that slave not Receiving Host sendRequest message.
For instance, suppose destination address that the main frame of making an appointment sends request message comprise 0xFF,0xEE (main frame can send request message to each destination address successively by the mode of poll), certain slaveThe address of default reception request message is 0xFF in advance, carries out corresponding when this slave has main control systemOperation demand time, 0xFF can be revised as in the address of self; When not having main control system, enters this slaveWhen the demand of row corresponding operating, the address outside 0xFF and 0xEE can be revised as in the address of self,As 0x55, thereby slave will not receive the request message of main frame transmission.
Alternatively, in this embodiment, default address is revised as in the address of slave, can comprise withLower step:
21) whether the address that, judges slave is default address;
22), if so, keeping the address of slave is default address;
23) otherwise, default address is revised as in the address of slave.
Step 201, send response message to main frame, and generate control command word.
In the embodiment of the present invention, after slave receives the request message of main frame transmission, can ring on the one handShould request message, send response message to main frame; On the other hand, can generate according to the demand of selfControl command word.
Wherein, this control command word is the one piece of data that carries out corresponding operating for slave main control system, canWith made an appointment by main frame and slave (also can appoint rear notice main frame and slave by third party),This control command word can carry out the operations such as data write, data read for slave main control system.
For instance, the control command of can making an appointment word is the string of binary characters of a section 8, wherein,In this string of binary characters of 8, first 2 (the 0th and the 1st) are for identifying this control commandThe operation that word is corresponding, as 01 corresponding data writes, 10 corresponding datas read; The 2nd and the 3rd canFor the type of identification data, for example 01 corresponding time, 10 corresponding voltage, 11 corresponding temperatures etc.,All the other 4 can be used as reserved field, or define other corresponding function.
The control command word reading command that step 103, Receiving Host send.
In the embodiment of the present invention, main frame can be determined slave after receiving the response message of slave transmissionHave the demand that main control system carries out operation response, now, main frame can send control command word to slaveReading command, to read corresponding control command word, to carry out phase according to this control command word from slaveShould operate.
Step 104, send control command word to main frame, so that main frame carries out phase according to this control command wordShould operate.
In the embodiment of the present invention, after slave receives the control command word reading command of main frame transmission, canTo send corresponding control command word to main frame, so that main frame carries out corresponding operating according to this control command word.
As the optional embodiment of one, when control command word in step 104 is that main control system writes numberAccording to control command word time, after main frame sends control command word, can also comprise the following steps:
31) data to be written that, Receiving Host sends according to control command word;
32), according to control command word, data to be written are saved in corresponding memory.
In this embodiment, in the time that control command word is the control command word of main control system data writing,After main frame receives this control command word, can send and treat accordingly to slave according to this control command wordData writing, as time, voltage, temperature etc.; Slave receives after these data to be written, can basisControl command word is saved in these data to be written in corresponding memory. For example, if the data that read beTime, data to be written can be saved in the memory that time data is corresponding; If the data that readFor temperature, data to be written can be saved in the memory that temperature data is corresponding etc.
It should be noted that above-mentioned steps 31)~32) in write number with slave main control system to this slaveAccording to being example, but in actual applications, slave also can be by control command word main control system outside slaveChip or equipment data writing, its specific implementation does not repeat them here.
As the optional embodiment of another kind, when control command word in step 104 is that main control system readsWhen the control command word of data, after main frame sends control command word, can also comprise the following steps:
41) the data reading command that, Receiving Host sends according to control command word;
42), send corresponding data according to this control command word to main frame.
In this embodiment, in the time that control command word is the control command word of main control system reading out data,After main frame receives this control command word, can send data to slave according to this control command word and readInstruction, to read corresponding data, as time, voltage, temperature etc.; Slave receives these data and readsAfter instruction, can corresponding data be sent to main frame according to control command word.
What deserves to be explained is, in embodiments of the present invention, slave is except passing through the control of control command wordMain frame writes, outside reading out data, can also carry out other operation by control command word main control system,As control light on and off of rotation speed of the fan, lamp etc.
Visible, in the described method flow of Fig. 1, by generating control command word, and will control lifeMake word send to main frame, so that main frame carries out corresponding operating according to control command word, realized slave to masterThe operation control of machine.
Refer to Fig. 2, the stream of a kind of exchange method based on universal serial bus providing for the embodiment of the present inventionJourney schematic diagram, wherein, the method can be applied to the system that comprises main frame and slave, this main frame and slaveConnect by universal serial bus, as shown in Figure 2, should can comprise following by the exchange method based on universal serial busStep:
Step 201, send request message to slave.
In the embodiment of the present invention, the executive agent of said method can be main frame or the main frame in said systemIn control module, as CPU, for ease of understanding and describing, below taking the executive agent of said method asMain frame in said system is example.
In the embodiment of the present invention, main frame can send request message to slave, and this request message is for triggeringThe slave that has pair main frame to carry out demand for control carries out corresponding control operation to main frame.
Alternatively, main frame can send request message to slave by the mode of poll.
The response message that step 202, reception slave send.
Step 203, send control command word reading command to slave.
In the embodiment of the present invention, after slave receives the request message of main frame transmission, can ring on the one handShould request message, send response message to main frame; On the other hand, can generate according to the demand of selfControl command word.
Main frame determines that slave has main control system and responds after receiving the response message of slave transmissionThe demand of operation, now, main frame can send control command word reading command to slave, with from slaveRead corresponding control command word, to carry out corresponding operating according to this control command word.
Step 204, carry out corresponding operating according to this control command word.
In the embodiment of the present invention, after slave receives the control command word reading command of main frame transmission, canTo send corresponding control command word to main frame; After main frame receives the control command word of slave transmission,Can carry out corresponding operating according to this control command word.
As the optional embodiment of one, when the control command word in step 204 is that main control system writesWhen the control command word of data, carry out corresponding operating according to this control command word, can comprise:
Send data to be written according to this control command word to slave, so that slave is according to this control command wordThese data to be written are saved in corresponding memory.
In this embodiment, in the time that control command word is the control command word of main control system data writing,After main frame receives this control command word, can send and treat accordingly to slave according to this control command wordData writing, as time, voltage, temperature etc.; Slave receives after these data to be written, can basisControl command word is saved in these data to be written in corresponding memory. For example, if the data that read beTime, data to be written can be saved in the memory that time data is corresponding; If the data that readFor temperature, data to be written can be saved in the memory that temperature data is corresponding etc.
It should be noted that above taking slave main control system to this slave data writing as example, but in realityIn application, slave also can write to chip or equipment outside slave by control command word main control systemData, its specific implementation does not repeat them here.
As the optional embodiment of another kind, when control command word in step 204 is that main control system readsWhen the control command word of data, carry out corresponding operating according to control command word, can comprise the following steps:
51), send data reading command according to control command word to slave;
52), receive the corresponding data that slave sends according to control command word.
In this embodiment, in the time that control command word is the control command word of main control system reading out data,After main frame receives this control command word, can send data to slave according to this control command word and readInstruction, to read corresponding data, as time, voltage, temperature etc.; Slave receives these data and readsAfter instruction, can corresponding data be sent to main frame according to control command word.
As another optional embodiment, in above-mentioned steps 204, carry out phase according to control command wordShould operate, can also comprise:
According to the light on and off of control command word control rotation speed of the fan or lamp.
In this embodiment, slave is except writing, read number by control command word main control systemAccording to outside, can also by control command word main control system carry out other operation, as control rotation speed of the fan,The light on and off of lamp etc.
Visible, in the described method flow of Fig. 2, can, by sending request message to slave, touchSend out slave and return to response message, and then, send control command word reading command to this slave, and according to connecingThe control command word of receiving carries out corresponding operating, has realized the operation control of slave to main frame.
Refer to Fig. 3, the stream of a kind of exchange method based on universal serial bus providing for the embodiment of the present inventionJourney schematic diagram, wherein, the method can be applied to the system that comprises main frame and slave, this main frame and slaveConnect by universal serial bus, in this system, can comprise a main frame or multiple slave, its system block diagramCan be as shown in Figure 4 A, in this system block diagram, taking A equipment/chip as main frame, B, C equipment/coreSheet is that slave is example, and wherein, host A comprises that control command word obtains district and data storage area, shouldControl command word obtains the control command word of the slave transmission of arriving for storing received in district; Slave B, C bagDraw together control command word memory block and data storage area, it is raw that this control command word memory block is used for storing slaveThe control command word becoming, based on this system, taking slave B main control system A as example, should be based on universal serial busExchange method can comprise the following steps:
Step 301, host A send request message by the mode of poll to slave.
In this embodiment, host A can be asked to slave A and slave B transmission by the mode of pollAsk message, this request message carries out corresponding for triggering the slave that main frame is carried out to demand for control to main frameControl operation.
The request message that step 302, slave B Receiving Host A send, sends response message to host A,And generate control command word.
In the embodiment of the present invention, after slave receives the request message of main frame transmission, can ring on the one handShould request message, send response message to main frame; On the other hand, can generate according to the demand of selfControl command word.
Wherein, this control command word is the one piece of data that carries out corresponding operating for slave main control system, canWith made an appointment by main frame and slave (also can appoint rear notice main frame and slave by third party),This control command word can carry out the operations such as data write, data read for slave main control system.
For instance, the control command of can making an appointment word is the string of binary characters of a section 8, wherein,In this string of binary characters of 8, first 2 (the 0th and the 1st) are for identifying this control commandThe operation that word is corresponding, as 01 corresponding data writes, 10 corresponding datas read; The 2nd and the 3rd canFor the type of identification data, for example 01 corresponding time, 10 corresponding voltage, 11 corresponding temperatures etc.,All the other 4 can be used as reserved field, or define other corresponding function.
In this embodiment, slave B has main control system A carries out the demand of corresponding operating, therefore, ifThe address of slave B is hardware address, and slave B need to enable the serial line interface of self; If the ground of slave BLocation is software address, and slave B need to be revised as default address by the software address of self, as 0xFF.
Step 303, host A receive the response message that slave B sends, and send and control to this slave BCommand word reading command.
In this embodiment, host A receive slave B send response message after, can determine fromMachine B has main control system carries out the demand of operation response, and now, host A can send to slave BControl command word reading command, to read corresponding control command word from slave B, with according to this controlCommand word is carried out corresponding operating.
Step 304, host A receive the control command word that slave B sends, and according to this control command wordCarry out corresponding operating.
In this embodiment, after slave B receives the control command word reading command of host A transmission,Can send corresponding control command word to host A; Host A receives the control life that slave B sendsAfter making word, can carry out corresponding operating according to this control command word, wherein, slave B main control system AOperational flowchart can be as shown in Figure 4 B.
In this embodiment, the control command word that main frame sends according to slave carries out specifically showing of corresponding operatingExample can be referring to the associated description in Fig. 1 or the described method flow of Fig. 2, and the embodiment of the present invention is at thisRepeat no more.
Can find out by above description, in the technical scheme providing in the embodiment of the present invention, can pass throughSend request message to slave, trigger slave and return to response message, and then, send and control life to this slaveMake word reading command, and carry out corresponding operating according to the control command word receiving, realized slave to masterThe operation control of machine.
Refer to Fig. 5, the knot of a kind of interactive device based on universal serial bus providing for the embodiment of the present inventionStructure schematic diagram, wherein, described device can be applied to the slave of the system that comprises main frame and slave, described inMain frame is connected by described universal serial bus with slave, as shown in Figure 5, is somebody's turn to do the mutual dress based on universal serial busPut and can comprise:
Receiving element 510, the request message sending for Receiving Host;
Transmitting element 520, for sending response message to described main frame;
Generation unit 530, for generating control command word;
Described receiving element 510, the control command word reading command also sending for receiving described main frame;
Described transmitting element 520, also for send described control command word to described main frame, so that described inMain frame carries out corresponding operating according to described control command word.
Please also refer to Fig. 6, the mutual dress of the another kind providing for the embodiment of the present invention based on universal serial busThe structural representation of putting, this embodiment is on aforementioned basis embodiment illustrated in fig. 5, and described device also canTo comprise: control module 540. Wherein:
Control module 540, in the time that the address of described slave is hardware address, controls serial line interface placeIn enabled state.
Please also refer to Fig. 7, the mutual dress of the another kind providing for the embodiment of the present invention based on universal serial busThe structural representation of putting, this embodiment is on aforementioned basis embodiment illustrated in fig. 5, and described device also canTo comprise: amendment unit 550. Wherein:
Amendment unit 550, in the time that the address of described slave is software address, repaiies the address of slaveChange default address into; Described default address is the destination that the described main frame of making an appointment sends request messageLocation.
In optional embodiment, described receiving element 510, can also be used for when described control command word beWhen the control command word of main control system data writing, receive described main frame and send according to described control command wordData to be written;
Correspondingly, please also refer to Fig. 8, the another kind providing for the embodiment of the present invention is based on universal serial busThe structural representation of interactive device, this embodiment on aforementioned basis embodiment illustrated in fig. 5, described inDevice can also comprise: storage unit 560. Wherein:
Storage unit 560, for being saved in correspondence according to described control command word by described data to be writtenMemory in.
In optional embodiment, described receiving element 510, can also be used for when described control command word beWhen the control command word of main control system reading out data, receive described main frame and send according to described control command wordData reading command;
Described transmitting element 520, it is right to be used for sending to described main frame according to described control command wordThe data of answering.
Refer to Fig. 9, the knot of a kind of interactive device based on universal serial bus providing for the embodiment of the present inventionStructure schematic diagram, wherein, described device can be applied to the main frame of the system that comprises main frame and slave, described inMain frame is connected by described universal serial bus with slave, as shown in Figure 9, is somebody's turn to do the mutual dress based on universal serial busPut and can comprise:
Transmitting element 910, for sending request message to slave;
Receiving element 920, the response message sending for receiving described slave;
Described transmitting element 910, also for sending control command word reading command to described slave;
Described receiving element 920, the control command word also sending for receiving described slave;
Processing unit 930, for carrying out corresponding operating according to described control command word.
Please also refer to Figure 10, the mutual dress of the another kind providing for the embodiment of the present invention based on universal serial busThe structural representation of putting, this embodiment, on aforementioned basis embodiment illustrated in fig. 9, locates in described deviceReason unit 930 can comprise: first sends subelement 931. Wherein:
First sends subelement 931, for the control that is main control system data writing when described control command wordWhen command word processed, send data to be written according to described control command word to described slave so that described fromMachine is saved in described data to be written in corresponding memory according to described control command word.
Please also refer to Figure 11, the mutual dress of the another kind providing for the embodiment of the present invention based on universal serial busThe structural representation of putting, this embodiment, on aforementioned basis embodiment illustrated in fig. 9, locates in described deviceReason unit 930 can comprise: second sends subelement 932 and first receives subelement 933. Wherein:
Second sends subelement 932, reads for sending data according to described control command word to described slaveInstruction fetch;
First receives subelement 933, for receiving right that described slave sends according to described control command wordThe data of answering.
In optional embodiment, described processing unit 930, specifically for according to the control of described control command wordThe light on and off of rotation speed of the fan processed or lamp.
Refer to Figure 12, the frame of a kind of interactive system based on universal serial bus providing for the embodiment of the present inventionStructure schematic diagram, wherein, described system can main frame 1210 and slave 1220, described main frame 1210 and fromMachine 1220 connects by described universal serial bus, wherein:
Described main frame 1210, for sending request message to slave;
Described slave 1220, the request message sending for receiving described main frame, sends and rings to described main frameAnswer message, and generate control command word;
Described main frame 1210, the response message also sending for receiving described slave, and send out to described slaveSend control command word reading command;
Described slave 1220, the control command word reading command also sending for receiving described main frame, and toDescribed main frame sends described control command word;
Described main frame 1210, the control command word also sending for receiving described slave, and according to described controlCommand word processed is carried out corresponding operating.
In optional embodiment, described slave 1220 can comprise total based on serial shown in arbitrary of Fig. 5-8The interactive device of line; Or/and, described main frame 1210 can comprise Fig. 9-11 shown in arbitrary based on serialThe interactive device of bus.
In said apparatus, the implementation procedure of the function and efficacy of unit specifically refers in said method correspondingThe implementation procedure of step, does not repeat them here.
For device embodiment, because it corresponds essentially to embodiment of the method, so relevant part ginsengSee the part explanation of embodiment of the method. Device embodiment described above is only schematically,The wherein said unit as separating component explanation can or can not be also physically to separate, and doesThe parts that show for unit can be or can not be also physical locations, can be positioned at a place,Or also can be distributed on multiple NEs. Can select according to the actual needs part wherein orThe whole modules of person realize the present invention program's object. Those of ordinary skill in the art are not paying creativenessIn the situation of work, be appreciated that and implement.
As seen from the above-described embodiment, by sending request message to slave, trigger slave and return to response message,And then, send control command word reading command to this slave, and carry out according to the control command word receivingCorresponding operating, has realized the operation control of slave to main frame.
Those skilled in the art are considering description and are putting into practice after invention disclosed herein, will easily expect thisOther embodiment of invention. The application is intended to contain any modification of the present invention, purposes or adaptabilityChange, these modification, purposes or adaptations are followed general principle of the present invention and are comprised thisBright undocumented common practise or conventional techniques means in the art. Description and embodiment only byBe considered as exemplary, true scope of the present invention and spirit pointed out by claim below.
Should be understood that, the present invention is not limited to described above and illustrated in the accompanying drawings accurateStructure, and can carry out various amendments and change not departing from its scope. Scope of the present invention is only by instituteAttached claim limits.

Claims (13)

1. the exchange method based on universal serial bus, is applied to the system that comprises main frame and slave, described inMain frame is connected by described universal serial bus with slave, it is characterized in that, the method comprises:
The request message that Receiving Host sends;
Send response message to described main frame, and generate control command word;
Receive the control command word reading command that described main frame sends;
Send described control command word to described main frame, so that described main frame enters according to described control command wordRow corresponding operating.
2. method according to claim 1, is characterized in that, described request message is described main frameSend in the mode of poll.
3. method according to claim 1, is characterized in that, the request that described Receiving Host sendsBefore message, also comprise:
In the time that the address of described slave is hardware address, control serial line interface in enabled state;
In the time that the address of described slave is software address, default address is revised as in the address of slave, wherein,Described default address is the destination address that the described main frame of making an appointment sends request message.
4. according to the method described in claim 1-3 any one, it is characterized in that, when described control commandWhen word is the control command word of main control system data writing, describedly send described control command to described main frameAfter word, also comprise:
Receive the data to be written that described main frame sends according to described control command word;
According to described control command word, described data to be written are saved in corresponding memory.
5. according to the method described in claim 1-3 any one, it is characterized in that, when described control commandWhen word is the control command word of main control system reading out data, describedly send described control command to described main frameAfter word, also comprise:
Receive the data reading command that described main frame sends according to described control command word;
Send corresponding data according to described control command word to described main frame.
6. according to the method described in claim 1-3 any one, it is characterized in that, described to described main frameSend described control command word, so that described main frame carries out corresponding operating according to described control command word, bagDraw together:
Send the control command word of the light on and off for controlling rotation speed of the fan or lamp to described main frame, so that described inMain frame is according to the light on and off of described control command word control rotation speed of the fan or lamp.
7. the interactive device based on universal serial bus, be applied in the system that comprises main frame and slave fromMachine, described main frame is connected by described universal serial bus with slave, it is characterized in that, and this device comprises:
Receiving element, the request message sending for Receiving Host;
Transmitting element, for sending response message to described main frame;
Generation unit, for generating control command word;
Described receiving element, the control command word reading command also sending for receiving described main frame;
Described transmitting element, also for send described control command word to described main frame, so that described main frameCarry out corresponding operating according to described control command word.
8. device according to claim 7, is characterized in that, described request message is described main frameSend in the mode of poll.
9. device according to claim 7, is characterized in that, described device also comprises:
Control module, in the time that the address of described slave is hardware address, controls serial line interface in makingEnergy state; Or/and,
Amendment unit, in the time that the address of described slave is software address, is revised as the address of slaveDefault address; Wherein, described default address is the object that the described main frame of making an appointment sends request messageAddress.
10. according to the device described in claim 7-9 any one, it is characterized in that,
Described receiving element, also orders for the control that is main control system data writing when described control command wordWhile making word, receive the data to be written that described main frame sends according to described control command word;
Described device also comprises:
Storage unit, for being saved in corresponding depositing according to described control command word by described data to be writtenIn reservoir.
11. according to the device described in claim 7-9 any one, it is characterized in that,
Described receiving element, also orders for the control that is main control system reading out data when described control command wordWhile making word, receive the data reading command that described main frame sends according to described control command word;
Described transmitting element, also for sending corresponding data according to described control command word to described main frame.
12. according to the device described in claim 7-9 any one, it is characterized in that,
Described transmitting element, specifically for sending the light on and off for controlling rotation speed of the fan or lamp to described main frameControl command word so that described main frame is according to the light on and off of described control command word control rotation speed of the fan or lamp.
13. 1 kinds of interactive systems based on universal serial bus, is characterized in that, comprise main frame and slave, instituteStating main frame is connected by described universal serial bus with slave; Wherein:
Described main frame, for sending request message to slave;
Described slave, the request message sending for receiving described main frame, sends response report to described main frameLiterary composition, and generate control command word;
Described main frame, the response message also sending for receiving described slave, and send control to described slaveCommand word reading command processed;
Described slave, the control command word reading command also sending for receiving described main frame, and to describedMain frame sends described control command word;
Described main frame, the control command word also sending for receiving described slave, and according to described control lifeMake word carry out corresponding operating.
CN201510505082.XA 2015-08-17 2015-08-17 Interaction method, device and system based serial bus Pending CN105591854A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510505082.XA CN105591854A (en) 2015-08-17 2015-08-17 Interaction method, device and system based serial bus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510505082.XA CN105591854A (en) 2015-08-17 2015-08-17 Interaction method, device and system based serial bus

Publications (1)

Publication Number Publication Date
CN105591854A true CN105591854A (en) 2016-05-18

Family

ID=55931106

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510505082.XA Pending CN105591854A (en) 2015-08-17 2015-08-17 Interaction method, device and system based serial bus

Country Status (1)

Country Link
CN (1) CN105591854A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411655A (en) * 2016-11-04 2017-02-15 合肥工业大学 Communication processing method based on state diagnosis of serial communication equipment
CN112003954B (en) * 2020-10-27 2021-02-19 苏州纳芯微电子股份有限公司 Data communication method, data communication system, and computer-readable storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101158466A (en) * 2007-11-13 2008-04-09 吴江市天地人真空炉业有限公司 Industry boiler control system
CN101211487A (en) * 2006-12-27 2008-07-02 航天信息股份有限公司 Tax control collector and its collecting method
CN101216999A (en) * 2007-12-27 2008-07-09 青岛海信网络科技股份有限公司 A split type traffic signal controlling machine system
CN101293518A (en) * 2007-04-27 2008-10-29 佛山市澳科特汽车制动技术有限公司 Controller and control method for electric eddy speed damper based on wired or wireless digital communication
CN101763333A (en) * 2008-12-08 2010-06-30 北京谊安医疗系统股份有限公司 Bus controller and method for realizing multi-host communication
CN101770443A (en) * 2009-01-07 2010-07-07 成都市华为赛门铁克科技有限公司 Time sequence adjusting method for internal IC (integrated circuit) bus, corresponding device and system thereof
CN101788965A (en) * 2010-02-25 2010-07-28 上海乐春重工机电设备有限公司 Multipoint automatic identification and master-slave synchronization serial communication mode
US20110072102A1 (en) * 2009-09-24 2011-03-24 Kraemer Ralf Method for exchanging data
CN103593316A (en) * 2013-11-25 2014-02-19 深圳市共进电子股份有限公司 Method for reducing I2C bus time occupied by MCU interruption

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101211487A (en) * 2006-12-27 2008-07-02 航天信息股份有限公司 Tax control collector and its collecting method
CN101293518A (en) * 2007-04-27 2008-10-29 佛山市澳科特汽车制动技术有限公司 Controller and control method for electric eddy speed damper based on wired or wireless digital communication
CN101158466A (en) * 2007-11-13 2008-04-09 吴江市天地人真空炉业有限公司 Industry boiler control system
CN101216999A (en) * 2007-12-27 2008-07-09 青岛海信网络科技股份有限公司 A split type traffic signal controlling machine system
CN101763333A (en) * 2008-12-08 2010-06-30 北京谊安医疗系统股份有限公司 Bus controller and method for realizing multi-host communication
CN101770443A (en) * 2009-01-07 2010-07-07 成都市华为赛门铁克科技有限公司 Time sequence adjusting method for internal IC (integrated circuit) bus, corresponding device and system thereof
US20110072102A1 (en) * 2009-09-24 2011-03-24 Kraemer Ralf Method for exchanging data
CN101788965A (en) * 2010-02-25 2010-07-28 上海乐春重工机电设备有限公司 Multipoint automatic identification and master-slave synchronization serial communication mode
CN103593316A (en) * 2013-11-25 2014-02-19 深圳市共进电子股份有限公司 Method for reducing I2C bus time occupied by MCU interruption

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411655A (en) * 2016-11-04 2017-02-15 合肥工业大学 Communication processing method based on state diagnosis of serial communication equipment
CN106411655B (en) * 2016-11-04 2019-08-02 合肥工业大学 Communication processing method based on the diagnosis of serial communication equipment state
CN112003954B (en) * 2020-10-27 2021-02-19 苏州纳芯微电子股份有限公司 Data communication method, data communication system, and computer-readable storage medium

Similar Documents

Publication Publication Date Title
KR20110010707A (en) Direct data transfer between slave devices
US10496279B2 (en) Slave device, control method of slave device, non-volatile computer readable recording medium
CN102339048A (en) Method for operating an automation device
CN105335309A (en) Data transmission method and computer
CN104111870A (en) Interrupt processing device and method
CN106168934A (en) A kind of data transmission method and device
CN106126465A (en) A kind of data transmission method and device
KR102080078B1 (en) Automation system and method for operation
CN105591854A (en) Interaction method, device and system based serial bus
CN103412838B (en) A kind of expanding system, communication means, address configuration method, equipment and device
JPS58217069A (en) Communicating system of multi-microcomputer
US9577882B2 (en) Control system, master station, and remote station
CN101261611A (en) Peripheral apparatus data-transmission apparatus and transmission method
JP2000010902A (en) Daisy chain connecting device and its address setting method
CN107577202B (en) Automation system and method for operating the same
JP6419400B1 (en) PLC, network unit, CPU unit, and data transfer method
CN110795373A (en) Method for converting I2C bus into parallel bus, terminal and storage medium
CN110687854B (en) PA bus controller and PA bus control system
CN103973581A (en) Method, device and system for processing message data
JP4723334B2 (en) DMA transfer system
JPWO2014020667A1 (en) Programmable logic controller
CN114095303B (en) Communication device, data transmission method and electronic device
JP2007508620A (en) Communication steering for use in a multi-master shared resource system
JP3005379B2 (en) Communication system between programmable controllers
JP6384359B2 (en) Information processing apparatus having distributed shared memory, method, and program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant after: Xinhua three Technology Co., Ltd.

Address before: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant before: Huasan Communication Technology Co., Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20160518

RJ01 Rejection of invention patent application after publication