WO2017185685A1 - 快速充电命令处理方法、装置及电子设备 - Google Patents
快速充电命令处理方法、装置及电子设备 Download PDFInfo
- Publication number
- WO2017185685A1 WO2017185685A1 PCT/CN2016/102966 CN2016102966W WO2017185685A1 WO 2017185685 A1 WO2017185685 A1 WO 2017185685A1 CN 2016102966 W CN2016102966 W CN 2016102966W WO 2017185685 A1 WO2017185685 A1 WO 2017185685A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- processing
- command
- linked list
- fast
- charger
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30076—Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
- G06F9/3009—Thread control instructions
-
- H—ELECTRICITY
- H01—ELECTRIC ELEMENTS
- H01M—PROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
- H01M10/00—Secondary cells; Manufacture thereof
- H01M10/42—Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
- H01M10/44—Methods for charging or discharging
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02E—REDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
- Y02E60/00—Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
- Y02E60/10—Energy storage using batteries
Definitions
- the present disclosure relates to the field of Universal Serial Bus Power Delivery (USB-PD) technology, for example, to a fast charging command processing method apparatus and an electronic device.
- USB-PD Universal Serial Bus Power Delivery
- USB-PD is an emerging fast charging technology. It mainly implements this kind of fast charging design through Type-C interface. In order to understand USB-PD charging technology, the basic structure of Type-C interface will be explained first.
- the biggest feature of the Type-C interface is that it supports the "front and back insertion" function that can be inserted from both sides.
- the A side and the B side respectively have 12 pins.
- the arrangement of each pin is shown in Table 1:
- TX1+, TX1-, RX1+, RX1-, TX2+, TX2-, RX2+, RX2- are four pairs of differential signal pins
- GND is the ground pin
- D+ and D- are USB differential signal pins for USB2.0 compatibility.
- VBUS is the power pin
- CC1 and CC2 are the pins for detecting the forward and reverse insertion, distinguishing the master and slave, and configuring the VBUS voltage.
- SBU1 and SBU2 are bus pins.
- the Type-C interface has four power pins and four ground pins, the Type-C interface can theoretically support 100W power output, which is why the Type-C interface can achieve USB-PD fast charging.
- USB-PD fast charging refers to requesting the charger to adjust the output power through the USB 5V voltage (VBUS) DC level on the frequency-shift keying (FSK) signal.
- the process of pressure and current, the process includes the following steps 1-5.
- step 1 the mobile phone identifies whether the inserted charger is a PD charger that supports fast charging. If the inserted charger is a PD charger that supports fast charging, the switching is performed, that is, the differential signal pin of the Type-C is changed to To transmit PD signals (including PD commands and data, etc.), change the SBU1 and SUB2 bus pins of Type-C to use for Auxiliary (AUX) signals.
- AUX Auxiliary
- step 2 the USB-PD device policy manager is started, the policy manager monitors the FSK signal coupled on the DC level of the VBUS, and decodes the Capabilities Source message therefrom, and then parses the message according to the USB-PD specification.
- step 3 the handset selects a voltage and current pair from the Capabilities Source message according to the user's configuration, and loads the voltage and current pairs into the payload portion of the Request message, and then the Policy Manager will FSK The signal is coupled to the VBUS DC level.
- step 4 the charger decodes the FSK signal and sends an Accept message to the handset while adjusting the output voltage and current of the charger.
- step 5 after receiving the Accept message, the mobile phone adjusts the charging voltage and current of the charging IC.
- the mobile phone can dynamically send a Request message during the charging process to request the charger to change the output voltage and current, thereby implementing a fast charging process.
- Embodiments of the present disclosure provide a technical solution for improving the processing speed of a PD command.
- a first aspect of the present disclosure provides a method for processing a fast charging command, which is applied to an electronic device, including:
- the method further includes:
- the received processing notification is ignored when the dedicated thread is busy.
- the step of continuously reading the fast charging command from the linked list to the dedicated thread for processing includes:
- the linked list is traversed, and a fast charging command is continuously read from the linked list to the dedicated thread for processing.
- the creating a dedicated thread for processing a fast charging command includes:
- a second aspect of the present disclosure provides a fast charging command processing apparatus, including:
- the identification module is configured to identify whether the charger inserted into the USB interface is a PD charger that supports fast charging;
- a dedicated thread creation module configured to create a dedicated thread for processing a fast charge command if the identification module recognizes that the charger plugged into the USB interface is the PD charger;
- a scheduling module configured to process a notification triggered by writing a fast charging command to the kernel linked list, and continuously download the fast charging command from the linked list to the dedicated thread for processing until the linked list is fast
- the processing command is empty; and when the fast processing command in the linked list is empty, the state is changed to wait for receiving the processing notification.
- the scheduling module is further configured to ignore the received processing notification when the dedicated thread is busy.
- the scheduling module is configured to traverse the linked list, and the fast charging command is continuously read from the linked list to the dedicated thread for processing.
- the dedicated thread creation module is configured to create a new thread as a dedicated thread for handling fast charging commands.
- an electronic device comprising the second aspect of the present disclosure s installation.
- an electronic device comprising an interface device, a memory and a processor, the interface device being arranged to establish a connection with a charger via a Type-C data line, the memory being arranged to store an instruction, The instructions are arranged to control the processor to operate to perform the method of the first aspect of the present disclosure.
- an embodiment of the present disclosure provides a non-transitory computer readable storage medium storing computer executable instructions for causing the computer to perform the method described above.
- an embodiment of the present disclosure further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program When the instructions are executed by the computer, the computer is caused to perform the method described above.
- the inventors of the present disclosure have found that in the related art, there is a problem that the fast charging command processing speed is slow, which in turn causes a slow response.
- the dedicated thread by creating a dedicated thread for the fast charging command, and by receiving a processing notification, the dedicated thread continues to process the fast charging command in the linked list until the fast processing command in the linked list is empty.
- the processing method will reduce the response time of the electronic device to the fast charging command.
- FIG. 1 is a flow chart of an embodiment of a method for processing a fast charge command of the present disclosure
- FIG. 2 is a block schematic diagram of an implementation structure of the fast charging command processing apparatus of the present disclosure
- FIG. 3 is a block schematic diagram of an implementation structure of an electronic device of the present disclosure.
- any numerical values are to be construed as merely exemplary. Accordingly, other examples of the exemplary embodiments may have different numerical values.
- the present disclosure provides a technical solution for reducing response time to PD commands by creating dedicated threads for PD commands.
- FIG. 1 is a flow chart of one embodiment of a PD command processing method of the present disclosure.
- step 110 after detecting the connection with the charger, the electronic device recognizes whether the charger inserted into the Universal Serial Bus (USB) interface is a Power Delivery (PD) charging that supports fast charging. If the charger inserted into the USB interface is a PD charger that supports fast charging, the PD command corresponding to the PD charger is processed according to the method of the present disclosure, that is, the following steps 120 to 160 are performed, such as a charger inserted into the USB interface is not supported. For a fast-charging PD charger, the charging command is processed in the usual manner.
- USB Universal Serial Bus
- PD Power Delivery
- step 120 a dedicated thread for processing the fast charge command is created.
- This step can be to take up an existing thread as a dedicated thread for handling fast charging commands; or create a new thread as a dedicated thread for handling fast charging commands to minimize the processing speed of other commands. Impact.
- step 130 after the dedicated thread is created, a state of waiting for the reception processing notification is performed.
- the PD command is written into the kernel linked list, that is, the list list in the kernel.
- the system triggers the processing notification according to the write operation to notify the dedicated thread.
- the PD command is queued for processing, so that the dedicated thread starts to read the PD command from the linked list after receiving the processing notification.
- the connection here is after receiving a processing notification.
- the processing of the PD command in the linked list is completed one by one until the fast processing command in the linked list is considered empty, without waiting for the next processing notification after completing the processing of one PD command, corresponding to the following steps 140 to 160.
- step 140 according to the processing notification, a fast charging command is read from the linked list to a dedicated thread for processing, and then step 150 is performed.
- the fast charging command is deleted from the linked list after being read to a dedicated thread for processing or Process the marked.
- step 150 it is determined whether the processing of the current fast charging command is completed. If the processing of the current fast charging command is completed, step 160 is performed. If the processing of the current fast charging command is not completed, step 150 is continued to perform The judgment of the processing of the current fast charging command is completed.
- step 160 it is determined whether the fast charging command in the linked list is empty. If the fast charging command is empty, the process returns to step 130 to enter a state of waiting for receiving the processing notification. If the fast charging command is not empty, the process returns to step 140. Then, the fast processing commands in the linked list are processed to a dedicated thread for processing.
- the fast processing command in the linked list may be determined by traversing the linked list. Whether it is empty or not, it is also possible to search from the beginning of the linked list every time it is read.
- the present disclosure adopts, in one embodiment, a manner of traversing a linked list to perform a fast processing command search according to one processing notification to improve search efficiency.
- the method of the present disclosure performs the processing of continuously reading the PD command from the linked list according to one processing notification until the processing of the fast processing command in the linked list is considered empty, the processing efficiency is improved in order not to affect the processing of the current PD command.
- the dedicated thread is busy, that is, when the PD command is being processed, the received processing notification is ignored, which means that only when the dedicated thread is idle and waiting to receive the processing notification, A round of search processing will be started according to the processing notification, and when the dedicated thread is busy, the next round of search processing will not be started according to the processing notification received at this time.
- the method of the present disclosure creates a dedicated thread for processing the PD command only for the PD command after identifying that the charger that establishes the connection is the PD charger, and will continue to perform the linked list according to each received processing notification.
- FIG. 2 shows a block schematic diagram of an implementation structure of the apparatus.
- the fast charge command processing apparatus 200 includes an identification module 201, a dedicated thread creation module 202, and a scheduling module 203.
- the above identification module 201 is arranged to identify whether the charger inserted into the USB interface is a PD charger that supports fast charging.
- the dedicated thread creation module 202 described above is arranged to create a dedicated thread for processing the fast charge command if the identification module 201 recognizes that the inserted charger is a PD charger.
- the scheduling module 203 is configured to notify the processing notification triggered by writing the received fast charging command to the kernel linked list, and continuously read the fast charging command from the linked list to the dedicated thread for processing until the fast processing in the linked list When the command is empty; and when the fast processing command in the linked list is empty, the state is changed to wait for receiving the processing notification.
- the scheduling module 203 above may also be configured to ignore the received processing notification when the dedicated thread is busy.
- the scheduling module 203 may be further configured to traverse the linked list to continuously read the fast charging command from the linked list to the dedicated thread for processing.
- the dedicated thread creation module 202 described above can be set to create a new thread as a dedicated thread for handling fast charge commands.
- the present disclosure also provides an electronic device including the fast charge command processing device 200 of the present disclosure.
- FIG. 3 is a block schematic diagram of an implementation structure of the electronic device in accordance with another aspect of the present disclosure.
- the electronic device 300 includes a memory 301 and a processor 302 that is arranged to store instructions that are arranged to control the processor 302 to operate to perform the fast charge command processing method described above.
- the electronic device 300 further includes an interface device 303, an input device 304, a display device 305, a communication device 306, a speaker 307, a microphone 308, and the like.
- an interface device 303 an input device 304
- a display device 305 a display device 305
- a communication device 306 a speaker 307
- a microphone 308 a microphone
- the disclosed electronic device may relate only to some of the devices, such as processor 301, memory 302, interface device 303, and the like.
- the communication device 306 can be wired or wirelessly communicated, for example.
- the interface device 303 includes, for example, a headphone jack, a Type-C interface, etc., such that the Type-C interface of the interface device 303 establishes a connection with the charger through the Type-C data line.
- the input device 304 described above may include, for example, a touch screen, a button, and the like.
- the display device 305 described above is, for example, a liquid crystal display, a touch display, or the like.
- the electronic device of the present disclosure is, for example, a mobile phone, a tablet computer, or the like.
- the present disclosure can be an apparatus, method, and/or computer program product.
- the computer program product can include a computer program stored on a non-transitory computer readable storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to perform any of the above-described embodiments method.
- the computer readable storage medium can be a tangible device that can hold and store the instructions used by the instruction execution device.
- the computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
- Examples of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory ROM, erasable Erasable Programmable Read Only Memory (EPROM), Flash Memory, Static Random Access Memory (SRAM), Compact Disc Read-Only Memory (CD-) ROM), Digital Versatile Disc (DVD), memory stick, floppy disk, mechanical encoding device, for example, a punch card with instructions stored therein, and any suitable combination of the above.
- RAM random access memory
- EPROM erasable Erasable Programmable Read Only Memory
- SRAM Static Random Access Memory
- CD- Compact Disc Read-Only Memory
- DVD Digital Versatile Disc
- memory stick floppy disk
- mechanical encoding device for example, a punch card with instructions stored therein, and any suitable combination of the above.
- a computer readable storage medium as used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (eg, a light pulse through a fiber optic cable), or through a wire The electrical signal transmitted.
- the computer readable program instructions described herein can be downloaded to a plurality of computing/processing devices from a computer readable storage medium or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
- the network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and/or edge servers.
- a network adapter card or network interface in each computing/processing device receives computer readable program instructions from a network and forwards the computer readable program instructions for storage on a computer readable storage medium in a plurality of computing/processing devices in.
- Computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (Industry Standard Architecture, ISA) instructions, machine instructions, machine related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, the programming language Includes object-oriented programming languages - such as Smalltalk, C++, etc., as well as conventional procedural programming languages - such as the "C" language or similar programming languages.
- the computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer, partly on the remote computer, or entirely on the remote computer or server. carried out.
- the remote computer can be connected to the user computer through any kind of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using the Internet)
- the service provider comes to connect via the Internet).
- the customized electronic circuitry such as a programmable logic circuit, a Field-Programmable Gate Array (FPGA), or a programmable logic array (Programmable), is personalized by utilizing state information of computer readable program instructions.
- Logic Array PLA
- the electronic circuit can execute computer readable program instructions to implement the present disclosure.
- the computer readable program instructions can be provided to a general purpose computer, a special purpose computer, or a processor of other programmable data processing apparatus to produce a machine such that when executed by a processor of a computer or other programmable data processing apparatus Means for implementing the functions/acts specified in one or more of the blocks of the flowcharts and/or block diagrams.
- the computer readable program instructions can also be stored in a computer readable storage medium that causes the computer, programmable data processing device, and/or other device to operate in a particular manner, such that the computer readable medium storing the instructions includes
- An article of manufacture includes instructions for implementing aspects of the functions/acts recited in one or more of the flowcharts and/or block diagrams.
- the computer readable program instructions can also be loaded onto a computer, other programmable data processing device, or other device to perform a series of operational steps on a computer, other programmable data processing device or other device to produce a computer-implemented process.
- instructions executed on a computer, other programmable data processing apparatus, or other device implement the functions/acts recited in one or more of the flowcharts and/or block diagrams.
- each block in the flowchart or block diagram can represent a module, a program segment, or a portion of an instruction that includes one or more components for implementing the specified logical functions.
- Executable instructions can also occur in a different order than those illustrated in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or function. Or it can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.
- the fast charging command processing method, device and electronic device provided by the embodiments of the present disclosure improve the processing speed of the PD command.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Manufacturing & Machinery (AREA)
- Chemical & Material Sciences (AREA)
- Chemical Kinetics & Catalysis (AREA)
- Electrochemistry (AREA)
- General Chemical & Material Sciences (AREA)
- Charge And Discharge Circuits For Batteries Or The Like (AREA)
Abstract
本文公开了一种快速充电命令处理方法、装置及电子设备,该方法包括:识别插入通用串行总线USB接口的充电器是否为支持快速充电的快速充电PD充电器,如插入USB接口的充电器是支持快速充电的PD充电器,则:创建用于处理快速充电命令的专用线程;根据将接收到的快速充电命令写入内核链表而触发的处理通知,从链表中将快速充电命令接续读取至专用线程进行处理,直至链表中的快速处理命令为空为止;以及在链表中的快速处理命令为空时,转为等待接收处理通知的状态。
Description
本公开要求在2016年4月27日提交中国专利局、申请号为201610274206.2、的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
本公开涉及通用串行总线快速充电(Universal Serial Bus Power Delivery,USB-PD)技术领域,例如,涉及一种快速充电命令处理方法装置及电子设备。
USB-PD是一种新兴的快速充电技术,主要通过Type-C接口实现该种快速充电设计,为了便于了解USB-PD充电技术,以下将先说明一下Type-C接口的基本结构。
Type-C接口的最大特点是支持从正反两面均可插入的“正反插”功能,其A面和B面分别具有12个针脚,每个针脚的布置如表1所示:
表1:
其中,TX1+、TX1-,RX1+、RX1-,TX2+、TX2-,RX2+、RX2-为四对差分信号针脚,GND为接地针脚,D+、D-为用于兼容USB2.0的USB差分信号针脚,VBUS为电源针脚,CC1、CC2为用于探测正反插、区分主从、配置VBUS电压等的针脚,SBU1、SBU2为总线针脚。
由于Type-C接口具有四个电源针脚和四个接地针脚,因此,Type-C接口理论上能够支持100W的电源输出,这也是Type-C接口能够实现USB-PD快速充电的原因。
在此基础上,USB-PD快速充电是指通过USB的5V电压(VBUS)直流电平上耦合频移键控(Frequency-shift keying,FSK)信号来请求充电器调整输出电
压和电流的过程,该过程包括如下步骤1-5。
在步骤1中,手机识别插入的充电器是否为支持快速充电的PD充电器,如插入的充电器是支持快速充电的PD充电器,则进行切换,即将Type-C的差分信号针脚改为用于传输PD信号(包括PD命令和数据等),将Type-C的SBU1、SUB2总线针脚改为用于传输辅助(Auxiliary,AUX)信号。
在步骤2中,启动USB-PD设备策略管理器,策略管理器监控VBUS的直流电平上耦合的FSK信号,并从中解码得到能力资源(Capabilities Source)消息,再根据USB-PD规范解析该消息得出PD充电器支持的所有电压和电流对列表。
在步骤3中,手机根据用户的配置从Capabilities Source消息中选择一个电压和电流对,并将电压和电流对加载至充电请求(Request)消息的载荷(payload)部分,然后,策略管理器将FSK信号耦合到VBUS直流电平上。
在步骤4中,充电器解码FSK信号并发出接收(Accept)消息给手机,同时调整充电器的输出电压和电流。
在步骤5中,手机接收到Accept消息后,调整充电IC的充电电压和电流。
在此,手机在充电过程中可以动态发送Request消息来请求充电器改变输出电压和电流,从而实现快速充电的过程。
由此可见,在进行快速充电的过程中,电子设备与PD充电器会进行交互而产生大量的快速充电命令(简称为PD命令),这些命令与其他命令一样均将进入缓冲队列中排队等待处理,该种处理方式将影响对PD命令的处理速度,进而出现响应迟缓的问题。
发明内容
本公开实施例提供了一种提高对PD命令的处理速度的技术方案。
本公开的第一方面,提供了一种快速充电命令处理方法,应用于电子设备,包括:
识别插入通用串行总线USB接口的充电器是否为支持快速充电的快速充电PD充电器,如插入USB接口的充电器是支持快速充电的PD充电器,则:
创建用于处理快速充电命令的专用线程;
根据将接收到的快速充电命令写入内核链表而触发的处理通知,从所述链表中将快速充电命令接续读取至所述专用线程进行处理,直至所述链表中的快速处理命令为空为止;以及
在所述链表中的快速处理命令为空时,转为等待接收所述处理通知的状态。
可选的,所述方法还包括:
在所述专用线程忙时,忽略接收到的处理通知。
可选的,所述从所述链表中将快速充电命令接续读取至所述专用线程进行处理包括:
遍历所述链表,从所述链表中将快速充电命令接续读取至所述专用线程进行处理。
可选的,所述创建用于处理快速充电命令的专用线程包括:
创建一个新的线程作为用于处理快速充电命令的专用线程。
本公开第二方面,提供了一种快速充电命令处理装置,包括:
识别模块,设置为识别插入USB接口的充电器是否为支持快速充电的PD充电器;
专用线程创建模块,设置为在所述识别模块识别到插入USB接口的充电器为所述PD充电器的情况下,创建用于处理快速充电命令的专用线程;以及,
调度模块,设置为根据将接收到的快速充电命令写入内核链表而触发的处理通知,从所述链表中将快速充电命令接续读取至所述专用线程进行处理,直至所述链表中的快速处理命令为空为止;及在所述链表中的快速处理命令为空时,转为等待接收所述处理通知的状态。
可选的,所述调度模块还设置为在所述专用线程忙时,忽略接收到的处理通知。
可选的,所述调度模块设置为遍历所述链表,从所述链表中将快速充电命令接续读取至所述专用线程进行处理。
可选的,所述专用线程创建模块设置为创建一个新的线程作为用于处理快速充电命令的专用线程。
根据本公开的第三方面,提供了一种电子设备,包括本公开第二方面所述
的装置。
根据本公开的第四方面,提供了一种电子设备,包括接口装置、存储器和处理器,所述接口装置设置为通过Type-C数据线与充电器建立连接,所述存储器设置为存储指令,所述指令设置为控制所述处理器进行操作以执行本公开第一方面所述的方法。
第五方面,本公开实施例提供了一种非暂态计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于使所述计算机执行上述的方法。
第六方面,本公开实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述的方法。
本公开的发明人发现,在相关技术中,存在快速充电命令处理速度较慢、进而导致响应迟缓的问题。而在本公开实施例中,通过为快速充电命令创建专用线程,并通过在接收到一次处理通知时,使该专用线程接续处理链表中的快速充电命令,直至链表中的快速处理命令为空为止的处理方式,将能够减少电子设备一端对快速充电命令的响应时间。
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。
图1是本公开快速充电命令处理方法的一种实施方式的流程图;
图2是本公开快速充电命令处理装置的一种实施结构的方框原理图;以及
图3是本公开电子设备的一种实施结构的方框原理图。
以下参照附图对实施例进行说明,在不冲突的情况下,实施例和实施例中
的特征可以相互任意组合。应注意到:本公开对实施例中阐述的部件和步骤的相对布置、数字表达式和数值进行不限定在。
在这里示出和讨论的所有例子中,任何数值应被解释为仅仅是示例性的。因此,示例性实施例的其它例子可以具有不同的数值。
应注意到:相似的标号和字母在下面的附图中表示类似项。
本公开提供了一种通过为PD命令创建专用线程而减少对PD命令的响应时间的技术方案。
图1是本公开的PD命令处理方法的一种实施方式的流程图。
在步骤110中,电子设备一端在检测到与充电器建立连接后,识别插入通用串行总线(Universal Serial Bus,USB)接口的充电器是否为支持快速充电的快速充电(Power Delivery,PD)充电器,如插入USB接口的充电器是支持快速充电的PD充电器,则按照本公开方法处理对应PD充电器的PD命令,即执行以下步骤120至步骤160,如插入USB接口的充电器不是支持快速充电的PD充电器,则按照常规方式处理充电命令。
在步骤120中,创建用于处理快速充电命令的专用线程。
该步骤可以是占用现有的一个线程作为用于处理快速充电命令的专用线程;也可以是创建一个新的线程作为用于处理快速充电命令的专用线程,以尽可能减少对其他命令的处理速度的影响。
在步骤130中,创建专用线程后,进行等待接收处理通知的状态。
在此,电子设备一端在产生或者接收到PD命令时,会将PD命令写入内核链表,即内核中的列表list,此时,系统会根据该写入操作而触发处理通知,以通知专用线程已有PD命令排队等待处理,以使专用线程在接收到该处理通知后即开始从链表中接续读取PD命令进行处理的操作,此处的接续即为在接收到一次处理通知后,便一个接一个地完成对链表中的PD命令的处理,直至认为链表中的快速处理命令为空为止,而无需在完成对一条PD命令的处理后等待下一次处理通知,对应以下步骤140至步骤160。
在步骤140中,根据该处理通知,从链表中将一条快速充电命令读取至专用线程进行处理,之后执行步骤150。
该条快速充电命令在被读取至专用线程进行处理后,便从链表中删除或者
进行已处理标记。
在步骤150中,判断是否完成对当前快速充电命令的处理,如完成对当前快速充电命令的处理,则执行步骤160,如未完成对当前快速充电命令的处理,则继续执行步骤150,进行是否完成对当前快速充电命令的处理的判断。
在步骤160中,判断链表中的快速充电命令是否为空,如快速充电命令为空,则回到步骤130,进入等待接收处理通知的状态,如快速充电命令不为空,则回到步骤140,接续读取链表中的快速处理命令至专用线程进行处理。
在此,在根据一次处理通知进行从链表中接续读取PD命令进行处理,直至认为链表中的快速处理命令为空为止的过程中,可以采用遍历所述链表的方式确定链表中的快速处理命令是否为空,也可以采用每进行一次读取即从链表的开始位置进行搜索的方式。本公开在一个实施例中采用根据一次处理通知,遍历链表进行快速处理命令的搜索的方式,以提高搜索效率。
由于本公开方法会根据一次处理通知进行从链表中接续读取PD命令进行处理,直至认为链表中的快速处理命令为空为止的处理,因此,为了不影响对当前PD命令的处理,提高处理效率,在本公开的一个实施例中,在专用线程为忙时,即正在处理PD命令时,忽略接收到的处理通知,这说明,只有在专用线程空闲而处于等待接收处理通知的状态下,才会根据处理通知开始一轮搜索处理,而在专用线程为忙时,将不会根据此时接收到的处理通知开始下一轮的搜索处理。
由此可见,本公开方法是在识别到建立连接的充电器为PD充电器后,为PD命令创建仅用于处理PD命令的专用线程,并会根据每次接收到的处理通知接续进行链表中PD命令的处理,直至链表中的PD命令为空为止,这将明显提高对PD命令的处理速度,进而减少对PD命令的响应时间。
本公开还提供了一种PD命令处理装置,图2示出了该装置的一种实施结构的方框原理图。
根据图2所示,该快速充电命令处理装置200包括识别模块201、专用线程创建模块202和调度模块203。
上述识别模块201设置为识别插入USB接口的充电器是否为支持快速充电的PD充电器。
上述专用线程创建模块202设置为在识别模块201识别到插入的充电器为PD充电器的情况下,创建用于处理快速充电命令的专用线程。
上述调度模块203设置为根据将接收到的快速充电命令写入内核链表而触发的处理通知,从链表中将快速充电命令接续读取至所述专用线程进行处理,直至所述链表中的快速处理命令为空为止;及在链表中的快速处理命令为空时,转为等待接收所述处理通知的状态。
上述调度模块203还可以设置为在所述专用线程忙时,忽略接收到的处理通知。
上述调度模块203还可以设置为遍历该链表,以从链表中将快速充电命令接续读取至所述专用线程进行处理。
上述专用线程创建模块202可设置为创建一个新的线程作为用于处理快速充电命令的专用线程。
本公开还提供了一种电子设备,该电子设备包括本公开的快速充电命令处理装置200。
图3为根据本公开另一方面的该电子设备的实施结构的方框原理图。
根据图3所示,该电子设备300包括存储器301和处理器302,该存储器301设置为存储指令,该指令设置为控制处理器302进行操作以执行上述的快速充电命令处理方法。
除此之外,根据图3所示,该电子设备300还包括接口装置303、输入装置304、显示装置305、通信装置306、扬声器307、麦克风308等等。尽管在图3中示出了多个装置,但是,本公开电子设备可以仅涉及其中的部分装置,例如,处理器301、存储器302、接口装置303等。
上述通信装置306例如能够进行有线或无线通信。
上述接口装置303例如包括耳机插孔、Type-C接口等,以使接口装置303的Type-C接口通过Type-C数据线与充电器建立连接。
上述输入装置304例如可以包括触摸屏、按键等。
上述显示装置305例如是液晶显示屏、触摸显示屏等。
本公开的电子设备例如是手机、平板电脑等。
本说明书中的实施例均采用递进的方式描述,实施例之间相同相似的部分相互参见即可,每个实施例说明的都是与其他实施例的不同之处,但本领域技术人员应当清楚的是,上述实施例可以根据需要单独使用或者相互结合使用。另外,对于装置实施例而言,由于装置实施例是与方法实施例相对应,相关之处请参见方法实施例的对应部分的说明。以上所描述的系统实施例仅仅是示意性的,其中作为分离部件说明的模块可以是或者也可以不是物理上分开的。
本公开可以是装置、方法和/或计算机程序产品。计算机程序产品可以包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述任一实施例中的方法。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是但不限于电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(Random-Access Memory,RAM)、只读存储器(Read-only Memory ROM)、可擦式可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、闪存(Flash)、静态随机存取存储器(Static Random Access Memory,SRAM)、便携式压缩盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、数字多功能盘(Digital Versatile Disc,DVD)、记忆棒、软盘、机械编码设备、例如存储有指令的打孔卡以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到多个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在多个计算/处理设备中的计算机可读存储介质中。
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构
(Industry Standard Architecture,ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言-诸如Smalltalk、C++等,以及常规的过程式编程语言-诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络包括局域网(Local Area Network,LAN)或广域网(Wide Area Network,WAN)连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或可编程逻辑阵列(Programmable Logic Array,PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开。
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的多个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。对于本领域技术人员来说公知的是,通过硬件方式实现、通过软件方式实现以及通过软件和硬件结合的方式实现都是等价的。
本公开实施例提供的快速充电命令处理方法、装置及电子设备,提高了对PD命令的处理速度。
Claims (12)
- 一种快速充电命令处理方法,应用于电子设备,包括:识别插入通用串行总线USB接口的充电器是否为支持快速充电的快速充电PD充电器,如插入USB接口的充电器是支持快速充电的PD充电器,则:创建用于处理快速充电命令的专用线程;根据将接收到的快速充电命令写入内核链表而触发的处理通知,从所述链表中将快速充电命令接续读取至所述专用线程进行处理,直至所述链表中的快速处理命令为空为止;以及在所述链表中的快速处理命令为空时,转为等待接收所述处理通知的状态。
- 根据权利要求1所述的方法,所述方法还包括:在所述专用线程忙时,忽略接收到的处理通知。
- 根据权利要求1所述的方法,其中,所述从所述链表中将快速充电命令接续读取至所述专用线程进行处理包括:遍历所述链表,从所述链表中将快速充电命令接续读取至所述专用线程进行处理。
- 根据权利要求1、2或3所述的方法,其中,所述创建用于处理快速充电命令的专用线程包括:创建一个新的线程作为用于处理快速充电命令的专用线程。
- 一种快速充电命令处理装置,包括:识别模块,设置为识别插入USB接口的充电器是否为支持快速充电的PD充电器;专用线程创建模块,设置为在所述识别模块识别到插入USB接口的充电器为所述PD充电器的情况下,创建用于处理快速充电命令的专用线程;以及,调度模块,设置为根据将接收到的快速充电命令写入内核链表而触发的处理通知,从所述链表中将快速充电命令接续读取至所述专用线程进行处理,直至所述链表中的快速处理命令为空为止;及在所述链表中的快速处理命令为空时,转为等待接收所述处理通知的状态。
- 根据权利要求5所述的装置,其中,所述调度模块还设置为在所述专用线 程忙时,忽略接收到的处理通知。
- 根据权利要求5所述的装置,其中,所述调度模块设置为遍历所述链表,从所述链表中将快速充电命令接续读取至所述专用线程进行处理。
- 根据权利要求5、6或7所述的装置,其中,所述专用线程创建模块设置为创建一个新的线程作为用于处理快速充电命令的专用线程。
- 一种电子设备,包括权利要求5至8中任一项所述的装置。
- 一种电子设备,包括接口装置、存储器和处理器,所述接口装置设置为通过Type-C数据线与充电器建立连接,所述存储器设置为存储指令,所述指令设置为控制所述处理器进行操作以执行根据权利要求1至4中任一项所述的方法。
- 一种非暂态计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于使所述计算机执行如权利要求1-4任一项所述的方法。
- 一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1-4所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610274206.2A CN105975250A (zh) | 2016-04-27 | 2016-04-27 | 用于电子设备的快速充电命令处理方法、装置及电子设备 |
CN201610274206.2 | 2016-04-27 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017185685A1 true WO2017185685A1 (zh) | 2017-11-02 |
Family
ID=56993552
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/102966 WO2017185685A1 (zh) | 2016-04-27 | 2016-10-21 | 快速充电命令处理方法、装置及电子设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105975250A (zh) |
WO (1) | WO2017185685A1 (zh) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105975250A (zh) * | 2016-04-27 | 2016-09-28 | 乐视控股(北京)有限公司 | 用于电子设备的快速充电命令处理方法、装置及电子设备 |
CN112952485B (zh) * | 2021-01-28 | 2021-12-07 | 深圳慧能泰半导体科技有限公司 | 兼容式的充电线缆及其控制方法 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103179294A (zh) * | 2013-03-12 | 2013-06-26 | 厦门亿联网络技术股份有限公司 | 一种通过线程池防止voip话机中任务阻塞的方法 |
CN104269585A (zh) * | 2014-10-17 | 2015-01-07 | 广东欧珀移动通信有限公司 | 一种充电方法和移动终端 |
CN105975250A (zh) * | 2016-04-27 | 2016-09-28 | 乐视控股(北京)有限公司 | 用于电子设备的快速充电命令处理方法、装置及电子设备 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10514743B2 (en) * | 2013-10-29 | 2019-12-24 | Velvetwire Llc | Software controlled power supply |
-
2016
- 2016-04-27 CN CN201610274206.2A patent/CN105975250A/zh active Pending
- 2016-10-21 WO PCT/CN2016/102966 patent/WO2017185685A1/zh active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103179294A (zh) * | 2013-03-12 | 2013-06-26 | 厦门亿联网络技术股份有限公司 | 一种通过线程池防止voip话机中任务阻塞的方法 |
CN104269585A (zh) * | 2014-10-17 | 2015-01-07 | 广东欧珀移动通信有限公司 | 一种充电方法和移动终端 |
CN105975250A (zh) * | 2016-04-27 | 2016-09-28 | 乐视控股(北京)有限公司 | 用于电子设备的快速充电命令处理方法、装置及电子设备 |
Also Published As
Publication number | Publication date |
---|---|
CN105975250A (zh) | 2016-09-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109690513B (zh) | 用于混合扩展坞中的本地虚拟化视频的系统、方法和装置 | |
WO2017185686A1 (zh) | 充电功率调整方法、装置及电子设备 | |
US9203252B2 (en) | Redirecting notifications to a wearable computing device | |
US11243595B2 (en) | Method and apparatus for reducing continuous-wakeup delay of bluetooth loudspeaker, and bluetooth loudspeaker | |
US8904051B2 (en) | Controlling multiple external device coupled to user equipment | |
US9110863B2 (en) | Seamless switching of USB devices connected to a monitor hub | |
US10311000B2 (en) | Integrated universal serial bus (USB) type-C switching | |
KR20140143793A (ko) | 유니버셜 직렬 버스 디바이스들에 대한 데이터 재지향 | |
JP5988449B2 (ja) | 通信制御ピンを介したシリアル通信 | |
US20130290746A1 (en) | System, apparatus, and method of performing charging operation in host mode | |
US9990328B2 (en) | Increased data flow in universal serial bus (USB) cables | |
KR20160092310A (ko) | 전자 장치들 간 양방향 데이터 통신 방법 및 장치 | |
US10880728B2 (en) | Method for data migration and terminal device | |
US9335862B1 (en) | Virtual multi-device navigation in surface computing system | |
CN107391419B (zh) | 支持多主机的通用序列汇流排集线设备及车用主机 | |
US20180129294A1 (en) | Gesture-based control and usage of video relay systems | |
WO2017161750A1 (zh) | 一种移动设备 | |
EP3324289A1 (en) | Contextual conversation mode for digital assistant | |
US20190191296A1 (en) | Method for Data Migration and Terminal | |
WO2017185685A1 (zh) | 快速充电命令处理方法、装置及电子设备 | |
WO2017185687A1 (zh) | 充电保护方法、装置及电子设备 | |
WO2018036073A1 (zh) | 一种通过usb升级电子设备的方法、装置及电子设备 | |
WO2018058946A1 (zh) | 一种信号切换方法和装置、计算机存储介质 | |
US9077811B2 (en) | Method and apparatus for enabling interoperability of touch devices | |
US10515025B2 (en) | Communication protocol adapter |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16900193 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16900193 Country of ref document: EP Kind code of ref document: A1 |