CN103631476B - Mode switching method of electronic device and related electronic device - Google Patents
- ️Wed Mar 01 2017
CN103631476B - Mode switching method of electronic device and related electronic device - Google Patents
Mode switching method of electronic device and related electronic device Download PDFInfo
-
Publication number
- CN103631476B CN103631476B CN201210312740.XA CN201210312740A CN103631476B CN 103631476 B CN103631476 B CN 103631476B CN 201210312740 A CN201210312740 A CN 201210312740A CN 103631476 B CN103631476 B CN 103631476B Authority
- CN
- China Prior art keywords
- electronic device
- host
- mode
- driver
- operating system Prior art date
- 2012-08-29 Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Stored Programmes (AREA)
- Control By Computers (AREA)
Abstract
本发明公开了一种电子装置的模式切换方法与相关电子装置,该方法包含有:当该电子装置与一主机电性连接时,设定该电子装置开始操作于一第一模式;当该主机有安装一作业系统时,侦测该主机是否有安装该电子装置的一驱动程序;当该主机有安装该驱动程序时,维持该电子装置为该第一模式;以及当该主机没有安装该驱动程序时,切换该电子装置为一第二模式。本发明可以避免使用者在每次连接该装置的时候荧幕上都会出现安装驱动程序的视窗,进而增加使用者的方便性。
The present invention discloses a mode switching method of an electronic device and a related electronic device, the method comprising: when the electronic device is electrically connected to a host, setting the electronic device to start operating in a first mode; when the host has an operating system installed, detecting whether the host has a driver installed for the electronic device; when the host has the driver installed, maintaining the electronic device in the first mode; and when the host has not the driver installed, switching the electronic device to a second mode. The present invention can avoid the appearance of a driver installation window on the screen every time the user connects the device, thereby increasing the convenience of the user.
Description
技术领域technical field
本发明有关于一种电子装置,且特别有关于一种具有多种功能的电子装置的模式切换方法与相关的电子装置。The present invention relates to an electronic device, and in particular to a method for switching modes of an electronic device with multiple functions and the related electronic device.
背景技术Background technique
通用串行总线(Universal Serial Bus,USB)是现今很普遍的一种装置接口,很多电子装置均采用此种装置接口,然而,并非所有USB装置的驱动程序均已内建在主机所使用的作业系统当中,因此,使用者需要先将驱动程序安装至主机之后,才可以通过主机来使用USB装置,但如此一来便限制了USB装置在使用上的便利性。The Universal Serial Bus (USB) is a very common device interface nowadays, and many electronic devices adopt this device interface. However, not all USB device drivers have been built into the operating system used by the host. In the system, therefore, the user needs to install the driver to the host before using the USB device through the host, but this limits the convenience of using the USB device.
为了解决上述驱动程序安装的问题,一种复合型USB装置被发展出来,复合型USB装置包含有多个功能,而其中一个功能被模拟成储存装置以作为驱动程序的安装来源,以使得当复合型USB装置连接到主机时,主机可以直接由复合型USB装置安装所需的驱动程序。然而,无论主机是否已经安装了驱动程序,这种复合型USB装置在每次连接到主机,都会在荧幕上跳出一个视窗以询问使用者是否要安装驱动程序,而使用者则每次都要去点选关闭这个视窗,因此造成使用者的困扰。In order to solve the above-mentioned problem of driver installation, a composite USB device has been developed. The composite USB device contains multiple functions, and one of the functions is simulated as a storage device as a driver installation source, so that when the composite When the composite USB device is connected to the host, the host can directly install the required driver from the composite USB device. However, no matter whether the host computer has installed the driver program or not, when this composite USB device is connected to the host computer every time, a window will pop up on the screen to ask the user whether to install the driver program. Go to click to close this window, thus causing confusion for users.
发明内容Contents of the invention
因此,本发明的目的之一在于提供一种电子装置的模式切换方法,其可以避免在主机已经安装驱动程序时仍然跳出安装驱动程序的视窗,以解决上述的问题。Therefore, one of the objectives of the present invention is to provide a mode switching method for an electronic device, which can avoid popping up the window for installing the driver when the driver has been installed on the host, so as to solve the above-mentioned problems.
本发明提供了一种电子装置的模式切换方法,包含有:当该电子装置与一主机电性连接时,设定该电子装置开始操作于一第一模式;当该主机有安装一作业系统时,侦测该主机是否有安装该电子装置的一驱动程序;当该主机有安装该驱动程序时,维持该电子装置为该第一模式;以及当该主机没有安装该驱动程序时,切换该电子装置为一第二模式。The present invention provides a mode switching method of an electronic device, comprising: when the electronic device is electrically connected to a host, setting the electronic device to start operating in a first mode; when the host has an operating system installed , to detect whether the host computer has installed a driver program for the electronic device; when the host computer has installed the driver program, maintain the electronic device in the first mode; and when the host computer has not installed the driver program, switch the electronic device The device is in a second mode.
本发明还提供了一种电子装置,包含有一储存单元以及一控制器,其中该储存单元用来储存一驱动程序。当该电子装置与一主机电性连接时,该控制器设定该电子装置开始操作于一第一模式;当该主机有安装一作业系统时,该控制器侦测该主机是否有安装该电子装置的一驱动程序;当该主机有安装该驱动程序时,该控制器维持该电子装置为该第一模式;以及当该主机没有安装该驱动程序时,该控制器切换该电子装置为一第二模式。The invention also provides an electronic device, which includes a storage unit and a controller, wherein the storage unit is used to store a driver program. When the electronic device is electrically connected to a host, the controller sets the electronic device to operate in a first mode; when the host has an operating system installed, the controller detects whether the host has installed the electronic a driver of the device; when the host has installed the driver, the controller maintains the electronic device in the first mode; and when the host does not install the driver, the controller switches the electronic device to a first mode Two modes.
本发明可以避免使用者在每次连接该装置的时候荧幕上都会出现安装驱动程序的视窗,进而增加使用者的方便性。The invention can prevent the window for installing the driver from appearing on the screen every time the user connects the device, thereby increasing the convenience of the user.
附图说明Description of drawings
图1为依据本发明一实施例的电子装置的示意图。FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the invention.
图2为依据本发明一实施例的电子装置的模式切换方法的流程图。FIG. 2 is a flowchart of a mode switching method of an electronic device according to an embodiment of the invention.
图3为依据本发明一实施例的判断电子装置是否是在作业系统操作下切换至第二模式的流程图。FIG. 3 is a flow chart of determining whether the electronic device is switched to the second mode under the operation of the operating system according to an embodiment of the present invention.
其中,附图标记说明如下:Wherein, the reference signs are explained as follows:
电子装置:100Electronics: 100
接口:102、122Interface: 102, 122
控制器:104Controller: 104
储存单元:106Storage Units: 106
驱动程序:108Drivers: 108
主机:120Host: 120
步骤:200~214、300~306Steps: 200~214, 300~306
具体实施方式detailed description
请参考图1,图1为依据本发明一实施例的电子装置100的示意图。如图1所示,电子装置100包含有一接口102、一控制器104以及一储存单元106,其中接口102用来电性连接于一主机120的一接口122,且储存单元106储存有用来给主机120安装的一驱动程序108。于本实施例中,电子装置100为一通用串行总线(Universal Serial Bus,USB)电子装置,接口102为USB接口,且电子装置100支援多种功能且接口102也支援相对应的多种功能;此外,主机120可为任何具有一作业系统且支援USB功能的主机,例如桌上型电脑、笔记型电脑、平板电脑…等等,且接口122也为USB接口。Please refer to FIG. 1 , which is a schematic diagram of an electronic device 100 according to an embodiment of the present invention. As shown in FIG. 1 , the electronic device 100 includes an interface 102 , a controller 104 and a storage unit 106 , wherein the interface 102 is used to electrically connect to an interface 122 of a host 120 , and the storage unit 106 stores data for the host 120. A driver 108 is installed. In this embodiment, the electronic device 100 is a Universal Serial Bus (USB) electronic device, the interface 102 is a USB interface, and the electronic device 100 supports multiple functions and the interface 102 also supports corresponding multiple functions ; In addition, the host 120 can be any host that has an operating system and supports USB functions, such as a desktop computer, a notebook computer, a tablet computer, etc., and the interface 122 is also a USB interface.
另外,于一实施例中,电子装置100为一USB网络卡,且至少支援网络功能以及储存装置功能,也即电子装置100可以提供主机120网络连线通讯等相关功能,也可以被主机120视作一储存装置。In addition, in one embodiment, the electronic device 100 is a USB network card, and at least supports network functions and storage device functions, that is, the electronic device 100 can provide the host 120 with related functions such as network connection communication, and can also be viewed by the host 120. as a storage device.
请参考图2,图2为依据本发明一实施例的电子装置100的模式切换方法的流程图,其中图2所示的流程为电子装置100刚插入主机120后电子装置100的操作,也或是在电子装置100已经插入主机120的情况下主机120重新开机后电子装置100的操作。此外,图2所示的流程是由控制器104依据硬件或是软件(固件)所执行。参考图1、2,流程叙述如下。Please refer to FIG. 2. FIG. 2 is a flowchart of a mode switching method of an electronic device 100 according to an embodiment of the present invention, wherein the process shown in FIG. is the operation of the electronic device 100 after the host 120 is restarted when the electronic device 100 has been plugged into the host 120 . In addition, the process shown in FIG. 2 is executed by the controller 104 according to hardware or software (firmware). Referring to Figures 1 and 2, the process is described as follows.
首先,步骤200中,当电子装置100刚插入主机120,或是在电子装置100已经插入主机120的情况下主机120重新开机时,控制器104会设定电子装置100直接操作于一第一模式,而于本实施例中,假设电子装置100支援两种功能,例如网络功能以及储存装置功能,则此时该第一模式则可以是网络功能模式;此外,此时电子装置100并不会操作于一第二模式,也即电子装置100中的储存装置功能在此时并不会启动。First, in step 200, when the electronic device 100 is just plugged into the host 120, or when the host 120 restarts after the electronic device 100 has been plugged into the host 120, the controller 104 will set the electronic device 100 to directly operate in a first mode , and in this embodiment, assuming that the electronic device 100 supports two functions, such as a network function and a storage device function, the first mode may be a network function mode at this time; in addition, the electronic device 100 will not operate In a second mode, that is, the storage device function in the electronic device 100 is not activated at this time.
接着,在步骤202中,控制器104判断是否接收到来自主机120的一查询命令,其中该查询命令是主机120为了询问电子装置100的产品名称(Product Identifcation,PID)、供应商名称(Vendor Identifcation,VID)、装置类型(class)以及子类型(sub-class)等信息而传送至电子装置100的命令,举例来说,该查询命令可以是规范在USB规格书中的询问型式控制传输(query type control transfer)中的一装置描述命令DEVICE_DESCRIPTOR。于一实施例中,控制器104可以依据在一预定时间内(例如,3秒的内)是否有接收到该查询命令来判断是否接收到来自主机120的该查询命令。若是控制器104有接收到来自主机120的该查询命令,则表示主机120有安装作业系统而且是一个USB主机,则流程进入206以判断电子装置100确实是连接到一个有安装作业系统的USB主机;反之,若是控制器104没有接收到来自主机120的该查询命令,则表示主机120并未安装作业系统,而电子装置100有可能仅是连接到一电源供应器,则此时流程进入204以判断电子装置100是连接到一个电源供应器,且流程接着进入步骤214以持续操作在该第一模式。Next, in step 202, the controller 104 determines whether a query command from the host 120 is received, wherein the query command is for the host 120 to inquire about the product name (Product Identifcation, PID) and vendor name (Vendor Identifcation) of the electronic device 100 . , VID), device type (class) and sub-class (sub-class) and other information to transmit to the electronic device 100 command, for example, the query command can be the query type control transmission (query type control transfer) in a device description command DEVICE_DESCRIPTOR. In one embodiment, the controller 104 may determine whether the query command from the host 120 is received according to whether the query command is received within a predetermined time (for example, within 3 seconds). If the controller 104 has received the query command from the host 120, it means that the host 120 has an operating system installed and is a USB host, and the process enters 206 to determine that the electronic device 100 is indeed connected to a USB host with an installed operating system. Conversely, if the controller 104 does not receive the query command from the host 120, it means that the host 120 does not have an operating system installed, and the electronic device 100 may only be connected to a power supply, then the process enters 204 and It is determined that the electronic device 100 is connected to a power supply, and the process then enters step 214 to continue operating in the first mode.
当流程进入206以判断电子装置100确实是连接到一个有安装作业系统的USB主机后,流程紧接着进入步骤208以判断是否接收到来自主机120的一设定信息,其中该设定信息是只有当主机120已经有安装电子装置100的驱动程序时才会传送至电子装置100的信息,举例来说,该设定信息可以是规范在USB规格书中的设定型式控制传输(set typecontrol transfer)中的一设定配置命令SET_CONFIGURATION。于一实施例中,控制器104可以依据在一预定时间内(例如,3秒之内)是否有接收到该设定信息来判断是否接收到来自主机120的该设定信息。若是控制器104有接收到来自主机120的该设定信息,则代表主机120已经有安装电子装置100的驱动程序,故此时流程接着进入步骤214以持续操作在该第一模式;反之,若是控制器104没有接收到来自主机120的该设定信息,则代表主机120尚未安装电子装置100的驱动程序,则此时流程进入步骤210。When the process enters 206 to determine that the electronic device 100 is indeed connected to a USB host with an operating system installed, the process then proceeds to step 208 to determine whether a setting message from the host 120 has been received, wherein the setting information is only The information transmitted to the electronic device 100 will only be sent when the host 120 has installed the driver program of the electronic device 100. For example, the setting information may be the set type control transfer (set type control transfer) specified in the USB specification. One of the set configuration commands SET_CONFIGURATION. In one embodiment, the controller 104 may determine whether the setting information from the host 120 is received according to whether the setting information is received within a predetermined time (for example, within 3 seconds). If the controller 104 has received the setting information from the host 120, it means that the host 120 has already installed the driver of the electronic device 100, so the flow then enters step 214 to continue operating in the first mode; otherwise, if the controller If the device 104 does not receive the setting information from the host 120, it means that the host 120 has not installed the driver program of the electronic device 100, and the process goes to step 210 at this time.
在步骤210中,控制器104将电子装置100切换为操作在该第二模式,其中该第二模式为储存装置模式。当电子装置100操作在该第二模式时,主机120的荧幕上会显示出一个新的视窗(未绘示),以供使用者点选以进行驱动程序的安装,当主机120使用电子装置100中的驱动程序108来完成驱动程序安装之后,主机120会传送一特定命令至电子装置100以表示主机120已经完成了驱动程序的安装,因此,控制器104便可以依据是否接收到来自主机120的该特定命令来判断主机120是否已经完成该驱动程序的安装操作,而当控制器104判断主机120已经完成该驱动程序的安装之后,将电子装置100切换为操作在该第一模式,且流程紧接着进入步骤214以持续操作在该第一模式。In step 210, the controller 104 switches the electronic device 100 to operate in the second mode, wherein the second mode is a storage device mode. When the electronic device 100 operates in the second mode, a new window (not shown) will be displayed on the screen of the host 120 for the user to click to install the driver. When the host 120 uses the electronic device After the driver 108 in 100 completes the driver installation, the host 120 will send a specific command to the electronic device 100 to indicate that the host 120 has completed the driver installation. The specific command is used to determine whether the host 120 has completed the installation of the driver, and when the controller 104 determines that the host 120 has completed the installation of the driver, the electronic device 100 is switched to operate in the first mode, and the process flow Then enter step 214 to continue operating in the first mode.
如上所述,虽然电子装置100有支援两种功能,但其中的储存装置功能在一开始并不会自动启动,而是要等到控制器104判断主机120没有安装电子装置100的驱动程序时才会进入储存装置功能,以供使用者使用储存于电子装置100的驱动程序108来进行安装,因此,相较于现有技术,本发明可以避免让使用者在每次开机的时候都要关闭安装驱动程序的视窗,因此可以增进使用者的方便性。As mentioned above, although the electronic device 100 supports two functions, the storage device function will not be automatically activated at the beginning, but will not start until the controller 104 determines that the host computer 120 has not installed the driver program of the electronic device 100. Enter the storage device function for the user to use the driver program 108 stored in the electronic device 100 to install. Therefore, compared with the prior art, the present invention can prevent the user from having to close the installation driver every time the computer is turned on. The window of the program, so the user's convenience can be improved.
此外,当主机120有支援USB随身碟开机功能时,主机120中的基本输出输入系统(Basic Input/Output System,BIOS)也会有支援USB装置的功能,因此,当在电子装置100已经插入主机120的情况下主机120重新开机时,由于BIOS会先运作,因此电子装置100会将BIOS当作是USB主机,而使得电子装置100会依序经由图2所示的步骤200、202、206、208而进入步骤210,以使得电子装置100操作于该第二模式(储存装置模式);而等到之后主机120的作业系统正式完成开机之后,由于电子装置100已经操作于该第二模式(储存装置模式),因此,主机120的荧幕上仍然会跳出一个视窗以询问使用者是否要安装驱动程序,而使用者便需要去点选关闭这个视窗,因此造成使用者的困扰。In addition, when the host 120 supports the USB flash drive boot function, the Basic Input/Output System (BIOS) in the host 120 will also have the function of supporting USB devices. Therefore, when the electronic device 100 has been plugged into the host In the case of 120, when the host 120 restarts, since the BIOS will run first, the electronic device 100 will regard the BIOS as a USB host, so that the electronic device 100 will sequentially go through steps 200, 202, 206, 208 to enter step 210, so that the electronic device 100 operates in the second mode (storage device mode); mode), therefore, a window will still pop up on the screen of the host computer 120 to ask the user whether to install the driver, and the user needs to click to close the window, thus causing confusion for the user.
因此,为了解决此一问题,请参考图3,图3为依据本发明一实施例的判断电子装置是否是在作业系统操作下切换至该第二模式(储存装置模式)的流程图。其中,图3所示的流程是紧接着图2所示的步骤210之后,也即,当进入步骤210后,除了等待驱动程序安装完成以进入步骤212之外,流程也会自动进入图3所示的步骤300。同时参考图1~3,流程叙述如下:Therefore, in order to solve this problem, please refer to FIG. 3 , which is a flowchart of determining whether the electronic device is switched to the second mode (storage device mode) under the operation of the operating system according to an embodiment of the present invention. Wherein, the process shown in Figure 3 is immediately after step 210 shown in Figure 2, that is, after entering step 210, in addition to waiting for the driver installation to complete to enter step 212, the process will automatically enter the process shown in Figure 3 Step 300 shown. Referring to Figures 1 to 3 at the same time, the process is described as follows:
于步骤300中,控制器104记录电子装置100切换至该第二模式的时间点t0(也即,进入图2的步骤210的时间点)。接着,于步骤302中,控制器等待一重置信号,并记录接收到该重置信号的时间点t1,其中,于本实施例,该重置信号为主机120的作业系统一侦测到电子装置100时所立即产生的对应于电子装置100的一命令信号;此外,该重置信号也可以是主机120的作业系统在进行作业系统切换、接口切换或是电子装置100的模式切换时所立即产生的一命令信号。In step 300 , the controller 104 records the time point t 0 when the electronic device 100 switches to the second mode (ie, the time point when entering step 210 in FIG. 2 ). Next, in step 302, the controller waits for a reset signal, and records the time point t 1 when the reset signal is received, wherein, in this embodiment, the reset signal is detected by the operating system of the host 120 A command signal corresponding to the electronic device 100 is generated immediately when the electronic device 100 is activated; in addition, the reset signal may also be generated by the operating system of the host computer 120 when the operating system is switched, the interface is switched, or the mode of the electronic device 100 is switched. A command signal generated immediately.
接着,在步骤304中,计算记录电子装置100切换至该第二模式的时间点t0与接收到该重置信号的时间点t1的一时间差,并将该时间差与一临界值Tth比较,以判断电子装置100是否是在主机120的作业系统操作下切换为该第二模式。详细来说,由于该重置信号是由主机120作业系统在侦测到电子装置100时所发出的,因此,若是电子装置100是在主机120的作业系统操作下切换为该第二模式,则该时间差(t1-t0)应该是很短的;反之,若是电子装置100是在BIOS操作下切换为该第二模式,则由于该时间差(t1-t0)接近于主机120的开机时间,因此,该时间差会很长。如上所述,在步骤304中,若是判断该时间差(t1-t0)小于临界值Tth(临界值Tth可以预设为小于主机120开机时间的任何值,例如5~10秒),则表示电子装置100是在主机120的作业系统操作下切换至该第二模式,因此流程回到步骤302;反之,若是判断该时间差(t1-t0)大于临界值Tth,则表示电子装置100是在BIOS操作下,而不是在主机120的作业系统操作下切换至该第二模式,因此流程进入步骤306。Next, in step 304, calculate a time difference between the time point t 0 when the recording electronic device 100 switches to the second mode and the time point t 1 when the reset signal is received, and compare the time difference with a critical value T th , to determine whether the electronic device 100 is switched to the second mode under the operation of the operating system of the host 120 . Specifically, since the reset signal is sent by the operating system of the host 120 when the electronic device 100 is detected, if the electronic device 100 is switched to the second mode under the operation of the operating system of the host 120, then The time difference (t 1 -t 0 ) should be very short; on the contrary, if the electronic device 100 is switched to the second mode under BIOS operation, since the time difference (t 1 -t 0 ) is close to the booting of the host 120 time, therefore, the time difference will be very long. As mentioned above, in step 304, if it is judged that the time difference (t 1 -t 0 ) is less than the critical value T th (the critical value T th can be preset as any value shorter than the power-on time of the host 120, for example, 5-10 seconds), It means that the electronic device 100 is switched to the second mode under the operation of the operating system of the host 120, so the process returns to step 302 ; The device 100 switches to the second mode under the operation of the BIOS instead of the operating system of the host 120 , so the process goes to step 306 .
于步骤306中,控制器104将电子装置100切换回该第一模式,并重新回到图2所示的步骤200以重新进行图2的流程。In step 306 , the controller 104 switches the electronic device 100 back to the first mode, and returns to step 200 shown in FIG. 2 to repeat the process of FIG. 2 .
此外,需注意的是图3所示的流程仅为一范例说明,而并非作为本发明的限制,于本发明的其他实施例中,控制器104也可以通过其他的判断方式来判断电子装置100是否是在主机120的作业系统操作下切换为该第二模式,并据以决定是否要重新开始进行图2的流程。In addition, it should be noted that the process shown in FIG. 3 is only an example and not a limitation of the present invention. In other embodiments of the present invention, the controller 104 may also determine the electronic device 100 in other ways Whether it is switched to the second mode under the operation of the operating system of the host computer 120 is used to determine whether to restart the process of FIG. 2 .
简要归纳本发明,于本发明的电子装置的模式切换方法中,应用于一种具有多种功能的USB装置,且可以通过判断主机是否有安装驱动程序来决定电子装置是否要进入储存装置模式,如此一来,便可以避免使用者在每次连接该装置的时候荧幕上都会出现安装驱动程序的视窗,进而增加使用者的方便性。To briefly summarize the present invention, the mode switching method of an electronic device of the present invention is applied to a USB device with multiple functions, and can determine whether the electronic device will enter the storage device mode by judging whether the host has a driver installed. In this way, the window for installing the driver program can be prevented from appearing on the screen every time the user connects the device, thereby increasing the convenience of the user.
以上所述仅为本发明的较佳实施例,凡依本发明申请专利范围所做的均等变化与修饰,皆应属本发明的涵盖范围。The above descriptions are only preferred embodiments of the present invention, and all equivalent changes and modifications made according to the scope of the patent application of the present invention shall fall within the scope of the present invention.
Claims (13)
1.一种电子装置的模式切换方法,包含有:1. A method for switching modes of an electronic device, comprising: 当该电子装置与一主机电性连接时,设定该电子装置开始操作于一对应至第一功能的第一模式;其中该电子装置为一通用串行总线网络卡,该第一模式为一网络功能模式;When the electronic device is electrically connected to a host, the electronic device is set to start operating in a first mode corresponding to the first function; wherein the electronic device is a universal serial bus network card, and the first mode is a network function mode; 当该主机有安装一作业系统时,侦测该主机是否有安装该电子装置的一驱动程序;When an operating system is installed on the host, detecting whether a driver of the electronic device is installed on the host; 当该主机有安装该驱动程序时,维持该电子装置为该第一模式;以及When the host has installed the driver, maintain the electronic device in the first mode; and 当该主机没有安装该驱动程序时,切换该电子装置为一对应至与该第一功能不同的第二功能的第二模式,在该第二模式,该主机进行该驱动程序的安装;其中该第二模式为一储存装置模式When the host does not install the driver, switch the electronic device to a second mode corresponding to a second function different from the first function, in the second mode, the host installs the driver; wherein the The second mode is a storage device mode 其中,所述模式切换方法还包含有:Wherein, the mode switching method also includes: 于切换该电子装置为该第二模式之后:After switching the electronic device to the second mode: 判断该电子装置是否是在对应于该主机的该作业系统操作下切换为该第二模式;judging whether the electronic device is switched to the second mode under the operation of the operating system corresponding to the host; 当该电子装置是在对应于该主机的该作业系统操作下切换为该第二模式时,维持该电子装置为该第二模式;以及When the electronic device is switched to the second mode under the operation of the operating system corresponding to the host, maintaining the electronic device in the second mode; and 当该电子装置不是在对应于该主机的该作业系统操作下切换为该第二模式时,切换该电子装置为该第一模式,并判断该主机是否有安装该电子装置的该驱动程序以决定该电子装置要维持在该第一模式或是再次切换至该第二模式以进行该驱动程序的安装。When the electronic device is not switched to the second mode under the operation of the operating system corresponding to the host, switch the electronic device to the first mode, and determine whether the host has installed the driver of the electronic device to determine The electronic device should be maintained in the first mode or switched to the second mode again to install the driver. 2.如权利要求1所述的模式切换方法,还包含有:2. The mode switching method as claimed in claim 1, further comprising: 侦测该主机是否有安装该作业系统;以及detect whether the host has the operating system installed; and 当该主机没有安装该作业系统时,维持该电子装置为该第一模式。When the operating system is not installed on the host, the electronic device is maintained in the first mode. 3.如权利要求2所述的模式切换方法,其中侦测该主机是否有安装该作业系统的步骤包含有:3. The mode switching method as claimed in claim 2, wherein the step of detecting whether the host computer has installed the operating system includes: 判断在一预定时间内是否有接收到来自该主机的一查询命令;judging whether a query command from the host is received within a predetermined time; 当在该预定时间内有接收到来自该主机的该查询命令时,判断该主机有安装该作业系统;以及When the query command from the host is received within the predetermined time, it is determined that the host has the operating system installed; and 当在该预定时间内没有接收到来自该主机的该查询命令时,判断该主机没有安装该作业系统。When the query command from the host is not received within the predetermined time, it is determined that the operating system is not installed on the host. 4.如权利要求1所述的模式切换方法,其中侦测该主机是否有安装该电子装置的该驱动程序的步骤包含有:4. The mode switching method as claimed in claim 1, wherein the step of detecting whether the host has installed the driver of the electronic device includes: 判断在一预定时间内是否有接收到来自该主机的一设定信息;judging whether a setting message from the host is received within a predetermined time; 当在该预定时间内有接收到来自该主机的该设定信息时,判断该主机有安装该驱动程序;以及When the setting information from the host is received within the predetermined time, it is determined that the host has installed the driver; and 当在该预定时间内没有接收到来自该主机的该设定信息时,判断该主机没有安装该驱动程序。When the setting information from the host is not received within the predetermined time, it is determined that the host has not installed the driver. 5.如权利要求1所述的模式切换方法,其中该电子装置中储存有该驱动程序,且该模式切换方法还包含有:5. The mode switching method as claimed in claim 1, wherein the driver program is stored in the electronic device, and the mode switching method further comprises: 于切换该电子装置为该第二模式之后:After switching the electronic device to the second mode: 接收来自该主机的一特定命令以判断该主机是否已经使用储存于该电子装置中的该驱动程序来完成该驱动程序的安装操作,并据以决定是否切换回该第一模式。A specific command is received from the host to determine whether the host has used the driver stored in the electronic device to complete the installation of the driver, and accordingly determines whether to switch back to the first mode. 6.如权利要求1所述的模式切换方法,其中判断该电子装置是否是在对应于该主机的该作业系统操作下切换为该第二模式的步骤包含有:6. The mode switching method as claimed in claim 1, wherein the step of judging whether the electronic device switches to the second mode under the operation of the operating system corresponding to the host includes: 记录该电子装置切换至该第二模式的时间点;record the time point when the electronic device switches to the second mode; 自该主机接收一重置信号并记录接收到该重置信号的时间点;以及receiving a reset signal from the host and recording the time point of receiving the reset signal; and 依据该电子装置切换至该第二模式的时间点以及接收到该重置信号的时间点,以判断该电子装置是否是在对应于该主机的该作业系统操作下切换为该第二模式。According to the time point when the electronic device switches to the second mode and the time point when the reset signal is received, it is determined whether the electronic device is switched to the second mode under the operation of the operating system corresponding to the host. 7.如权利要求6所述的模式切换方法,其中该重置信号为该主机侦测到该电子装置时所立即产生的对应于该电子装置的一命令信号。7. The mode switching method as claimed in claim 6, wherein the reset signal is a command signal corresponding to the electronic device generated immediately when the host detects the electronic device. 8.如权利要求6所述的模式切换方法,其中判断该电子装置是否是在对应于该主机的该作业系统操作下切换为该第二模式的步骤包含有:8. The mode switching method as claimed in claim 6, wherein the step of judging whether the electronic device switches to the second mode under the operation of the operating system corresponding to the host includes: 依据该电子装置切换至该第二模式的时间点以及接收到该重置信号的时间点之间的一时间差,以判断该电子装置是否是在对应于该主机的该作业系统操作下切换为该第二模式;According to a time difference between the time point when the electronic device switches to the second mode and the time point when the reset signal is received, it is determined whether the electronic device is switched to the operating system corresponding to the host computer. second mode; 当该时间差大于一临界值时,判断该电子装置不是在对应于该主机的该作业系统操作下切换为该第二模式;以及When the time difference is greater than a threshold value, it is determined that the electronic device is not switched to the second mode under the operating system corresponding to the host; and 当该时间差小于一临界值时,判断该电子装置是在对应于该主机的该作业系统操作下切换为该第二模式。When the time difference is less than a critical value, it is determined that the electronic device is switched to the second mode under the operation of the operating system corresponding to the host. 9.一种电子装置,包含有9. An electronic device comprising 一储存单元,用来储存一驱动程序;a storage unit for storing a driver; 一控制器,耦接于该储存单元;a controller coupled to the storage unit; 其中当该电子装置与一主机电性连接时,该控制器设定该电子装置开始操作于一对应至第一功能的第一模式;当该主机有安装一作业系统时,该控制器侦测该主机是否有安装该电子装置的一驱动程序;当该主机有安装该驱动程序时,该控制器维持该电子装置为该第一模式;以及当该主机没有安装该驱动程序时,该控制器切换该电子装置为一对应至与该第一功能不同的第二功能的第二模式,在该第二模式,该主机进行该驱动程序的安装;其中该电子装置为一通用串行总线网络卡,该第一模式为一网络功能模式,而该第二模式为一储存装置模式;Wherein when the electronic device is electrically connected with a host, the controller sets the electronic device to start operating in a first mode corresponding to the first function; when the host has an operating system installed, the controller detects Whether the host has installed a driver program for the electronic device; when the host has installed the driver, the controller maintains the electronic device in the first mode; and when the host has not installed the driver, the controller switching the electronic device to a second mode corresponding to a second function different from the first function, in the second mode, the host computer performs the installation of the driver; wherein the electronic device is a universal serial bus network card , the first mode is a network function mode, and the second mode is a storage device mode; 其中于切换该电子装置为该第二模式之后,该控制器判断该电子装置是否是在对应于该主机的该作业系统操作下切换为该第二模式;以及当该电子装置是在对应于该主机的该作业系统操作下切换为该第二模式时,该控制器维持该电子装置为该第二模式,而当该电子装置不是在对应于该主机的该作业系统操作下切换为该第二模式时,该控制器切换该电子装置为该第一模式,该控制器切换该电子装置为该第一模式后,该控制器判断该主机是否有安装该电子装置的该驱动程序以决定该电子装置要维持在该第一模式或是再次切换至该第二模式以进行该驱动程序的安装。Wherein after switching the electronic device to the second mode, the controller judges whether the electronic device is switched to the second mode under the operating system corresponding to the host; and when the electronic device is in the operation corresponding to the host When the operating system of the host is switched to the second mode, the controller maintains the electronic device in the second mode, and when the electronic device is not switched to the second mode under the operating system corresponding to the host mode, the controller switches the electronic device to the first mode, and after the controller switches the electronic device to the first mode, the controller judges whether the host computer has installed the driver program of the electronic device to determine whether the electronic device The device should remain in the first mode or switch to the second mode again to install the driver. 10.如权利要求9所述的电子装置,其中该控制器另侦测该主机是否有安装该作业系统,且当该主机没有安装该作业系统时,维持该电子装置为该第一模式。10. The electronic device as claimed in claim 9, wherein the controller further detects whether the operating system is installed on the host, and maintains the electronic device in the first mode when the operating system is not installed on the host. 11.如权利要求9所述的电子装置,其中该控制器判断在一预定时间内是否有接收到来自该主机的一设定信息;当该控制器接收到来自该主机的该设定信息后判断该主机有安装该驱动程序。11. The electronic device as claimed in claim 9, wherein the controller judges whether a setting information from the host is received within a predetermined time; when the controller receives the setting information from the host It is judged that the host has installed the driver. 12.如权利要求9所述的电子装置,其中于切换该电子装置为该第二模式之后,该控制器接收来自该主机的一特定命令以判断该主机是否已经使用储存于该电子装置中的该驱动程序来完成该驱动程序的安装操作,并据以决定是否切换回该第一模式。12. The electronic device as claimed in claim 9, wherein after switching the electronic device to the second mode, the controller receives a specific command from the host to determine whether the host has used the data stored in the electronic device. The driver program completes the installation operation of the driver program, and determines whether to switch back to the first mode accordingly. 13.如权利要求9所述的电子装置,其中该控制器记录该电子装置切换至该第二模式的时间点,并记录自该主机接收到一重置信号的时间点,以及依据该电子装置切换至该第二模式的时间点以及接收到该重置信号的时间点,以判断该电子装置是否是在对应于该主机的该作业系统操作下切换为该第二模式。13. The electronic device as claimed in claim 9, wherein the controller records the time point when the electronic device is switched to the second mode, and records the time point when a reset signal is received from the host, and according to the electronic device The time point of switching to the second mode and the time point of receiving the reset signal are used to determine whether the electronic device is switched to the second mode under the operation of the operating system corresponding to the host.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210312740.XA CN103631476B (en) | 2012-08-29 | 2012-08-29 | Mode switching method of electronic device and related electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210312740.XA CN103631476B (en) | 2012-08-29 | 2012-08-29 | Mode switching method of electronic device and related electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103631476A CN103631476A (en) | 2014-03-12 |
CN103631476B true CN103631476B (en) | 2017-03-01 |
Family
ID=50212613
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210312740.XA Active CN103631476B (en) | 2012-08-29 | 2012-08-29 | Mode switching method of electronic device and related electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103631476B (en) |
Families Citing this family (1)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6237737B2 (en) * | 2015-09-15 | 2017-11-29 | 株式会社デンソー | Vehicle communication device, computer program, and communication system |
Citations (5)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101071402A (en) * | 2007-06-21 | 2007-11-14 | 北京中星微电子有限公司 | Method and system for realizing normal working of compound device |
US7328333B2 (en) * | 2001-12-07 | 2008-02-05 | Lenovo (Singapore) Pte. Ltd. | Apparatus, method and program product for selectively starting one of a plurality of operating systems and secondary storage according to whether or not a predetermined peripheral is connected to the system |
CN101452435A (en) * | 2008-12-12 | 2009-06-10 | 深圳华为通信技术有限公司 | USB terminal mode switching method and terminal |
TWI328743B (en) * | 2006-10-27 | 2010-08-11 | Nuvoton Technology Corp | Device switching methods and computer systems |
CN102063320A (en) * | 2011-01-06 | 2011-05-18 | 华为终端有限公司 | Work mode switching methods, USB (Universal Serial Bus) equipment and host machine equipment |
Family Cites Families (1)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7269630B2 (en) * | 2001-10-17 | 2007-09-11 | International Business Machines Corporation | Automatically switching shared remote devices in a dense server environment thereby allowing the remote devices to function as a local device |
-
2012
- 2012-08-29 CN CN201210312740.XA patent/CN103631476B/en active Active
Patent Citations (5)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7328333B2 (en) * | 2001-12-07 | 2008-02-05 | Lenovo (Singapore) Pte. Ltd. | Apparatus, method and program product for selectively starting one of a plurality of operating systems and secondary storage according to whether or not a predetermined peripheral is connected to the system |
TWI328743B (en) * | 2006-10-27 | 2010-08-11 | Nuvoton Technology Corp | Device switching methods and computer systems |
CN101071402A (en) * | 2007-06-21 | 2007-11-14 | 北京中星微电子有限公司 | Method and system for realizing normal working of compound device |
CN101452435A (en) * | 2008-12-12 | 2009-06-10 | 深圳华为通信技术有限公司 | USB terminal mode switching method and terminal |
CN102063320A (en) * | 2011-01-06 | 2011-05-18 | 华为终端有限公司 | Work mode switching methods, USB (Universal Serial Bus) equipment and host machine equipment |
Also Published As
Publication number | Publication date |
---|---|
CN103631476A (en) | 2014-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI477970B (en) | 2015-03-21 | Mode switch method of electronic device and assocaited electronic device |
US8874953B2 (en) | 2014-10-28 | System and method of cloud testing and remote monitoring for integrated circuit components in system validation |
WO2016091033A1 (en) | 2016-06-16 | Method and server for presenting initialization degree of hardware in server |
TW201717001A (en) | 2017-05-16 | Unified firmware managment system, non-transitory computer-readable storage medium and method for unified firmware managment |
US7921230B2 (en) | 2011-04-05 | USB devices pre-configuration for KVM switch |
WO2003027892A1 (en) | 2003-04-03 | Method and system for providing a modulized server on board |
US20150082056A1 (en) | 2015-03-19 | Computer device and method for converting working mode of universal serial bus connector of the computer device |
CN109976816B (en) | 2021-06-15 | Computer system configuration method and server |
US8250255B2 (en) | 2012-08-21 | Two-way connectivity USB control device and operation method thereof |
US20120060023A1 (en) | 2012-03-08 | Methods for booting an operating system using non-volatile memory |
CN107111568B (en) | 2020-03-24 | System and method for presenting drive installation files when USB device is enabled |
CN107135462A (en) | 2017-09-05 | The Bluetooth pairing methods and its computing system of UEFI firmwares |
US7849300B2 (en) | 2010-12-07 | Method for changing booting sources of a computer system and a related backup/restore method thereof |
WO2013189388A2 (en) | 2013-12-27 | Usb network card access method, usb network card and pc |
CN104866397A (en) | 2015-08-26 | Computer System And Control Method |
CN103631476B (en) | 2017-03-01 | Mode switching method of electronic device and related electronic device |
CN103218335A (en) | 2013-07-24 | USB multifunction device and method for USB multifunction device |
CN104111845A (en) | 2014-10-22 | Processing device and system program changing method |
US20150301834A1 (en) | 2015-10-22 | Sensing data reading device and method |
CN104282293A (en) | 2015-01-14 | Electronic device with display device capable of synchronously controlling brightness and operation method thereof |
US8041846B2 (en) | 2011-10-18 | Apparatus with reduced latency for master and slave storage devices |
CN101154144B (en) | 2011-07-20 | Peripheral device, peripheral-device recognizing method, and computer product |
CN107368322B (en) | 2020-11-20 | A method and device for adjusting the boot sequence of a hard disk under an operating system |
CN116028100B (en) | 2024-04-05 | Software version upgrading method and electronic device |
CN104111905B (en) | 2017-05-10 | External electronic device and control method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
2014-03-12 | PB01 | Publication | |
2014-03-12 | PB01 | Publication | |
2014-04-09 | C10 | Entry into substantive examination | |
2014-04-09 | SE01 | Entry into force of request for substantive examination | |
2017-03-01 | GR01 | Patent grant | |
2017-03-01 | GR01 | Patent grant |