Summary of the invention
Embodiments of the invention provide the method and system of a kind of multiprocessor machine, multiprocessor machine correspondence with foreign country, can promote the overall performance of multiprocessor machine.
The technical scheme that the embodiment of the invention adopts is:
A kind of method of multiprocessor machine correspondence with foreign country, described multiprocessor machine is by connecting from processor and user's peripheral hardware, and described method comprises:
The data that receive user's peripheral hardware from processor write or read request;
From processor the request that writes or read of described data is transmitted to primary processor, judges the writing position of described data or read the position by primary processor;
According to described judged result, described data are write or read operation from processor.
A kind of multiprocessor machine comprises that at least a primary processor and one from processor, wherein comprise from processor:
Link block is used for connecting with user's peripheral hardware;
Receiver module, the data that are used to receive user's peripheral hardware write or read request;
Forwarding module is used for the request that writes or read of described data is transmitted to primary processor, is judged the writing position of described data or is read the position by primary processor;
Processing module is used for the judged result according to described primary processor, and described data are write or read operation.
A kind of system of multiprocessor machine correspondence with foreign country comprises: multiprocessor machine and user's peripheral hardware, described multiprocessor machine comprise a primary processor and one at least from processor, and described multiprocessor machine is by being connected with user's peripheral hardware from processor, wherein,
Described from processor, the data that are used to receive user's peripheral hardware write or read request, and the described data read or the request that writes are transmitted to primary processor, according to the judged result of primary processor, described data are write or read operation;
Described primary processor is used to receive the described data of transmitting from processor and writes or read request, judges the writing position of described data or reads the position according to the described data read or the request that writes, and described judged result is notified described from processor;
Described user's peripheral hardware is used for sending data from processor and writing or read request to described, carries out from processor by described that data write or read operation.
The method and system of embodiment of the invention multiprocessor machine, multiprocessor machine correspondence with foreign country, multiprocessor machine is by connecting from processor and user's peripheral hardware, by receive the data transfer request of user's peripheral hardware, the data transmission between realization and the user's peripheral hardware from processor.Compared with prior art, data transmission all via finishing from processor, can promote the data transmission performance of multiprocessor machine, especially when more outstanding when processor performance is higher than primary processor; Be usually less than primary processor and be connected employed cable cost with user's peripheral hardware owing to be connected employed cable cost with user's peripheral hardware, thereby can reduce system cost from processor; In addition, the data major part in the multiprocessor machine is arranged in the storer of hanging down from processor, when reading this partial data, does not need this partial data is transmitted to primary processor from processor, thereby can reduce system power dissipation.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making all other embodiment that obtained under the creative work prerequisite.
For the advantage that makes technical solution of the present invention is clearer, the present invention is elaborated below in conjunction with drawings and Examples.
As shown in Figure 1, the embodiment of the invention provides a kind of method of multiprocessor machine correspondence with foreign country, and described multiprocessor machine is by connecting from processor and user's peripheral hardware, and the method for described multiprocessor machine correspondence with foreign country comprises:
101, the data from processor reception user peripheral hardware write or read request;
102, from processor the request that writes or read of described data is transmitted to primary processor, judges the writing position of described data or read the position by primary processor;
103,, described data are write or read operation from processor according to described judged result.
The method of embodiment of the invention multiprocessor machine correspondence with foreign country, multiprocessor machine is by connecting from processor and user's peripheral hardware, by receive the data transfer request of user's peripheral hardware, the data transmission between realization and the user's peripheral hardware from processor.Compared with prior art, data transmission all via finishing from processor, can promote the data transmission performance of multiprocessor machine, especially when more outstanding when processor performance is higher than primary processor; Owing to when processor is connected employed cable cost and is usually less than primary processor and is connected employed cable cost with user's peripheral hardware with user's peripheral hardware, thereby can reduce system cost; In addition, when the data major part in the multiprocessor machine is arranged in from the storer that processor is hung down, when reading this partial data, does not need this partial data is transmitted to primary processor, thereby can reduce system power dissipation from processor.
As shown in Figure 2, the embodiment of the invention provides a kind of method of multiprocessor machine correspondence with foreign country.In the present embodiment, described multiprocessor machine comprises a primary processor and one from processor, and described multiprocessor machine is connected with user's peripheral hardware from processor by described.Wherein, be higher than primary processor from the dominant frequency and the processing power of processor, usually adopt USB (Universal SerialBus from the interface between processor and the user's peripheral hardware, USB (universal serial bus)), and the interface between primary processor and the user's peripheral hardware adopts UART (Universal Asynchronous Receiver/Transmitter usually, universal asynchronous serial port), compare the UART interface, USB interface has data transmission performance height, characteristic that cost is low.
The method of described multiprocessor machine correspondence with foreign country comprises:
201, regularly detect the Interface status that is connected with user's peripheral hardware from processor.
202, detecting user's peripheral hardware from processor inserts.
203, from processor current state information is sent to primary processor.
204, primary processor judges whether connect with user's peripheral hardware from processor, if do not connect, then returns step 201; If connect, then execution in step 205.
205, receive the data transfer request of user's peripheral hardware from processor.
206, judge this data transfer request for writing data or reading of data from processor, if this data transfer request is for writing data, then execution in step 207; If this data transfer request is a reading of data, then execution in step 213.
207, from processor this is write request of data and be transmitted to primary processor.
208, primary processor judges that the writing position of these data is a primary processor or from processor, if the writing position of these data is a primary processor, then execution in step 209; If the writing position of these data is from processor, then execution in step 212.
209, primary processor is to assigning forward command from processor, and indication is given primary processor from processor with this data forwarding.
210, give primary processor from processor with this data forwarding.
211, primary processor is preserved this data, and returns step 201.
212, the primary processor notice is preserved this data from processor, and returns step 201.
213, from processor this reading of data request is transmitted to primary processor.
214, primary processor judges that the position of reading of these data is a primary processor or from processor, if the position of reading of these data is a primary processor, then execution in step 215; If the position of reading of these data is that then execution in step 216 from processor.
215, primary processor sends to these data from processor.
216, from processor these data are sent to user's peripheral hardware, and return step 201.
The method of embodiment of the invention multiprocessor machine correspondence with foreign country, multiprocessor machine is by connecting from processor and user's peripheral hardware, by receive the data transfer request of user's peripheral hardware, the data transmission between realization and the user's peripheral hardware from processor.Compared with prior art, data transmission all by finishing from processor, can promote the data transmission performance of multiprocessor machine, especially when more outstanding when processor performance is higher than primary processor; Because when processor is connected employed cable cost and is usually less than primary processor and is connected employed cable cost with user's peripheral hardware with user's peripheral hardware, thereby reduction system cost; In addition, the data major part in the multiprocessor machine is arranged in the storer of hanging down from processor, when reading this partial data, does not need this partial data is transmitted to primary processor from processor, thereby can reduce system power dissipation.
As shown in Figure 3, the embodiment of the invention provides a kind of multiprocessor machine, and described multiprocessor machine comprises that at least a primary processor and one from processor, wherein comprise from processor:
Link block 301 is used for connecting with user's peripheral hardware;
Receiver module 302, the data that are used to receive user's peripheral hardware write or read request;
Forwarding module 303 is used for the request that writes or read of described data is transmitted to primary processor, is judged the writing position of described data or is read the position by primary processor;
Processing module 304 is used for the judged result according to described primary processor, and described data are write or read operation.
Embodiment of the invention multiprocessor machine, multiprocessor machine is by connecting from processor and user's peripheral hardware, by receive the data transfer request of user's peripheral hardware, the data transmission between realization and the user's peripheral hardware from processor.Compared with prior art, data transmission all via finishing from processor, can promote the data transmission performance of multiprocessor machine, especially when more outstanding when processor performance is higher than primary processor; When being connected employed cable cost from processor with user's peripheral hardware and being usually less than primary processor and being connected employed cable cost with user's peripheral hardware, thereby can reduce system cost; In addition, the data major part in multiprocessor machine is arranged in the storer of hanging down from processor, when reading this partial data, does not need this partial data is transmitted to primary processor from processor, thereby can reduce system power dissipation.
As shown in Figure 4, the embodiment of the invention provides a kind of multiprocessor machine, and described multiprocessor machine comprises that at least a primary processor and one from processor, wherein comprise from processor:
Link block 301 is used for connecting with user's peripheral hardware;
Receiver module 302, the data that are used to receive user's peripheral hardware write or read request;
Forwarding module 303 is used for the request that writes or read of described data is transmitted to primary processor, is judged the writing position of described data or is read the position by primary processor;
Processing module 304 is used for the judged result according to described primary processor, and described data are write or read operation.
Wherein, described processing module 304 can comprise:
First receiving element 3041, the judged result that is used for when described primary processor is when primary processor writes data, receives the forward command that primary processor is assigned;
First retransmission unit 3042 is used for according to described forward command, gives primary processor with described data forwarding.
Wherein, described processing module 304 can also comprise:
Second receiving element 3043, be used for when the judged result of described primary processor for to when processor writes data, receive the notice of primary processor storage data;
Storage unit 3044 is used to store described data.
Wherein, described processing module 304 can also comprise:
The 3rd receiving element 3045, be used for when the judged result of described primary processor for by the primary processor reading of data time, receive the data that primary processor sends;
Second retransmission unit 3046 is used for giving user's peripheral hardware with described data forwarding.
Wherein, described processing module 304 can also comprise:
Transmitting element 3047 is used for when the judged result of described primary processor is served as reasons from the processor reading of data described data being sent to user's peripheral hardware.
Embodiment of the invention multiprocessor machine, multiprocessor machine is by connecting from processor and user's peripheral hardware, by receive the data transfer request of user's peripheral hardware, the data transmission between realization and the user's peripheral hardware from processor.Compared with prior art, data transmission all via finishing from processor, can promote the data transmission performance of multiprocessor machine, especially when more outstanding when processor performance is higher than primary processor; Owing to when processor is connected employed cable cost and is usually less than primary processor and is connected employed cable cost with user's peripheral hardware with user's peripheral hardware, thereby can reduce system cost; In addition, the data major part in the multiprocessor machine is arranged in the storer of hanging down from processor, when reading this partial data, does not need this partial data is transmitted to primary processor from processor, thereby can reduce system power dissipation.
As shown in Figure 5, the embodiment of the invention provides a kind of system of multiprocessor machine correspondence with foreign country, the system of described multiprocessor machine correspondence with foreign country, comprise: multiprocessor machine 50 and user's peripheral hardware 51, described multiprocessor machine 50 comprises that at least a primary processor 501 and one are from processor 502, described multiprocessor machine 50 is by being connected with user's peripheral hardware 51 from processor 502, wherein
Described from processor 501, be used to receive the data transfer request of user's peripheral hardware 51, judge that described data transfer request is for writing data or reading of data, described data transfer request is transmitted to primary processor 502, according to the judged result of primary processor 502, described data are write or read operation;
Described primary processor 502 is used to receive the described data transfer request of transmitting from processor 501, judges the writing position of described data or reads the position according to described data transfer request, described judged result is notified described from processor 501;
Described user's peripheral hardware 51 is used for sending data transfer request to described from processor 501, carries out from processor 501 by described that data write or read operation.
The system of embodiment of the invention multiprocessor machine correspondence with foreign country, multiprocessor machine is by connecting from processor and user's peripheral hardware, by receive the data transfer request of user's peripheral hardware, the data transmission between realization and the user's peripheral hardware from processor.Compared with prior art, data transmission all via finishing from processor, can promote the data transmission performance of multiprocessor machine, especially when more outstanding when processor performance is higher than primary processor; Owing to when processor is connected employed cable cost and is usually less than primary processor and is connected employed cable cost with user's peripheral hardware with user's peripheral hardware, thereby can reduce system cost; In addition, the data major part in the multiprocessor machine is arranged in the storer of hanging down from processor, when reading this partial data, does not need this partial data is transmitted to primary processor from processor, thereby can reduce system power dissipation.
The embodiment of the invention is applicable between multiprocessor machine with two or more processors and the user's peripheral hardware carries out data transmission, but is not limited only to this.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in the foregoing description method, be to instruct relevant hardware to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
The above; only be the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.