CN109901980B - Serial port log capturing circuit, method, terminal and computer readable storage medium - Google Patents

Serial port log capturing circuit, method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN109901980B
CN109901980B CN201910093408.0A CN201910093408A CN109901980B CN 109901980 B CN109901980 B CN 109901980B CN 201910093408 A CN201910093408 A CN 201910093408A CN 109901980 B CN109901980 B CN 109901980B
Authority
CN
China
Prior art keywords
usb
serial port
cpu
serial
terminal
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.)
Active
Application number
CN201910093408.0A
Other languages
Chinese (zh)
Other versions
CN109901980A (en
Inventor
马柏杰
祁庆克
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201910093408.0A priority Critical patent/CN109901980B/en
Publication of CN109901980A publication Critical patent/CN109901980A/en
Application granted granted Critical
Publication of CN109901980B publication Critical patent/CN109901980B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a serial log grabbing circuit, a method, a terminal and a computer readable storage medium, which relate to the technical field of communication, wherein the serial log grabbing circuit comprises the following components: the CPU is connected with the switching module, the switching module is connected with the serial port socket, a USB _ ID interface of the CPU is connected with a USB _ ID end of the identification module, a USB _ ID _ CONNECT end of the identification module is connected with the serial port socket, the identification module is used for identifying a level signal of the USB _ ID in a serial port circuit inserted into the serial port socket, and the CPU is used for controlling the switching module to switch among a D + end, a D-end, a TX end and a GND end of the CPU according to the level signal of the USB _ ID. By the method, a user can connect the TX and the GND to the serial port line to print the serial port log without disassembling the machine, so that the effect of grabbing the serial port log without disassembling the machine is realized, the times of disassembling the machine are reduced, the service life of the terminal is prolonged, and the log analysis efficiency is improved.

Description

Serial port log capturing circuit, method, terminal and computer readable storage medium
Technical Field
The invention relates to the technical field of audible electronic equipment, in particular to a serial port log grabbing circuit, a serial port log grabbing method, a terminal and a computer readable storage medium.
Background
With the continuous development of mobile communication technology, more and more applications and more complex functions are provided on the mobile phone, and more interfaces are provided on the mobile phone to support the applications. In a handset single board design, transmitter TX, receiver RX and ground GND test points are usually reserved. In the analysis of machines which are not started and machines which can not grab general log logs, a serial port log is generally printed by connecting TX and GND to a serial port line to analyze machine faults.
If TX and GND are exposed outside the complete machine after being assembled into the complete machine, static electricity is more easily introduced to damage the machine, the machine is also easily short-circuited when meeting water, and the problems of unattractive appearance and the like are also caused; TX and GND cannot be exposed outside the complete machine. Therefore, if the machine is required to be disassembled by grabbing the serial port log, the disassembling process is complicated, which may cause a bad phenomenon to be damaged and the problem of analysis to be not continued, or may damage other devices and cause unnecessary loss.
Disclosure of Invention
The invention mainly aims to provide a serial log capture circuit, a serial log capture method, a terminal and a computer readable storage medium, and aims to solve the technical problem that a serial log cannot be captured under the condition of not disassembling a machine.
In order to achieve the above object, a first aspect of the present invention provides a serial log capture circuit, including a CPU, a switching module, an identification module, and a serial socket, where the CPU is connected to the switching module, the switching module is connected to the serial socket, a USB _ ID interface of the CPU is connected to a USB _ ID end of the identification module, a USB _ ID _ CONNECT end of the identification module is connected to the serial socket, the identification module is configured to identify a level signal of a USB _ ID inserted into a serial circuit of the serial socket, and the CPU is configured to control the switching module to switch between a D + end, a D-end, a TX end, and a GND end of the CPU according to the level signal of the USB _ ID.
Further, the switching module is a double-pole double-throw switch DPDT, the CPU is connected to the enable terminal of the DPDT through an IGPO, the first inactive terminal of the DPDT is connected to the D + terminal of the serial port socket, the second inactive terminal of the DTDP is connected to the D-terminal of the serial port socket, when the level signal of the USB _ ID is low level, the first active terminal of the DTDP is connected to the D + terminal of the CPU, the second active terminal of the DTDP is connected to the D-terminal of the CPU, when the level signal of the USB _ ID is high level, the first active terminal of the DTDP is connected to the GDN terminal of the CPU, and the second active terminal of the DTDP is connected to the TX terminal of the CPU.
Further, the USB _ ID terminal of the identification module is connected to the USB _ ID _ CONNECT terminal through a parallel diode and a first resistor, the USB _ ID terminal is grounded through a second resistor, and the USB _ ID _ CONNECT terminal is grounded through a capacitor.
Further, the first resistor is 2M Ω, and the second resistor is 1M Ω.
The invention also provides a serial port circuit, which comprises a USB _ ID interface, wherein the serial port circuit is matched with the serial port log grabbing circuit as claimed in any one of claims 1 to 3, the USB _ ID interface is connected with the VBUS, and when the serial port circuit is inserted into the serial port socket, a high level is provided for the serial port log grabbing circuit.
The invention also discloses a serial port log capture method, which comprises the following steps:
detecting a level signal of the USB _ ID;
and controlling the switching among the D + end, the D-end, the TX end and the GND end of the CPU according to the level signal of the USB _ ID.
Further, when the level signal of the USB _ ID is at a high level, the D + terminal of the CPU is switched to the GND terminal, and the D-terminal is switched to the TX terminal.
The invention further provides a serial log capture terminal, which comprises any one of the serial log capture terminals.
The invention also provides a USB data line which comprises the serial port circuit.
In another aspect, the present invention further provides a computer-readable storage medium, where one or more programs are stored, and the one or more programs are executable by one or more processors to implement the steps of any one of the above serial port log capture methods.
According to the serial port log capture circuit, the serial port log capture method, the terminal and the computer readable storage medium, on one hand, a level signal of a USB _ ID in a serial port circuit inserted into a serial port socket is identified through an identification module, and a CPU controls a switching module to switch among a D + end, a D-end, a TX end and a GND end of the CPU according to the level signal of the USB _ ID. On the other hand, the USB _ ID interface in the serial port circuit is directly connected with VBUS high level. After the serial port circuit is inserted into the serial port socket, the identification module identifies a high level, the CPU controls the switching module to switch the D + end of the CPU into the GND end, and the D-end of the CPU into the TX end, so that a user can connect the TX end and the GND end to a serial port line to print a serial port log without disassembling the serial port, the effect of grabbing the serial port log without disassembling the serial port log is realized, the disassembling times are reduced, the service life of the terminal is prolonged, and the log analysis efficiency is improved.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention;
FIG. 2 is a schematic diagram of a wireless communication system of the mobile terminal shown in FIG. 1;
fig. 3 is a circuit diagram of a serial log capture circuit according to an embodiment of the present invention;
fig. 4 is a circuit diagram of another serial log capture circuit according to an embodiment of the present invention;
FIG. 5 is a circuit diagram of an identification module according to an embodiment of the present invention;
fig. 6 is a flowchart of a serial log capture method according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a serial log capture terminal according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation terminal, a wearable device, an automotive wristband, a pedometer, and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an a/V (audio/video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex Long Term Evolution), and TDD-LTE (Time Division duplex Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, and the Graphics Processing Unit 1041 processes image data of still pictures or videos obtained by an image capturing terminal (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and can process such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or the backlight when the mobile terminal 100 moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus pen, or any other suitable object or accessory), and drive a corresponding connection terminal according to a preset program. The touch panel 1071 may include two parts of a touch detection terminal and a touch controller. The touch detection terminal detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing terminal, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, without limitation.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although in fig. 1, the touch panel 1071 and the display panel 1061 are two independent components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, which is not limited herein.
The interface unit 108 serves as an interface through which at least one external terminal is connected to the mobile terminal 100. For example, the external terminal may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a terminal having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external terminal and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and the external terminal.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and Charging Rules Function) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above-mentioned mobile terminal hardware structure and communication network system, various embodiments of the present invention are proposed.
Fig. 3 is a serial log capture circuit according to a first embodiment of the present invention, where the serial log capture circuit includes a processor CPU _31, a switching module 32, an identification module 33, and a serial socket 34, where the CPU _31 is connected to the switching module 32, the switching module 32 is connected to the serial socket 34, a USB _ ID interface of the CPU _31 is connected to a USB _ ID end of the identification module 33, a USB _ ID _ CONNECT end of the identification module 33 is connected to the serial socket 34, the identification module 33 is configured to identify a level signal of a USB _ ID in a serial circuit inserted into the serial socket 34, and the CPU _31 is configured to control the switching module 32 to switch between a D + end, a D-end, a TX end, and a GND end of the CPU _31 according to the level signal of the USB _ ID.
According to the invention, the identification module 33 identifies the level signal of the USB _ ID in the serial port circuit inserted into the serial port socket 34, and the CPU _31 controls the switching module 32 to switch between the D + end and the D-end of the CPU _31, the TX end and the GND end according to the level signal of the USB _ ID. In addition, the USB _ ID interface in the serial port circuit is directly connected with the VBUS high level. After the serial port circuit is inserted into the serial port socket 34, the identification module 33 identifies a high level, the CPU _31 controls the switching module 32 to switch the D + end of the CPU _31 to the GND end and the D-end to the TX end, so that a user can connect the TX and the GND to a serial port line to print a serial port log under the condition of not disassembling the machine, the effect of grabbing the serial port log without disassembling the machine is realized, the disassembling times are reduced, the service life of the terminal is prolonged, and the log analysis efficiency is improved.
Another embodiment of the present invention further provides a serial log capture circuit, as shown in fig. 4, the serial log capture circuit includes a processor CPU _31, a switching module 32, an identification module 33, and a serial socket 34.
The switching module 32 is a double-pole double-throw switch DPDT, the CPU _31 is connected to an enable end of the DPDT _32 through an IGPO, a first inactive end of the DPDT _32 is connected to a D + end of the serial port socket 34, a second inactive end of the DTDP _32 is connected to a D-end of the serial port socket 34, when a level signal of the USB _ ID is a low level, a first active end of the DTDP _32 is connected to the D + end of the CPU _31, a second active end of the DTDP _32 is connected to the D-end of the CPU _31, when the level signal of the USB _ ID is a high level, the first active end of the DTDP _32 is connected to a GDN end of the CPU _31, and the second active end of the DTDP _32 is connected to a TX end of the CPU _ 31. In this embodiment, the DTDP _32 may be disposed on the motherboard.
The USB _ ID interface of the CPU _31 is connected to the USB _ ID terminal of the identification module 33, and the USB _ ID _ CONNECT terminal of the identification module 33 is connected to the serial port socket 34. As shown in fig. 5, the USB _ ID terminal of the identification module 33 is connected to the USB _ ID _ connection terminal through a diode D and a first resistor R1 connected in parallel, the USB _ ID terminal is grounded through a second resistor R2, and the USB _ ID _ connection terminal is grounded through a capacitor C. Preferably, the first resistor is 2M Ω, the second resistor is 1M Ω, and the capacitor is 100P.
In this embodiment, the identification module 33 may be specifically disposed on the PCB to identify level signals in three states, i.e., low level, floating level, and high level; specifically, when the USB _ ID _ CONNECT terminal is at a low level and in a floating state, the current flows through the diode D, which can be recognized normally, and when the USB _ ID _ CONNECT terminal is at a high level, the USB _ ID can be recognized as a high level by dividing the voltage by the first resistor R1 of 2M Ω and the second resistor R2 of 1M Ω to obtain a level of 1.8V.
When a serial port circuit is inserted into a serial port socket 34, the identification module 33 identifies that a level signal of a USB _ ID is not at a high level, the CPU _31 controls the DTDP _32 to switch the connection of a first moving terminal with the D + terminal of the CPU _31 to the connection with the GDN terminal of the CPU _31, and switch the connection of a second moving terminal with the D-terminal of the CPU _31 to the connection with the TX terminal of the CPU _ 31. Therefore, a user can print the serial port log by connecting the TX and the GND to a serial port line through the serial port circuit under the condition that the machine is not dismounted, the effect of grabbing the serial port log without dismounting is achieved, the dismounting times are reduced, the service life of the terminal is prolonged, and the log analysis efficiency is improved.
Another embodiment of the present invention further provides a serial port circuit, including a USB _ ID interface, where the serial port circuit is matched with the serial port log capture circuit shown in any one of fig. 3 and 4, the USB _ ID interface is connected to the VBUS, and when the serial port circuit is inserted into the serial port socket, the serial port circuit provides a high level to the serial port log capture circuit.
Another embodiment of the present invention further provides a USB data line, including the serial port circuit.
Based on the above embodiments of the serial log capture circuit, the present invention provides the following embodiments of the method.
Fig. 6 is a method for capturing a serial log according to an embodiment of the present invention, where the method includes:
s601, detecting a level signal of the USB _ ID;
in this step, the identification module 33 shown in fig. 3 or fig. 4 may be used to detect the level signal of the USB _ ID. For example, in fig. 4, when the USB _ ID _ CONNECT terminal is at a low level and in a floating state, the current flowing through the diode D can be normally recognized, and when the USB _ ID _ CONNECT terminal is at a high level, the USB _ ID can be recognized as a high level by dividing the voltage by the first resistor R1 of 2M Ω and the second resistor R2 of 1M Ω to obtain a level of 1.8V.
And S602, controlling the switching among the D + end, the D-end, the TX end and the GND end of the CPU according to the level signal of the USB _ ID.
In general, a level signal of the USB _ ID is low, and when the USB data line according to the present invention is inserted, the level signal of the USB _ ID is high, and the D + terminal of the CPU is switched to the GND terminal and the D-terminal is switched to the TX terminal. Specifically, the CPU _31 controls the DTDP _32 to switch the first moving end from being connected with the D + end of the CPU _31 to being connected with the GDN end of the CPU _31, and switch the second moving end from being connected with the D-end of the CPU _31 to being connected with the TX end of the CPU _ 31. Therefore, a user can print the serial port log by connecting the TX and the GND to a serial port line through the serial port circuit under the condition of not disassembling the machine, and the effect of grabbing the serial port log without disassembling the machine is realized.
Based on the foregoing embodiments, the present invention further provides a serial log capture terminal, where the serial log capture terminal includes the serial log capture circuit shown in any one of fig. 3 and fig. 4. The serial log capture terminal may specifically be a mobile terminal including a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation terminal, a wearable device, an automatic bracelet, a pedometer, and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like.
An embodiment of the present invention further provides a serial log capture terminal, as shown in fig. 7, where the serial log capture terminal 6 includes: a memory 61, a processor 62, and a serial log crawling program stored on the memory and operable on the processor, wherein the serial log crawling program, when executed by the processor, implements the following steps:
detecting a level signal of the USB _ ID;
and controlling the switching among the D + end, the D-end, the TX end and the GND end of the CPU according to the level signal of the USB _ ID.
In a specific embodiment, in the step of controlling switching between the D + terminal and the D-terminal of the CPU and the TX terminal and the GND terminal according to the level signal of the USB _ ID, the processor is further configured to execute the serial log capture program to implement the following steps:
and when the level signal of the USB _ ID is in a high level, switching the D + end of the CPU to a GND end and switching the D-end of the CPU to a TX end.
Yet another aspect of the present invention provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to perform the steps of:
detecting a level signal of the USB _ ID;
and controlling the switching among the D + end, the D-end, the TX end and the GND end of the CPU according to the level signal of the USB _ ID.
In one embodiment, in the step of controlling switching between the D + terminal, the D-terminal, and the TX terminal, the GND terminal of the CPU according to the level signal of the USB _ ID, the one or more programs may be executed by one or more processors to implement the steps of:
and when the level signal of the USB _ ID is in a high level, switching the D + end of the CPU into a GND end and switching the D-end of the CPU into a TX end.
According to the serial port log grabbing circuit, the serial port log grabbing method, the terminal and the computer readable storage medium, on one hand, a level signal of a USB _ ID in a serial port circuit inserted into a serial port socket is identified through an identification module, and a CPU controls a switching module to switch between a D + end, a D-end, a TX end and a GND end of the CPU according to the level signal of the USB _ ID. On the other hand, the USB _ ID interface in the serial port circuit is directly connected with the VBUS high level. After the serial port circuit is inserted into the serial port socket, the identification module identifies a high level, the CPU controls the switching module to switch the D + end of the CPU into the GND end, and the D-end of the CPU into the TX end, so that a user can connect the TX end and the GND end to a serial port line to print a serial port log without disassembling the serial port, the effect of grabbing the serial port log without disassembling the serial port log is realized, the disassembling times are reduced, the service life of the terminal is prolonged, and the log analysis efficiency is improved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element identified by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or terminal that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (8)

1. A serial port log grabbing circuit is characterized by comprising a CPU, a switching module, an identification module and a serial port socket, wherein the CPU is connected with the switching module, the switching module is connected with the serial port socket, a USB _ ID interface of the CPU is connected with a USB _ ID end of the identification module, a USB _ ID _ CONNECT end of the identification module is connected with the serial port socket, the identification module is used for identifying a level signal of a USB _ ID in a serial port circuit inserted into the serial port socket, and the CPU is used for controlling the switching module to switch among a D + end, a D-end, a TX end and a GND end of the CPU according to the level signal of the USB _ ID;
the switching module is a double-pole double-throw switch (DPDT), the CPU is connected with an enabling end of the DPDT through an IGPO, a first fixed end of the DPDT is connected with a D + end of the serial port socket, a second fixed end of the DPDT is connected with a D-end of the serial port socket, when a level signal of the USB _ ID is at a low level, a first movable end of the DPDT is connected with the D + end of the CPU, a second movable end of the DPDT is connected with the D-end of the CPU, when the level signal of the USB _ ID is at a high level, the first movable end of the DPDT is connected with a GDN end of the CPU, and the second movable end of the DPDT is connected with a TX end of the CPU;
the USB _ ID end of the identification module is connected with the USB _ ID _ CONNECT end through a diode and a first resistor which are connected in parallel, the USB _ ID end is grounded through a second resistor, and the USB _ ID _ CONNECT end is grounded through a capacitor.
2. The serial port log grabbing circuit according to claim 1, wherein the first resistor is 2M Ω, and the second resistor is 1M Ω.
3. A serial port circuit comprises a USB _ ID interface, and is characterized in that the serial port circuit is matched with the serial port log grabbing circuit in claim 1, the USB _ ID interface is connected with VBUS, and when the serial port circuit is inserted into a serial port socket, a high level is provided for the serial port log grabbing circuit.
4. A serial log capture method is applied to the serial log capture circuit as claimed in claim 1, and is characterized by comprising the following steps:
detecting a level signal of the USB _ ID;
and controlling the switching among the D + end, the D-end, the TX end and the GND end of the CPU according to the level signal of the USB _ ID.
5. The serial port log crawling method according to claim 4,
and when the level signal of the USB _ ID is in a high level, switching the D + end of the CPU into a GND end and switching the D-end of the CPU into a TX end.
6. A serial log capture terminal, comprising the serial log capture circuit of any one of claims 1-2.
7. A USB data line comprising the serial circuit of claim 3.
8. A computer-readable storage medium storing one or more programs, wherein the one or more programs are executable by one or more processors to perform the steps of the serial log crawling method according to any of claims 4 to 5.
CN201910093408.0A 2019-01-30 2019-01-30 Serial port log capturing circuit, method, terminal and computer readable storage medium Active CN109901980B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910093408.0A CN109901980B (en) 2019-01-30 2019-01-30 Serial port log capturing circuit, method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910093408.0A CN109901980B (en) 2019-01-30 2019-01-30 Serial port log capturing circuit, method, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109901980A CN109901980A (en) 2019-06-18
CN109901980B true CN109901980B (en) 2022-08-23

Family

ID=66944483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910093408.0A Active CN109901980B (en) 2019-01-30 2019-01-30 Serial port log capturing circuit, method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109901980B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110555090B (en) * 2019-07-19 2022-10-18 苏州浪潮智能科技有限公司 Method, system, terminal and storage medium for automatically acquiring CPU BUS Number
CN111045883B (en) * 2019-12-11 2022-07-08 紫光展讯通信(惠州)有限公司 Debugging circuit, method and terminal
CN111400226A (en) * 2020-03-02 2020-07-10 上海闻泰信息技术有限公司 Mobile terminal device and log acquisition system
CN111897755A (en) * 2020-06-15 2020-11-06 深圳市广和通无线股份有限公司 Log capture method and device and switching module
CN116719712B (en) * 2023-08-09 2024-01-19 金舟远航(北京)信息产业有限公司 Processor serial port log output method and device, electronic equipment and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009086753A (en) * 2007-09-27 2009-04-23 Toshiba Corp Information processor and connection control method
CN101945155B (en) * 2010-09-03 2013-03-27 展讯通信(上海)有限公司 Method and terminal device for capturing terminal debugging information in real-time manner
CN206363306U (en) * 2016-08-30 2017-07-28 深圳市金立通信设备有限公司 A kind of terminal and its serial communication circuit
CN107798099A (en) * 2017-10-27 2018-03-13 努比亚技术有限公司 A kind of log information grasping means, terminal and computer-readable recording medium
CN108363667A (en) * 2018-02-27 2018-08-03 广州视源电子科技股份有限公司 A kind of log information capture apparatus
CN108509317A (en) * 2018-03-29 2018-09-07 广州视源电子科技股份有限公司 Log file storing method, device, electronic device and storage medium
CN208283492U (en) * 2018-07-05 2018-12-25 深圳市泰比特科技有限公司 Have convenient for quick-downloading and AccessPort test smelting

Also Published As

Publication number Publication date
CN109901980A (en) 2019-06-18

Similar Documents

Publication Publication Date Title
CN109901980B (en) Serial port log capturing circuit, method, terminal and computer readable storage medium
CN108572764B (en) Character input control method and device and computer readable storage medium
CN109195143B (en) Network access method, mobile terminal and readable storage medium
CN109144441B (en) Screen adjusting method, terminal and computer readable storage medium
CN108121681B (en) Hot plug implementation method, terminal and storage medium
CN109710159B (en) Flexible screen response method and device and computer readable storage medium
CN109522276B (en) Application icon management method, terminal and computer-readable storage medium
CN108009116B (en) MicroUSB interface circuit and mobile terminal thereof
CN107466081B (en) Wireless switching method and terminal
CN113391968A (en) Static detection method and device and computer readable storage medium
CN112888084A (en) Full-band communication method and device and mobile terminal
CN112423211A (en) Multi-audio transmission control method, equipment and computer readable storage medium
CN109683796B (en) Interaction control method, equipment and computer readable storage medium
CN109710168B (en) Screen touch method and device and computer readable storage medium
CN108650404B (en) Port starting circuit, device and mobile terminal
CN110955397A (en) Method for setting frame rate of game terminal, game terminal and storage medium
CN108183833B (en) Response processing method and device and computer readable storage medium
CN107678622B (en) Application icon display method, terminal and storage medium
CN107580106B (en) Call control method, mobile terminal and computer readable storage medium
CN109739676B (en) Operation monitoring method, mobile terminal and computer readable storage medium
CN109980721B (en) Quick charge detection circuit and method and computer storage medium
CN109413272B (en) Gravity sensor management method, double-sided screen mobile terminal and storage medium
CN113079528A (en) Network exception handling method and device and computer readable storage medium
CN108364595B (en) Electrostatic discharge detection method, mobile terminal and computer readable storage medium
CN110058761B (en) Copy selection method, mobile terminal and computer readable storage medium

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