201011551 V , Μ. -V 28126twf.doc/n 九、發明說明: 【發明所屬之技術領域】 本發明疋有關於一種周邊系統控制方法,且特別是有 關於一種新增硬體的方法。 【先前技術】 在以前,電腦必須透過各式各樣的連接介面耦接不同 的週邊設備。例如,透過序列埠連接數據機與滑鼠、透過 ❹ 2行料接印表機.··等等,时種規格的輸出人介面造成 管理不易。再者,早先必須先關閉電腦主機才能進行週邊 設備之連接或卸除工作,亦造成使用上的不便。 因此,產業界制定了通用串列匯流排(Universal Serial201011551 V , Μ. -V 28126twf.doc/n IX. Description of the Invention: TECHNICAL FIELD OF THE INVENTION The present invention relates to a peripheral system control method, and more particularly to a method of adding a new hardware. [Prior Art] In the past, computers had to be coupled to different peripheral devices through a variety of connection interfaces. For example, connecting the modem to the mouse through the serial port, the printer through the ❹ 2 line, etc., the output interface of the various specifications makes management difficult. Furthermore, the computer host must be turned off before the connection or removal of peripheral devices can be performed, which also causes inconvenience in use. Therefore, the industry has developed a universal serial bus (Universal Serial)
Bus ’以下簡稱USB )標準,可支援隨插即用(㈣_㈣, PNP)之安裝功能。由於聰具有熱插拔之設計,因此不 必關機或是重新啟動’電齡機即可經由卿錢用周邊 設備。目前已有許多電子裝置皆具有聰介面,例如鍵 盤、掃描器、隨身碟以及數位相機等。The Bus ’ hereinafter referred to as the USB standard supports the plug-and-play ((4) _(4), PNP) installation function. Because Cong has a hot-swappable design, it is not necessary to shut down or restart the 'electricity machine' to use peripheral equipment. Many electronic devices currently have smart interfaces such as keyboards, scanners, flash drives, and digital cameras.
认咖 的需求’使甩者會鎖住電腦主機上 、 埠。但是以硬體鎖住或是於電腦裝置管理員方式中The need to recognize the coffee's will make the reader lock the computer, oh. But locked in hardware or in the way of computer device administrator
斷⑽娜)聰琿的功能,使得此USB埠對於所有的 ^置類型都不具有隨插㈣的魏。也就是說,鎖住USB 並不具有任何選擇性,而是全面性的對於新增裝置鎖 =因此當制者躲轉歡的裝置轉使肖刪淳連 201011551 νον-τ^^.χ rV 28126twf.doc/n 【發明内容】 流璋種新增硬體时法,可提高通用串列匯 部分法’可·_ 1衣罝鎖住通用串列匯流排埠。 本發明提出-種新增硬體的方法,適用 少一串列匯流排埠,豆申電腦句人 、岛上的至 ❹ ,性驅動程式,;括 與二椒二其中此裝置!!係查詢用於查詢隨插即用裝置 、騎關係。接著,_驗‘_程式根據裝置關 ϊΐΐ!辨識隨插即用裝置的裝置類型,其中當裝置類型 Hi 類型時,則繼續列舉程序,並根據階層關係, :現插即用裝置相對應的裝置節點加人裝置樹。而當裝 ^類,為禁止新增裝置類型時,則接收使用者所輸入的^ 稱/、畨碼。並且,驗證使用者所輸入的名稱與密碼是否正 確。接著,當使用者所輸入的名稱與密碼為不正確時,終 '^列舉程序。而當使用者所輸入的名稱與密碼為正確時, ί、、貝列舉程序,並根據階層關係,以將隨插即用裝置相對 應的一裝置節點加入裝置樹。 在本發明一實施例中,上述接收使用者所輸入的密碼 的步驟之前還包括產生對話方塊,用以要求使用者輸入密 瑪0 在本發明一實施例中,上述接收使用者所輸入的密碼 201011551 ^一 .一·…/ 28126twf.doc/n 的步驟之後還包括將使用者所輸入的密碼進行加密。 在本發明一實施例中,上述驗證使用者所輸入的密碼 ^否正確的步驟包括:從密碼檔案中,取得加密後的預設 密碼;比對加密後的預設密碼與使用者所輸入的密碼。 置樹在本魏-實施财,上猶獅騎賴組維護裝 ❹ φ 在本發明-實施例中,上述終止列舉程序還包括通用 串列匯流排集_姉式停止建立相對應_即用裝 實體裝置物件。 在本發明-實施例中,上述終止列舉程序還包括隨插 =用管理模組停止搜尋相對應隨插即用裝置的裝置驅動= 在本發明一實施例中,上述辨識 ,步驟還包括根據客製化條件,將隨插 禁止新增裝置_以及可新增裝置類型。裝置刀類為Broken (10) Na) Satoshi's function makes this USB port not have the insertion (four) of Wei for all types of settings. In other words, locking the USB does not have any selectivity, but is comprehensive for the new device lock = so when the makers are escaping the device, the device is transferred to the 201011551 νον-τ^^.χ rV 28126twf .doc/n [Summary of the Invention] The new hardware method of the rogue type can improve the general serial concatenation method, which can lock the universal serial bus. The invention proposes a method for adding a new hardware, which is suitable for a series of busbars, a bean sentence, a singularity on the island, a sex driver, and a device with two peppers. Used to query plug-and-play devices and ride relationships. Then, the _test '_ program is based on the device switch! Identify the device type of the plug-and-play device, wherein when the device type Hi type, continue to enumerate the program, and according to the hierarchical relationship, the device corresponding to the plug-and-play device The node adds a device tree. When the class is installed, when the device type is prohibited, the ^/, weight input by the user is received. Also, verify that the name and password entered by the user are correct. Then, when the name and password entered by the user are incorrect, the program is finally enumerated. When the name and password entered by the user are correct, ί, 贝, and 程序 enumerate the program, and according to the hierarchical relationship, a device node corresponding to the plug-and-play device is added to the device tree. In an embodiment of the invention, the step of receiving the password input by the user further comprises: generating a dialog box for requesting the user to input the MME 0. In an embodiment of the invention, the receiving the password input by the user The steps of 201011551 ^一.一·.../ 28126twf.doc/n also include encrypting the password entered by the user. In an embodiment of the invention, the step of verifying that the password input by the user is correct comprises: obtaining the encrypted preset password from the password file; comparing the encrypted preset password with the input by the user password. In the present invention-embodiment, the above-mentioned termination enumeration program also includes a universal serial bus set _ 停止 建立 建立 相对 _ _ _ _ _ _ _ _ _ _ _ _ 通用 通用 通用 通用 通用 通用 通用 通用 通用 通用 通用 通用 通用 φ 通用Physical device object. In the embodiment of the present invention, the termination enumeration program further includes: stopping, by the management module, the device driving to stop searching for the corresponding plug-and-play device. In an embodiment of the present invention, the identifying, the step further comprises: The manufacturing conditions will be added with the prohibition of adding devices _ and the types of devices that can be added. Device tool is
時,一實施例中,上述終止列舉程序的步驟同 除夺提^的顯示器所顯示的使用者介面上不會出現裝J 裝置::====法:將隨插即用 _動程式,包括:啟動列舉;;上之c含筛選 裝置新增增。而當裝置_= 7 V 28126twf.doc/n 201011551 時’接收使用者所輸人的名稱與密t並且,驗證使用者 所輸入的名難密碼是紅確。t㈣者所輸人的名稱與 密碼為不正確時,_選性驅動程式終止列舉程序。而當使 用者所輸入的名稱與密碼為正確時,則繼續列舉程序,以 將隨插即用裝置新增至電腦。 在本發明-實施例中’上述接收使用者所輸入的密碼 的步驟之前還包括產生對話方塊,用以要求使用者輸入密 ❹In an embodiment, the step of terminating the enumeration procedure does not appear to be installed on the user interface displayed by the display that is removed from the display: :==== method: plug-and-play_moving program, Including: start enumeration;; on the c containing screening equipment added. When the device _= 7 V 28126twf.doc/n 201011551, the name and password of the user input are received, and the hard password entered by the user is verified to be red. When the name and password of the person input by t(4) are incorrect, the _selective driver terminates the enumeration procedure. When the user enters the correct name and password, continue to enumerate the program to add the plug-and-play device to the computer. In the embodiment of the present invention, the step of receiving the password input by the user further includes generating a dialog box for requesting the user to input the password.
碼。 在本發明一實施例中,上述接收使用者所輸入的密碼 的步驟之後還包括將使用者所輸入的密碼進行加密。 β在本發明-實施例中,上述驗證使用者所輸入的密碼 =否正確的步驟包括:從密碼檔針,取得加密後的預設 密碼;以及比對加密後的預設密碼與使用者所輸人的密碼。 在本發明-實施射,上述終止列舉程序還包括通用 串列匯流排絲驅祕式停止建立相對應隨插即用裝置的 實體褒置物件。 搜尋的程序還包括停止 在本發明-實施例中,上述辨識隨插即用裝置 根據客製化條件,將隨插即用裝置分類為 7Κ止新增裝置類型以及可新增裝置類型。 在本發明一實施例中,上述終止列舉程序的步 除提,腦的顯示器所顯示的使用者介面上不會出現裝 時 驟同 置移code. In an embodiment of the invention, the step of receiving the password input by the user further comprises encrypting the password input by the user. In the embodiment of the present invention, the step of verifying that the password input by the user is correct is: obtaining the encrypted preset password from the password file; and comparing the encrypted preset password with the user Enter the password. In the present invention, the above-described termination enumeration program further includes a universal serial bus wire drive to stop the establishment of a physical device corresponding to the plug-and-play device. The search procedure also includes stopping. In the present invention-embodiment, the above-described identification plug-and-play device classifies the plug-and-play device into a new device type and a new device type according to the customization conditions. In an embodiment of the present invention, in the step of terminating the enumeration procedure, the user interface displayed on the display of the brain does not appear to be moved simultaneously.
201011551 W 28l26twf.doc/n 時,即用裝置實體連結上電腦的㈣埠 動程式辨节此連I广組啟動列舉程序,並且㈣選性驅 ======= =====時’要求使用者輪人名稱 =不器上察覺任何移除裝置的訊息。奸鱗 =入的名稱與密碼為正確時,__練式繼續列ΐ ii電止新增裝置類型的隨插即用震置新 增至電腦以便於讓使用者可以使用。 另外,藉由軟體模組在列舉程序進行之初,對於新婵 震置做可钟增的確認㈣,轉性的允賴增部分種^ 的裝置’並且對於禁止新增的裝置種類,電腦主機上的 USB埠可以藉由使用者所輸人的名稱與密碼來判斷是否 呈現鎖住狀態。因此,電腦主機上的USB埠具有選擇性的 ,於部分裝置鎖住,以便於提高USB埠的使用彈性,並且 可以避免未知人士使用可存取的隨插即用裝置進行資料盜 拷。 现 為讓本發明之上述和其他目的、特徵和優點能更明顯 易It,下文特舉實施例,並配合所附圖式,作詳細說明 下。 【實施方式】 圖1繪示為本發明一實施例的新增硬體的方法流程 9 v 28126twf.doc/n 201011551 圖。請參照圖1,電腦200上具有至少一串列匯流排埠 (Universal Serial Bus Port,USB port) 202,其中電腦包201011551 W 28l26twf.doc/n, the device entity is connected to the computer's (4) mobilization program to identify the I group start list program, and (4) selective drive ============ 'Require user user name=No information on any device removed. Rape scale = When the name and password of the entry are correct, __Learning continues to be listed. ii The new plug-and-play device for the new device type is added to the computer so that it can be used by the user. In addition, with the software module at the beginning of the enumeration process, the confirmation of the new 婵 置 ( ( ( 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四The USB port on the computer can determine whether the lock state is present by the name and password of the user. Therefore, the USB port on the host computer is selective and locked in some devices, so as to improve the flexibility of the USB port and prevent unauthorized persons from using the accessible plug-and-play device for data theft. The above and other objects, features, and advantages of the present invention will become more apparent from the aspects of the invention. [Embodiment] FIG. 1 is a flowchart of a method for adding a hardware according to an embodiment of the present invention. 9 v 28126 twf.doc/n 201011551. Referring to FIG. 1, the computer 200 has at least one serial port bus (USB port) 202, wherein the computer bag
含有隨插即用管理模組(Plug-and-Play Manager)、篩選 性驅動程式(Filter Driver)以及通用串列匯流排集線驅動 程式(USB Hub Driver) ’其中隨插即用管理模組維護 (Maintain) —裝置樹(Device Tree),而此裝置樹作為電 腦系統追蹤系統内有效使用的裝置與裝置的資訊。再者, 上述的篩選性驅動程式例如是上層篩選性驅動程式 (Upper-Level Filter Driver)。首先,於步驟 S101 中,將 隨插即用裝置204連結至電腦200的串列匯流排埠202。 其中,此隨插即用裝置204例如是具有符合USB界面規格 的電腦周邊設備,包括滑鼠、鍵盤、觸控板、顯示器、可 攜式儲存媒體等。 於步驟S103中,當隨插即用裝置2〇4連接上電腦2〇〇 時,電腦200中的隨插即用管理模組則啟動列舉程序 (Enumeration Process )。藉此此列舉程序發出一裝置關 係查s旬(Query Device Relation),而此裝£關係查詢是用 於查詢隨插即用裝置204與隨插即用管賴組所維護的裝 置樹中的一階層關係。 、 於步驟S105中,根據上述襄置關係查詢,電腦 師選性驅動程式辨識此隨插即用裝置2〇4的裝置類型i 識隨插即用裝置204的裝置類型步驟還包括根據^ 衣化條件’將隨插即用裝置綱分類為禁止新增裝 以及可新增裝《貞型。也就是’使用封以自砂定咖 v 28126twf.doc/n 201011551 璋選擇性的允許新增部分裝置義(亦即可新增裳 例如人性化介面裝置(Human Interfaee 括滑鼠、觸控板、滑鼠筆、鍵盤等,並^ 因此,當隨插即用裝置204的裝置 類型時’則繼續列舉程序(步驟S107),亦 即用裝置204在裝置樹中的階層關係,以將隨插 204相對應的裝置節點加入裝置樹,且由通用串列匯^ US式建立相對應隨插即用裝置2〇4的實體裝置物 件且由Ik插即用管理模組進行搜尋隨插即用裝置綱 驅動程式的步驟,完成新增隨插即用裝置204至電腦2〇〇 的步驟。如此一來,則可在電腦系統的裳置管理員找到新 增入電腦200的隨插即用裝置2〇4的裝置資訊。 相反的’當隨插即用裝置204的褒置類型為禁止新择 裝置類型時,難收使用者所輸人的名稱與密碼(步^ Sl〇7)。另外,在此步驟1〇7執行之前,電腦系統會產生 -對話方塊,而此對話方塊則是用以要求使用者輸入名稱 與密碼。此外,在本實施例中,當電腦系統接收到使用者 所輸入的密碼,會將此密碼進行加密的動作,並且此加密 的動作為不可還原之加密的方式,亦即加密後的密碼無法 還原成原來使用者所輸入的密碼,故可以有效地保障隨插 即用裝置於使用上的安全性。 之後’當電腦接收到使用者所輸入的名稱與密碼時, 會於步驟S109中,驗證使用者所輸入的名稱與密碼是否 11 / 28126twf.doc/n 201011551 正確。在此步驟S109中,首先,電腦系統會從密碼檔案 中,取得加密後的預設密碼。之後,再藉由篩選式驅動程 式比對加密後的設密碼與使用者所輸入的密碼,以便於驗 證使用者所輸入的名稱與密碼是否正確。 接著,當使用者所輸入的名稱與密碼為不正確時,則 執行步驟S113 ’終止列舉程序包括通用串列匯流排集線驅 動程式停止建立相對應隨插即用裝置204的實體裝置物件 ❿ (Physical device object)且隨插即用管理模組停止搜尋相 對應隨插即用裝置204的裝置驅動程式《由於終止列舉程 序中通用串列匯流排集線驅動程式停止建立相對應之實體 裝置物件,因此電腦的顯示器2〇〇a所顯示的使用者介面上 不會出現裝置移除提示。 相反地,當使用者所輸入的名稱與密碼為正確(亦即 使用者通過身分確認)時,則繼續列舉程序(步驟sn5), 亦即根據此隨插即用裝置204在裝置樹中的階層關係,以 將隨插即用裝置2〇4相對應的裝置節點加入裝置樹,且由 通用串列匯流排集線驅動程式建皂相對應隨插即用裝置 204的實體裝置物件,且由隨插即用管理模組進行搜尋隨 插即用裝置204的驅動程式的步驟,完成新增隨插即用裝 置204至電細200的步驟,並且,使用者可在電腦系統的 裝置管理員找到新增入電腦200的隨插即用裝置2〇4的裝 置資訊。如此一來,本實施例確實可以有效地管理隨插即 用裝置的使用方式,即便是被辨識為禁止新增裝置類型的 隨插即用裝置,只要是使用者所輸入的名稱與密碼正確時 12 v 28126twf.doc/n 201011551 增加_即用I置的使用便利性,並且可以 避免笔腦中資料被盜拷。 卿所述’本發明在隨插即用裝置實體連結上電腦的 ¥ ’由隨插即用管理模組啟動列舉程序,並且由筛 k驅動程式辨識此連結上電腦的隨插即用裝置是不是屬 =可新增類型的隨插即用裝置。當此隨插即用裝置被筛選 驅動程式辨識成為禁止新增裝置類型時,要求使用者輸 入名稱與密碼。而當崎出使用者所輸人的名稱與密碼為 不正確時,_性軸程式終止列舉程序,因此使用者不 會在電腦齡H上錢任何移除裝置㈣息。^是判斷出 使用者7輸人的名稱與密碼為正確時,騎性鶴程式繼 、、只歹〗舉程序並且將辨識為禁止新增裝置類型的隨插即用 裝置新增至電腦,以便於讓使用者可以使用。 另外,藉由軟體模組在列舉程序進行之初,對於新增 裝置做可否新增的確認步驟,選擇㈣允許新增部分種類 的裝置,並且對於禁止新增的裝置種類,電腦主機上的 USB埠可以藉由使甩者所輪入的名稱與密碼來判斷是否 呈現鎖住狀態。因此,電腦主機上的USB埠具有選擇性的 對於部分裝置鎖住,以便於提高USB埠的使用彈性,並且 可以避免未知人士使用可存取的隨插即用裝置進行資料盜 拷。 现 雖然本發明已以實施例揭露如上,然其並非用以限定 本發明,任何熟習此技藝者,在不脫離本發明之精神和範 圍内,當可作些許之更動與潤飾,因此本發明之保護範圍 13 201011551 v 28126twf.doc/n 當視後附之申請專利範圍所界定者為準。 【圖式簡單說明】 圖1繪示為根據本發明一實施例的一種新增硬體的方 法流程簡圖。 【主要元件符號說明】 S101〜S115 :方法流程步驟 200 :電腦 200a :顯示器 202 :通用串列匯流排埠 204 :隨插即用裝置 14Includes Plug-and-Play Manager, Filter Driver, and Universal Hub Driver (USB Hub Driver) Maintain) - Device Tree, which acts as a computer system to track information about devices and devices that are effectively used in the system. Furthermore, the above-mentioned screening driver is, for example, an upper-level filter driver. First, in step S101, the plug-and-play device 204 is coupled to the serial bus bar 202 of the computer 200. The plug-and-play device 204 is, for example, a computer peripheral device having a USB interface specification, including a mouse, a keyboard, a touch pad, a display, a portable storage medium, and the like. In step S103, when the plug-and-play device 2〇4 is connected to the computer 2〇〇, the plug-and-play management module in the computer 200 starts the enumeration process (Enumeration Process). Thereby, the enumeration program issues a device relationship Query Device Relation, and the load relationship query is used to query one of the device trees maintained by the Plug and Play device 204 and the Plug and Play management group. Class relationship. In step S105, according to the above-mentioned relationship query, the computer-selective driver identifies the device type of the plug-and-play device 2〇4, and the device type of the plug-and-play device 204 further includes according to the device. The condition 'is classified as a plug-and-play device class that prohibits new installations and can be added with a new type. That is to say, 'Use the seal to set the coffee v 28126twf.doc/n 201011551 璋 Selectively allow the addition of some device meanings (you can also add a new device such as a human interface device (Human Interfaee, mouse, touchpad, Mouse pen, keyboard, etc., and therefore, when the device type of the plug-and-play device 204 is used, 'the program continues to be enumerated (step S107), that is, the hierarchical relationship of the device 204 in the device tree to be inserted 204 The corresponding device node joins the device tree, and the physical device object corresponding to the plug-and-play device 2〇4 is established by the universal serial port and the Ik plug-and-play management module searches for the plug-and-play device. The driver step is to complete the step of adding the plug-and-play device 204 to the computer 2, so that the plug-and-play device added to the computer 200 can be found in the computer system's skirting administrator. Device information of 4. Conversely, when the type of the plug-and-play device 204 is prohibiting the new device type, it is difficult to receive the name and password of the user (step S1). Before step 1〇7 is executed, the computer system will generate - The dialog box is used to ask the user to input a name and a password. In addition, in this embodiment, when the computer system receives the password input by the user, the password is encrypted, and this The encrypted action is an irreversible encryption method, that is, the encrypted password cannot be restored to the password input by the original user, so the security of the plug-and-play device can be effectively guaranteed. When the name and password entered by the user are reached, in step S109, it is verified whether the name and password entered by the user are correct. In this step S109, first, the computer system will receive the password. In the file, the encrypted default password is obtained, and then the encrypted driver compares the encrypted password with the password entered by the user, so as to verify whether the name and password entered by the user are correct. When the name and password entered by the user are incorrect, step S113 is performed to terminate the enumeration program including the universal serial bus. The line driver stops establishing the physical device object corresponding to the plug-and-play device 204 and the plug-and-play management module stops searching for the device driver corresponding to the plug-and-play device 204. The universal serial busbar line driver stops establishing the corresponding physical device object, so the device removal prompt does not appear on the user interface displayed on the display 2〇〇a of the computer. Conversely, when the user inputs When the name and password are correct (that is, the user confirms by identity), the program is continued (step sn5), that is, according to the hierarchical relationship of the plug-and-play device 204 in the device tree, the plug-and-play device will be used. 2〇4 corresponding device nodes are added to the device tree, and the universal serial bus line driver driver builds the physical device object corresponding to the plug-and-play device 204, and the plug-and-play management module searches and inserts The step of using the driver of the device 204 completes the step of adding the plug-and-play device 204 to the battery module 200, and the user can install the computer system. The administrator finds the device information of the plug-and-play device 2〇4 added to the computer 200. In this way, the embodiment can effectively manage the use mode of the plug-and-play device, even if the plug-and-play device identified as prohibiting the added device type, as long as the user inputs the correct name and password. 12 v 28126twf.doc/n 201011551 Increase the ease of use of the _ I use, and avoid theft of data in the pen and brain. According to the above description, the 'invention of the plug-and-play device entity connected to the computer' is activated by the plug-and-play management module, and the screen k driver recognizes whether the plug-and-play device of the connected computer is Dependent = Add-on type plug-and-play device. When the plug-and-play device is identified by the screening driver as a new device type, the user is required to enter a name and password. When the name and password of the user lost by the user are incorrect, the _axis program terminates the enumeration procedure, so the user does not need to remove any device (4) at the computer age H. ^ is to determine that the name and password of the user 7 input is correct, the rider program is followed by the program, and the plug-and-play device identified as prohibiting the addition of the device type is added to the computer so that For users to use. In addition, by means of the software module, at the beginning of the enumeration process, a new confirmation step can be added for the newly added device, and (4) a device for allowing a new type of device to be added, and a USB device on the host computer for prohibiting the newly added device type. You can judge whether or not the lock state is present by making the name and password that the leader has entered. Therefore, the USB port on the host computer is selectively locked to some devices, so as to increase the flexibility of the USB port and prevent unauthorized persons from using the accessible plug-and-play device for data theft. Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention, and those skilled in the art can make some modifications and retouchings without departing from the spirit and scope of the present invention. The scope of protection 13 201011551 v 28126twf.doc/n is subject to the definition of the scope of the patent application. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a schematic flow chart of a method for adding a hardware according to an embodiment of the invention. [Description of Main Component Symbols] S101 to S115: Method Flow Step 200: Computer 200a: Display 202: Universal Serial Bus 埠 204: Plug and Play Device 14