CN113419515A - Master-slave mode switching method, electronic equipment and vehicle diagnostic instrument - Google Patents
Master-slave mode switching method, electronic equipment and vehicle diagnostic instrument Download PDFInfo
- Publication number
- CN113419515A CN113419515A CN202110691722.6A CN202110691722A CN113419515A CN 113419515 A CN113419515 A CN 113419515A CN 202110691722 A CN202110691722 A CN 202110691722A CN 113419515 A CN113419515 A CN 113419515A
- Authority
- CN
- China
- Prior art keywords
- mode
- master
- slave
- executing
- switching method
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 21
- 238000003745 diagnosis Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B23/00—Testing or monitoring of control systems or parts thereof
- G05B23/02—Electric testing or monitoring
- G05B23/0205—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
- G05B23/0259—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the response to fault detection
- G05B23/0262—Confirmation of fault detection, e.g. extra checks to confirm that a failure has indeed occurred
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/24—Pc safety
- G05B2219/24065—Real time diagnostics
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Test And Diagnosis Of Digital Computers (AREA)
Abstract
The invention provides a master-slave mode switching method, electronic equipment and a vehicle diagnostic apparatus.
Description
Technical Field
The invention belongs to the technical field of mode switching, and particularly relates to a master-slave mode switching method, electronic equipment and a vehicle diagnostic apparatus.
Background
With the rapid development of computers and mobile internet, intelligent devices bring much convenience to the work and life of people. The development and utilization of the method are always the focus of the researchers, and the method develops towards the direction of convenience and rapidness.
Android (Android) is a Linux-based operating system, and due to the special openness and freedom of the operating system, the operating system is widely applied to devices of mobile device terminals, such as smart phones and tablets, and even microsoft computers in recent years run. In the modern times, the android system is widely applied in our daily life.
Android equipment, like vehicle diagnostic device's host computer when debugging development and diagnosis, need connect computer and lower computer respectively, need carry out the switching of system principal and subordinate equipment identity this moment, often will withdraw from the switching that appointed page could just carry out the identity, and user operation is got up complicacy consuming time, and is extremely inconvenient.
Disclosure of Invention
Therefore, aiming at the technical problems, the master-slave mode switching method, the electronic equipment and the vehicle diagnostic apparatus are provided quickly and conveniently.
In order to solve the technical problems, the invention adopts the following technical scheme:
in one aspect, a master-slave mode switching method is provided, and includes:
s101, displaying a mode change-over switch through a screen resident tool;
s102, responding to the operation of a user on the mode switch, performing matching judgment on the operation, executing a step S103 if the operation represents that a master device mode is opened, and executing a step S104 if the operation represents that a slave device mode is opened;
s103, opening a system main equipment mode;
and S104, opening a system slave device mode.
In another aspect, an electronic device is provided, which includes a storage module including instructions loaded and executed by a processor, where the instructions, when executed, cause the processor to execute one of the above-described master-slave mode switching methods.
In another aspect, a vehicle diagnostic apparatus is provided, which includes an upper computer and a lower computer, and is characterized in that the upper computer is the electronic device.
According to the invention, the screen resident tool display mode switch is adopted, so that a user can switch the master mode and the slave mode of the system on any page, the operation is fast and convenient, and the use experience of the user is improved.
Drawings
The invention is described in detail below with reference to the following figures and detailed description:
FIG. 1 is a flow chart of the present invention.
Detailed Description
As shown in fig. 1, an embodiment of the present specification provides a master-slave mode switching method, including:
s101, displaying a mode switch through a screen resident tool.
In this embodiment, the screen-resident tool is a floating window or a side pull menu, and the side pull menu is a pull-down menu, and the screen-resident tool is started along with the startup, or started along with the application program, for example, the screen-resident tool can be started along with the startup of the upper computer of the diagnostic apparatus, or started along with the vehicle diagnostic program on the upper computer.
The mode switch may take various forms, such as clicking a button, sliding a slider, or selecting a frame.
Taking the floating window as an example, the creation process is as follows:
creating a starting page MainActivity, and configuring android, permission, RECEIVE-BOOT-COMPLETED in a manifest file;
adding startup BroadcastReceiver and registering the startup BroadcastReceiver to a list file;
after the page is started, applying for floating window authority android, settings, access, MANAGE-OVERLAY-PERMISSION and starting-up authority;
and after the authority application is successful, the suspended window service MainService is started, and after the service is started, the suspended window can be displayed.
And S102, responding to the operation of the mode switch by the user, performing matching judgment on the operation, executing the step S103 if the operation represents that the master equipment mode is turned on, and executing the step S104 if the operation represents that the slave equipment mode is turned on.
For the click button, in order to prevent the misoperation, the step S102 further includes:
1. and calculating the time difference between the current click event and the last click event. A click event occurs when a user clicks a button.
2. And judging whether the time difference is greater than a threshold value, if so, matching the current user operation, and if not, ignoring the current user operation, wherein the threshold value can be set to be 1 second.
S103, opening a system main device mode:
the first script is executed, and the first script sends a first parameter representing the mode of opening the main equipment to the system.
S104, opening a system slave device mode:
and executing a second script, wherein the second script sends a second parameter representing the opening of the slave device mode to the system.
For the android system, the application program cannot directly call the system kernel program, and therefore, the call is indirectly carried out through the first script and the second script.
In this embodiment, the master device mode is a USB master device mode, the slave device mode is a USB slave device mode, when the first script is executed, the first script sends a first parameter to a rk _ USB _ force _ mode command of the system, after receiving the first parameter, the command enables the system to supply power to a USB serial bus of the device, the device enters the USB master device mode to supply power to a slave device connected to the USB serial bus, when the second script is executed, the second script sends a second parameter to the rk _ USB _ force _ mode command of the system, after receiving the second parameter, the device enters the slave device mode, and the USB serial bus of the connected master device supplies power.
Based on the same inventive concept, embodiments of the present specification further provide an electronic device, including a storage module, where the storage module includes instructions loaded and executed by a processor, and the instructions, when executed, cause the processor to perform steps according to various exemplary embodiments of the present invention described in the above-mentioned one master-slave mode switching method section of the present specification.
The memory module may include a readable medium in the form of a volatile memory unit, such as a random access memory unit (RAM) and/or a cache memory unit, and may further include a read only memory unit (ROM).
In this embodiment, the electronic device is an upper computer of a vehicle diagnostic apparatus, such as a smart phone or a tablet computer.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Based on the same inventive concept, the embodiment of the present specification further provides a vehicle diagnostic apparatus, which includes an upper computer and a lower computer, wherein the upper computer is the electronic device, and details are not repeated herein.
In an actual application scenario, when the upper computer is used as a slave device, the upper computer is connected with the computer for starting debugging, and when the upper computer is used as a master device, the upper computer is connected with the lower computer for diagnosing the vehicle.
However, those skilled in the art should realize that the above embodiments are illustrative only and not limiting to the present invention, and that changes and modifications to the above described embodiments are intended to fall within the scope of the appended claims, provided they fall within the true spirit of the present invention.
Claims (10)
1. A master-slave mode switching method is characterized by comprising the following steps:
s101, displaying a mode change-over switch through a screen resident tool;
s102, responding to the operation of a user on the mode switch, performing matching judgment on the operation, executing a step S103 if the operation represents that a master device mode is opened, and executing a step S104 if the operation represents that a slave device mode is opened;
s103, opening a system main equipment mode;
and S104, opening a system slave device mode.
2. The method as claimed in claim 1, wherein the screen-resident tool is started with boot or application.
3. A method as claimed in claim 2, wherein the screen-resident tool is a floating window or a side-pull menu.
4. A method according to claim 3, wherein the mode switch is a click button, a slider or a frame.
5. The method according to claim 4, wherein for clicking a button, the step S102 further comprises:
calculating the time difference between the current click event and the last click event;
and judging whether the time difference is larger than a threshold value, if so, matching the operation, and if not, ignoring the operation.
6. A method according to claim 1 or 5, wherein said step S103 further comprises:
executing a first script that sends a first parameter representing turning on a master mode to a system.
7. The method according to claim 6, wherein the step S104 further comprises:
executing a second script that sends a second parameter to the system representing opening of the slave device mode.
8. A method according to claim 7, wherein the master mode is a USB master mode, and the slave mode is a USB slave mode.
9. An electronic device comprising a memory module, said memory module comprising instructions loaded and executed by a processor, said instructions when executed cause said processor to perform a master-slave mode switching method according to any of claims 1-8.
10. A vehicle diagnostic apparatus comprises an upper computer and a lower computer, wherein the upper computer is an electronic device according to claim 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110691722.6A CN113419515A (en) | 2021-06-22 | 2021-06-22 | Master-slave mode switching method, electronic equipment and vehicle diagnostic instrument |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110691722.6A CN113419515A (en) | 2021-06-22 | 2021-06-22 | Master-slave mode switching method, electronic equipment and vehicle diagnostic instrument |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113419515A true CN113419515A (en) | 2021-09-21 |
Family
ID=77789885
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110691722.6A Pending CN113419515A (en) | 2021-06-22 | 2021-06-22 | Master-slave mode switching method, electronic equipment and vehicle diagnostic instrument |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113419515A (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6281457B1 (en) * | 2000-03-16 | 2001-08-28 | Aten International Co., Ltd. | Power switch apparatus of universal serial bus device |
CN101944074A (en) * | 2010-07-05 | 2011-01-12 | 中兴通讯股份有限公司 | Method and device for realizing OTG based on USB socket |
CN101989246A (en) * | 2009-07-29 | 2011-03-23 | 鸿富锦精密工业(深圳)有限公司 | Electronic device capable of automatically switching master and slave equipment modes of universal serial bus (USB) |
CN103220485A (en) * | 2012-01-18 | 2013-07-24 | 腾讯科技(深圳)有限公司 | Displayed video picture rotating method and system |
CN105183309A (en) * | 2015-08-13 | 2015-12-23 | 小米科技有限责任公司 | Switching control method and device |
CN105183274A (en) * | 2015-08-13 | 2015-12-23 | 小米科技有限责任公司 | Switching control method and device |
CN107196409A (en) * | 2016-03-14 | 2017-09-22 | 浙江正泰电器股份有限公司 | The intelligent controller of breaker |
CN111823863A (en) * | 2020-05-28 | 2020-10-27 | 惠州华阳通用电子有限公司 | Vehicle-mounted play source switching method, system and equipment |
CN112540825A (en) * | 2020-12-02 | 2021-03-23 | 上海星融汽车科技有限公司 | Data receiving and transmitting method and system for diagnostic software in virtual machine |
-
2021
- 2021-06-22 CN CN202110691722.6A patent/CN113419515A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6281457B1 (en) * | 2000-03-16 | 2001-08-28 | Aten International Co., Ltd. | Power switch apparatus of universal serial bus device |
CN101989246A (en) * | 2009-07-29 | 2011-03-23 | 鸿富锦精密工业(深圳)有限公司 | Electronic device capable of automatically switching master and slave equipment modes of universal serial bus (USB) |
CN101944074A (en) * | 2010-07-05 | 2011-01-12 | 中兴通讯股份有限公司 | Method and device for realizing OTG based on USB socket |
CN103220485A (en) * | 2012-01-18 | 2013-07-24 | 腾讯科技(深圳)有限公司 | Displayed video picture rotating method and system |
CN105183309A (en) * | 2015-08-13 | 2015-12-23 | 小米科技有限责任公司 | Switching control method and device |
CN105183274A (en) * | 2015-08-13 | 2015-12-23 | 小米科技有限责任公司 | Switching control method and device |
CN107196409A (en) * | 2016-03-14 | 2017-09-22 | 浙江正泰电器股份有限公司 | The intelligent controller of breaker |
CN111823863A (en) * | 2020-05-28 | 2020-10-27 | 惠州华阳通用电子有限公司 | Vehicle-mounted play source switching method, system and equipment |
CN112540825A (en) * | 2020-12-02 | 2021-03-23 | 上海星融汽车科技有限公司 | Data receiving and transmitting method and system for diagnostic software in virtual machine |
Non-Patent Citations (1)
Title |
---|
马宏锋: "《微机原理与接口技术——基于8086和Proteus仿真》", 31 December 2016 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3160150A1 (en) | Electronic device and method for executing function using speech recognition thereof | |
CN108509333A (en) | Adjustment method and device | |
CN113792278A (en) | Method and device for displaying application and picture and electronic equipment | |
US11455075B2 (en) | Display method when application is exited and terminal | |
CN112465466B (en) | Method, device, computer equipment and storage medium for executing flow task | |
CN111625312A (en) | APP skin changing method and device, electronic equipment and storage medium | |
CN112506854A (en) | Method, device, equipment and medium for storing page template file and generating page | |
CN114489350B (en) | Input method calling method and related equipment | |
CN112199135A (en) | Information guiding method, device, electronic equipment and storage medium | |
CN105786321B (en) | A kind of function switching method and device | |
CN104915228A (en) | Application program language setting method and device | |
CN108241510B (en) | Display card switching method | |
CN110442499A (en) | Test, the method and apparatus for improving page response performance, terminal device | |
EP3699731A1 (en) | Method and device for calling input method, and server and terminal | |
US11328706B2 (en) | System and method for multilingual conversion of text data to speech data | |
CN116467221B (en) | Pile inserting method and system based on interpreter and related electronic equipment | |
CN112286419B (en) | Method, device, terminal and storage medium for loading list data | |
CN113419515A (en) | Master-slave mode switching method, electronic equipment and vehicle diagnostic instrument | |
CN114490266A (en) | Data acquisition method, device, equipment and storage medium | |
CN107220053B (en) | BIOS management method and electronic equipment | |
CN111880702A (en) | Interface switching method and device and electronic equipment | |
CN111475322A (en) | Method and device for positioning stuck thread, computer equipment and readable storage medium | |
CN112685045A (en) | Page source file processing method and device, electronic equipment and storage medium | |
CN105912672B (en) | A kind of document reading method and terminal | |
CN113268300B (en) | Information display method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210921 |
|
RJ01 | Rejection of invention patent application after publication |