WO2017049556A1 - 数据传输方法和移动终端 - Google Patents

数据传输方法和移动终端 Download PDF

Info

Publication number
WO2017049556A1
WO2017049556A1 PCT/CN2015/090625 CN2015090625W WO2017049556A1 WO 2017049556 A1 WO2017049556 A1 WO 2017049556A1 CN 2015090625 W CN2015090625 W CN 2015090625W WO 2017049556 A1 WO2017049556 A1 WO 2017049556A1
Authority
WO
WIPO (PCT)
Prior art keywords
mobile terminal
data
processor
uart
port
Prior art date
Application number
PCT/CN2015/090625
Other languages
English (en)
French (fr)
Inventor
田晨
廖福椿
张加亮
张俊
Original Assignee
广东欧珀移动通信有限公司
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 广东欧珀移动通信有限公司 filed Critical 广东欧珀移动通信有限公司
Priority to EP15890158.7A priority Critical patent/EP3171269B1/en
Priority to CN201580015845.0A priority patent/CN108027744B/zh
Priority to PCT/CN2015/090625 priority patent/WO2017049556A1/zh
Priority to US15/253,444 priority patent/US10248611B2/en
Publication of WO2017049556A1 publication Critical patent/WO2017049556A1/zh
Priority to US16/250,531 priority patent/US20190197010A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • G06F13/4286Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a handshaking protocol, e.g. RS232C link
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4022Coupling between buses using switching circuits, e.g. switching matrix, connection or expansion network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines

Definitions

  • Embodiments of the present invention relate to the field of mobile terminals, and, more particularly, to a data transmission method and a mobile terminal.
  • a mobile terminal such as a mobile phone
  • interface data in multiple formats, such as I2C (Inter-Integrated Circuit), Universal Asynchronous Receiver/Transmitter (UART), and string.
  • SPI Serial Peripheral Interface
  • GPIO general purpose input output
  • the processor needs to delay the time to control when to send and receive data/clock. For synchronous data such as I2C and SPI, the delay can not be too accurate. As long as the clock and data can be matched, the clock can be triggered to accurately complete the transmission and reception of data.
  • the processor of the mobile terminal generally performs multiple tasks at the same time, but to ensure the accuracy of the delay, it is necessary to lock the processor, shield all interrupt responses, and ensure that the processor does not run the delay function. It will be interrupted by other interrupts to handle other things, causing the delay to time out. This will cause another problem. If the data transmitted by the analog UART serial port is too long, it will take a long time to lock the processor, which will cause various interrupts to be processed, and eventually the processor will crash.
  • the embodiment of the invention provides a data transmission method and a mobile terminal, which avoids the processor crash when the data stability of the mobile terminal is ensured.
  • a data transmission method including: a mobile terminal generates data in a UART format of a universal asynchronous transceiver; the mobile terminal simulates a UART port through a general-purpose input/output GPIO port in the processor, and batches to the receiving end Transmitting data in the UART format, wherein the processor of the mobile terminal is in a locked state during each batch of data transmission, and does not respond What is interrupted, the processor is in an unlocked state during idle periods of two consecutive data transfers.
  • the mobile terminal simulates a UART port by using a GPIO port in the processor, and transmits the data in the UART format to the receiving end in batches, including: the mobile terminal Obtaining data of a preset size from untransferred data in the data of the UART format, simulating a UART port through a GPIO port of the processor, transmitting the preset size data to the receiving end, and controlling the The processor is in a locked state, the mobile terminal delays for a preset period of time, and controls the processor to be in an unlocked state during the period of time, and repeats the step until all data in the UART format is transmitted to The receiving end.
  • the receiving end is a power adapter
  • the mobile terminal is connected to the power adapter through a charging interface
  • the mobile terminal generates data in a UART format, including: the mobile terminal downloads software upgrade information of the power adapter; the mobile terminal converts the software upgrade information into data in the UART format; the mobile terminal passes the processor
  • the GPIO port in the analog UART port transmits the data in the UART format to the receiving end in batches, including: the mobile terminal simulates the UART port through the GPIO port in the processor, and performs micro-processing to the power adapter in batches.
  • the UART port of the unit MCU transmits the data in the UART format.
  • the mobile terminal simulates a UART port through a GPIO port in the processor, and batches the power adapter to the power adapter. Transmitting, by the UART port of the MCU, the data in the UART format, the mobile terminal transmitting the UART format to an MCU of the power adapter during charging of the mobile terminal by using a normal charging mode
  • the method further includes: after the power adapter upgrades the software of the power adapter according to the data of the UART format, the mobile terminal switches from the normal charging mode to a fast charging mode, wherein the The charging speed of the fast charging mode is greater than the charging speed of the normal charging mode.
  • the processor of the mobile terminal is an application processor of the mobile terminal.
  • a mobile terminal including: a generating module, configured to generate data in a UART format of a universal asynchronous transceiver; a transmission module, configured to simulate a UART port through a general-purpose input/output GPIO port in the processor, and batch Transmitting the data in the UART format to the receiving end, wherein in the process of each batch of data transmission, the processor of the mobile terminal is in a locked state and does not respond to any interruption, during the idle period of the adjacent two batches of data transmission, The processor is in an unlocked state.
  • the transmitting module is configured to obtain, by using the processor, a preset size data from untransferred data in the UART format data.
  • the GPIO port simulates a UART port, sends the preset size data to the receiving end, and controls the processor to be in a locked state, delays a preset period of time, and controls the processor to be in the period of time In the unlocked state, this step is repeated until all data of the UART format is transmitted to the receiving end.
  • the receiving end is a power adapter
  • the mobile terminal is connected to the power adapter through a charging interface
  • the generating module is specifically configured to download software upgrade information of the power adapter, and convert the software upgrade information into data in the UART format
  • the transmission module is specifically configured to use, by the mobile terminal, a GPIO port in the processor
  • the UART port is analog, and the UART format data is transmitted to the UART port of the micro processor unit MCU of the power adapter in batches.
  • the transmission module is specifically configured to: charge the mobile terminal by using the normal charging mode in the power adapter Transmitting the data in the UART format to the MCU of the power adapter; the mobile terminal further includes: a switching module, configured to: after the power adapter upgrades the software of the power adapter according to the data in the UART format, Switching from the normal charging mode to the fast charging mode, wherein the charging speed of the fast charging mode is greater than the charging speed of the normal charging mode.
  • the processor of the mobile terminal is an application processor of the mobile terminal.
  • the GPIO port of the mobile terminal simulates the UART port to send the UART format data to the receiving end in batches, and sets the processor to the locked state during data transmission, does not respond to other interrupts, and ensures data transmission.
  • the stability in the data transmission interval, set the processor to the unlock state, handle other transactions or interrupts, to avoid the crash caused by the AP being locked for a long time.
  • FIG. 1 is a schematic flowchart of a data transmission method according to an embodiment of the present invention.
  • FIG. 2 is a diagram showing an example of a data transmission method according to an embodiment of the present invention.
  • FIG. 3 is a schematic block diagram of a mobile terminal according to an embodiment of the present invention.
  • FIG. 4 is a schematic block diagram of a mobile terminal according to an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of a data transmission method according to an embodiment of the present invention.
  • the method of Figure 1 includes:
  • the mobile terminal generates data in a UART format.
  • the mobile terminal simulates a UART port by using a GPIO port in the processor, and transmits the data in the UART format to the receiving end in batches, wherein, in each batch of data transmission, the processor of the mobile terminal is locked.
  • the state, without responding to any interrupts, is in an unlocked state during idle periods of two adjacent batches of data transfers.
  • the GPIO port of the mobile terminal simulates the UART port to send the UART format data to the receiving end in batches, and sets the processor to the locked state during data transmission, does not respond to other interrupts, and ensures data transmission.
  • the stability in the data transmission interval, set the processor to the unlock state, handle other transactions or interrupts, to avoid the crash caused by the AP being locked for a long time.
  • the 120 may include: the mobile terminal acquires preset size data from untransmitted data in the UART format data, and simulates the UART through the GPIO port of the processor. Transmitting, by the receiving end, the preset size data, and controlling the processor to be in a locked state, the mobile terminal delaying for a preset period of time, and controlling the processor to be in the period of time In the unlocked state, this step is repeated until all data of the UART format is transmitted to the receiving end.
  • some power adapters are smart power adapters with MCUs, for example, OPPO's power adapters that enable fast charging.
  • the power adapter does not have a radio frequency module. Once the power adapter has a bug or needs to be upgraded, the power adapter can only be returned to the factory. Power consumption.
  • the receiving end is a power adapter
  • the mobile terminal is connected to the power adapter through a charging interface
  • the step 110 may include: the mobile terminal downloading software upgrade information of the power adapter;
  • the mobile terminal converts the software upgrade information into data in the UART format.
  • Step 120 may include: the mobile terminal simulates a UART port through a GPIO port in the processor, and batches to an MCU of the power adapter.
  • the UART port transmits the data in the UART format.
  • the upgrade information of the power adapter is downloaded by the mobile terminal, and then the upgrade information is transmitted to the UART interface of the processor of the power adapter in the UART format (other dedicated interfaces of the MCU of the power adapter are generally occupied, UART The port has not been fully utilized, thus enabling an upgrade of the power adapter.
  • the embodiment of the invention completes the downloading and upgrading of the software upgrade information of the power adapter under the premise of ensuring the charging of the mobile terminal.
  • the processor of the mobile terminal is an application processor of the mobile terminal.
  • the mobile terminal may include an application processor and an MCU (or a baseband processor), wherein the application processor may perform functions of the smart terminal, such as installation and processing of the APP, and the MCU may process basic functions related to communication, such as a phone call, a short message, etc. .
  • the method of FIG. 1 may further include: the mobile terminal emulating a UART port through a GPIO port in the processor, and receiving data in a UART format from the receiving end in batches, wherein each batch of data is received.
  • the processor of the mobile terminal is in a locked state and does not respond to any interruption, and the processor is in an unlocked state during idle periods of two adjacent batches of data transmission.
  • the reception of data is the reverse process of data transmission.
  • FIG. 2 illustrates an example in which the processor of the mobile terminal is an application processor AP.
  • the AP transmits 1 byte of data each time, and during the transmission of the 1-byte data, the AP is in a locked state and does not respond to any interruption. After the 1-byte data is sent and the next byte of data starts to be sent, the AP is in the unlock state and can handle other transactions, so that the AP will not be locked for a long time and cannot respond to other terminals, resulting in a crash.
  • FIG. 3 is a schematic block diagram of a mobile terminal according to an embodiment of the present invention.
  • the mobile terminal 300 of FIG. 3 includes:
  • a generating module 310 configured to generate data in a UART format
  • the transmission module 320 is configured to simulate the UART port by using a GPIO port in the processor, and transmit the data in the UART format to the receiving end in batches, wherein the processor of the mobile terminal is locked during each batch of data transmission
  • the state, without responding to any interrupts, is in an unlocked state during idle periods of two adjacent batches of data transfers.
  • the GPIO port of the mobile terminal simulates the UART port to send the UART format data to the receiving end in batches, and sets the processor to the locked state during data transmission, does not respond to other interrupts, and ensures data transmission.
  • the stability in the data transmission interval, set the processor to the unlock state, handle other transactions or interrupts, to avoid the crash caused by the AP being locked for a long time.
  • the transmission module 320 may be specifically configured to obtain preset size data from untransmitted data in the UART format data, and simulate a UART port by using a GPIO port of the processor. Transmitting, by the receiving end, the preset size data, and controlling the processor to be in a locked state, delaying a preset period of time, and controlling the processor to be in an unlocked state during the period of time, and repeatedly performing This step until all data of the UART format is transmitted to the receiving end.
  • the receiving end is a power adapter
  • the mobile terminal is connected to the power adapter through a charging interface
  • the generating module 310 may be specifically configured to download the Software upgrade information of the power adapter; converting the software upgrade information into data in the UART format;
  • the transmission module 320 may be specifically configured to: the mobile terminal simulates a UART port through a GPIO port in the processor, and batch The data in the UART format is transmitted to the UART port of the MCU of the power adapter.
  • the transmission module 320 may be specifically configured to: when the power adapter uses a normal charging mode to charge the mobile terminal, transmit the UART format to an MCU of the power adapter.
  • the mobile terminal further includes: a switching module, configured to switch from the normal charging mode to the fast charging mode after the power adapter upgrades the software of the power adapter according to the data of the UART format, where The charging speed of the fast charging mode is greater than the charging speed of the normal charging mode.
  • the processor of the mobile terminal is an application processor of the mobile terminal.
  • the mobile terminal 400 of FIG. 4 includes:
  • a memory 410 configured to store a program
  • a processor 420 configured to execute a program, when the program is executed, the processor 420 is specifically configured to generate data in a UART format; simulate a UART port through a GPIO port in the processor, and transmit the batch to the receiving end Data in UART format, in which the processor of the mobile terminal is in a locked state during each batch of data transmission, and does not respond to any interruption, the processor is unlocked during idle periods of two adjacent batches of data transmission status.
  • the GPIO port of the mobile terminal simulates the UART port to send the UART format data to the receiving end in batches, and sets the processor to the locked state during data transmission, does not respond to other interrupts, and ensures data transmission.
  • the stability in the data transmission interval, set the processor to the unlock state, handle other transactions or interrupts, to avoid the crash caused by the AP being locked for a long time.
  • the processor 420 may be specifically configured to obtain data of a preset size from untransmitted data in the data of the UART format, and simulate a UART port by using a GPIO port of the processor. Transmitting, by the receiving end, the preset size data, and controlling the processor to be in a locked state, delaying a preset period of time, and controlling the processor to be in an unlocked state during the period of time, and repeatedly performing This step until all data of the UART format is transmitted to the receiving end.
  • the receiving end is a power adapter
  • the mobile terminal is connected to the power adapter through a charging interface
  • the processor 420 is specifically configured to download software upgrade information of the power adapter. Converting the software upgrade information into data in the UART format; the mobile terminal simulates a UART port through a GPIO port in the processor, and transmits the UART format to a UART port of an MCU of the power adapter in batches data.
  • the processor 420 may be specifically configured to: when the power adapter uses a normal charging mode to charge the mobile terminal, transmit the UART format to an MCU of the power adapter. Data; the mobile terminal further includes: switching the normal charging mode to a fast charging mode after the power adapter upgrades the software of the power adapter according to the data of the UART format, wherein the fast charging mode The charging speed is greater than the charging speed of the normal charging mode.
  • the processor of the mobile terminal is an application processor of the mobile terminal.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. You can choose some of them according to actual needs or All units are used to achieve the objectives of the solution of this embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明提供一种数据处理的方法和移动终端,以避免移动终端的处理器死机。该方法包括:移动终端生成通用异步收发传输器UART格式的数据;移动终端通过处理器中的通用输入/输出GPIO口模拟UART口,分批向接收端传输UART格式的数据,其中,在每批数据传输的过程中,移动终端的处理器处于锁定状态,不响应任何中断,在相邻的两批数据传输的空闲期间,处理器处于解锁状态。本发明实施例中,移动终端的处理器的GPIO口模拟UART口分批向接收端发送UART格式的数据,并在数据传输时,将处理器设置为锁定状态,不响应其他中断,保证数据传输的稳定性,在数据传输间隔,将处理器设置为解锁状态,处理其他事务或中断,避免AP长时间处于锁定状态造成的死机问题。

Description

数据传输方法和移动终端 技术领域
本发明实施例涉及移动终端领域,并且更具体地,涉及一种数据传输方法和移动终端。
背景技术
在某些情境下,我们需要移动终端(如手机)的处理器输出多种格式的接口数据,例如I2C(Inter-Integrated Circuit),通用异步收发传输器(Universal Asynchronous Receiver/Transmitter,UART),串行外设接口(Serial Peripheral Interface,SPI)等,但是在移动终端的处理器的专用接口数量不足的情况下,就需要用通用输入/输出(General Purpose Input Output,GPIO)口来模拟其他接口形式,这时就需要处理器通过延时来控制何时发送接收数据/时钟。对与I2C,SPI这种同步数据来说,延时可以不需要太准,只要时钟和数据可以对得上,就可以通过时钟触发准确的完成数据的发送及接收。但是对与UART这种异步通信来说,接收端检测到起始位后,是通过延时来采集数据的,如果延时不准就很容易导致数据的接收错误,因此,延时的准确性对于GPIO模拟UART串口就极为重要。
移动终端的处理器一般会同时执行多种任务,但是要让其保证延时的准确性,就必须要求锁住处理器,屏蔽掉所有的中断响应,保证在运行延时函数时,处理器不会被其他中断打断,去处理其他事物,而导致延时超时。这样就会引起另外一个问题,如果模拟的UART串口传输的数据过长,就需长时间锁住处理器,会导致各种中断来不及处理,最终处理器会崩溃死机。
发明内容
本发明实施例提供一种数据传输方法和移动终端,在保证移动终端传输数据稳定性的前提下,避免处理器死机。
第一方面,提供一种数据传输方法,包括:移动终端生成通用异步收发传输器UART格式的数据;所述移动终端通过处理器中的通用输入/输出GPIO口模拟UART口,分批向接收端传输所述UART格式的数据,其中,在每批数据传输的过程中,所述移动终端的处理器处于锁定状态,不响应任 何中断,在相连的两批数据传输的空闲期间,所述处理器处于解锁状态。
结合第一方面,在第一方面的一种实现方式中,所述移动终端通过处理器中的GPIO口模拟UART口,分批向接收端传输所述UART格式的数据,包括:所述移动终端从所述UART格式的数据中的未传输的数据中获取预设大小的数据,通过所述处理器的GPIO口模拟UART口,向所述接收端发送所述预设大小的数据,并控制所述处理器处于锁定状态,所述移动终端延迟预设的一段时间,并在所述一段时间内控制所述处理器处于解锁状态,重复执行本步骤,直到将所述UART格式的数据全部传输至所述接收端。
结合第一方面或其上述实现方式的任一种,在第一方面的另一种实现方式中,所述接收端为电源适配器,所述移动终端通过充电接口与所述电源适配器相连,所述移动终端生成UART格式的数据,包括:所述移动终端下载所述电源适配器的软件升级信息;所述移动终端将所述软件升级信息转换成所述UART格式的数据;所述移动终端通过处理器中的GPIO口模拟UART口,分批向接收端传输所述UART格式的数据,包括:所述移动终端通过所述处理器中的GPIO口模拟UART口,分批向所述电源适配器的微处理单元MCU的UART口传输所述UART格式的数据。
结合第一方面或其上述实现方式的任一种,在第一方面的另一种实现方式中,所述移动终端通过所述处理器中的GPIO口模拟UART口,分批向所述电源适配器的MCU的UART口传输所述UART格式的数据,包括:在所述电源适配器采用普通充电模式为所述移动终端充电的过程中,所述移动终端向所述电源适配器的MCU传输所述UART格式的数据;所述方法还包括:当所述电源适配器根据所述UART格式的数据升级所述电源适配器的软件后,所述移动终端从所述普通充电模式切换至快速充电模式,其中,所述快速充电模式的充电速度大于所述普通充电模式的充电速度。
结合第一方面或其上述实现方式的任一种,在第一方面的另一种实现方式中,所述移动终端的处理器为所述移动终端的应用处理器。
第二方面,提供一种移动终端,包括:生成模块,用于生成通用异步收发传输器UART格式的数据;传输模块,用于通过处理器中的通用输入/输出GPIO口模拟UART口,分批向接收端传输所述UART格式的数据,其中,在每批数据传输的过程中,所述移动终端的处理器处于锁定状态,不响应任何中断,在相邻的两批数据传输的空闲期间,所述处理器处于解锁状态。
结合第二方面,在第二方面的一种实现方式中,所述传输模块具体用于从所述UART格式的数据中的未传输的数据中获取预设大小的数据,通过所述处理器的GPIO口模拟UART口,向所述接收端发送所述预设大小的数据,并控制所述处理器处于锁定状态,延迟预设的一段时间,并在所述一段时间内控制所述处理器处于解锁状态,重复执行本步骤,直到将所述UART格式的数据全部传输至所述接收端。
结合第二方面或其上述实现方式的任一种,在第二方面的另一种实现方式中,所述接收端为电源适配器,所述移动终端通过充电接口与所述电源适配器相连,所述生成模块具体用于下载所述电源适配器的软件升级信息;将所述软件升级信息转换成所述UART格式的数据;所述传输模块具体用于所述移动终端通过所述处理器中的GPIO口模拟UART口,分批向所述电源适配器的微处理单元MCU的UART口传输所述UART格式的数据。
结合第二方面或其上述实现方式的任一种,在第二方面的另一种实现方式中,所述传输模块具体用于在所述电源适配器采用普通充电模式为所述移动终端充电的过程中,向所述电源适配器的MCU传输所述UART格式的数据;所述移动终端还包括:切换模块,用于当所述电源适配器根据所述UART格式的数据升级所述电源适配器的软件后,从所述普通充电模式切换至快速充电模式,其中,所述快速充电模式的充电速度大于所述普通充电模式的充电速度。
结合第二方面或其上述实现方式的任一种,在第二方面的另一种实现方式中,所述移动终端的处理器为所述移动终端的应用处理器。
本发明实施例中,移动终端的处理器的GPIO口模拟UART口分批向接收端发送UART格式的数据,并在数据传输时,将处理器设置为锁定状态,不响应其他中断,保证数据传输的稳定性,在数据传输间隔,将处理器设置为解锁状态,处理其他事务或中断,避免AP长时间处于锁定状态造成的死机问题。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例中所需要使用的附图作简单地介绍,显而易见地,下面所描述的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的 前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例的数据传输方法的示意性流程图。
图2是本发明实施例的数据传输方法的示例图。
图3是本发明实施例的移动终端的示意性框图。
图4是本发明实施例的移动终端的示意性框图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明的一部分实施例,而不是全部实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都应属于本发明保护的范围。
图1是本发明实施例的数据传输方法的示意性流程图。图1的方法包括:
110、移动终端生成UART格式的数据;
120、所述移动终端通过处理器中的GPIO口模拟UART口,分批向接收端传输所述UART格式的数据,其中,在每批数据传输的过程中,所述移动终端的处理器处于锁定状态,不响应任何中断,在相邻的两批数据传输的空闲期间,所述处理器处于解锁状态。
本发明实施例中,移动终端的处理器的GPIO口模拟UART口分批向接收端发送UART格式的数据,并在数据传输时,将处理器设置为锁定状态,不响应其他中断,保证数据传输的稳定性,在数据传输间隔,将处理器设置为解锁状态,处理其他事务或中断,避免AP长时间处于锁定状态造成的死机问题。
可选地,作为一个实施例,所述120可包括:所述移动终端从所述UART格式的数据中的未传输的数据中获取预设大小的数据,通过所述处理器的GPIO口模拟UART口,向所述接收端发送所述预设大小的数据,并控制所述处理器处于锁定状态,所述移动终端延迟预设的一段时间,并在所述一段时间内控制所述处理器处于解锁状态,重复执行本步骤,直到将所述UART格式的数据全部传输至所述接收端。
现有技术中,某些电源适配器是智能的电源适配器,具有MCU,例如,OPPO的能够实现快充的电源适配器。但是,电源适配器不具有射频模块,一旦电源适配器出现bug或者需要升级,只能将电源适配器返厂,这样耗时 耗力。
可选地,作为一个实施例,所述接收端为电源适配器,所述移动终端通过充电接口与所述电源适配器相连,步骤110可包括:所述移动终端下载所述电源适配器的软件升级信息;所述移动终端将所述软件升级信息转换成所述UART格式的数据;步骤120可包括:所述移动终端通过所述处理器中的GPIO口模拟UART口,分批向所述电源适配器的MCU的UART口传输所述UART格式的数据。
本发明实施例中,通过移动终端下载电源适配器的升级信息,然后将该升级信息以UART格式的数据传输至电源适配器的处理器的UART接口(电源适配器的MCU的其他专用接口一般被占用,UART口还未被充分利用),从而实现了电源适配器的升级。
可选地,作为一个实施例,所述移动终端通过所述处理器中的GPIO口模拟UART口,分批向所述电源适配器的MCU的UART口传输所述UART格式的数据可包括:在所述电源适配器采用普通充电模式为所述移动终端充电的过程中,所述移动终端向所述电源适配器的MCU传输所述UART格式的数据;图1的方法还可包括:当所述电源适配器根据所述UART格式的数据升级所述电源适配器的软件后,所述移动终端从所述普通充电模式切换至快速充电模式,其中,所述快速充电模式的充电速度大于所述普通充电模式的充电速度。
本发明实施例在保证移动终端充电的前提下,完成了电源适配器的软件升级信息的下载和升级。
可选地,作为一个实施例,所述移动终端的处理器为所述移动终端的应用处理器。
移动终端可以包括应用处理器和MCU(或基带处理器),其中,应用处理器可以完成智能终端的功能,如APP的安装与处理,MCU可以处理与通信相关的基本功能,如电话、短信等。
可选地,作为一个实施例,图1的方法还可包括:所述移动终端通过处理器中的GPIO口模拟UART口,分批从接收端接收的UART格式的数据,其中,在每批数据传输的过程中,所述移动终端的处理器处于锁定状态,不响应任何中断,在相邻的两批数据传输的空闲期间,所述处理器处于解锁状态。
数据的接收是数据发送的逆过程,具体参见数据的发送过程,此处不再详述。
下面结合具体的例子,详细描述本发明实施例的数据传输方法。
图2以移动终端的处理器为应用处理器AP为例进行举例说明。从图2可以看出,AP每次传输1字节的数据,在该1字节的数据的传输过程中,AP处于锁定状态,不会响应任何中断。在1字节数据发送完毕,下一字节数据开始发送之前这段时间内,AP处于解锁状态,可以处理其他事务,从而不会让AP长时间处于锁定状态,无法响应其他终端,导致死机。
上文结合图1-图2,详细描述了根据本发明实施例的数据传输方法,下文结合图3-图4,详细描述根据本发明实施例的移动终端。应理解,图3-图4的移动终端能够实现图1-图2的各个步骤,为避免重复,此处不再详述。
图3是本发明实施例的移动终端的示意性框图。图3的移动终端300包括:
生成模块310,用于生成UART格式的数据;
传输模块320,用于通过处理器中的GPIO口模拟UART口,分批向接收端传输所述UART格式的数据,其中,在每批数据传输的过程中,所述移动终端的处理器处于锁定状态,不响应任何中断,在相邻的两批数据传输的空闲期间,所述处理器处于解锁状态。
本发明实施例中,移动终端的处理器的GPIO口模拟UART口分批向接收端发送UART格式的数据,并在数据传输时,将处理器设置为锁定状态,不响应其他中断,保证数据传输的稳定性,在数据传输间隔,将处理器设置为解锁状态,处理其他事务或中断,避免AP长时间处于锁定状态造成的死机问题。
可选地,作为一个实施例,所述传输模块320可具体用于从所述UART格式的数据中的未传输的数据中获取预设大小的数据,通过所述处理器的GPIO口模拟UART口,向所述接收端发送所述预设大小的数据,并控制所述处理器处于锁定状态,延迟预设的一段时间,并在所述一段时间内控制所述处理器处于解锁状态,重复执行本步骤,直到将所述UART格式的数据全部传输至所述接收端。
可选地,作为一个实施例,所述接收端为电源适配器,所述移动终端通过充电接口与所述电源适配器相连,所述生成模块310可具体用于下载所述 电源适配器的软件升级信息;将所述软件升级信息转换成所述UART格式的数据;所述传输模块320可具体用于所述移动终端通过所述处理器中的GPIO口模拟UART口,分批向所述电源适配器的MCU的UART口传输所述UART格式的数据。
可选地,作为一个实施例,所述传输模块320可具体用于在所述电源适配器采用普通充电模式为所述移动终端充电的过程中,向所述电源适配器的MCU传输所述UART格式的数据;所述移动终端还包括:切换模块,用于当所述电源适配器根据所述UART格式的数据升级所述电源适配器的软件后,从所述普通充电模式切换至快速充电模式,其中,所述快速充电模式的充电速度大于所述普通充电模式的充电速度。
可选地,作为一个实施例,所述移动终端的处理器为所述移动终端的应用处理器。
图4是本发明实施例的移动终端的示意性框图。图4的移动终端400包括:
存储器410,用于存储程序;
处理器420,用于执行程序,当所述程序被执行时,所述处理器420具体用于生成UART格式的数据;通过处理器中的GPIO口模拟UART口,分批向接收端传输所述UART格式的数据,其中,在每批数据传输的过程中,所述移动终端的处理器处于锁定状态,不响应任何中断,在相邻的两批数据传输的空闲期间,所述处理器处于解锁状态。
本发明实施例中,移动终端的处理器的GPIO口模拟UART口分批向接收端发送UART格式的数据,并在数据传输时,将处理器设置为锁定状态,不响应其他中断,保证数据传输的稳定性,在数据传输间隔,将处理器设置为解锁状态,处理其他事务或中断,避免AP长时间处于锁定状态造成的死机问题。
可选地,作为一个实施例,所述处理器420可具体用于从所述UART格式的数据中的未传输的数据中获取预设大小的数据,通过所述处理器的GPIO口模拟UART口,向所述接收端发送所述预设大小的数据,并控制所述处理器处于锁定状态,延迟预设的一段时间,并在所述一段时间内控制所述处理器处于解锁状态,重复执行本步骤,直到将所述UART格式的数据全部传输至所述接收端。
可选地,作为一个实施例,所述接收端为电源适配器,所述移动终端通过充电接口与所述电源适配器相连,所述处理器420可具体用于下载所述电源适配器的软件升级信息;将所述软件升级信息转换成所述UART格式的数据;所述移动终端通过所述处理器中的GPIO口模拟UART口,分批向所述电源适配器的MCU的UART口传输所述UART格式的数据。
可选地,作为一个实施例,所述处理器420可具体用于在所述电源适配器采用普通充电模式为所述移动终端充电的过程中,向所述电源适配器的MCU传输所述UART格式的数据;所述移动终端还包括:当所述电源适配器根据所述UART格式的数据升级所述电源适配器的软件后,从所述普通充电模式切换至快速充电模式,其中,所述快速充电模式的充电速度大于所述普通充电模式的充电速度。
可选地,作为一个实施例,所述移动终端的处理器为所述移动终端的应用处理器。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或 者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。

Claims (10)

  1. 一种数据传输方法,其特征在于,包括:
    移动终端生成通用异步收发传输器UART格式的数据;
    所述移动终端通过处理器中的通用输入/输出GPIO口模拟UART口,分批向接收端传输所述UART格式的数据,其中,在每批数据传输的过程中,所述移动终端的处理器处于锁定状态,不响应任何中断,在相邻的两批数据传输的空闲期间,所述处理器处于解锁状态。
  2. 如权利要求1所述的方法,其特征在于,所述移动终端通过处理器中的GPIO口模拟UART口,分批向接收端传输所述UART格式的数据,包括:
    所述移动终端从所述UART格式的数据中的未传输的数据中获取预设大小的数据,通过所述处理器的GPIO口模拟UART口,向所述接收端发送所述预设大小的数据,并控制所述处理器处于锁定状态,所述移动终端延迟预设的一段时间,并在所述一段时间内控制所述处理器处于解锁状态,重复执行本步骤,直到将所述UART格式的数据全部传输至所述接收端。
  3. 如权利要求1或2所述的方法,其特征在于,所述接收端为电源适配器,所述移动终端通过充电接口与所述电源适配器相连,
    所述移动终端生成UART格式的数据,包括:
    所述移动终端下载所述电源适配器的软件升级信息;
    所述移动终端将所述软件升级信息转换成所述UART格式的数据;
    所述移动终端通过处理器中的GPIO口模拟UART口,分批向接收端传输所述UART格式的数据,包括:
    所述移动终端通过所述处理器中的GPIO口模拟UART口,分批向所述电源适配器的微处理单元MCU的UART口传输所述UART格式的数据。
  4. 如权利要求3所述的方法,其特征在于,所述移动终端通过所述处理器中的GPIO口模拟UART口,分批向所述电源适配器的MCU的UART口传输所述UART格式的数据,包括:
    在所述电源适配器采用普通充电模式为所述移动终端充电的过程中,所述移动终端向所述电源适配器的MCU传输所述UART格式的数据;
    所述方法还包括:
    当所述电源适配器根据所述UART格式的数据升级所述电源适配器的 软件后,所述移动终端从所述普通充电模式切换至快速充电模式,其中,所述快速充电模式的充电速度大于所述普通充电模式的充电速度。
  5. 如权利要求1-4中任一项所述的方法,其特征在于,所述移动终端的处理器为所述移动终端的应用处理器。
  6. 一种移动终端,其特征在于,包括:
    生成模块,用于生成通用异步收发传输器UART格式的数据;
    传输模块,用于通过处理器中的通用输入/输出GPIO口模拟UART口,分批向接收端传输所述UART格式的数据,其中,在每批数据传输的过程中,所述移动终端的处理器处于锁定状态,不响应任何中断,在相邻的两批数据传输的空闲期间,所述处理器处于解锁状态。
  7. 如权利要求6所述的移动终端,其特征在于,所述传输模块具体用于从所述UART格式的数据中的未传输的数据中获取预设大小的数据,通过所述处理器的GPIO口模拟UART口,向所述接收端发送所述预设大小的数据,并控制所述处理器处于锁定状态,延迟预设的一段时间,并在所述一段时间内控制所述处理器处于解锁状态,重复执行本步骤,直到将所述UART格式的数据全部传输至所述接收端。
  8. 如权利要求6或7所述的移动终端,其特征在于,所述接收端为电源适配器,所述移动终端通过充电接口与所述电源适配器相连,所述生成模块具体用于下载所述电源适配器的软件升级信息;将所述软件升级信息转换成所述UART格式的数据;所述传输模块具体用于所述移动终端通过所述处理器中的GPIO口模拟UART口,分批向所述电源适配器的微处理单元MCU的UART口传输所述UART格式的数据。
  9. 如权利要求8所述的移动终端,其特征在于,所述传输模块具体用于在所述电源适配器采用普通充电模式为所述移动终端充电的过程中,向所述电源适配器的MCU传输所述UART格式的数据;所述移动终端还包括:切换模块,用于当所述电源适配器根据所述UART格式的数据升级所述电源适配器的软件后,从所述普通充电模式切换至快速充电模式,其中,所述快速充电模式的充电速度大于所述普通充电模式的充电速度。
  10. 如权利要求6-9中任一项所述的移动终端,其特征在于,所述移动终端的处理器为所述移动终端的应用处理器。
PCT/CN2015/090625 2015-09-24 2015-09-24 数据传输方法和移动终端 WO2017049556A1 (zh)

Priority Applications (5)

Application Number Priority Date Filing Date Title
EP15890158.7A EP3171269B1 (en) 2015-09-24 2015-09-24 Data transmission method and mobile terminal
CN201580015845.0A CN108027744B (zh) 2015-09-24 2015-09-24 数据传输方法和移动终端
PCT/CN2015/090625 WO2017049556A1 (zh) 2015-09-24 2015-09-24 数据传输方法和移动终端
US15/253,444 US10248611B2 (en) 2015-09-24 2016-08-31 Data transmission method and mobile terminal
US16/250,531 US20190197010A1 (en) 2015-09-24 2019-01-17 Data transmission method and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/090625 WO2017049556A1 (zh) 2015-09-24 2015-09-24 数据传输方法和移动终端

Publications (1)

Publication Number Publication Date
WO2017049556A1 true WO2017049556A1 (zh) 2017-03-30

Family

ID=58385573

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/090625 WO2017049556A1 (zh) 2015-09-24 2015-09-24 数据传输方法和移动终端

Country Status (4)

Country Link
US (2) US10248611B2 (zh)
EP (1) EP3171269B1 (zh)
CN (1) CN108027744B (zh)
WO (1) WO2017049556A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017049548A1 (zh) * 2015-09-24 2017-03-30 广东欧珀移动通信有限公司 移动终端、电源适配器及其升级方法
CN109976243B (zh) * 2017-12-28 2020-08-25 深圳市优必选科技有限公司 机器人同步控制方法、装置及设备
CN108446172B (zh) * 2018-02-26 2021-03-23 平安普惠企业管理有限公司 数据调取方法、装置、计算机设备和存储介质
CN113094305B (zh) * 2021-04-02 2024-03-26 北京黑蚁兄弟科技有限公司 一种异步通信处理方法、装置和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101499053A (zh) * 2008-01-31 2009-08-05 上海普芯达电子有限公司 实现微控制器可配置性的方法和可配置的微控制器
CN102880576A (zh) * 2012-03-08 2013-01-16 深圳市华旭科技开发有限公司 基于stm32f103ve芯片模拟多组uart接口的方法
CN103268248A (zh) * 2012-10-17 2013-08-28 厦门雅迅网络股份有限公司 Arm平台linux系统下模拟多路全双工串口的方法

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6993617B2 (en) * 2002-05-01 2006-01-31 Sun Microsystems, Inc. System-on-a-chip having an on-chip processor and an on-chip dynamic random access memory (DRAM)
CN101303684B (zh) * 2007-05-08 2012-12-05 中兴通讯股份有限公司 一种供多种移动终端升级软件版本的方法
TW200923781A (en) * 2007-11-29 2009-06-01 Qisda Corp Firmware updating system for updating firmware of a display device and method thereof
CN101296448B (zh) * 2008-06-03 2016-01-20 中兴通讯股份有限公司 一种终端软件的升级方法及装置
KR101452575B1 (ko) * 2012-06-28 2014-10-21 엘에스산전 주식회사 휴대용 충전기 및 이의 동작 방법
US9092300B2 (en) * 2013-04-18 2015-07-28 Ottr Products, Llc Peripheral device and method for updating firmware thereof
EP2989550A4 (en) * 2014-07-04 2017-03-15 ABB Technology Ltd. Standalone automation device and machine
US9880965B2 (en) * 2014-09-11 2018-01-30 Qualcomm Incorporated Variable frame length virtual GPIO with a modified UART interface
US9563398B2 (en) * 2015-03-06 2017-02-07 Qualcomm Incorporated Impedance-based flow control for a two-wire interface system with variable frame length

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101499053A (zh) * 2008-01-31 2009-08-05 上海普芯达电子有限公司 实现微控制器可配置性的方法和可配置的微控制器
CN102880576A (zh) * 2012-03-08 2013-01-16 深圳市华旭科技开发有限公司 基于stm32f103ve芯片模拟多组uart接口的方法
CN103268248A (zh) * 2012-10-17 2013-08-28 厦门雅迅网络股份有限公司 Arm平台linux系统下模拟多路全双工串口的方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
See also references of EP3171269A4 *
ZHENG, ZHIXIONG ET AL.: "Full Duplex UART Software Simulation Based on LPC1768", MICROCONTROLLERS & EMBEDDED SYSTEMS, 30 June 2013 (2013-06-30), XP008185722, ISSN: 1009-623X *

Also Published As

Publication number Publication date
CN108027744B (zh) 2021-08-31
EP3171269B1 (en) 2022-04-27
CN108027744A (zh) 2018-05-11
EP3171269A4 (en) 2018-01-03
EP3171269A1 (en) 2017-05-24
US10248611B2 (en) 2019-04-02
US20170091142A1 (en) 2017-03-30
US20190197010A1 (en) 2019-06-27

Similar Documents

Publication Publication Date Title
CN106415490B (zh) 移动终端、电源适配器及其升级方法
WO2017049548A1 (zh) 移动终端、电源适配器及其升级方法
CN108763140B (zh) 一种双向通信的方法、系统及终端设备
WO2017049556A1 (zh) 数据传输方法和移动终端
CN108628784B (zh) 串行通信器及串行通信系统
CN112291703A (zh) 建立用于交换测距信息的通信的系统和方法
CN109254210B (zh) 电子设备端口类型检测方法、装置、检测电路及电子设备
CN106416196B (zh) 移动终端、电源适配器及其升级方法
WO2011116610A1 (zh) 一种对上网设备进行初始化的方法、系统及设备
KR20150103905A (ko) 듀얼 mcu에서 마스터 mcu 및 슬레이브 mcu 전환 방법 및 장치
US20190386762A1 (en) Date processing system and method
WO2017117123A1 (en) Solving unstable universal asynchronous receive transmit (uart) communication between a power manager and a universal serial bus (usb) - bridge device
CN112769196B (zh) 一种充电控制方法、装置、电子设备及充电器
CN101998691B (zh) 一种数据传输的方法、系统和装置
CN113821252B (zh) 小程序的构建方法、装置、终端设备以及存储介质
CN112817895A (zh) 一种基于gpio的通信方法
CN111338671A (zh) 一种移动终端的硬件升级装置、移动终端和硬件升级方法
US9886406B2 (en) Electronic device and detecting method
CN116438501A (zh) 可独立升级的扩展坞
CN115422117A (zh) 一种低成本芯片间可靠通讯方法
CN113038447A (zh) 数据传输方法、装置、移动终端以及存储介质

Legal Events

Date Code Title Description
REEP Request for entry into the european phase

Ref document number: 2015890158

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2015890158

Country of ref document: EP

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15890158

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE