CN111823863A - Vehicle-mounted play source switching method, system and equipment - Google Patents
Vehicle-mounted play source switching method, system and equipment Download PDFInfo
- Publication number
- CN111823863A CN111823863A CN202010466706.2A CN202010466706A CN111823863A CN 111823863 A CN111823863 A CN 111823863A CN 202010466706 A CN202010466706 A CN 202010466706A CN 111823863 A CN111823863 A CN 111823863A
- Authority
- CN
- China
- Prior art keywords
- mode
- master
- usb
- target
- slave
- Prior art date
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 30
- 238000003860 storage Methods 0.000 claims description 47
- 238000012217 deletion Methods 0.000 claims description 3
- 230000037430 deletion Effects 0.000 claims description 3
- 238000001514 detection method Methods 0.000 description 19
- 238000002360 preparation method Methods 0.000 description 8
- 230000004044 response Effects 0.000 description 6
- 230000004048 modification Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 3
- 230000035484 reaction time Effects 0.000 description 3
- 238000004904 shortening Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 230000009191 jumping Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000006855 networking Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B60—VEHICLES IN GENERAL
- B60K—ARRANGEMENT OR MOUNTING OF PROPULSION UNITS OR OF TRANSMISSIONS IN VEHICLES; ARRANGEMENT OR MOUNTING OF PLURAL DIVERSE PRIME-MOVERS IN VEHICLES; AUXILIARY DRIVES FOR VEHICLES; INSTRUMENTATION OR DASHBOARDS FOR VEHICLES; ARRANGEMENTS IN CONNECTION WITH COOLING, AIR INTAKE, GAS EXHAUST OR FUEL SUPPLY OF PROPULSION UNITS IN VEHICLES
- B60K35/00—Instruments specially adapted for vehicles; Arrangement of instruments in or on vehicles
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B60—VEHICLES IN GENERAL
- B60K—ARRANGEMENT OR MOUNTING OF PROPULSION UNITS OR OF TRANSMISSIONS IN VEHICLES; ARRANGEMENT OR MOUNTING OF PLURAL DIVERSE PRIME-MOVERS IN VEHICLES; AUXILIARY DRIVES FOR VEHICLES; INSTRUMENTATION OR DASHBOARDS FOR VEHICLES; ARRANGEMENTS IN CONNECTION WITH COOLING, AIR INTAKE, GAS EXHAUST OR FUEL SUPPLY OF PROPULSION UNITS IN VEHICLES
- B60K35/00—Instruments specially adapted for vehicles; Arrangement of instruments in or on vehicles
- B60K35/10—Input arrangements, i.e. from user to vehicle, associated with vehicle functions or specially adapted therefor
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B60—VEHICLES IN GENERAL
- B60K—ARRANGEMENT OR MOUNTING OF PROPULSION UNITS OR OF TRANSMISSIONS IN VEHICLES; ARRANGEMENT OR MOUNTING OF PLURAL DIVERSE PRIME-MOVERS IN VEHICLES; AUXILIARY DRIVES FOR VEHICLES; INSTRUMENTATION OR DASHBOARDS FOR VEHICLES; ARRANGEMENTS IN CONNECTION WITH COOLING, AIR INTAKE, GAS EXHAUST OR FUEL SUPPLY OF PROPULSION UNITS IN VEHICLES
- B60K35/00—Instruments specially adapted for vehicles; Arrangement of instruments in or on vehicles
- B60K35/80—Arrangements for controlling instruments
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B60—VEHICLES IN GENERAL
- B60K—ARRANGEMENT OR MOUNTING OF PROPULSION UNITS OR OF TRANSMISSIONS IN VEHICLES; ARRANGEMENT OR MOUNTING OF PLURAL DIVERSE PRIME-MOVERS IN VEHICLES; AUXILIARY DRIVES FOR VEHICLES; INSTRUMENTATION OR DASHBOARDS FOR VEHICLES; ARRANGEMENTS IN CONNECTION WITH COOLING, AIR INTAKE, GAS EXHAUST OR FUEL SUPPLY OF PROPULSION UNITS IN VEHICLES
- B60K35/00—Instruments specially adapted for vehicles; Arrangement of instruments in or on vehicles
- B60K35/85—Arrangements for transferring vehicle- or driver-related data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/382—Information transfer, e.g. on bus using universal interface adapter
- G06F13/385—Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/40—Bus structure
- G06F13/4063—Device-to-bus coupling
- G06F13/4068—Electrical coupling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B60—VEHICLES IN GENERAL
- B60K—ARRANGEMENT OR MOUNTING OF PROPULSION UNITS OR OF TRANSMISSIONS IN VEHICLES; ARRANGEMENT OR MOUNTING OF PLURAL DIVERSE PRIME-MOVERS IN VEHICLES; AUXILIARY DRIVES FOR VEHICLES; INSTRUMENTATION OR DASHBOARDS FOR VEHICLES; ARRANGEMENTS IN CONNECTION WITH COOLING, AIR INTAKE, GAS EXHAUST OR FUEL SUPPLY OF PROPULSION UNITS IN VEHICLES
- B60K2360/00—Indexing scheme associated with groups B60K35/00 or B60K37/00 relating to details of instruments or dashboards
- B60K2360/143—Touch sensitive instrument input devices
- B60K2360/1438—Touch screens
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B60—VEHICLES IN GENERAL
- B60K—ARRANGEMENT OR MOUNTING OF PROPULSION UNITS OR OF TRANSMISSIONS IN VEHICLES; ARRANGEMENT OR MOUNTING OF PLURAL DIVERSE PRIME-MOVERS IN VEHICLES; AUXILIARY DRIVES FOR VEHICLES; INSTRUMENTATION OR DASHBOARDS FOR VEHICLES; ARRANGEMENTS IN CONNECTION WITH COOLING, AIR INTAKE, GAS EXHAUST OR FUEL SUPPLY OF PROPULSION UNITS IN VEHICLES
- B60K2360/00—Indexing scheme associated with groups B60K35/00 or B60K37/00 relating to details of instruments or dashboards
- B60K2360/55—Remote control arrangements
- B60K2360/56—Remote control arrangements using mobile devices
- B60K2360/563—Vehicle displaying mobile device information
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B60—VEHICLES IN GENERAL
- B60K—ARRANGEMENT OR MOUNTING OF PROPULSION UNITS OR OF TRANSMISSIONS IN VEHICLES; ARRANGEMENT OR MOUNTING OF PLURAL DIVERSE PRIME-MOVERS IN VEHICLES; AUXILIARY DRIVES FOR VEHICLES; INSTRUMENTATION OR DASHBOARDS FOR VEHICLES; ARRANGEMENTS IN CONNECTION WITH COOLING, AIR INTAKE, GAS EXHAUST OR FUEL SUPPLY OF PROPULSION UNITS IN VEHICLES
- B60K2360/00—Indexing scheme associated with groups B60K35/00 or B60K37/00 relating to details of instruments or dashboards
- B60K2360/55—Remote control arrangements
- B60K2360/56—Remote control arrangements using mobile devices
- B60K2360/569—Vehicle controlling mobile device functions
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B60—VEHICLES IN GENERAL
- B60K—ARRANGEMENT OR MOUNTING OF PROPULSION UNITS OR OF TRANSMISSIONS IN VEHICLES; ARRANGEMENT OR MOUNTING OF PLURAL DIVERSE PRIME-MOVERS IN VEHICLES; AUXILIARY DRIVES FOR VEHICLES; INSTRUMENTATION OR DASHBOARDS FOR VEHICLES; ARRANGEMENTS IN CONNECTION WITH COOLING, AIR INTAKE, GAS EXHAUST OR FUEL SUPPLY OF PROPULSION UNITS IN VEHICLES
- B60K2360/00—Indexing scheme associated with groups B60K35/00 or B60K37/00 relating to details of instruments or dashboards
- B60K2360/586—Wired data transfers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0042—Universal serial bus [USB]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Chemical & Material Sciences (AREA)
- Combustion & Propulsion (AREA)
- Transportation (AREA)
- Mechanical Engineering (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Computer Hardware Design (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to the technical field of vehicle-mounted electronics, and provides a method, a system and equipment for switching a vehicle-mounted play source, wherein a preset master-slave mode identifier is established, and the state of the preset master-slave mode identifier and a host mode form a fixed joint relation, so that the master-slave attribute of a currently cached USB driver can be directly acquired according to the state of the master-slave mode identifier; meanwhile, the consistency judgment of the target mode and the default connection mode can be directly obtained by utilizing the operation of the master-slave mode identifier, so that the judgment of whether to reload the corresponding USB driving program is obtained, and the repeated loading of the USB driving program is reduced when the target mode is the same as the default connection mode, so that the switching speed of the vehicle-mounted playing source is further improved.
Description
Technical Field
The invention relates to the technical field of vehicle-mounted electronics, in particular to a method, a system and equipment for switching vehicle-mounted playing sources.
Background
The Android system supports various USB peripheral devices and Android devices (hardware with Android accessory specification) through two modes, and specifically comprises a USB accessory mode (slave mode) and a USB host mode. In the USB accessory mode, the external device acts as a USB host and supplies power to the USB bus, and its practical applications include robot controllers, diagnostic and music devices, card readers, and the like. This mode enables Android devices without host functionality to have the capability of interacting with USB hardware. In the USB host mode, the Android device is in the host mode and provides power for the USB, and the practical applications of the Android device include a digital camera, a keyboard, a mouse, a gamepad and the like.
The existing switching means of master-slave mode of USB equipment mainly judges the current USB connection mode by detecting circuit level signal, and then carries out mode switching by resetting USB interface.
However, if this switching means is used in two devices in which the USB interface is continuously connected but the master-slave mode needs to be switched, an analog plugging method is also needed to repeatedly detect the access level of the USB interface, which not only increases the complexity of the device access detection, but also prolongs the detection time due to the added analog plugging step, thereby reducing the switching rate of the master-slave mode and the response speed of the device.
Disclosure of Invention
The invention provides a vehicle-mounted play source switching method, equipment and a storage medium, and solves the technical problems of long time consumption, low efficiency and high circuit manufacturing cost of the conventional master-slave mode switching means of USB equipment.
In order to solve the above technical problems, the present invention provides a method for switching a vehicle-mounted play source, including:
s1, receiving selection information of a target playing source and acquiring corresponding USB connection mode information;
s2, acquiring target mode information from the USB connection mode information, and adjusting a master-slave mode identifier according to the target mode information;
and S3, loading a corresponding USB driver according to the state of the master-slave mode identifier, and switching to the target play source.
According to the basic scheme, mode switching intentions (namely target mode information) of the user are directly extracted from the target playing source selected by the user, a traditional USB plug detection circuit is replaced by a data information extraction method, and the hardware composition of equipment is reduced and the production cost of the equipment is reduced while the mode switching intentions of the user are accurately judged; establishing a preset master-slave mode identifier, and forming a fixed joint relation between the state of the preset master-slave mode identifier and a host mode, so that the master-slave attribute of the current cached USB driver can be directly obtained according to the state of the master-slave mode identifier; meanwhile, the consistency judgment of the target mode and the default connection mode can be directly obtained by utilizing the operation of the master-slave mode identifier, so that the judgment of whether to reload the corresponding USB driver is obtained, and the repeated loading of the USB driver is reduced when the target mode is the same as the default connection mode, so that the switching speed of the master-slave mode is further improved.
In a further embodiment, said adjusting a master-slave mode identifier according to said target mode information comprises:
extracting a corresponding target mode from the target mode information;
judging whether the target mode is a host mode, if so, retaining the master-slave mode identifier or creating the master-slave mode identifier; if not, deleting the master-slave mode identifier or maintaining the original state of the master-slave mode identifier without existence.
According to the scheme, the state of the master-slave mode identifier is used as a basis for the joint relation between the state of the master-slave mode identifier and the host mode, the state of the master-slave mode identifier is adjusted according to the judgment of whether the target mode is the host mode, so that the existing states of the master-slave mode identifier and the host mode are consistent, and the visual judgment of whether the current USB connection mode is in the host state can be obtained through the judgment of the existence of the master-slave mode identifier, so that the detection program is reduced, and the response rate of the equipment is accelerated.
In a further embodiment, in the step S2, the loading the corresponding USB driver according to the state of the master-slave mode identifier includes:
if the master-slave mode identifier is in a reserved state or maintains the non-existent original state, loading a default USB driver;
if the master-slave mode identifier is in a creation state or a deletion state, resetting a USB bus power supply, and loading a USB driver corresponding to the target mode after restarting the USB bus.
The scheme realizes the direct comparison of whether the target mode is consistent with the default connection mode by judging the operation (whether the operation is in a modification state) of the identifiers of the master mode and the slave mode, and can directly adopt the default USB driving program when the operation is consistent with the default connection mode, thereby reducing the program loading process, shortening the play preparation time of a target play source and improving the response speed of equipment; when the USB driver and the host mode are inconsistent, the USB driver corresponding to the target mode is directly loaded according to the existence of the master-slave mode identifier by resetting the USB bus power supply and jumping to the state judgment step of the master-slave mode identifier, and the accurate acquisition of the USB driver corresponding to the target mode is realized by utilizing the joint relation between the state of the master-slave mode identifier and the host mode.
In a further embodiment, the master-slave mode identifier is a file node for identifying the host mode; and when the master-slave mode identifier exists, the current USB connection mode is represented as a master mode, otherwise, the current USB connection mode is represented as a slave mode.
According to the scheme, the master-slave mode identifier of the file node is preset to serve as the host mode identifier, and whether the current USB connection mode is the host mode can be effectively, visually and quickly judged by using the simple file node identifier, so that the comparison time between the target mode and the default connection mode is greatly shortened, and the reaction rate of equipment and the switching rate of the master-slave mode are further improved.
In a further embodiment, before the step S1, the method further includes:
and S0, reading the USB connection mode storage file, acquiring a default connection mode, and loading a corresponding USB driver.
According to the scheme, the default connection mode is prestored in the USB connection mode storage file, and the default connection mode is directly used and the corresponding USB driving program is loaded when the USB connection mode storage file is started, so that the loading time of the USB driving program can be greatly reduced when the target mode is the same as the default connection mode, the playing preparation time of the target playing source is shortened, and better use experience is provided for a user.
In a further embodiment, after the step S3, the method further includes:
and S4, replacing the USB connection mode of the target mode with the default connection mode, and saving the USB connection mode into the USB connection mode storage file.
According to the scheme, the default connection mode in the USB connection mode storage file is updated in real time, the standard default engraving setting in the traditional default setting is replaced, the current USB connection mode at each time is set to be the default connection mode, and the use psychology of unified processing of customers is predicted, so that the master-slave mode switching times are greatly reduced while the fast and accurate switching of the master-slave mode is realized, and the reaction time and flexibility of equipment are improved.
The invention also provides a vehicle-mounted play source switching system for operating the vehicle-mounted play source switching method, which comprises a vehicle-mounted central control system, wherein the vehicle-mounted central control system comprises a main control module, a storage module, a USB controller and a power supply module which are electrically connected;
the storage module is used for storing a master-slave mode switching program, a corresponding USB driver, a USB connection mode storage file, a master-slave mode identifier and selection information of a target playing source;
the main control module is used for responding to user operation, receiving selection information of the target playing source, calling the master-slave mode switching program according to the selection information, switching the USB connection mode of the vehicle-mounted central control system to a target mode and adjusting the state of the master-slave mode identifier; the USB driver is also used for loading a corresponding USB driver according to the state of the master-slave mode identifier;
the USB controller is used for responding to a switching instruction of the main control module, controlling the power supply on-off of a USB bus and unloading or loading the USB driver in a corresponding mode;
the power supply module is used for respectively providing power for the main control module, the storage module and the USB controller.
The basic scheme forms a switching mechanism integrating the master control module, the storage module and the USB controller in the vehicle-mounted central control system to detect the switching intention of the master mode and the slave mode and realize the switching operation by connecting, carries out real-time monitoring on the selection intention (the selection information of the target playing source) of a target control system icon on a control panel by a user, and realizes effective detection on the switching intention of the master mode and the slave mode of the equipment on the premise of not additionally arranging a USB interface detection circuit, thereby not only improving the detection precision of the equipment, but also greatly reducing the detection cost; the method comprises the steps of processing selection information by utilizing a preset master-slave mode switching program, directly obtaining consistency comparison between a target mode and a host mode and between the target mode and a default connection mode by judging the existence state and operation of a master-slave mode identifier, further controlling a USB controller to load a corresponding USB driving program and switching to a target playing source, and accordingly reducing repeated loading of the USB driving program when the target mode is consistent with the default connection mode, greatly reducing loading time of the USB driving program, shortening playing preparation time of the target playing source and giving better use experience to a user.
In a further embodiment, the USB connection mode storage file is for storing a default connection mode;
the USB connection mode comprises a host mode and a slave mode; the host mode is that the vehicle-mounted central control system serves as a host end, and an external USB device connected with the host end serves as a client end; the slave mode is that the vehicle-mounted central control system serves as a client side, and an external USB device connected with the client side serves as a host side;
the external USB equipment comprises a mobile phone and a tablet personal computer;
the master-slave mode switching program comprises instructions for executing the steps in the vehicle-mounted play source switching method;
when the main control module detects user operation, loading the default connection mode, responding to the user operation to receive corresponding selection information of the target playing source, substituting the selection information into the called master-slave mode switching program to obtain consistency judgment of a target mode and a host mode, if the two are consistent, adjusting the master-slave mode identifier to be in a present state, and if the two are not consistent, adjusting the master-slave mode identifier to be in a non-present state;
the master control module obtains a target mode and consistency judgment of the target mode and a default connection mode according to the operation of the master-slave mode identifier, and if the target mode and the default connection mode are consistent, the master control module is directly switched to the target playing source; if the two are not consistent, controlling the power module to reset the power supply of the USB bus, loading a USB driving program corresponding to the target mode and switching to the target playing source; and the main control module also takes the current target mode as an updated default connection mode and stores the updated default connection mode into a USB connection mode storage file of the storage module.
According to the scheme, the default connection mode is stored in the USB connection mode storage file of the storage module, the standard default engraving setting in the traditional default setting is replaced, the current USB connection mode at each time is replaced by the default connection mode, and the use psychology of the unified processing of customers is predicted, so that the switching times of the master mode and the slave mode are greatly reduced while the fast and accurate switching of the master mode and the slave mode is realized, and the reaction time and the flexibility of equipment are improved.
The invention also provides a vehicle-mounted playing source switching device which at least comprises the vehicle-mounted playing source switching system or runs the vehicle-mounted playing source switching method.
According to the invention, the master control module, the storage module and the USB controller are used for establishing the high-automation and high-precision master-slave mode automatic switching equipment, on the basis of utilizing the original components, the master-slave mode switching program is established, so that the purpose of accurately judging the user intention and quickly switching the master-slave mode of the USB equipment are realized, the USB interface detection circuit is deleted, the master-slave mode switching detection cost of the USB equipment is reduced, the playing preparation time of a target playing source is shortened, and the user is provided with better use experience.
Drawings
Fig. 1 is a flowchart of a method for switching a vehicle-mounted play source according to embodiment 1 of the present invention;
fig. 2 is a system framework diagram of a vehicle-mounted play source switching system according to embodiment 2 of the present invention;
fig. 3 is an icon schematic diagram of a display screen of a vehicle-mounted central control system according to embodiment 2 of the present invention;
wherein: the vehicle-mounted central control system comprises a vehicle-mounted central control system 1, a main control module 2, a storage module 3, a USB controller 4, a power module 5, an external USB device 6, a USB interface 7 and a display screen 8.
Detailed Description
The embodiments of the present invention will be described in detail below with reference to the accompanying drawings, which are given solely for the purpose of illustration and are not to be construed as limitations of the invention, including the drawings which are incorporated herein by reference and for illustration only and are not to be construed as limitations of the invention, since many variations thereof are possible without departing from the spirit and scope of the invention.
Example 1
An embodiment of the present invention provides a method for switching a vehicle-mounted play source, as shown in fig. 1, in order to solve the above technical problems, the method includes:
and S0, reading the USB connection mode storage file, acquiring a default connection mode, and loading a corresponding USB driver.
S1, receiving selection information of a target playing source and acquiring corresponding USB connection mode information;
s2, acquiring target mode information from the USB connection mode information, and adjusting a master-slave mode identifier according to the target mode information;
and S3, loading a corresponding USB driver according to the state of the master-slave mode identifier, and switching to the target play source.
And S4, updating the USB connection mode of the target mode to the default connection mode, and saving the USB connection mode to the USB connection mode storage file.
In the embodiment, the mode switching intention (namely the target mode information) of the user is directly extracted from the target playing source selected by the user, and the traditional USB plug detection circuit is replaced by the data information extraction method, so that the mode switching intention of the user is accurately judged, meanwhile, the hardware composition of equipment is reduced, and the production cost of the equipment is reduced; establishing a preset master-slave mode identifier, and forming a fixed joint relation between the state of the preset master-slave mode identifier and a host mode, so that the master-slave attribute of the current cached USB driver can be directly obtained according to the state of the master-slave mode identifier; meanwhile, the consistency judgment of the target mode and the default connection mode can be directly obtained by utilizing the operation of the master-slave mode identifier, so that the judgment of whether to reload the corresponding USB driver is obtained, the automatic output control from the mode switching intention of the user to the master-slave mode switching is finally realized, and the repeated loading of the USB driver is reduced when the target mode is the same as the default connection mode, so that the switching speed of the master-slave mode is further improved.
In this embodiment, in step S0, the present solution pre-stores the default connection mode in the USB connection mode storage file, and directly uses the default connection mode and loads the corresponding USB driver when starting, so that when the target mode is the same as the default connection mode, the loading time of the USB driver is greatly reduced, the play preparation time of the target play source is shortened, and a better use experience is provided for a user.
In step S0, if there is a default connection mode saved for the last time, the default connection mode is loaded; and if the default connection mode stored for the last time does not exist, loading the default USB connection mode of the system leaving the factory, namely the host mode.
In this embodiment, in step S4, the present scheme replaces the standard default template setting in the conventional default setting by updating the default connection mode in the USB connection mode storage file in real time, sets the current USB connection mode at each time as the default connection mode, and predicts the use psychology handled by the client in a unified manner, so that the fast and accurate switching between the master mode and the slave mode is achieved, the number of times of switching between the master mode and the slave mode is greatly reduced, and the response time and flexibility of the device are improved.
In this embodiment, in step S2, the adjusting the master-slave mode identifier according to the target mode information includes:
extracting a corresponding target mode from the target mode information;
judging whether the target mode is a host mode, if so, retaining the master-slave mode identifier or creating the master-slave mode identifier; if not, deleting the master-slave mode identifier or maintaining the original state of the master-slave mode identifier without existence.
According to the scheme, the state of the master-slave mode identifier is used as a basis for the joint relation between the state of the master-slave mode identifier and the host mode, the state of the master-slave mode identifier is adjusted according to the judgment of whether the target mode is the host mode, so that the existing states of the master-slave mode identifier and the host mode are consistent, and the intuitive judgment of whether the current USB connection mode is in the host state can be obtained through the judgment of the existence of the master-slave mode identifier, so that the detection program of the program is reduced, and the response rate of the equipment is accelerated.
In this embodiment, in step S3, the loading the corresponding USB driver according to the state of the master-slave mode identifier includes:
if the master-slave mode identifier is in a reserved state or maintains the non-existent original state, loading a default USB driver;
if the master-slave mode identifier is in a creation state or a deletion state, resetting a USB bus power supply, and loading a USB driver corresponding to the target mode after restarting the USB bus.
The scheme realizes the direct comparison of whether the target mode is consistent with the default connection mode by judging the operation (whether the operation is in a modification state) of the identifiers of the master mode and the slave mode, and can directly adopt the default USB driving program when the operation is consistent with the default connection mode, thereby reducing the program loading process, shortening the play preparation time of a target play source and improving the response speed of equipment; when the USB driver and the host mode are inconsistent, the USB driver corresponding to the target mode is accurately acquired by resetting the USB bus power supply, jumping to the state judgment step of the master-slave mode identifier, loading the USB driver corresponding to the target mode according to the existence of the master-slave mode identifier, and utilizing the joint relation between the state of the master-slave mode identifier and the host mode.
In this embodiment, the master-slave mode identifier is a file node, and is used to identify the host mode; and when the master-slave mode identifier exists, the current USB connection mode is represented as a master mode, otherwise, the current USB connection mode is represented as a slave mode.
According to the scheme, the master-slave mode identifier of the file node is preset to serve as the host mode identifier, and whether the current USB connection mode is the host mode can be effectively, visually and quickly judged by using the simple file node identifier, so that the comparison time between the target mode and the default connection mode is greatly shortened, and the reaction rate of equipment and the switching rate of the master-slave mode are further improved.
In this embodiment, the receiving of the selection information of the target play source specifically includes: and acquiring the selection intention of a user on the target control system icon on the control panel, and selecting the corresponding selection information of the target playing source according to the selection intention.
Referring to fig. 3, the control panel includes a display screen 8 of the vehicle-mounted central control system 1, and the user selects a related target play source by using icons on the display screen 8, where the icons include, but are not limited to, an iPhone icon (representing an iPhone mobile phone), a Carplay icon (apple car system), and a carplife icon (hundred degree car networking system). The obtaining of the user selection intention includes but is not limited to mouse click obtaining, touch screen click obtaining and button click obtaining.
According to the scheme, the acquisition of the switching intention of a user in the master-slave mode is realized by acquiring the selected information of the target control system icon on the control panel, the detection of the current of the USB interface 7 by the traditional USB plug-pull detection circuit is replaced by the acquisition of data information, the complex and expensive hardware current judgment is replaced by the simple and convenient contact judgment, the cost of hardware equipment is reduced while the accurate judgment of the switching intention of the master-slave mode is realized, and the method is more suitable for the continuous connection of the USB interface 7 and the connection relation of equipment needing to be switched in the master-slave mode.
The USB connection mode comprises a host mode and a slave mode; the host mode is that the vehicle-mounted central control system 1 serves as a host end, and an external USB device 6 connected with the host end serves as a client end; the slave mode is that the vehicle-mounted central control system 1 serves as a client side, and an external USB device 6 connected with the client side serves as a host side.
The embodiment of the invention takes a vehicle-mounted central control system 1 and an iPhone mobile phone as an example, and the switching working principle is as follows:
the default vehicle-mounted central control system 1 is connected with the iPhone through a USB interface 7, and at the moment, the vehicle-mounted central control system 1 reads a USB connection mode storage file, acquires the default connection mode and loads a corresponding USB driver.
When a user clicks an iPhone icon and needs to switch a master mode and a slave mode, receiving selection information of a target playing source from the iPhone icon, confirming corresponding USB connection mode information, and extracting the target mode from the USB connection mode information to be a slave mode; and comparing the target mode with the host mode to obtain inconsistent comparison results. Judging the state of the master-slave mode identifier, if the master-slave mode identifier exists, judging that the current default connection mode is the master mode, deleting the master-slave mode identifier, resetting a USB bus power supply, and after restarting a USB bus, loading a USB driver corresponding to the slave mode and switching to the target play source; if the identifier does not exist, the current default connection mode is judged to be the slave mode, the original state of the master-slave mode identifier which does not exist is maintained, and the target playing source is directly switched to.
And finally, updating the target mode (slave mode) to the default connection mode, and saving the target mode (slave mode) to the USB connection mode storage file.
Thus, the master-slave mode switching is finished.
Example 2
Referring to fig. 2, an embodiment of the present invention further provides a vehicle-mounted play source switching system for operating the vehicle-mounted play source switching method, including a vehicle-mounted central control system 1, where the vehicle-mounted central control system 1 includes a main control module 2, a storage module 3, a USB controller 4, and a power module 5, which are electrically connected;
the storage module 3 is used for storing a master-slave mode switching program, a corresponding USB driver, a USB connection mode storage file, a master-slave mode identifier and selection information of a target playing source;
the main control module 2 is used for responding to user operation, receiving selection information of the target playing source, calling the master-slave mode switching program according to the selection information, switching the USB connection mode of the vehicle-mounted central control system 1 and the external USB equipment 6 to a target mode, and adjusting the state of the master-slave mode identifier; the USB driver is also used for loading a corresponding USB driver according to the state of the master-slave mode identifier;
the USB controller 4 is used for responding to a switching instruction of the main control module 2, controlling the power supply on-off of a USB bus and unloading or loading the USB driver in a corresponding mode;
the power module 5 is used for respectively providing power for the main control module 2, the storage module 3 and the USB controller 4.
In the embodiment, an original main control module 2, a storage module 3 and a USB controller 4 in a vehicle-mounted central control system 1 are connected to form a switching mechanism integrating the detection of master-slave mode switching intentions and realizing the switching operation, so that the selection intention (the selection information of a target playing source) of a target control system icon on a control panel by a user is monitored in real time, and the effective detection of the master-slave mode switching intention of equipment is realized on the premise of not additionally arranging a USB interface detection circuit, thereby not only improving the detection precision of the equipment, but also greatly reducing the detection cost; the selection information is processed by a preset master-slave mode switching program, consistency comparison between a target mode and a host mode and consistency comparison between the target mode and a default connection mode can be directly obtained by judging the existence state and operation of a master-slave mode identifier, and the USB controller 4 is further controlled to load a corresponding USB driving program and switch to a target playing source, so that when the target mode is consistent with the default connection mode, the loading time of the USB driving program is greatly reduced, the playing preparation time of the target playing source is shortened, and better use experience is provided for a user by reducing repeated loading of the USB driving program.
In this embodiment, the USB connection mode storage file is used to store a default connection mode;
the USB connection mode comprises a host mode and a slave mode; the host mode is that the vehicle-mounted central control system 1 serves as a host end, and an external USB device 6 connected with the host end serves as a client end; the slave mode is that the vehicle-mounted central control system 1 serves as a client side, and an external USB device 6 connected with the client side serves as a host side;
the external USB device 6 comprises but is not limited to a mobile phone and a tablet computer;
the master-slave mode switching program includes instructions for executing the steps in the consistent vehicle-mounted play source switching method provided in embodiment 1 above;
when the main control module 2 detects user operation, loading the default connection mode, responding to the user operation to receive corresponding selection information of the target playing source, substituting the selection information into the called master-slave mode switching program to obtain consistency judgment of a target mode and a host mode, if the two are consistent, adjusting the master-slave mode identifier to be in a present state, and if the two are not consistent, adjusting the master-slave mode identifier to be in a non-present state;
the main control module 2 obtains a target mode and consistency judgment of the target mode and a default connection mode according to the operation of the master-slave mode identifier, and if the target mode and the default connection mode are consistent, the target mode is directly switched to the target playing source; if the two are not consistent, controlling the power module 5 to reset the power supply of the USB bus, and loading a USB driver corresponding to the target mode to switch to the target playing source; and finally, the main control module 2 replaces the current target mode with a default connection mode and stores the default connection mode into a USB connection mode storage file of the storage module 3.
In the embodiment, the default connection mode is stored in the USB connection mode storage file of the storage module 3, instead of the standard default engraving setting in the conventional default setting, the current USB connection mode at each time is set as the default connection mode, and the use psychology of the unified processing of the client is predicted, so that the switching times of the master mode and the slave mode are greatly reduced while the fast and accurate switching of the master mode and the slave mode is realized, and the reaction time and the flexibility of the device are improved.
Referring to fig. 3, the main control module 2 detects a user operation through a control panel of the vehicle-mounted central control system 1, the control panel includes but is not limited to a display screen 8, and a user selects a related target play source through an icon on the display screen 8 by a motor, the icon includes but is not limited to an iPhone icon (representing an iPhone mobile phone), a Carplay icon (apple car system), and a carplife icon (a hundred-degree car networking system).
The master-slave mode switching system provided by the embodiment of the invention has the following working principle:
the default vehicle-mounted central control system 1 is connected with the iPhone through a USB interface 7, and at the moment, the vehicle-mounted central control system 1 reads a USB connection mode storage file, acquires the default connection mode and loads a corresponding USB driver.
When a user clicks an iPhone icon and needs to switch a master-slave mode, the master control module 2 responds to the user operation to receive selection information of the corresponding target playing source, substitutes the selection information into a master-slave mode switching program to obtain that the target mode is a slave mode, so that when the default connection mode is a master mode, the power supply module 5 is controlled to reset the power supply of a USB bus (a USB interface 7), a USB driving program corresponding to the target mode is loaded, and the USB driving program is switched to the target playing source; and when the default connection mode is the slave mode, directly switching to the target playing source.
And finally, the main control module 2 replaces the current target mode with a default connection mode and stores the default connection mode into a USB connection mode storage file of the storage module 3.
Thus, the master-slave mode switching is finished.
Example 3
An embodiment of the present invention further provides a vehicle-mounted playback source switching device, which at least includes the vehicle-mounted playback source switching system according to embodiment 2, or operates the vehicle-mounted playback source switching method according to embodiment 1.
In the embodiment, highly automatic and high-precision master-slave mode automatic switching equipment is established through the master control module 2, the storage module 3 and the USB controller 4, on the basis of utilizing original components, accurate judgment on user intention and quick switching of the master-slave mode of the USB equipment are realized through establishing a master-slave mode switching program, the switching detection cost of the master-slave mode of the USB equipment is reduced through deleting a USB interface 7 detection circuit, the playing preparation time of a target playing source is shortened, and therefore, better use experience is provided for users.
The above embodiments are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and all such changes, modifications, substitutions, combinations, and simplifications are intended to be included in the scope of the present invention.
Claims (9)
1. A vehicle-mounted play source switching method is characterized by comprising the following steps:
s1, receiving selection information of a target playing source and acquiring corresponding USB connection mode information;
s2, acquiring target mode information from the USB connection mode information, and adjusting a master-slave mode identifier according to the target mode information;
and S3, loading a corresponding USB driver according to the state of the master-slave mode identifier, and switching to the target play source.
2. The method for switching vehicular playback sources of claim 1, wherein in step S2, said adjusting the master-slave mode identifier according to the target mode information comprises:
extracting a corresponding target mode from the target mode information;
judging whether the target mode is a host mode, if so, retaining the master-slave mode identifier or creating the master-slave mode identifier; if not, deleting the master-slave mode identifier or maintaining the original state of the master-slave mode identifier without existence.
3. The method as claimed in claim 2, wherein in step S3, said loading a corresponding USB driver according to the status of the master-slave mode identifier includes:
if the master-slave mode identifier is in a reserved state or maintains the non-existent original state, loading a default USB driver;
if the master-slave mode identifier is in a creation state or a deletion state, resetting a USB bus power supply, and loading a USB driver corresponding to the target mode after restarting the USB bus.
4. The vehicle-mounted play source switching method according to claim 2, characterized in that: the master-slave mode identifier is a file node and is used for identifying the host mode; and when the master-slave mode identifier exists, representing that the current USB connection mode is the master mode, otherwise, representing that the current USB connection mode is the slave mode.
5. The vehicle-mounted playing source switching method according to claim 1, before said step S1, further comprising:
and S0, reading the USB connection mode storage file, acquiring a default connection mode, and loading a corresponding USB driver.
6. The vehicle-mounted playing source switching method according to claim 5, further comprising, after the step S3:
and S4, replacing the USB connection mode of the target mode with the default connection mode, and saving the USB connection mode into the USB connection mode storage file.
7. The utility model provides a vehicle-mounted play source switching system, includes vehicle-mounted center control system, its characterized in that: the vehicle-mounted central control system comprises a main control module, a storage module, a USB controller and a power supply module which are electrically connected;
the storage module is used for storing a master-slave mode switching program, a corresponding USB driver, a USB connection mode storage file, a master-slave mode identifier and selection information of a target playing source;
the main control module is used for responding to user operation, receiving selection information of the target playing source, calling the master-slave mode switching program according to the selection information, switching the USB connection mode of the vehicle-mounted central control system to a target mode and adjusting the state of the master-slave mode identifier; the USB driver is also used for loading a corresponding USB driver according to the state of the master-slave mode identifier;
the USB controller is used for responding to a switching instruction of the main control module, controlling the power supply on-off of a USB bus and unloading or loading the USB driver in a corresponding mode;
the power supply module is used for respectively providing power for the main control module, the storage module and the USB controller.
8. The vehicle-mounted play source switching system according to claim 7, wherein:
the USB connection mode storage file is used for storing a default connection mode;
the USB connection mode comprises a host mode and a slave mode; the host mode is that the vehicle-mounted central control system serves as a host end, and an external USB device connected with the host end serves as a client end; the slave mode is that the vehicle-mounted central control system serves as a client side, and an external USB device connected with the client side serves as a host side;
the master-slave mode switching program comprising instructions for carrying out the steps of the method according to any one of claims 1 to 7;
when the main control module detects user operation, loading the default connection mode, responding to the user operation to receive corresponding selection information of the target playing source, substituting the selection information into the called master-slave mode switching program to obtain consistency judgment of a target mode and a host mode, if the two are consistent, adjusting the master-slave mode identifier to be in a present state, and if the two are not consistent, adjusting the master-slave mode identifier to be in a non-present state;
the master control module obtains a target mode and consistency judgment of the target mode and a default connection mode according to the operation of the master-slave mode identifier, and if the target mode and the default connection mode are consistent, the master control module is directly switched to a target playing source; if the two are not consistent, controlling the power module to reset the power supply of the USB bus, loading a USB driving program corresponding to the target mode and switching to the target playing source; and the main control module also takes the current target mode as an updated default connection mode and stores the updated default connection mode into a USB connection mode storage file of the storage module.
9. A vehicle-mounted play source switching device is characterized in that: at least comprising a vehicle-mounted playing source switching system as claimed in any one of claims 7 to 8, or operating a vehicle-mounted playing source switching method as claimed in any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010466706.2A CN111823863B (en) | 2020-05-28 | 2020-05-28 | Vehicle-mounted play source switching method, system and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010466706.2A CN111823863B (en) | 2020-05-28 | 2020-05-28 | Vehicle-mounted play source switching method, system and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111823863A true CN111823863A (en) | 2020-10-27 |
CN111823863B CN111823863B (en) | 2021-11-16 |
Family
ID=72914056
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010466706.2A Active CN111823863B (en) | 2020-05-28 | 2020-05-28 | Vehicle-mounted play source switching method, system and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111823863B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113419515A (en) * | 2021-06-22 | 2021-09-21 | 上海星融汽车科技有限公司 | Master-slave mode switching method, electronic equipment and vehicle diagnostic instrument |
JP2022114441A (en) * | 2021-01-26 | 2022-08-05 | 創惟科技股▲ふん▼有限公司 | Switching method of universal serial bus switch for in-vehicle host system |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102662898A (en) * | 2012-04-06 | 2012-09-12 | 华为技术有限公司 | Host-slave compatibility method, device and system for USB (universal serial bus) device |
CN103809979A (en) * | 2014-02-25 | 2014-05-21 | 南京南瑞继保电气有限公司 | Man-machine interaction software module integration system and implementing method thereof |
CN106066842A (en) * | 2016-05-30 | 2016-11-02 | 上海华为技术有限公司 | A kind of method of switch mode, SOC(system on a chip) and base station |
CN106547705A (en) * | 2016-10-25 | 2017-03-29 | 北京小米移动软件有限公司 | USB (universal serial bus) operating mode control method and device |
CN106909087A (en) * | 2017-04-14 | 2017-06-30 | 广州亚美信息科技有限公司 | A kind of USB switching systems based on WiFi |
CN107070727A (en) * | 2017-05-23 | 2017-08-18 | 上海斐讯数据通信技术有限公司 | The USB mode switching method and system of a kind of router |
CN107678996A (en) * | 2017-09-26 | 2018-02-09 | 深圳市汉普电子技术开发有限公司 | Determination method, USB device and the storage medium of USB mode |
CN109408418A (en) * | 2017-08-17 | 2019-03-01 | 深圳市中兴微电子技术有限公司 | A kind of USB mode switching device and method, USB device |
-
2020
- 2020-05-28 CN CN202010466706.2A patent/CN111823863B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102662898A (en) * | 2012-04-06 | 2012-09-12 | 华为技术有限公司 | Host-slave compatibility method, device and system for USB (universal serial bus) device |
CN103809979A (en) * | 2014-02-25 | 2014-05-21 | 南京南瑞继保电气有限公司 | Man-machine interaction software module integration system and implementing method thereof |
CN106066842A (en) * | 2016-05-30 | 2016-11-02 | 上海华为技术有限公司 | A kind of method of switch mode, SOC(system on a chip) and base station |
CN106547705A (en) * | 2016-10-25 | 2017-03-29 | 北京小米移动软件有限公司 | USB (universal serial bus) operating mode control method and device |
CN106909087A (en) * | 2017-04-14 | 2017-06-30 | 广州亚美信息科技有限公司 | A kind of USB switching systems based on WiFi |
CN107070727A (en) * | 2017-05-23 | 2017-08-18 | 上海斐讯数据通信技术有限公司 | The USB mode switching method and system of a kind of router |
CN109408418A (en) * | 2017-08-17 | 2019-03-01 | 深圳市中兴微电子技术有限公司 | A kind of USB mode switching device and method, USB device |
CN107678996A (en) * | 2017-09-26 | 2018-02-09 | 深圳市汉普电子技术开发有限公司 | Determination method, USB device and the storage medium of USB mode |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2022114441A (en) * | 2021-01-26 | 2022-08-05 | 創惟科技股▲ふん▼有限公司 | Switching method of universal serial bus switch for in-vehicle host system |
JP7235421B2 (en) | 2021-01-26 | 2023-03-08 | 創惟科技股▲ふん▼有限公司 | Switching method of universal serial bus switch for in-vehicle host system |
CN113419515A (en) * | 2021-06-22 | 2021-09-21 | 上海星融汽车科技有限公司 | Master-slave mode switching method, electronic equipment and vehicle diagnostic instrument |
Also Published As
Publication number | Publication date |
---|---|
CN111823863B (en) | 2021-11-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3575962B1 (en) | Method and device for preloading application, storage medium and intelligent terminal | |
US20190370603A1 (en) | Method and apparatus for establishing an application prediction model, storage medium and terminal | |
CN109062467B (en) | Split screen application switching method and device, storage medium and electronic equipment | |
CN111823863B (en) | Vehicle-mounted play source switching method, system and equipment | |
CN111142711B (en) | Firmware configuration method and device, storage medium and mobile terminal | |
CN108388451B (en) | Mobile terminal starting method and device and mobile terminal | |
JP2016500175A (en) | Method and apparatus for realizing floating object | |
CN102647515B (en) | Terminal state displaying control method and device | |
CN108984089B (en) | Touch operation method and device, storage medium and electronic equipment | |
CN111277991B (en) | Operator name display method and device, mobile terminal and storage medium | |
CN112578967B (en) | Chart information reading method and mobile terminal | |
EP2869604B1 (en) | Method, apparatus and device for processing a mobile terminal resource | |
WO2018085992A1 (en) | Charging state indication method, charging state indication system, and terminal device | |
CN103677239A (en) | Wireless display terminal control method and device | |
CN215599311U (en) | Chip testing device | |
CN112769210B (en) | Electronic device and charging method thereof | |
CN108170211B (en) | Camera power-on driving method and electronic terminal | |
CN110570830B (en) | Equipment adjusting method and device, storage medium and electronic equipment | |
CN116860219A (en) | Multi-board sharing method of CPLD firmware and related components | |
CN110970954B (en) | Charging control method and device, storage medium and split type electronic equipment | |
CN106155733B (en) | Method and device for running application program | |
CN112035130A (en) | Program burning method and device based on industrial control screen and computer equipment | |
CN114168482A (en) | Test method of vehicle control unit | |
CN109032728B (en) | UI (user interface) display method, intelligent terminal and computer-readable storage medium | |
CN113835555A (en) | Touch screen adjusting method and device, storage medium and terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |