Equipment switching method, electronic equipment and computer readable storage medium
By building a local area network communication connection in the dual-system device, the problems of complex circuits and high costs caused by the transfer switching module in the prior art are solved, and the effects of simplifying the hardware structure and reducing costs are achieved.
Patent Information
- Application Number
- CN202410287435.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2025-09-16
AI Technical Summary
In the prior art, dual-system devices require a transfer switching module, which results in complex circuit routing and high hardware costs.
A communication connection is established between the first system module and the second system module of the target device so that they are in the same local area network. Data is transmitted through the local area network, avoiding the need for an additional transfer switching module and realizing the switching of external devices.
The circuit routing complexity and hardware cost of the target device are reduced, the hardware structure is simplified, and the equipment switching cost is reduced.
Smart Images

Figure CN120653311A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of control technology, and in particular to a device switching method, an electronic device, and a computer-readable storage medium. Background Art
[0002] In the prior art, in a device with a dual system (such as an Android system and a Windows system), if the dual system needs to be connected to an external device (such as a USB device), a relay switching module (such as a USB-Switch, i.e., a USB converter) is usually required. The relay switching module is respectively connected to the two system modules in the dual system device and is also connected to the external device that needs to be connected. When the user switches any system in the dual system to the currently used system, the relay switching module will establish a connection between the external device and the system module corresponding to the currently used system.
[0003] The defect of the existing technology is that due to the need to set up a transfer switching module, the circuit routing of the device is relatively complicated, and a corresponding processor (such as an MCU chip) needs to be added to control the operation of the transfer switching module, resulting in a high hardware cost and a high cost of switching existing equipment. Summary of the Invention
[0004] The main technical problem solved by this application is how to reduce the cost of equipment switching.
[0005] In order to solve the above technical problems, the first technical solution adopted in this application is: a device switching method, applied to a target device; the target device includes a first system module and a second system module, the first system module and the second system module are in the same local area network, and the first system module is connected to at least one external device; the device switching method includes: in response to receiving a first connection instruction, controlling the first system module to convert the original data sent by the external device received into transmission data in a network transmission format; generating a first connection instruction when switching the currently used system to the system provided by the second system module; controlling the first system module to send the transmission data to the second system module; controlling the second system module to convert the transmission data into original data, so that the second system module establishes a communication connection with the external device.
[0006] Among them, the device switching method also includes: in response to receiving a second connection instruction, controlling the first system module to establish a communication connection with the external device based on the original data received from the external device; and generating the second connection instruction when switching the currently used system to the system provided by the first system module.
[0007] Among them, the device switching method also includes: in response to receiving a first connection instruction, outputting a first prompt information; the external device includes a first external device and / or a second external device, and the first prompt information includes first device information of the first external device and / or second device information of the second external device; the first external device is an external device that needs to establish a communication connection when the user uses the system provided by the second system module; the second external device is an external device other than the first external device, which can establish a communication connection when the user uses the system provided by the second system module.
[0008] Among them, the device switching method also includes: in response to receiving a second connection instruction, outputting a second prompt information; the external device also includes a third external device and / or a fourth external device, and the second prompt information includes third device information of the third external device and / or fourth device information of the fourth external device; the third external device is an external device that needs to establish a communication connection when the user uses the system provided by the first system module; the fourth external device is an external device other than the third external device, which can establish a communication connection when the user uses the system provided by the first system module.
[0009] The device switching method further includes: powering on the target device and opening the initial startup system as the currently used system; in response to the initial startup system being the system provided by the first system module and the external device establishing a communication connection with the system provided by the second system module, generating a second connection instruction; in response to the initial startup system being the system provided by the second system module and the external device establishing a communication connection with the system provided by the first system module, generating a first connection instruction.
[0010] The device switching method further includes: determining the system provided by the module electrically connected to the external device among the first system module and the second system module as the initial startup system.
[0011] The device switching method further includes: obtaining a first number after each power-on of the target device; the first number being the number of times the target device receives the second connection instruction within a preset time period after the single power-on, and the first cumulative number being the sum of the first numbers obtained after each power-on of the target device before the current moment; obtaining a second number after each power-on of the target device; the second number being the number of times the target device receives the first connection instruction within a preset time period after the single power-on, and the second cumulative number being the sum of the second numbers obtained after each power-on of the target device before the current moment; in response to the current initial startup system being the system provided by the second system module, the first cumulative number being greater than the second cumulative number, and the difference between the first cumulative number and the second cumulative number being greater than a preset difference threshold, updating the initial startup system to the system provided by the first system module; in response to the current initial startup system being the system provided by the first system module, the first cumulative number being less than the second cumulative number, and the difference between the first cumulative number and the second cumulative number being greater than the preset difference threshold, updating the initial startup system to the system provided by the second system module.
[0012] Among them, the device switching method also includes: obtaining a first number after each power-on of the target device; the first number is the number of times the target device receives the second connection instruction within a preset time after a single power-on, the first cumulative number is the sum of the first numbers obtained after each power-on of the target device before the current moment, and the number of first numbers corresponding to the first cumulative number is a preset number; obtaining a second number after each power-on of the target device; the second number is the number of times the target device receives the first connection instruction within a preset time after a single power-on, and the second cumulative number is the sum of the second numbers obtained after each power-on of the target device before the current moment. The sum value obtained by adding the first cumulative number and the second cumulative number corresponding to the second cumulative number is a preset number; in response to the current initial startup system being the system provided by the second system module, the first cumulative number is greater than the second cumulative number, and the difference between the first cumulative number and the second cumulative number is greater than the preset difference threshold, the initial startup system is updated to the system provided by the first system module; in response to the current initial startup system being the system provided by the first system module, the first cumulative number is less than the second cumulative number, and the difference between the first cumulative number and the second cumulative number is greater than the preset difference threshold, the initial startup system is updated to the system provided by the second system module.
[0013] In order to solve the above technical problems, the second technical solution adopted in this application is: a device switching device, applied to a target device; the target device includes a first system module and a second system module, the first system module and the second system module are in the same local area network, and the first system module is connected to at least one external device; the system provided by the first system module includes a first application unit, a first drive unit and a second drive unit; the system provided by the second system includes a second application unit, a third drive unit and a fourth drive unit; the first application unit is used to: send a first connection instruction to the first drive unit; the second drive unit is used to: receive the original data sent by the external device and send the original data to the first drive unit; the first drive unit is used to: in response to receiving the first connection instruction, convert the original data into transmission data in a network transmission format, and send the transmission data to the third drive unit; the third drive unit is used to: convert the transmission data into original data, and send the original data to the fourth drive unit; the fourth drive unit is used to: send the original data to the second application unit, so that the second system module establishes a communication connection with the external device.
[0014] In order to solve the above technical problems, the third technical solution adopted in this application is: an electronic device, including: a memory and a processor; the memory is used to store program instructions, and the processor is used to execute the program instructions to implement the above method.
[0015] In order to solve the above technical problems, the fourth technical solution adopted in this application is: a computer-readable storage medium, which stores program instructions, and the above method is implemented when the program instructions are executed by a processor.
[0016] The beneficial effect of the present application is that, different from the prior art, in the technical solution of the present application, a communication connection is established between the first system module and the second system module in the target device, so that the first system module and the second system module are in the same local area network, and the first system module is connected to at least one external device. Based on this hardware structure, a corresponding device switching method is provided. When the user switches the currently used system from the system provided by the first system module to the system provided by the second system module, the first system module is controlled to convert the original data sent by the external device it receives into transmission data suitable for network transmission, and send the transmission data to the second system module through the local area network. The second system module is controlled to convert the transmission data back to the original data, and realize the connection of the external device through the system communication provided by the second system module, so as to realize the switching of the external device from connecting to the first system module to connecting to the second system module, avoiding the need to set up additional devices other than the two system modules and the external device to realize device switching, reducing the complexity of the circuit routing and the hardware cost of the target device, thereby reducing the cost of device switching. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 This is a flow chart of an embodiment of the device switching method of the present application;
[0019] Figure 2 This is one of the structural diagrams of an embodiment of the target device of the present application;
[0020] Figure 3 This is the second structural diagram of an embodiment of the target device of the present application;
[0021] Figure 4 This is a schematic structural diagram of an embodiment of the electronic device of the present application;
[0022] Figure 5 It is a structural diagram of an embodiment of the computer-readable storage medium of the present application;
[0023] Figure 6 It is a structural diagram of an embodiment of the device switching device of the present application. DETAILED DESCRIPTION
[0024] The present application will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only intended to illustrate the present application and are not intended to limit the scope of the present application. Similarly, the following examples are only some examples of the present application and not all examples. All other examples obtained by those of ordinary skill in the art without creative work are intended to fall within the scope of protection of this application.
[0025] References to "embodiments" herein mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0026] In the description of this application, it should be noted that, unless otherwise expressly specified or limited, the terms "installed," "disposed," "connected," and "connected" should be understood broadly. For example, they can mean fixed, removable, or integral. They can be mechanically or electrically connected. They can be directly connected or connected through an intermediate medium. Those skilled in the art will understand the specific meanings of the above terms in this application as they relate to specific circumstances.
[0027] Some existing electronic devices are usually equipped with dual systems (such as Android system and Windows system). One system module provides one system, and a corresponding communication connection is usually set between the two system modules for data transmission between the dual systems when switching one of the dual systems as the current use system of the electronic device.
[0028] In a device with a dual system, if the dual system needs to be connected to an external device (such as a USB device), a relay switching module (such as a USB-Switch, i.e., a USB converter) is usually required. The relay switching module is respectively connected to the two system modules in the dual system device and also connects to the external device that needs to be connected. When the user switches any system in the dual system to the currently used system, the relay switching module will establish a connection between the external device and the system module corresponding to the currently used system.
[0029] A drawback of existing electronic devices is that, since the above-mentioned transfer switching module needs to be set up, after switching the system provided by the system module, the external device can be further switched to the system module corresponding to the currently used system. This will make the circuit wiring of the device more complicated, and a corresponding processor (such as an MCU chip) needs to be added to control the operation of the transfer switching module, resulting in a high hardware cost, which makes the cost of existing device switching high.
[0030] In order to solve the above technical problems, the present application proposes a device switching method, which is applied to the target device. Figures 1 to 3 , Figure 1 This is a flow chart of an embodiment of the device switching method of the present application. Figure 2 This is one of the structural diagrams of an embodiment of the target device of the present application. Figure 3 This is the second structural diagram of an embodiment of the target device of the present application.
[0031] like Figure 2 and Figure 3 As shown, the target device includes a first system module 11 and a second system module 12 . The first system module 11 and the second system module 12 are in the same local area network. The first system module 11 is connected to at least one external device 13 .
[0032] The first system module 11 and the second system module 12 may directly establish a corresponding communication connection, for example, a network transmission channel using the TCP / IP protocol may be established, specifically a hardware method for establishing the communication connection.
[0033] like Figure 2 As shown, the first system module 11 and the second system module 12 may be directly connected by wire, such as through the RJ45 interfaces on the first system module 11 and the second system module 12. The first system module 11 or the second system module 12 is used as a gateway, and an IP address is allocated through DHCP (Dynamic Host Configuration Protocol) to establish a communication connection.
[0034] like Figure 3 As shown, the target device may also include a router 14, which is connected to the first system module 11 and the second system module 12 respectively. The first system module 11 and the second system module 12 can assign corresponding IP addresses to the corresponding system modules through the router 14 as a gateway to establish a communication connection. The router 14 can also be replaced with a switch or other device with communication connection functions, which is not limited here.
[0035] Alternatively, the first system module 11 and the second system module 12 may be placed in the same local area network through other methods, which are not limited here.
[0036] The external device 13 may be a USB device, such as a USB network card, a USB camera, a USB keyboard and mouse, or an external device with other connection methods, which is not limited here. For example, when the external device 13 is a USB device, the raw data received by the first system module 11 connected to the external device is data in the USB data format.
[0037] like Figure 1 As shown, the device switching method includes:
[0038] Step S11 : in response to receiving the first connection instruction, controlling the first system module 11 to convert the original data received from the external device 13 into transmission data in a network transmission format.
[0039] The first connection instruction may be generated when the currently used system is switched to the system provided by the second system module 12 .
[0040] In one example, the system provided by the first system module 11 may be an Android system, and the system provided by the second system module 12 may be a Windows system. In another example, the system provided by the first system module 11 may be a Windows system, and the system provided by the second system module 12 may be an Android system.
[0041] The first connection instruction may specifically refer to detection information of detecting that the currently used system is switched to the system provided by the second system module 12, and receiving the first connection instruction may be receiving the detection information, that is, perceiving that the user has switched the currently used system to the system provided by the second system module 12.
[0042] The first connection instruction may specifically be information generated by switching the currently used system to the system provided by the second system module 12, for example, operation information related to a process that must be run when the second system module 12 is started, or shutdown information of the first system module 11.
[0043] The first connection instruction may also be other types of information generated when switching the current system to the system provided by the second system module 12, or information generated when the user desires to use the second system module 12 to control an external device, which is not limited here.
[0044] The first system module 11 may convert the received original information (such as data in a USB data format) into transmission data (such as data in a network transmission format) so as to transmit the transmission data through a local area network.
[0045] Step S12 : controlling the first system module 11 to send the transmission data to the second system module 12 .
[0046] The first system module 11 sends the converted transmission data to the second system module 12 via the local area network.
[0047] Step S13 : controlling the second system module 12 to convert the transmission data into original data, so that the second system module 12 establishes a communication connection with the external device 13 .
[0048] The second system module 12 converts the received transmission data and restores it to the original data, thereby enabling the second system module 12 to receive the original data sent by the external device 13 through the local area network. That is, when the second system module 12 is not connected to the external device 13 and the first system module 11 is connected to the external device 13, the second system module 12 can communicate with the external device 13. At this time, the user can use the external device 13 through the second system module 12.
[0049] Based on the above method, when a user uses a target device with dual systems or more than dual systems, the user can operate the external devices 13 connected to the target device regardless of which system is used without additionally setting up a transfer switching module (such as a USB-Switch, a USB switching module). At the same time, its hardware structure is relatively simple and the cost is low, which reduces the cost of the target device with the above functions, that is, reduces the cost of device switching.
[0050] Different from the prior art, the technical solution of the present application establishes a communication connection between a first system module 11 and a second system module 12 in a target device, so that the first system module 11 and the second system module 12 are in the same local area network. The first system module 11 is connected to at least one external device 13. Based on this hardware structure, a corresponding device switching method is provided. When a user switches the currently used system from the system provided by the first system module 11 to the system provided by the second system module 12, the first system module 11 is controlled to convert the original data sent by the external device into transmission data suitable for network transmission, and then transmit the transmission data to the second system module 12 via the local area network. The second system module 12 is controlled to convert the transmission data back to the original data, thereby connecting the external device through the system communication provided by the second system module 12, thereby achieving the switching of the external device from the first system module 11 to the second system module 12. Compared with the prior art, the need for additional components other than the two system modules and the external device to achieve device switching is avoided, thereby reducing the circuit routing complexity and hardware cost of the target device, thereby reducing the cost of device switching.
[0051] In one embodiment, the device switching method further includes:
[0052] In response to receiving the first connection instruction, first prompt information is output.
[0053] The external device 13 includes a first external device and / or a second external device, and the first prompt information includes first device information of the first external device and / or second device information of the second external device.
[0054] The first external device is an external device 13 that needs to establish a communication connection when the user uses the system provided by the second system module 12 .
[0055] The second external device is an external device 13 other than the first external device, with which a user can establish a communication connection when using the system provided by the second system module 12 .
[0056] Specifically, all external devices 13 may include a first external device and / or a second external device.
[0057] The first external device may specifically refer to an external device 13 that the user must use when using the system provided by the second system module 12 , and the second external device may specifically refer to an external device 13 that the user does not need but can use when using the second system module 12 .
[0058] The first prompt information may specifically refer to a pop-up window message displayed by the system provided by the second system module 12 and visible to the user on the corresponding display module. The content of the pop-up window message is a reminder of the external devices 13 that the user must switch or can switch among all the external devices 13, which can be used to remind the user. If the user needs to switch a specific external device 13 (such as the external device 13 mentioned in the prompt information), the above steps S11-S13 can be executed for the original data sent by the specific external device 13 to the first system module 11 to establish a communication connection between the specific external device 13 and the second system module 12, so that the user can use the specific external device through the system provided by the second system module 12.
[0059] Based on the above method, compared with the prior art of directly establishing a communication connection between some default external devices and the second system module 12, the technical solution of the present application can output a first prompt message to prompt the user which external devices 13 must and / or can be switched to communicate with the second system module 12 when the user switches the currently used system to the system provided by the second system module 12, thereby reducing the possibility of the user forgetting to switch devices and causing the user to delay the normal operation of the corresponding external device 13, thereby improving the reliability of device switching.
[0060] Optionally, the device switching method further includes:
[0061] In response to receiving the second connection instruction, second prompt information is output.
[0062] The external device 13 further includes a third external device and / or a fourth external device, and the second prompt information includes third device information of the third external device and / or fourth device information of the fourth external device.
[0063] The third external device is an external device 13 that needs to establish a communication connection when the user uses the system provided by the first system module 11 .
[0064] The fourth external device is an external device 13 other than the third external device, which can establish a communication connection when the user uses the system provided by the first system module 11 .
[0065] Specifically, all external devices 13 may include a third external device and / or a fourth external device.
[0066] The third external device may specifically refer to an external device 13 that the user must use when using the system provided by the first system module 11 , and the fourth external device may specifically refer to an external device 13 that the user does not need but can use when using the first system module 11 .
[0067] The second prompt information may specifically refer to a pop-up window message displayed by the system provided by the first system module 11 and visible to the user on the corresponding display module. The content of the pop-up window message is to prompt the user of the external devices 13 that must be switched or that can be switched among all the external devices 13, thereby reminding the user. If the user needs to switch a specific external device 13 (such as an external device 13 mentioned in the prompt information), the above steps S11-S13 may be stopped for the original data sent by the specific external device 13. Instead, only a communication connection between the specific external device 13 and the first system module 11 may be established, so that the user can use the specific external device through the system provided by the first system module 11.
[0068] Based on the above method, compared with the prior art of directly establishing a communication connection between some default external devices and the first system module 11, the technical solution of the present application can output a second prompt message to prompt the user which external devices 13 must and / or can be switched to communicate with the first system module 11 when the user switches the currently used system to the system provided by the first system module 11, thereby reducing the possibility of the user forgetting to switch devices and causing the user to delay the normal operation of the corresponding external device 13, thereby improving the reliability of device switching.
[0069] In one embodiment, the device switching method further includes:
[0070] In response to receiving the second connection instruction, the first system module 11 is controlled to establish a communication connection with the external device 13 based on the received original data sent by the external device 13 .
[0071] The second connection instruction may be generated when the currently used system is switched to the system provided by the first system module 11 .
[0072] Specifically, the second connection instruction may specifically refer to the detection information of detecting that the currently used system is switched to the system provided by the first system module 11, and receiving the second connection instruction may be receiving the detection information, that is, perceiving that the user has switched the currently used system to the system provided by the first system module 11.
[0073] The second connection instruction may specifically be information generated by switching the currently used system to the system provided by the first system module 11, for example, relevant operation information of a process that must be run when the first system module 11 is started, or shutdown information of the second system module 12.
[0074] The second connection instruction may also be other types of information generated when switching the currently used system to the system provided by the first system module 11, or information generated when the user desires to use the first system module 11 to control an external device, which is not limited here.
[0075] When the currently used system is switched to the system provided by the first system module 11, there is no need to transmit the original data sent by the external device 13 within the local area network. Instead, the first system module 11 can be directly controlled to use the corresponding external device 13 based on the original data. Based on the above method, the efficiency of device switching can be effectively improved.
[0076] In one example, the system provided by the first system module includes a first application unit, a first driving unit, and a second driving unit. The system provided by the second system module includes a second application unit, a third driving unit, and a fourth driving unit.
[0077] The first application unit, the first driving unit, the second driving unit, the second application unit, the third driving unit and the fourth driving unit may specifically refer to software modules in the corresponding system.
[0078] The first application module and the second application module are both used to interact with the user. The first application module is connected to the second application module, the first application module is connected to the first driver module, the first driver module is connected to the second driver module and the third driver module respectively, the second driver module is connected to the external device, the third driver module is connected to the fourth driver module, and the fourth driver module is connected to the second application module.
[0079] First, steps S11-S13 may specifically include:
[0080] A first connection instruction is sent to the first driving unit through the first application unit.
[0081] The original data sent by the external device is received through the second driving unit, and the original data is sent to the first driving unit.
[0082] In response to receiving the first connection instruction, the first driver unit converts the original data into transmission data in a network transmission format and sends the transmission data to the third driver unit. Assuming the original data is a USB data packet, the USB data packet can be encapsulated into a data format that conforms to network transmission to obtain the transmission data. The original data can also be other types of data packets, which are not limited here.
[0083] The transmission data is converted into original data by the third driving unit, and the original data is sent to the fourth driving unit.
[0084] The fourth driver unit sends the raw data to the second application unit, so that the second system module establishes a communication connection with the external device. After the external device is enumerated based on the USB data packet, the external device is connected to the second system module to complete the communication connection.
[0085] Second, in response to receiving the second connection instruction, establishing a communication connection with the external device based on the received original data sent by the external device through the first system module may specifically include:
[0086] A second connection instruction is sent to the first application unit through the second application unit.
[0087] The second connection instruction is sent to the first driving unit through the first application unit.
[0088] The second drive unit receives the raw data sent by the external device and sends the raw data to the first drive unit. Assuming that the raw data is a USB data packet, the transmitted data can be parsed and restored to a USB data packet. The raw data can also be other types of data packets, which are not limited here.
[0089] In response to receiving the second connection instruction, the first driver unit transmits the raw data to the first application module, thereby establishing a communication connection between the first system module and the external device. After the external device is enumerated based on the USB data packet, the external device is connected to the first system module to complete the communication connection. At the same time, the first driver unit may stop converting the raw data into transmission data for transmission to the third driver unit, thereby ceasing to establish the communication connection between the external device and the second system module.
[0090] Optionally, the device switching method further includes:
[0091] The target device is powered on and the initial startup system is opened as the current system for the user to use.
[0092] In response to the initial startup system being the system provided by the first system module 11 and the external device establishing a communication connection with the system provided by the second system module 12 , a second connection instruction is generated.
[0093] In response to the initial startup system being the system provided by the second system module 12 and the external device establishing a communication connection with the system provided by the first system module 11 , a first connection instruction is generated.
[0094] Specifically, the initial startup system may refer to the first system that is turned on by default by the target device after the target device is powered on. It may be a system provided by any one of the systems provided by the first system module 11 and the second system module 12, and is not limited here.
[0095] After the target device is powered on and the initial startup system is opened as the currently used system, the opened initial startup system can be tested to determine whether the opened initial startup system is the system provided by the first system module 11 or the system provided by the second system module 12. Subsequently, corresponding steps are performed when the initial startup system is the system provided by the first system module 11 or when the initial startup system is the system provided by the second system module 12, respectively, to enable the system module providing the initial startup system to establish a communication connection with the external device, thereby allowing the user to use the initial startup system normally or even better.
[0096] Based on the above method, compared with the prior art which requires manual access to external devices after the target device is turned on, the technical solution of the present application can enable the module where the initial startup system is started to quickly establish a communication connection with the external device 13 when the initial startup system is provided by any system module, so that the user can use the external device 13 through the initial startup system after the initial startup system is turned on, thereby improving the working efficiency of the target device.
[0097] Furthermore, the device switching method further includes:
[0098] The system provided by the module electrically connected to the external device among the first system module 11 and the second system module 12 is determined as the initial startup system.
[0099] Specifically, among all the system modules in the target device, a system module that is electrically connected to the network card in hardware can be determined as the system module that provides the initial startup system, and all the system modules in the target device except the system module that provides the initial startup system can be configured with a corresponding network card with wireless communication function.
[0100] For example, the at least one external device 13 may include a network card, and the system provided by the module electrically connected to the network card in the first system module 11 and the second system module 12 may be determined as the module of the initial startup system. The at least one external device 13 may include at least one of a network card, a display screen, a microphone, headphones, and other types of devices, without limitation herein.
[0101] Based on the above method, compared with the prior art that requires manual switching of the system to the system electrically connected to the external device and access of the external device after the target device is turned on, the technical solution of the present application can preferentially determine the system provided by the system module electrically connected to the external device as the system module providing the initial startup system, and then directly start the system provided by the system module electrically connected to the external device after the target device is turned on, and automatically access the external device, thereby improving the user experience and thus improving the user's work efficiency in using the target device.
[0102] Furthermore, the device switching method further includes:
[0103] A first number is obtained each time the target device is powered on. The first number is the number of times the target device receives the second connection instruction within a preset time period after a single power-on, and the first cumulative number is the sum of the first numbers obtained each time the target device is powered on before the current moment.
[0104] A second number is obtained each time the target device is powered on. The second number is the number of times the target device receives the first connection instruction within a preset time period after a single power-on. The second cumulative number is the sum of the second numbers obtained each time the target device is powered on before the current moment.
[0105] In response to the current initial startup system being the system provided by the second system module, the first cumulative number being greater than the second cumulative number, and the difference between the first cumulative number and the second cumulative number being greater than a preset difference threshold, the initial startup system is updated to the system provided by the first system module.
[0106] In response to the current initial startup system being the system provided by the first system module, the first cumulative number being less than the second cumulative number, and the difference between the first cumulative number and the second cumulative number being greater than a preset difference threshold, the initial startup system is updated to the system provided by the second system module.
[0107] Specifically, the preset difference threshold may be 5 times, 10 times, 15 times, or other times, which may be determined according to actual needs and is not limited here.
[0108] The number of times the target device receives the second connection instruction within a preset time period after each power-on and startup can be recorded to obtain a first count. The first count can be used to indicate the number of times the target device generates the second connection instruction to connect the external device to the first system module after a single power-on and startup. The first cumulative count is the sum of all first counts obtained after each power-on and startup of the target device up to the current moment.
[0109] The number of times the target device receives the first connection instruction within a preset time period after each power-on and startup can be recorded to obtain a second number. The second number can be used to represent the number of times the target device generates the first connection instruction to connect the external device to the second system module after a single power-on and startup. The second cumulative number is the sum of all second numbers obtained after each power-on and startup of the target device up to the current moment.
[0110] If the first cumulative count is greater than the second cumulative count, and the difference between the first cumulative count and the second cumulative count is greater than a preset difference threshold, it can be determined that the user, within the preset duration of each target device power-on, is more inclined to connect the external device to the system provided by the first system module. In other words, within the preset duration of each target device power-on, the user is more inclined to use the first system module to control the external device for use. Therefore, if the first cumulative count is greater than the second cumulative count, and the difference between the first cumulative count and the second cumulative count is greater than the preset difference threshold, it can be determined that the user is more inclined to use the system provided by the first system module as the initial startup system. If the initial startup system is the system provided by the second system module, the initial startup system can be updated to the system provided by the first system module to facilitate the user's use of the target device.
[0111] Similarly, if the first cumulative count is less than the second cumulative count, and the difference between the first and second cumulative counts is greater than a preset difference threshold, it can be assumed that the user, within the preset duration of each target device power-on, is more inclined to connect the external device to the system provided by the second system module. In other words, within the preset duration of each target device power-on, the user is more inclined to use the second system module to control the external device. Therefore, if the first cumulative count is less than the second cumulative count, and the difference between the first and second cumulative counts is greater than the preset difference threshold, it can be assumed that the user is more inclined to use the system provided by the second system module as the initial startup system. If the initial startup system is the system provided by the first system module, the initial startup system can be updated to the system provided by the second system module to facilitate the user's use of the target device.
[0112] Based on the above method, compared with the prior art which requires manual switching of the system to the system the user prefers to use and access of external devices after the target device is turned on, the technical solution of the present application can update the initial startup system in a timely manner after the user changes his habit of first using a certain system after turning on the target device, so as to make it more adapted to the user's operating habits, reduce the possibility that the user still needs to switch the communication connection of the external device within the preset time after turning on the target device, and improve the user's work efficiency when using the target device.
[0113] Furthermore, the device switching method further includes:
[0114] A first number is obtained each time the target device is powered on. The first number is the number of times the target device receives the second connection instruction within a preset time period after a single power-on. The first cumulative number is the sum of the first numbers obtained each time the target device is powered on before the current moment. The number of first numbers corresponding to the first cumulative number is a preset number.
[0115] A second number is obtained each time the target device is powered on. The second number is the number of times the target device receives the first connection instruction within a preset time period after a single power-on. The second cumulative number is the sum of the second numbers obtained each time the target device is powered on before the current moment. The number of second numbers corresponding to the second cumulative number is a preset number.
[0116] In response to the current initial startup system being the system provided by the second system module, the first cumulative number being greater than the second cumulative number, and the difference between the first cumulative number and the second cumulative number being greater than a preset difference threshold, the initial startup system is updated to the system provided by the first system module.
[0117] In response to the current initial startup system being the system provided by the first system module, the first cumulative number being less than the second cumulative number, and the difference between the first cumulative number and the second cumulative number being greater than a preset difference threshold, the initial startup system is updated to the system provided by the second system module.
[0118] Specifically, the preset difference threshold may be 5 times, 10 times, 15 times, or other times, which may be determined according to actual needs and is not limited here.
[0119] The preset number can be 50, 100, 150 or other numbers, which can be determined according to actual needs and is not limited here.
[0120] The number of times the target device receives the second connection instruction within a preset time period after each power-on and startup can be recorded to obtain a first count. The first count can be used to indicate the number of times the target device generates the second connection instruction to connect the external device to the first system module after a single power-on and startup. The first cumulative count is the sum of the preset number of first counts obtained each time the target device is powered on and started before the current moment. For example, if the preset number is 50, the 50 first counts obtained closest to the current moment before the current moment can be accumulated to obtain the first cumulative count.
[0121] The number of times the target device receives the first connection instruction within a preset time period after each power-on and startup can be recorded to obtain a second number. The second number can be used to represent the number of times the target device generates the first connection instruction to connect the external device to the second system module after a single power-on and startup. The second cumulative number is the sum of a preset number of second numbers obtained each time the target device is powered on and started before the current moment, and the sum of the preset number of second numbers can be calculated by summing the 50 second numbers obtained closest to the current moment before the current moment to obtain the second cumulative number.
[0122] In other examples, the preset number of 50 may be replaced with other numbers, which is not limited here.
[0123] If the first cumulative count is greater than the second cumulative count, and the difference between the first cumulative count and the second cumulative count is greater than a preset difference threshold, it can be determined that the user, within the preset duration of each target device power-on, is more inclined to connect the external device to the system provided by the first system module. In other words, within the preset duration of each target device power-on, the user is more inclined to use the first system module to control the external device for use. Therefore, if the first cumulative count is greater than the second cumulative count, and the difference between the first cumulative count and the second cumulative count is greater than the preset difference threshold, it can be determined that the user is more inclined to use the system provided by the first system module as the initial startup system. If the initial startup system is the system provided by the second system module, the initial startup system can be updated to the system provided by the first system module to facilitate the user's use of the target device.
[0124] Similarly, if the first cumulative count is less than the second cumulative count, and the difference between the first and second cumulative counts is greater than a preset difference threshold, it can be assumed that the user, within the preset duration of each target device power-on, is more inclined to connect the external device to the system provided by the second system module. In other words, within the preset duration of each target device power-on, the user is more inclined to use the second system module to control the external device. Therefore, if the first cumulative count is less than the second cumulative count, and the difference between the first and second cumulative counts is greater than the preset difference threshold, it can be assumed that the user is more inclined to use the system provided by the second system module as the initial startup system. If the initial startup system is the system provided by the first system module, the initial startup system can be updated to the system provided by the second system module to facilitate the user's use of the target device.
[0125] Based on the above method, compared with the prior art which requires manual switching of the system to the system the user prefers to use and access of external devices after the target device is turned on, the technical solution of the present application can update the initial startup system in a timely manner after the user's habit of first using a certain system after turning on the target device changes, so as to make it more adapted to the user's operating habits, reduce the possibility that the user still needs to switch the communication connection of the external device within the preset time after turning on the target device, and improve the user's work efficiency when using the target device.
[0126] This application also proposes an electronic device, see Figure 4 , Figure 4 This is a schematic diagram of the structure of an embodiment of the electronic device of the present application. Figure 4 As shown, the electronic device 20 includes a processor 21 , a memory 22 and a bus 23 .
[0127] The processor 21 and the memory 22 are connected to the bus 23 respectively. The memory 22 stores program instructions. The processor 21 is used to execute the program instructions to implement the device switching method in the above embodiment.
[0128] In this embodiment, the processor 21 may also be referred to as a CPU (Central Processing Unit). The processor 21 may be an integrated circuit chip having signal processing capabilities. The processor 21 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor, or the processor 21 may be any conventional processor.
[0129] Different from the prior art, the technical solution of the present application establishes a communication connection between a first system module 11 and a second system module 12 in a target device, so that the first system module 11 and the second system module 12 are in the same local area network. The first system module 11 is connected to at least one external device 13. Based on this hardware structure, a corresponding device switching method is provided. When a user switches the currently used system from the system provided by the first system module 11 to the system provided by the second system module 12, the first system module 11 is controlled to convert the original data sent by the external device into transmission data suitable for network transmission, and transmit the transmission data to the second system module 12 via the local area network. The second system module 12 is controlled to convert the transmission data back to the original data, thereby connecting the external device through the system communication provided by the second system module 12, thereby achieving the switching of the external device from the first system module 11 to the second system module 12. This avoids the need to set up additional devices other than the two system modules and the external device to achieve device switching, reduces the complexity of the circuit routing and the hardware cost of the target device, and thus reduces the cost of device switching.
[0130] This application also proposes a computer-readable storage medium, see Figure 5 , Figure 5 This is a schematic diagram of the structure of an embodiment of the computer-readable storage medium of the present application. Figure 5 As shown, the computer-readable storage medium 30 stores program instructions 31 thereon, and when the program instructions 31 are executed by a processor (not shown), the device switching method in the above embodiment is implemented.
[0131] The computer-readable storage medium 30 in this embodiment can be, but is not limited to, a USB flash drive, an SD card, a PD optical drive, a mobile hard drive, a large-capacity floppy drive, a flash memory, a multimedia memory card, a server, a storage unit in an FPGA or an ASIC, etc.
[0132] Different from the prior art, the technical solution of the present application establishes a communication connection between a first system module 11 and a second system module 12 in a target device, so that the first system module 11 and the second system module 12 are in the same local area network. The first system module 11 is connected to at least one external device 13. Based on this hardware structure, a corresponding device switching method is provided. When a user switches the currently used system from the system provided by the first system module 11 to the system provided by the second system module 12, the first system module 11 is controlled to convert the original data sent by the external device into transmission data suitable for network transmission, and transmit the transmission data to the second system module 12 via the local area network. The second system module 12 is controlled to convert the transmission data back to the original data, thereby connecting the external device through the system communication provided by the second system module 12, thereby achieving the switching of the external device from the first system module 11 to the second system module 12. This avoids the need to set up additional devices other than the two system modules and the external device to achieve device switching, reduces the complexity of the circuit routing and the hardware cost of the target device, and thus reduces the cost of device switching.
[0133] The present application also proposes a device switching device, which is applied to a target device, as described in any of the above embodiments. The target device includes a first system module 11 and a second system module 12. The first system module 11 and the second system module 12 are in the same local area network, and the first system module 11 is connected to at least one external device 13.
[0134] See also Figure 6 , Figure 6 This is a structural diagram of an embodiment of the device switching device of the present application. Figure 6 As shown, the system provided by the first system module includes a first application unit 111 , a first drive unit 112 and a second drive unit 113 , and the system provided by the second system module includes a second application unit 121 , a third drive unit 122 and a fourth drive unit 123 .
[0135] The first application unit 111 is configured to send a first connection instruction to the first driving unit 112 .
[0136] The second driving unit 113 is configured to receive original data sent by an external device and send the original data to the first driving unit 112 .
[0137] The first driver unit 112 is configured to, in response to receiving the first connection instruction, convert the original data into transmission data in a network transmission format, and send the transmission data to the third driver unit 122. Assuming that the original data is a USB data packet, the USB data packet can be encapsulated into a data format that conforms to network transmission to obtain the transmission data. The original data can also be other types of data packets, which are not limited here.
[0138] The third driving unit 122 is configured to convert the transmission data into original data and send the original data to the fourth driving unit 123 .
[0139] The fourth driver unit 123 is used to send the raw data to the second application unit 121 so that the second system module can establish a communication connection with the external device. After the external device is enumerated based on the USB data packet, the external device can be connected to the second system module to complete the communication connection.
[0140] In one embodiment, the second application unit 121 is configured to send a second connection instruction to the first application unit 111 .
[0141] The first application unit 111 is configured to send the second connection instruction to the first driving unit 112 .
[0142] The second drive unit 113 is configured to receive raw data sent by the external device and send the raw data to the first drive unit 112. Assuming that the raw data is a USB data packet, the transmitted data can be parsed and restored to a USB data packet. The raw data can also be other types of data packets, which are not limited here.
[0143] The first driver unit 112 is configured to, in response to receiving the second connection instruction, send the raw data to the first application module, thereby establishing a communication connection between the first system module and the external device. After completing the enumeration of the external device based on the USB data packet, the external device can be connected to the first system module to complete the communication connection establishment. At the same time, the first driver unit can also stop converting the raw data into transmission data for transmission to the third driver unit, thereby ceasing the communication connection between the external device and the second system module.
[0144] Different from the prior art, in the technical solution of the present application, a communication connection is established between the first system module and the second system module in the target device, so that the first system module and the second system module are in the same local area network. The first system module is connected to at least one external device. Based on this hardware structure, a corresponding device switching method is provided. When the user switches the currently used system from the system provided by the first system module to the system provided by the second system module, the first system module is controlled to convert the original data sent by the external device it receives into transmission data suitable for network transmission, and send the transmission data to the second system module through the local area network. The second system module is controlled to convert the transmission data back to the original data, and realize the connection of the external device through the system communication provided by the second system module, so as to realize the switching of the external device from connecting to the first system module to connecting to the second system module, avoiding the need to set up additional devices other than the two system modules and the external device to realize device switching, reducing the complexity of the circuit routing and the hardware cost of the target device, thereby reducing the cost of device switching.
[0145] In the description of the present application, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0146] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. Throughout the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0147] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0148] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (which can be a personal computer, server, network device, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and a portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing it in a suitable manner if necessary, and then storing it in a computer memory.
[0149] The above is only an implementation method of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A device switching method, characterized in that: applied to the target device; The target device includes a first system module and a second system module, the first system module and the second system module are in the same local area network, and the first system module is connected to at least one external device; The device switching method includes: In response to receiving a first connection instruction, controlling the first system module to convert the received raw data sent by the external device into transmission data in a network transmission format; wherein the first connection instruction is generated when the currently used system is switched to the system provided by the second system module; controlling the first system module to send the transmission data to the second system module; The second system module is controlled to convert the transmission data into the original data, so that the second system module establishes a communication connection with the external device.
2. The device switching method according to claim 1, wherein: The device switching method further includes: In response to receiving a second connection instruction, controlling the first system module to establish a communication connection with the external device based on the original data received from the external device; wherein the second connection instruction is generated when the currently used system is switched to the system provided by the first system module.
3. The device switching method according to claim 1 or 2, characterized in that: The device switching method further includes: In response to receiving the first connection instruction, outputting first prompt information; Wherein, the external device includes a first external device and / or a second external device, and the first prompt information includes first device information of the first external device and / or second device information of the second external device; The first external device is an external device that needs to establish a communication connection when the user uses the system provided by the second system module; The second external device is an external device other than the first external device, which can establish a communication connection when the user uses the system provided by the second system module.
4. The device switching method according to claim 3, characterized in that: The device switching method further includes: In response to receiving the second connection instruction, outputting second prompt information; Wherein, the external device further includes a third external device and / or a fourth external device, and the second prompt information includes third device information of the third external device and / or fourth device information of the fourth external device; The third external device is an external device that needs to establish a communication connection when the user uses the system provided by the first system module; The fourth external device is an external device other than the third external device, which can establish a communication connection when the user uses the system provided by the first system module.
5. The device switching method according to claim 2, wherein: The device switching method further includes: The target device is powered on and an initial startup system is opened as the current use system; In response to the initial startup system being the system provided by the first system module, and the external device establishing a communication connection with the system provided by the second system module, generating the second connection instruction; In response to the initial startup system being the system provided by the second system module and the external device establishing a communication connection with the system provided by the first system module, the first connection instruction is generated.
6. The device switching method according to claim 5, characterized in that: The device switching method further includes: The system provided by the module electrically connected to the external device among the first system module and the second system module is determined as the initial startup system.
7. The device switching method according to claim 5, characterized in that: The device switching method further includes: Obtaining a first number each time the target device is powered on; wherein the first number is the number of times the target device receives the second connection instruction within a preset time period after a single power-on, and the first cumulative number is the sum of the first numbers obtained each time the target device is powered on before the current moment; Obtaining a second number each time the target device is powered on; wherein the second number is the number of times the target device receives the first connection instruction within a preset time period after a single power-on, and the second cumulative number is the sum of the second numbers obtained each time the target device is powered on before the current moment; In response to the current initial startup system being the system provided by the second system module, the first cumulative number being greater than the second cumulative number, and the difference between the first cumulative number and the second cumulative number being greater than a preset difference threshold, updating the initial startup system to the system provided by the first system module; In response to the current initial startup system being the system provided by the first system module, the first cumulative number being less than the second cumulative number, and the difference between the first cumulative number and the second cumulative number being greater than a preset difference threshold, the initial startup system is updated to the system provided by the second system module.
8. The device switching method according to claim 5, characterized in that: The device switching method further includes: A first number is obtained each time the target device is powered on; wherein the first number is the number of times the target device receives the second connection instruction within a preset time period after a single power-on, and the first cumulative number is the sum of the first numbers obtained each time the target device is powered on before the current moment, and the number of the first times corresponding to the first cumulative number is a preset number; a second number is obtained each time the target device is powered on; wherein the second number is the number of times the target device receives the first connection instruction within a preset time period after a single power-on; the second cumulative number is the sum of the second numbers obtained each time the target device is powered on before the current moment; and the number of the second times corresponding to the second cumulative number is a preset number; In response to the current initial startup system being the system provided by the second system module, the first cumulative number being greater than the second cumulative number, and the difference between the first cumulative number and the second cumulative number being greater than a preset difference threshold, updating the initial startup system to the system provided by the first system module; In response to the current initial startup system being the system provided by the first system module, the first cumulative number being less than the second cumulative number, and the difference between the first cumulative number and the second cumulative number being greater than a preset difference threshold, the initial startup system is updated to the system provided by the second system module.
9. A device switching device, characterized in that: applied to the target device; The target device includes a first system module and a second system module, the first system module and the second system module are in the same local area network, and the first system module is connected to at least one external device; The system provided by the first system module includes a first application unit, a first driving unit and a second driving unit; The system provided by the second system includes a second application unit, a third driving unit and a fourth driving unit; The first application unit is configured to: send the first connection instruction to the first driving unit; The second driving unit is configured to: receive original data sent by the external device, and send the original data to the first driving unit; The first driving unit is configured to: in response to receiving the first connection instruction, convert the original data into transmission data in a network transmission format, and send the transmission data to the third driving unit; The third driving unit is configured to convert the transmission data into the original data, and send the original data to the fourth driving unit; The fourth driving unit is configured to send the original data to the second application unit, so that the second system module establishes a communication connection with the external device.
10. An electronic device, characterized in that: include: memory and processor; The memory is used to store program instructions, and the processor is used to execute the program instructions to implement the method according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores program instructions, and when the program instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.