Patent Publication Number: US-2023153262-A1

Title: Command transforming system and command transforming method

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a command transforming system and a command transforming method, and particularly relates to a command transforming system and a command transforming method which can control command transforming according to sequence requirements. 
     2. Description of the Prior Art 
     With the development of electronic technology, the transceiving interfaces have become more and more diverse, and the speed thereof become faster and faster. Therefore, the technology of high-speed transceiving interface switching is often used. For example, USB (Universal Serial Bus) to PCIE (peripheral component interconnect express), USB to SATA (Serial Advanced Technology Attachment) and the like. 
     In order to ensure these high-speed transceiving interfaces to transmit commands smoothly, a command transforming system which is compatible with two different transceiving interfaces is established. However, different high-speed transceiving interfaces have different characteristics or follow different standards. Some high-speed transceiving interfaces need to process commands in sequence, while others don&#39;t. Therefore, how the command transforming system can ensure the commands are smoothly received and executed while meeting the command execution sequence requirements of different transceiving interfaces becomes an important consideration. 
     SUMMARY OF THE INVENTION 
     One objective of the present invention is to provide a command transforming method which can meet the command execution sequence requirements of different transceiving interfaces. 
     Another objective of the present invention is to provide a command transforming system which can meet the command execution sequence requirements of different transceiving interfaces. 
     One embodiment of the present invention discloses a command transforming method, applied to a command transforming system comprising a first transceiving interface and a second transceiving interface, comprising: receiving at least one command transmitted from a first device via the first transceiving interface; determining a first sequence rule of the first device and a second sequence rule of a second device, wherein the first sequence rule means if the first device is required to process the command in sequence and the second sequence rule means if the second device is required to process the command in sequence; transmitting the command to the second device via the second transceiving interface; processing the command by the second device according to the second sequence rule and transmitting a response corresponding to the command to the second transceiving interface by the second device; and transmitting the response to the first device according to the first sequence rule. 
     Another embodiment of the present invention discloses a command transforming system, comprising: a first transceiving interface, configured to receive at least one command transmitted from a first device; a second transceiving interface, configured to transmit the command to the second device; and a controller, configured to control the first transceiving interface and the second transceiving interface; wherein the command transforming system determines a first sequence rule of the first device and a second sequence rule of a second device, wherein the first sequence rule means if the first device is required to process the command in sequence and the second sequence rule means if the second device is required to process the command in sequence; wherein the second transceiving interface receives a response, wherein the second device processes the command to generate the response according to the second sequence rule; wherein the first transceiving interface transmits the response to the first device according to the first sequence rule. 
     In view of above-mentioned embodiments, commands can be smoothly received and executed under the condition that the command execution sequence requirements of different transceiving interfaces are met, and devices that follow different standards can be smoothly connected and operate. 
     These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG.  1    is a block diagram illustrating a command transforming system according to one embodiment of the present invention. 
         FIG.  2   - FIG.  4    are schematic diagrams illustrating operations of the command transforming system in  FIG.  1   , according to different embodiments of the present invention. 
         FIG.  5    is a practical example of the command transforming system provided by the present invention. 
         FIG.  6    is a flow chart illustrating a command transforming method according to one embodiment of the present invention. 
     
    
    
     DETAILED DESCRIPTION 
     Several embodiments are provided in following descriptions to explain the concept of the present invention. Each component in following descriptions can be implemented by hardware (e.g. a device or a circuit) or hardware with software (e.g. a program installed to a processor). Besides, the method in following descriptions can be executed by programs stored in a non-transitory computer readable recording medium such as a hard disk, an optical disc or a memory. Additionally, the term “first”, “second”, “third” in following descriptions are only for the purpose of distinguishing different one elements, and do not mean the sequence of the elements. For example, a first device and a second device only mean these devices can have the same structure but are different devices. 
       FIG.  1    is a block diagram illustrating a command transforming system according to one embodiment of the present invention. As shown in  FIG.  1   , the command transforming system  100  comprises a first transceiving interface TRI 1 , a second transceiving interface TRI 2 , and a controller CR 1 . The first transceiving interface TRI 1  is configured to receive a command from the first device DV 1  and transmit it to the second transceiving interface TRI 2 . The second transceiving interface TRI 2  is configured to transmit the received command to the second device DV 2 , and to receive the response from the second device DV 2  and transmit the response to the first transceiving interface TRI 1 . The first transceiving interface TRI 1  transmits the response to the first device DV 1 . The first transceiving interface TRI 1  can be regarded as a direct interface, and the second transceiving interface TRI 2  can be regarded as a non-direct interface. The first device DV 1  and the second device DV 2  may comprise controllers CRa and CRb, respectively, and may also comprise transceiving interfaces TRIa and TRIb, respectively. 
     The command transforming system  100  determines a first sequence rule of the first device DV 1  and a second sequence rule of the second device DV 2 . The first sequence rule means if the first device DV 1  is required to process the command in sequence, and the second sequence rule means if the second device DV 2  is required to process the command in sequence. The second device DV 2  processes the command according to the second sequence rule and transmits a response corresponding to the command to the second transceiving interface TRI 2 . The first transceiving interface TRI 1  transmits a response to the first device DV 1  according to the first sequence rule. This determination step can be determined by any component in the command conversion system  100 . For example, it can be determined by the controller CR 1  or the first transceiving interface TRI 1 . The first sequence rule and the second sequence rule may be determined by the types of the first device DV 1  and the second device DV 2 , and the standard that the first device DV 1  and the second device DV 2  follow. In addition, the first sequence rule and the second sequence rule can also be forcibly set by the command transforming system  100 . 
       FIG.  2   - FIG.  4    are schematic diagrams illustrating operations of the command transforming system in  FIG.  1   , according to different embodiments of the present invention. In detail,  FIG.  2   - FIG.  4    are schematic diagrams illustrating the operations of the command transforming system shown in  FIG.  1    when the first sequence rule and the second sequence rule are in different states. 
     In the embodiment of  FIG.  2   , the first sequence rule means that the first device DV 1  is required to process the command in sequence, and the second sequence rule means that the second device DV 2  is required to process the command in sequence. In such case, the first transceiving interface TRU receives a command CMD 1  transmitted by the first device DV 1 , and transmits the command CMD 1  to the second transceiving interface TRI 2 . However, after the command CMD 1  is transmitted to the second device DV 2  via the second transceiving interface TRI 2 , the first transceiving interface TRI 1  does not receive any other command from the command CMD 1  from the first device DV 1  until the first device DV 1  receives the response CMD 1 R corresponding to the command CMD 1 . Specifically, after the command CMD 1  is transmitted to the second device DV 2  via the second transceiving interface TRI 2 , if the response CMD 1 R corresponding to the command CMD 1  is not received via the second transceiving interface TRI 2  and the response CMD 1 R corresponding to the command CMD 1  is not transmitted via the first transceiving interface DV 1  to the first device DV 1 , any other command from the first device DV 1  is not received via the first transceiving interface TRI 1 . 
     In another embodiment, the first sequence rule still means that the first device DV 1  is required to process the command in sequence, and the second sequence rule still means that the second device DV 2  is required to process the command in sequence. However, this embodiment is not limited to that the first transceiving interface TRI 1  does not receive any other command from the command CMD 1  from the first device DV 1  until the first device DV 1  receives the response CMD 1 R corresponding to the command CMD 1 . In this example, the first transceiving interface TRU receives a plurality of commands transmitted by the first device DV 1  by a first sequence, and the second transceiving interface TRI 2  also transmits the commands to the second device DV 2  by the first sequence. The second device DV 2  processes the commands by the first sequence and transmits responses corresponding to the commands to the second transceiving interface TRI 2 , and the first transceiving interface TRI 1  transmits the responses to the first device DV 1  by the first sequence. For example, the first device DV 1  sequentially transmits three commands CMD 1 , CMD 2 , CMD 3  (CMD 2 , CMD 3  are not shown in  FIG.  1   ) to the first transceiving interface TRI 1 , and then the second transceiving interface TRI 2  also transmits three commands CMD 1 , CMD 2 , CMD 3  to the second device DV 2  in sequence. After the second device DV 2  processes the commands CMD 1 , CMD 2  and CMD 3  in sequence and generates corresponding responses CMD 1 R, CMD 2 R and CMD 3 R (CMD 2 R and CMD 3 R are not shown in  FIG.  1   ), it transmits responses CMD 1 R, CMD 2 R and CMD 3 R to the first device DV 1  in sequence via the first transceiving interface TRI 1 . 
     In another embodiment, the first sequence rule means the first device DV 1  is required to process the command in sequence and the second sequence rule means the second device DV 2  is not required to process the command in sequence. In such case, the first transceiving interface TRI 1  receives a plurality of the commands from the first device DV 1  by a first sequence, and the second transceiving interface TRI 2  transmits the commands from the first transceiving interface TRI 1  to the second device DV 2  by the same first sequence or by a second sequence different from the first sequence. The second device DV 2  processes the commands by a third sequence and transmits a plurality of the responses corresponding to the commands to the second transceiving interface TRI 2 , and the first transceiving interface TRI 1  still transmits the responses to the first device DV 1  by the first sequence.  FIG.  3    shows an example of this embodiment. In the embodiment shown of  FIG.  3   , the first device DV 1  transmits three commands CMD 1 , CMD 2 , CMD 3  in sequence (the first sequence) to the first transceiving interface TRI 1 , and the first transceiving interface TRI 1  transmits the commands CMD 1 , CMD 2 , CMD 3  to the second transceiving interface TRI 2 . Please also note that since the second device DV 2  is not required to process the commands in sequence, the first transceiving interface TRI 1  can transmit the commands CMD 1 , CMD 2 , and CMD 3  to the second transceiving interface TRI 2  by any sequence. In the embodiment shown in  FIG.  2   , the first transceiving interface TRI 1  transmits commands to the second transceiving interface TRI 2  by the sequence of commands CMD 1 , CMD 2 , and CMD 3  (i.e., the first sequence). 
     The second transceiving interface TRI 2  can transmit three commands CMD 1 , CMD 2 , CMD 3  to the second device DV 2  by the first sequence. However, the second transceiving interface TRI 2  may also transmit the commands CMD 1 , CMD 2 , and CMD 3  to the second device DV 2  by another sequence (the second sequence). The second device DV 2  processes the commands CMD 1 , CMD 2 , and CMD 3  by another sequence (the third sequence), and then transmits the corresponding responses to the second transceiving interface TRI 2  by the another sequence. In the embodiment of  FIG.  3   , the second device DV 2  processes the commands in the sequence of commands CMD 2 , CMD 1 , and CMD 3 , and transmits the corresponding responses CMD 2 RR, CMD 1 R, CMD 3 R to the second receiving interface TRI 2  in sequence. Also, the second transceiving interface TRI 2  transmits the responses CMD 2 RR, CMD 1 R and CMD 3 R to the first transceiving interface TRI 1  by the same sequence. The first transceiving interface TRI 1  transmits the responses CMD 1 R, CMD 2 R and CMD 3 R to the first device DV 1  in sequence, that is, by the first sequence. In such case, the response received first, which is not the response CMD 1 R (for example, response CMD 2 R or CMD 3 R), is temporarily stored in the command transforming system  100 . After the response CMD 1 R is received, the responses CMD 1 R, CMD 2 R and CMD 3 R are transmitted to the first device DV 1  in sequence. 
     In one embodiment, the next command may be transmitted while the previous command is still being processed, but is not limited. For example, in  FIG.  3   , after the first device DV 1  transmits the command CMD 1  to the second device DV 2  via the first transceiving interface TRI 1  and the second transceiving interface TRI 2 , the command transforming system  100  may notify the first device DV 1  to continue to transmit the next command CMD 2  while the second device DV 2  is processing the command CMD 1 . In the embodiment of  FIG.  3   , if the first device DV 1  only transmits one command, the operations of the first device DV 1 , the second device DV 2  and the command transforming system  100  are the same as the embodiment shown in  FIG.  2   . 
     In another embodiment, the first sequence rule means that the first device DV 1  is not required to process the commands in sequence, and the second sequence rule means that the second device DV 2  is not required to process the commands in sequence. In such case, the first transceiving interface TRI 1  receives a plurality of the commands from the first device DV 1  by a first sequence, and the second transceiving interface TRI 2  transmits the commands from the first transceiving interface TRU to the second device DV 2  by the first sequence or by a second sequence different from the first sequence. The second device DV 2  processes the commands by a third sequence and transmits a plurality of the responses corresponding to the commands to the second transceiving interface TRI 2 , and the first transceiving interface TRI 1  transmits the responses to the first device DV 1  by the third sequence or a fourth sequence.  FIG.  4    shows an example of this embodiment. In the embodiment shown in  FIG.  4   , the first device DV 1  transmits three commands CMD 1 , CMD 2 , CMD 3  in sequence (i.e., the first sequence) to the first transceiving interface TRI 1 , and the first transceiving interface TRU transmits the commands CMD 1 , CMD 2  and CMD 3  to the second transceiving interface TRI 2 . Please note that since the second device DV 2  is not required to process the commands in sequence, the first transceiving interface TRU can transmit the commands CMD 1 , CMD 2 , and CMD 3  to the second transceiving interface TRI 2  by any sequence. In the embodiment shown in  FIG.  4   , the first transceiving interface TRI 1  transmits commands to the second transceiving interface TRI 2  by the sequence of commands CMD 1 , CMD 2 , and CMD 3  (i.e., the first sequence). 
     The second transceiving interface TRI 2  can transmit three commands CMD 1 , CMD 2 , CMD 3  to the second device DV 2  by the first sequence. However, the second transceiving interface TRI 2  may also transmit the commands CMD 1 , CMD 2 , and CMD 3  to the second device DV 2  by another sequence (a second sequence). Then, after the second device DV 2  processes CMD 1 , CMD 2 , and CMD 3  in another sequence (the third sequence), it transmits a corresponding response to the second transceiving interface TRI 2  by this sequence. In the embodiment shown in  FIG.  4   , the second device DV 2  processes the commands by the sequence of commands CMD 2 , CMD 1  and CMD 3  and transmits corresponding responses CMD 2 RR, CMD 1 R and CMD 3 R to the second receiving interface TRI 2  in sequence. Also, the second transceiving interface TRI 2  transmits the responses CMD 2 RR, CMD 1 R and CMD 3 R to the first transceiving interface TRI 1  by the same sequence. The first transceiving interface TRI 1  may transmit responses CMD 2 RR, CMD 1 R and CMD 3 R to the first device DV 1  by the third sequence, that is, by the sequence of responses CMD 2 RR, CMD 1 R and CMD 3 R shown in  FIG.  4   . However, since the first device DV 1  is not required to process the commands in sequence, the first transceiving interface TRI 1  can transmit responses CMD 1 RR, CMD 2 R and CMD 3 R to the first device DV 1  by another sequence (the fourth sequence). 
     In one embodiment, the next command may be transmitted while the previous command is still being processed. For example, after the first device DV 1  transmits the command CMD 1  to the second device DV 2  via the first transceiving interface TRI 1  and the second transceiving interface TRI 2 , the command transforming system  100  may notify the first device DV 1  to continue to transmit the next command CMD 2  while the second device DV 2  is processing the command CMD 1 . In the embodiment of  FIG.  4   , if the first device DV 1  only transmits one command, the operations of the first device DV 1 , the second device DV 2  and the command transforming system  100  are the same as the embodiment shown in  FIG.  2   . 
     In view of the above embodiments, if the first sequence rule means that the first device DV 1  is required to process the commands in sequence, the sequence by which the first device DV 1  transmits the commands must be the same as the sequence by which the first device DV 1  receives the corresponding responses. For example, if the first device DV 1  transmits the commands CMD 1 , CMD 2 , and CMD 3  in sequence, the sequence by which the first device DV 1  receives the corresponding responses must be the sequence of responses CMD 1 R, CMD 2 R, and CMD 3 R shown in  FIG.  3   . Oppositely, if the first sequence rule means that the first device DV 1  is not required to process the commands in sequence, the sequence by which the first device DV 1  transmits the commands can be different from the sequence by which the first device DV 1  receives the corresponding responses. As shown in  FIG.  4   , if the first device DV 1  transmits the commands CMD 1 , CMD 2 , and CMD 3  in sequence, the sequence by which the first device DV 1  receives the corresponding responses may be the sequence of the responses CMD 2 R, CMD 1 R, and CMD 3 R. 
     If the second sequence rule means that the second device DV 2  is required to process the commands in sequence, the sequence by which the second device DV 2  receives the commands must be the same as the sequence by which the second device DV 2  processes the commands and generates corresponding responses. For example, if the second device DV 2  receives the commands CMD 1 , CMD 2 , and CMD 3  in sequence, the second device DV 2  must process the commands by the sequence of the commands CMD 1 , CMD 2 , and CMD 3  and generate responses CMD 1 R, CMD 2 R, and CMD 3 R. Conversely, if the second sequence rule means that the second device DV 2  is not required to process the commands in sequence, the sequence by which the second device DV 2  receives the commands and the sequence by which the second device DV 2  processes the commands and generates corresponding responses may be different. As shown in  FIGS.  3  and  4   , if the second device DV 2  receives the commands CMD 1 , CMD 2 , and CMD 3  in sequence, the second device DV 2  can process the commands CMD 2 , CMD 1 , and CMD 3  in sequence and generate corresponding responses CMD 2 R, CMD 1 R, CMD 3 R. 
     Please also note, in the above-mentioned embodiments, only one indirect interface (the second transceiving interface TIR 2 ) and an electronic device (the second electronic device DV 2 ) connected to the indirect interface are comprised. However, the present invention may also comprise a plurality of indirect interfaces and a plurality of electronic devices connected to the indirect interfaces. For example, the command transforming system  100  may further comprise a third transceiving interface, which is also an indirect interface. The third transceiving interface is connected to a third device. The second transceiving interface and the third transceiving interface may be transceiving interfaces using the same standard or may be transceiving interfaces using different standards. The command transforming system  100  can follow the aforementioned rules, that is, determine whether the first device DV 1  and the third electronic device DV 3  are required to process commands in sequence, and then control the operations of the first transceiving interface TRI 1  and the third transceiving interface TRI 3  accordingly. 
     The aforementioned first device DV 1  and second device DV 2  may be various types of electronic devices. In one embodiment, the first transceiving interface TRI 1  is a USB interface and the second transceiving interface TRI 2  is a PCIE interface. The first device DV 1  is a USB device, for example, a USB device in a computer host. The first device DV 1  may also be a USB device including a controller and a USB interface. The second device DV 2  is a device using a PCIE interface, such as an SSD (Solid-state drive, or Solid-state disk). The first device DV 1  communicates with the command transforming system  100  through UASP (USB Attached SCSI Protocol), while the second device DV 2  communicates with the command transforming system  100  through NVMe (Non-Volatile Memory Express). Operations when the first transceiving interface TRI 1  is a USB interface and the second transceiving interface TRI 2  is a PCIE interface in the embodiments shown in  FIGS.  2 ,  3  and  4    are described as below. 
     In the embodiment of  FIG.  2   , when the first device DV 1  wants to transmit a SCSI (Small Computer System Interface) command to the second device DV 2 , it packages the SCSI command into a USB command through UASP, and then transmits the USB command to the first transceiving interface TRI 1 . The command transforming system  100  first determines whether the first device DV 1  and the second device DV 1  are required to process commands in sequence. In the embodiment of  FIG.  2   , since both the first device DV 1  and the second device DV 1  are required to process the commands in sequence, the command transforming system  100  transmits the commands to the second device DV 2  through the second transceiving interface TRI 2  for processing, and waits for the second device DV 2  to process and then response to the first device DV 1 . If the first device DV 1  generates another command before the second device DV 2  has finished processing the command, the command transforming system  100  can inform the first device DV 1  that the previous command has not been processed through a packet (e.g., Nrdy) following the USB standard. 
     In the embodiment of  FIG.  3   , when the first device DV 1  wants to transmit a SCSI command to the second device DV 2 , the SCSI command is packaged into a USB command through UASP, and then transmitted to the first transceiving interface TRI 1 . The command transforming system  100  first determines whether the first device DV 1  and the second device DV 1  are required to process commands in sequence. In the embodiment of  FIG.  3   , since only the first device DV 1  is required to process the commands in sequence and the second device DV 2  is not, the command transforming system  100  transmits the commands to the second device DV 2  for processing through the second transceiving interface TRI 2 , and informs the first device DV 1  that it can continue to transmit commands through a control packet (e.g., Erdy) following the USB standard. Then, regardless of the sequence by which the second device DV 2  processes the commands and transmits the responses, the command transforming system  100  ensures that the first transceiving interface TRI 1  transmits the responses to the first device DV 1  by the sequence by which the first device DV 1  transmits the commands. 
     In the embodiment of  FIG.  4   , when the first device DV 1  wants to transmit a SCSI command to the second device DV 2 , the SCSI command is packaged into a USB command through UASP, and then sent to the first transceiving interface TRI 1 . The command transforming system  100  first determines whether the first device DV 1  and the second device DV 1  are required to process commands in sequence. In the embodiment of  FIG.  4   , neither the first device DV 1  nor the second device DV 2  is required to process the commands in sequence, so the command transforming system  100  transmits the commands to the second device DV 2  through the second transmission interface TRI 2  for processing, and informs the first device DV 1  by a control packet (e.g., Erdy) following the USB standard that it can continue to transmit commands. Then, the first transceiving interface TRI 1  transmits the responses to the first device DV 1  by the sequence by which the second device DV 2  generates the responses. 
       FIG.  5    is a practical example of the command transforming system provided by the present invention. However, please note that the command transforming system provided by the present invention is not limited to be implemented by the command transforming device shown in  FIG.  5   . As shown in  FIG.  5   , the command transforming device  500  comprises a connector  501  and output ports  503 ,  505  and  507 . The connector  501  is a part of the direct interface (the aforementioned first transceiving interface TRI 1 ) comprised in the command transforming device  500 . The output ports  503 ,  505 , and  507  are parts of the indirect interface (the aforementioned second transceiving interface TRI 2 ) which follow different standards. The command transforming device  500  can be connected to the aforementioned first device DV 1  (e.g., the first device DV 1  in a computer host) through the connector  501 , and then the output ports  503 ,  505 , and  507  can be respectively used to connect peripheral devices following different standards. Via such structure, the user can control the peripheral devices connected to the output ports  503 ,  505  and  507  through the host computer, and uses the command transforming device  500  to transform the commands. 
       FIG.  6    is a flow chart illustrating a command transforming method according to one embodiment of the present invention, used in an command conversion system comprising a first transceiving interface and a second transceiving interface. The command transforming method comprises following steps: 
     Step  601   
     Receive at least one command transmitted from a first device (e.g., the first device DV 1  in  FIG.  1   ) via the first transceiving interface (e.g., the first transceiving interface TRI 1  in  FIG.  1   ). 
     Step  603   
     Determine a first sequence rule of the first device and a second sequence rule of a second device (e.g., the second device DV 2  of  FIG.  1   ) by a command transforming system (e.g., the command transforming system  100  of  FIG.  1   ). The first sequence rule means if the first device is required to process the command in sequence and the second sequence rule means if the second device is required to process the command in sequence. 
     Step  605   
     Transmit the command to the second device DV 2  via the second transceiving interface (e.g., the second transceiving interface TRI 2  in  FIG.  2   ). 
     Step  607   
     Process the command by the second device according to the second sequence rule and transmit a response corresponding to the command to the second transceiving interface by the second device. 
     Step  609   
     Transmit the response to the first device according to the first sequence rule. 
     Other detailed steps have been disclosed in the above-mentioned embodiments, thus are omitted for brevity here. 
     In view of above-mentioned embodiments, commands can be smoothly received and executed under the condition that the command execution sequence requirements of different transceiving interfaces are met, and devices that follow different standards can be smoothly connected and operate. 
     Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure is required to be construed as limited only by the metes and bounds of the appended claims.