.201035801 六、發明說明: 【發明所屬之技術領域】 本發明關於一種轉接裝置與多電腦切換器,特別是關於能 自動識別PS/2介面周邊裝置的轉接裝置、多電腦切換器及方 5 法。 【先前技術】 近年來隨著科技的發展’電腦或其相關裝置,例如多電腦 切換器(KVM switch),可透過多種周邊裝置(例如鍵盤或滑鼠) 0 來管理及控制多台電腦主機。一般用以連接於電腦主機和週邊 10裝置之間的介面可為RS232介面或PS/2介面。而長久以來, PS/2介面一直係用以將鍵盤和滑鼠等周邊裝置連接至電腦主 機上的介面標準之一。 請參照圖5A,其顯示依據習知技術之周邊裝置與pS/2介 面的示意圖。然而’ 一般的鍵盤和滑鼠的PS/2介面並無法互換 I5 使用,PS/2鍵盤901連接於專屬滑鼠的PS/2介面902或連接 埠(通常以綠色來表示)之後,電腦主機並無法識別其為一 PS/2 鍵盤,所以此PS/2鍵盤將無法正常工作。而PS/2滑鼠903亦 〇 無法連接於專屬鍵盤的PS/2介面904或連接埠(通常以紫色來 表示),因而造成使用上的不便和減少周邊裝置的適用性。 20 為改善上述問題,如圖5Β所示,美國專利第6919878號 揭露在控制器14與兩PS2連接埠10、12中間加入一切換控制 電路20,用以正確地切換來自鍵盤及滑鼠之時脈訊號及資料訊 號。然而,控制器14與切換控制電路20之間需要至少8組線 路(PKCLKIN〜PMD ATOUT)來分別傳輸鍵盤及滑鼠輸入及輸出 25 之訊號,明顯地,其增加了硬體成本及佈線複雜度。 【發明内容】 3 201035801 本發明之主要目的在於提供一種轉接裝置、多電腦切換器 及能識別PS/2介面周邊裝置的方法,藉以自動地識別ps/2介 面之周邊裝置的種類,因而可任意耦接不同種類的PS/2介面周 邊裝置。.201035801 VI. Description of the Invention: [Technical Field] The present invention relates to an adapter device and a KVM switch, and more particularly to an adapter device, a KVM switch and a square device capable of automatically recognizing a PS/2 interface peripheral device 5 methods. [Prior Art] In recent years, with the development of technology, computers or related devices, such as KVM switches, can manage and control multiple computer hosts through various peripheral devices such as a keyboard or a mouse. The interface generally used to connect between the host computer and the peripheral device 10 can be an RS232 interface or a PS/2 interface. For a long time, the PS/2 interface has been used as one of the interface standards for connecting peripheral devices such as keyboards and mice to computer hosts. Referring to Figure 5A, a schematic diagram of a peripheral device and a pS/2 interface in accordance with conventional techniques is shown. However, the general keyboard and mouse PS/2 interface is not interchangeable with I5. The PS/2 keyboard 901 is connected to the exclusive mouse's PS/2 interface 902 or port (usually indicated by green). It is not recognized as a PS/2 keyboard, so this PS/2 keyboard will not work properly. The PS/2 mouse 903 is also not connected to the PS/2 interface 904 or the port (usually in purple) of the dedicated keyboard, which causes inconvenience in use and reduces the applicability of peripheral devices. In order to improve the above problem, as shown in FIG. 5A, US Pat. No. 6919878 discloses that a switching control circuit 20 is added between the controller 14 and the two PS2 ports 10, 12 for correctly switching from the keyboard and the mouse. Pulse signal and data signal. However, at least 8 sets of lines (PKCLKIN~PMD ATOUT) are required between the controller 14 and the switching control circuit 20 to transmit signals of the keyboard and the mouse input and output 25 respectively, which obviously increases the hardware cost and the wiring complexity. . SUMMARY OF THE INVENTION 3 201035801 The main object of the present invention is to provide an adapter device, a KVM switch, and a method for recognizing a PS/2 interface peripheral device, thereby automatically identifying the type of peripheral device of the ps/2 interface, thereby Any type of PS/2 interface peripheral device can be arbitrarily coupled.
Ο 10 15Ο 10 15
20 根據本發明之實施例,本發明之轉接裝置係用以連接於電 腦主機與電腦周邊裝置之間,轉接裝置包含PS/2連接埠和控制 器。PS/2連接埠係用以耗接電腦周邊裳置,電腦周邊裝置具有 PS/2介面。控制器係用以經由PS/2連接埠電性來連接於電腦 周邊裝置’控制器包括識別單元,識別單元係用以接收電腦周 邊裝置的周邊控制訊號,並根據周邊控制訊號來識別電腦周邊 裝置的種類’控制器係依據電腦周邊裝置的種類,來安排電腦 周邊裝置所發出之一訊號至電腦主機的路徑。 又,根據本發明之實施例,本發明之轉接裝置係用以連接 於電腦主機與電腦周邊裝置之間,轉接裝置包含ps/2連接埠和 控制器。PS/2連接琿係用以耦接電腦周邊裝置,電腦周邊裝置 具有PS/2介面。控制器係用以經由ps/2連接埠電性來連接於 電腦周邊裝置’以控制電腦周邊裝置,其中控制器發出—控制 訊號至電腦周邊裝置,控制器係依據電腦周邊裝置對控制訊號 之回應來識職腦料裝置的錢,錄據㈣周邊裝置之種 類’以電關«置所㈣之軌協定來對電則邊裝置進行 初始化及溝通。 數個電腦連料、第發蚊多電肋換器包含複 連接璋及使用者介面。電H接;V第二ps/2連接绛、影像 連接鍵mm滑鼠,第二浦連料係用以 像連接埠係用以連接螢幕,使用者介面係 4 25 201035801 ΠΓ 徑設定選擇電腦主機被鍵盤或滑鼠所 控制’其中當第-ps/2連接埠連接鍵 ==所 PS/2連接琿後可控制電腦主機,其中 4在連接第二 5 Ο 10 滑鼠時,鍵盤在連接第二ps/2連接二 ^連接埠連接 妖坪傻可控制電腦主機。 赵二=據本發明之實施例’本發明之多電腦切換器包含複 數個電腦連接埠、第-PS/2連接埠、第二削連接埠 連接埠及使用者介面。電腦連接埠係心料㈣^ pS/2連接耗用以連接第―鍵盤、第二鍵盤、第一滑鼠或第二 滑鼠’、第二PS/2連接埠係用以連接第—鍵盤、第二鍵盤、第— 滑鼠或第二滑鼠’影像連接埠係用以連接螢幕,使用者介 用以供使用者依據-路徑設㈣擇電腦主機被第—鍵盤二 鍵盤、第-滑鼠或第二滑鼠所控制,其中t^ps/2連接蜂: 接第-鍵盤時’第二鍵盤、第一滑鼠或第二滑鼠在連接第二 PS/2連接埠後可控制電腦主機。 15 又’根據本發明之實施例,本發明之能識別PS/2介面周 邊裝置的方法係用以識別電腦周邊装置的種類,其中電腦周邊 Q裝置具有PS/2介面,此方法至少包含下列步驟: 接收電腦周邊裝置所發出的周邊控制訊號; 根據周邊控制訊號來識別電腦周邊裝置的種類;以及 20 根據電腦周邊裝置的種類來安排電腦周邊裝置所發出之 一訊號至該電腦主機的路徑。 因此,本發明可自動地識別ps/2介面周邊裝置的種類, 並根據其種類來對應地處理資料。因此,本發明的ps/2連接埠 可任意地耦接於任一種類之具有PS/2介面的電腦周邊裝置,以 25 提升使用便利和適用性。 【實施方式】 5 201035801 - 請參照圖1至圖2D,圖1顯示依據本發明之一實施例之 轉接裝置的示意圖,圖2A至圖2D顯示依據本發明之轉接裝 置、電腦主機及電腦周邊裝置的方塊示意圖。本實施例之轉接 裝置100可連接於電腦主機200與電腦周邊裝置之間,其中電 5腦周邊裝置具有PS/2介面,例如具有PS/2介面的鍵盤或滑鼠。 轉接裝置100可包含至少一 PS/2連接埠、控制器110和中央處 理器130。PS/2連接埠係用以耦接於電腦周邊裝置,在本實施 例中’轉接裝置100可設有第一 PS/2連接埠121和第二PS/2 0 連接埠122,用以分別耦接於第一電腦周邊裝置301和第二電 10腦周邊裝置302。然不限於此,在其他實施例中,轉接裝置100 亦可僅設有一 PS/2連接埠或更多個PS/2連接埠(三個以上), 以耦接於PS/2介面的電腦周邊裝置。控制器110係經由PS/2 連接埠來電性連接於電腦周邊裝置電性,用以識別電腦周邊裝 置的種類(例如鍵盤或滑鼠)。中央處理器130係電性連接於控 15 制器丨1〇,用以在識別電腦周邊裝置的種類後,依據一 PS/2通 訊協定來解析(parse)此電腦周邊裝置所傳來之訊號。 q 如圖1和圖2所示,本實施例之轉接裝置100的控制器110 例如為特定應用積體電路(Application Specific Integrated Circuit ’ ASIC)、場域可程式化閘陣列(Field-Programmable Gate 20 Array ’ FPGA)或微控制器(Micro-controller Unit,MCU),其可 經由PS/2 CLK訊號線123和124以及PS/2 Data訊號線125和 126來電性連接於PS/2連接埠121和122。控制器110可包括 識別單元111,識別單元111係用以接收電腦周邊裝置301、302 的至少一周邊控制訊號,並根據此周邊控制訊號來識別電腦周 25 邊裝置301、302的種類,其中識別單元111可以係韌體 (Firmware)的形式來由控制器11〇所執行。由於不同種類的電 6 201035801 - 腦周邊裝置301、302(如鍵盤和滑鼠)所發出的周邊控制訊號係 不相同,因而識別單元111可根據不同的周邊控制訊號來識別 電腦周邊裝置301、302的種類。在出識別電腦周邊裝置301、 3〇2的種類後,控制器11〇可依據電腦周邊裝置3〇1、3〇2的種 5類,來安排電腦周邊裝置301、302所發出之訊號至中央處理 器130之路徑,再由中央處理器丨3〇傳遞至電腦主機2〇〇,其 中此訊號可包含資料訊號,例如鍵盤資料訊號或滑鼠資料訊 號。另一方面,中央處理器130亦將電腦主機200發出之時脈 〇 訊號傳遞至電腦周邊裝置301、302。因此,不論轉接裝置1〇〇 10之第一 PS/2連接埠121或第二PS/2連接埠122所連接之電腦 周邊裝置301、302的種類為何(鍵盤或滑鼠),轉接裝置1 〇〇都 可識別出其種類並對應地進行處理,亦即本實施例之轉接裝置 100的PS/2連接埠121或122可任意地麵接於任一種具有pS/2 介面的電腦周邊裝置(鍵盤或滑鼠)。 15 在本實施例中,第一 PS/2連接埠121所耦接的第一電腦 周邊装置301可為鍵盤,而第二ps/2連接埠122所耦接的第一 〇 電腦周邊裝置302可為滑鼠;或者,第一 PS/2連接埠121所耦 接的第一電腦周邊裝置301可為滑鼠,而第二PS/2連接埠122 所耦接的第一電腦周邊裝置302可為鍵盤。 20 在一實施例中,控制器110更可依據電腦周邊裝置301、 302的種類(如鍵盤或滑鼠)來傳送不同的時脈訊號(例如鍵盤時 脈訊號或滑鼠時脈訊號)至電腦周邊裝置301、302。 以下進一步舉例來說明電腦周邊裝置301、302發出周邊 控制訊號至轉接裝置1 〇〇的情形。例如,當電腦周邊裝置3〇i、 25 3 0 2連接至ps/2連接埠而被供電時,電腦周邊裝置3〇1、 即可發出周邊控制訊號至控制器110的識別單元nl,此時, 7 .201035801 鍵盤可例如發出"AA”控制訊號,滑鼠可例如發出"AA〇〇"控制訊 號。又,例如,當電腦周邊裝置3〇1、3〇2接收到電腦主機2〇〇 所發出的電腦控制訊號(例如,,FF")時,電腦周邊裝置3〇1、3〇2 即可對應地發出周邊控制訊號,此時,鍵盤可例如發出"faaa" 5周邊控制訊號,滑鼠可例如發出"FA ΑΑ00"周邊控制訊號。又, 例如,當電腦周邊裝置301、302耦接於轉接裝置1〇〇,或經由 轉接裝置100來耦接於電腦主機200時,電腦周邊裝置3〇1、 302亦可對應地發出周邊控制訊號至識別單元i丨j。 〇 亦即,奂控制器11 〇發出一控制訊號(例如供電,發出ρρ 10或^命令等)至電腦周邊裝置301、302時,控制器110的識別 單元111可依據電腦周邊裝置301、302對控制訊號之回應(亦 即電腦周邊裝置301、302所發出的周邊控制訊號)來識別電腦 周邊裝置301、302的種類,且依據電腦周邊裝置的種類3〇1、 302之種類,以電腦周邊裝置301、3〇2所適用之一通訊協定(如 15 PS/2鍵盤通訊協定及/或PS/2滑鼠通訊協定)來對電腦周邊裝置 301、302進行初始化及溝通。 Q 請參照圖3 ’其顯示依據本發明之一實施例之多電腦切換 器、電腦主機及電腦周邊裝置的方塊示意圖。實施例之轉接裝 置100可設置(内建)於一電腦裝置(未繪示)中,或者,可應用於 2〇 一多電腦切換器(KVM switch) 101中。當應用於多電腦切換器 (KVM switch)101時’此多電腦切換器101可包含控制器11〇、 第一 PS/2連接埠121、第二PS/2連接埠122、中央處理器130、 電腦連接埠140、影像連接埠150、使用者介面16〇及多工器 (multiplexer)170,其中前述圖1之軔體hi可執行於控制器11〇 25 及/或中央處理器130之上。 仍請參照圖3,PS/2連接埠121和122係耦接於電腦周邊 8 201035801 裝置301、302,控制器no係電性連接於PS/2連接埠121和 122,用以識別電腦周邊裝置301、302的種類。中央處理器130 係電性連接於控制器H〇,用以在識別電腦周邊裝置3〇1、3〇2 的種類後,依據一 PS/2通訊協定(PS/2鍵盤通訊協定或PS/2滑 5鼠通訊協定)來解析(parse)電腦周邊裝置301及/或302所傳來 之訊號。電腦連接埠14〇係用以連接電腦主機200,影像連接 埠150係用以連接螢幕303。使用者介面160係電性連接至中 央處理器130’用以供使用者依據一路徑設定來選擇某一電腦 〇 主機係被第一 PS/2連接埠121或第二PS/2連接埠122(例如鍵 10盤或滑鼠)所控制,其中使用者介面160可為螢幕顯示選單 (on-screen display,OSD menu)或一控制面板,而此路徑設定可 例如為螢幕顯示選單之選項、鍵盤熱鍵(hot-key)或控制面板之 按紐。多工器170係用以依據此路徑設定來將電腦主機200之 影像訊號導引至螢幕303。 15 在一實施例中,如圖2A及圖2B所示,第一 PS/2連接埠 121和第二PS/2連接埠122所耦接的電腦周邊裝置301、302 Q 可例如為一鍵盤和一滑鼠。此時,鍵盤和滑鼠可任意地耦接於 第一 PS/2連接埠121或第二PS/2連接埠122。例如,第一 PS/2 連接埠121係麵接於鍵盤,而第二ps/2連接埠122係輕接於滑 20鼠(如圖2A所示);或者,第一 PS/2連接埠121係耦接於滑鼠, 而第二PS/2連接琿122係係耦接於鍵盤(如圖2B所示)。 又’如圖2C及圖2D所不’在另一實施例中,第一 PS/2 連接埠121和第二PS/2連接埠122所耦接的電腦周邊裝置 301、302可例如為二個鍵盤或二個滑鼠。例如,第一 pS/2連 25接埠121和第二ps/2連接埠122係耦接於二個鍵盤(如圖2C所 示);或者’第一 PS/2連接埠121和第二ps/2連接埠122係耦 9 201035801 接於二個滑鼠(如圖2D所示)。 請參考圖1及圖4 ’圖4顯示依據本發明之一實施例之能 識別PS/2介面周邊裝置之方法的流程圖。有關本發明之能識別 PS/2介面周邊裝置之方法的詳細步驟描述如下: 5 步驟410,首先,經由PS/2連接埠121或122來接收電腦 周邊裝置301、302所發出的周邊控制訊號; 步驟420’根據電腦周邊裝置301、302的周邊控制訊號來 識別電腦周邊裝置301、302的種類;以及 Ο 步驟430,根據電腦周邊裝置3〇1、302的種類來安排電腦 10周邊裝置301、302所發出之訊號至電腦主機2〇〇的路徑。 由上述本發明的實施例可知,本發明之轉接裝置與能識別 PS/2介面周邊裝置的方法及其應的多電腦切換器可自動地識 別周邊裝置的種類,並根據周邊裝置的種類來對應地處理周邊 裝置的資料。因此,本發明的PS/2連接琿可任意地耦接於任一 15種類之具有PS/2介㈣電腦周邊裝置,以提升使用便利和適用 性。 〇 雖然本發明已就較佳實施例揭露如上,然其並非用以限定 本發明。本發明所屬技術領域中具有通常知識者,在不脫離本 發明之精神和範圍内,當可作各種之變更和潤飾。因此,本發 20明之保護範圍當視後附之申請專利範圍所界定者為準。 【圖式簡單說明】 圖1顯示依據本發明之一實施例之轉接裝置的示意圖。 圖2A至圖2D顯不依據本發明之轉接裝置、電腦主機及 電腦周邊裝置的方塊示意圖。 25 ^ 3顯示依據本發明之—實施例之多電腦切換器、電腦主 機及電腦周邊裝置的方塊示意圖。 .201035801 - 圖4顯示依據本發明之一實施例之能識別PS/2介面周邊 裝置之方法的流程圖。 圖5A顯示依據習知技術之周邊裝置與PS/2介面的示意 圖。 5 圖5B顯示依據習知技術之鍵盤/滑鼠切換控制器的示意 圖。 【主要元件符號說明】 10、12 PS2連接埠 〇 14 控制器 10 20 切換控制電路 100 轉接裝置 101 多電腦切換器 110 控制器 111 識別單元 15 121 第一 PS/2連接埠 122 第二PS/2連接埠 〇 123 ' 124 CLK訊號線 125 ' 126 Data訊號線 130 中央處理器 20 140 電腦連接埠 150 影像連接埠 160 使用者介面 170 多工器 301 第一電腦周邊裝置 25 302 第二電腦周邊裝置 303 螢幕 11According to an embodiment of the invention, the switching device of the present invention is for connection between a computer host and a peripheral device of the computer, the switching device comprising a PS/2 port and a controller. The PS/2 port is used to drain the computer, and the computer peripheral has a PS/2 interface. The controller is used to connect to the computer peripheral device via the PS/2 connection. The controller includes an identification unit for receiving peripheral control signals of the computer peripheral device, and identifying the computer peripheral device according to the peripheral control signal. The type of controller is based on the type of computer peripheral device, to arrange a signal from the computer peripheral device to the host computer. Further, according to an embodiment of the present invention, the switching device of the present invention is for connecting between a host computer and a peripheral device of the computer, and the switching device includes a ps/2 port and a controller. The PS/2 port is used to couple the computer peripherals, and the computer peripherals have a PS/2 interface. The controller is used to connect to the computer peripheral device via the ps/2 connection to control the computer peripheral device, wherein the controller sends a control signal to the computer peripheral device, and the controller responds to the control signal according to the computer peripheral device. The money for the brain-storage device, the data (4) the type of peripheral devices, and the initialization and communication of the power-side device. Several computer linings, the first mosquito multi-electric ribs changer include a connection port and a user interface. Electric H connection; V second ps/2 connection port, image connection button mm mouse, the second port is used to connect the screen to connect the screen, user interface system 4 25 201035801 设定 path setting select the computer host Controlled by the keyboard or mouse 'When the first - ps/2 connection 埠 connection key == PS/2 connection 可 can control the computer host, 4 when connecting the second 5 Ο 10 mouse, the keyboard is connected Two ps/2 connection two ^ connection 埠 connection demon ping silly can control the computer host. According to an embodiment of the present invention, the KVM switch of the present invention comprises a plurality of computer ports, a -PS/2 port, a second port, and a user interface. Computer connection system (4) ^ pS/2 connection is used to connect the first keyboard, the second keyboard, the first mouse or the second mouse, and the second PS/2 connection is used to connect the first keyboard, The second keyboard, the first mouse or the second mouse's image connection system is used to connect the screen, and the user is provided for the user to set the path according to the path (four), the computer host is the first keyboard, the second keyboard, the first mouse Or controlled by the second mouse, where t^ps/2 is connected to the bee: when the first keyboard is connected, the second keyboard, the first mouse or the second mouse can control the computer host after connecting the second PS/2 port. . 15 In accordance with an embodiment of the present invention, the method for identifying a PS/2 interface peripheral device of the present invention is for identifying a type of computer peripheral device, wherein the computer peripheral Q device has a PS/2 interface, and the method includes at least the following steps : receiving the peripheral control signals sent by the peripheral devices of the computer; identifying the types of peripheral devices of the computer according to the peripheral control signals; and 20 arranging a path sent by the peripheral devices of the computer to the host computer according to the type of peripheral devices of the computer. Therefore, the present invention can automatically recognize the type of the ps/2 interface peripheral device and process the data correspondingly according to the type thereof. Therefore, the ps/2 port of the present invention can be arbitrarily coupled to any type of computer peripheral device having a PS/2 interface to enhance the convenience and applicability. [Embodiment] 5 201035801 - Please refer to FIG. 1 to FIG. 2D, FIG. 1 shows a schematic diagram of an adapter device according to an embodiment of the present invention, and FIGS. 2A to 2D show an adapter device, a computer host and a computer according to the present invention. A block diagram of the peripheral device. The adapter device 100 of this embodiment can be connected between the computer host 200 and a computer peripheral device, wherein the brain peripheral device has a PS/2 interface, such as a keyboard or mouse with a PS/2 interface. The switching device 100 can include at least one PS/2 port, a controller 110, and a central processor 130. The PS/2 port is configured to be coupled to the computer peripheral device. In this embodiment, the adapter device 100 can be provided with a first PS/2 port 121 and a second PS/2 0 port 122 for respectively The first computer peripheral device 301 and the second electrical 10 brain peripheral device 302 are coupled. However, in other embodiments, the switching device 100 may also be provided with only one PS/2 port or more than one PS/2 port (three or more) to be coupled to the PS/2 interface computer. Peripheral device. The controller 110 is electrically connected to the peripheral device of the computer via a PS/2 port to identify the type of peripheral device (such as a keyboard or a mouse). The central processing unit 130 is electrically connected to the controller 用以1〇 for parsing the signal transmitted by the peripheral device of the computer according to a PS/2 communication protocol after identifying the type of the peripheral device of the computer. As shown in FIG. 1 and FIG. 2, the controller 110 of the switching device 100 of the present embodiment is, for example, an Application Specific Integrated Circuit 'ASIC, a Field-Programmable Gate (Field-Programmable Gate). 20 Array 'FPGA) or Micro-controller Unit (MCU), which can be electrically connected to the PS/2 port 121 via PS/2 CLK signal lines 123 and 124 and PS/2 Data signal lines 125 and 126. And 122. The controller 110 can include an identification unit 111 for receiving at least one peripheral control signal of the computer peripheral devices 301, 302, and identifying the type of the computer peripheral device 301, 302 according to the peripheral control signal, wherein the identification Unit 111 can be implemented by controller 11 in the form of firmware. Since the different types of power 6 201035801 - the peripheral control signals issued by the brain peripheral devices 301, 302 (such as the keyboard and the mouse) are different, the identification unit 111 can identify the computer peripheral devices 301, 302 according to different peripheral control signals. kind of. After identifying the types of computer peripheral devices 301, 3〇2, the controller 11 can arrange the signals sent by the computer peripheral devices 301 and 302 to the center according to the types 5 of the computer peripheral devices 3〇1, 3〇2. The path of the processor 130 is then transmitted to the host computer 2 by the central processing unit, wherein the signal may include a data signal, such as a keyboard data signal or a mouse data signal. On the other hand, the central processing unit 130 also transmits the clock signal from the host computer 200 to the computer peripheral devices 301, 302. Therefore, regardless of the type of computer peripheral devices 301, 302 to which the first PS/2 port 121 or the second PS/2 port 122 of the switching device 1 10 is connected (keyboard or mouse), the switching device 1 〇〇 can identify the type and handle it correspondingly, that is, the PS/2 port 121 or 122 of the switching device 100 of the embodiment can be arbitrarily grounded to any computer peripheral having a pS/2 interface. Device (keyboard or mouse). In this embodiment, the first computer peripheral device 301 coupled to the first PS/2 port 121 can be a keyboard, and the first computer peripheral device 302 coupled to the second ps/2 port 122 can be For the mouse; or the first computer peripheral device 301 coupled to the first PS/2 port 121 can be a mouse, and the first computer peripheral device 302 coupled to the second PS/2 port 122 can be keyboard. In an embodiment, the controller 110 can further transmit different clock signals (such as a keyboard clock signal or a mouse clock signal) to the computer according to the type of the computer peripheral devices 301, 302 (such as a keyboard or a mouse). Peripheral devices 301, 302. The following further exemplifies the case where the peripheral devices 301, 302 send peripheral control signals to the switching device 1A. For example, when the computer peripheral device 3〇i, 25 3 0 2 is connected to the ps/2 port and is powered, the computer peripheral device 3〇1 can send the peripheral control signal to the identification unit n1 of the controller 110. , 7 .201035801 The keyboard can, for example, issue a "AA" control signal, and the mouse can, for example, issue a "AA" control signal. Also, for example, when the computer peripheral device 3〇1, 3〇2 receives the computer host 2 When the computer control signal (for example, FF") is issued, the computer peripheral devices 3〇1, 3〇2 can correspondingly send peripheral control signals. At this time, the keyboard can issue, for example, "faaa" For example, when the computer peripheral devices 301, 302 are coupled to the switching device 1 or coupled to the computer host 200 via the switching device 100, for example, the computer peripheral device 301, 302 is coupled to the switching device 100. The computer peripheral devices 3〇1, 302 can also correspondingly send peripheral control signals to the identification unit i丨j. That is, the controller 11 sends a control signal (for example, power supply, ρρ 10 or ^ command, etc.) To computer peripheral device 30 1. At 302, the identification unit 111 of the controller 110 can identify the computer peripheral devices 301 and 302 according to the response of the computer peripheral devices 301 and 302 to the control signals (that is, the peripheral control signals sent by the computer peripheral devices 301 and 302). Type, and depending on the type of computer peripheral device 3〇1, 302, one of the communication protocols (such as 15 PS/2 keyboard communication protocol and/or PS/2 mouse communication) applicable to computer peripheral devices 301, 3〇2 The protocol is used to initialize and communicate the computer peripheral devices 301 and 302. Q Referring to FIG. 3, a block diagram of a KVM switch, a computer host, and a computer peripheral device according to an embodiment of the present invention is shown. The connection device 100 can be provided (built-in) in a computer device (not shown), or can be applied to a KVM switch 101. When applied to a KVM switch (KVM switch) At 101 o'clock, the KVM switch 101 can include a controller 11A, a first PS/2 port 121, a second PS/2 port 122, a central processing unit 130, a computer port 140, an image port 150, and a use. Interface 16 And a multiplexer 170, wherein the foregoing body hi of FIG. 1 can be executed on the controller 11〇25 and/or the central processing unit 130. Still referring to FIG. 3, the PS/2 ports 埠121 and 122 The device is coupled to the computer peripheral 8 201035801 devices 301, 302, and the controller no is electrically connected to the PS/2 ports 121 and 122 for identifying the types of the computer peripheral devices 301, 302. The central processing unit 130 is electrically connected to the controller H〇 for identifying the type of the computer peripheral devices 3〇1, 3〇2 according to a PS/2 communication protocol (PS/2 keyboard communication protocol or PS/2). The mouse 5 communication protocol) parses the signals transmitted by the computer peripheral devices 301 and/or 302. The computer port 14 is connected to the computer host 200, and the image port 150 is used to connect to the screen 303. The user interface 160 is electrically connected to the central processing unit 130 ′ for the user to select a certain computer according to a path setting, and the host system is connected to the first PS/2 port 121 or the second PS/2 port 122 ( For example, the keyboard 10 or the mouse is controlled, wherein the user interface 160 can be an on-screen display (OSD menu) or a control panel, and the path setting can be, for example, an option for a screen display menu, and a keyboard hot. Key (hot-key) or control panel button. The multiplexer 170 is configured to direct the image signal of the host computer 200 to the screen 303 according to the path setting. In an embodiment, as shown in FIG. 2A and FIG. 2B, the computer peripheral devices 301, 302 Q to which the first PS/2 port 121 and the second PS/2 port 122 are coupled may be, for example, a keyboard and a mouse. At this time, the keyboard and the mouse can be arbitrarily coupled to the first PS/2 port 121 or the second PS/2 port 122. For example, the first PS/2 port 121 is connected to the keyboard, and the second ps/2 port 122 is lightly connected to the mouse (as shown in FIG. 2A); or, the first PS/2 port 121 The system is coupled to the mouse, and the second PS/2 port 122 is coupled to the keyboard (as shown in FIG. 2B). 2C and FIG. 2D, in another embodiment, the computer peripheral devices 301, 302 to which the first PS/2 port 121 and the second PS/2 port 122 are coupled may be, for example, two. Keyboard or two mice. For example, the first pS/2 connection 25 port 121 and the second ps/2 port 122 are coupled to two keyboards (as shown in FIG. 2C); or 'the first PS/2 port 121 and the second ps. The /2 port 122 coupler 9 201035801 is connected to two mice (as shown in Figure 2D). Please refer to FIG. 1 and FIG. 4'. FIG. 4 is a flow chart showing a method for identifying a PS/2 interface peripheral device according to an embodiment of the present invention. The detailed steps of the method for identifying the PS/2 interface peripheral device of the present invention are described as follows: 5 Step 410, first, receiving the peripheral control signals sent by the computer peripheral devices 301, 302 via the PS/2 port 121 or 122; Step 420' identifies the types of computer peripheral devices 301, 302 based on the peripheral control signals of the computer peripheral devices 301, 302; and Ο Step 430, arranging the peripheral devices 301, 302 of the computer 10 according to the types of the computer peripheral devices 3〇1, 302 The signal sent to the host computer 2〇〇 path. According to the embodiment of the present invention, the switching device of the present invention and the method for recognizing the PS/2 interface peripheral device and the KVM switch thereof can automatically identify the type of the peripheral device and according to the type of the peripheral device. The data of the peripheral device is processed correspondingly. Therefore, the PS/2 port of the present invention can be arbitrarily coupled to any of the 15 types of PS/2 media peripheral devices to improve ease of use and applicability. Although the present invention has been disclosed above in terms of preferred embodiments, it is not intended to limit the invention. Various changes and modifications can be made without departing from the spirit and scope of the invention. Therefore, the scope of protection of this disclosure is subject to the definition of the scope of the patent application. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 shows a schematic view of an adapter device in accordance with an embodiment of the present invention. 2A to 2D are block diagrams showing the switching device, the host computer, and the computer peripheral device according to the present invention. 25 ^ 3 shows a block diagram of a KVM switch, a computer host, and a computer peripheral device according to an embodiment of the present invention. .201035801 - Figure 4 shows a flow chart of a method for identifying a PS/2 interface peripheral device in accordance with an embodiment of the present invention. Figure 5A shows a schematic of a peripheral device and a PS/2 interface in accordance with conventional techniques. 5 Figure 5B shows a schematic diagram of a keyboard/mouse switching controller in accordance with the prior art. [Main component symbol description] 10, 12 PS2 port 控制器 14 Controller 10 20 switching control circuit 100 switching device 101 KVM switch 110 Controller 111 Identification unit 15 121 First PS/2 port 埠 122 Second PS/ 2 connection 埠〇 123 ' 124 CLK signal line 125 ' 126 Data signal line 130 central processor 20 140 computer connection 埠 150 image connection 埠 160 user interface 170 multiplexer 301 first computer peripheral device 25 302 second computer peripheral device 303 screen 11