Charging method and device, equipment, storage medium and product
By receiving and processing power gear broadcast messages of power supply equipment during charging, and selecting higher power gears for charging after safety certification, the problem of low charging efficiency in the prior art is solved, and more efficient charging is achieved process.
Patent Information
- Application Number
- CN202411367858.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-17
AI Technical Summary
It is difficult for existing charging technologies to charge electrical equipment through high power while ensuring safety, and the charging efficiency is low.
By receiving the power gear broadcast message sent by the power supply device, sending a power supply configuration request message, and obtaining multiple second power gears after the security authentication is passed, selecting a higher power gear from them for charging, realizing power configuration adjustment.
While taking into account charging safety, charging efficiency is improved, allowing electrical equipment to choose higher power gears for charging under safe conditions.
Smart Images

Figure CN119324541A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of charging technology, and in particular to a charging method, device, equipment, storage medium and product. Background Art
[0002] In a charging scenario, a power supply device (eg, a charger) is usually connected to a power-consuming device (eg, a mobile phone) via a charging cable to charge the power-consuming device.
[0003] In the related art, the power supply equipment usually adopts the default universal power gear for power supply configuration, and then charges the power-consuming equipment. However, in this way, it is usually difficult to charge the power-consuming equipment with a large power while ensuring charging safety, and the charging efficiency is low. Summary of the invention
[0004] The purpose of the embodiments of the present disclosure is to provide a charging method, device, equipment, storage medium and product to improve the charging efficiency while taking into account charging safety.
[0005] In one aspect, an embodiment of the present disclosure provides a charging method, including:
[0006] If a power level broadcast message sent by the power supply device is received, a power supply configuration request message including a first power level is sent to the power supply device, so that the power supply device supplies power according to the first power level;
[0007] If a power supply configuration confirmation message returned by the power supply device is received, a role exchange request message is sent to the power supply device to exchange roles with the power supply device;
[0008] If a role exchange acceptance message is received from the power supply device based on the role exchange request message, security authentication is performed with the power supply device;
[0009] If it is determined that the security authentication is passed, a power supply capability request is sent to the power supply device;
[0010] If a second power level returned by the power supply device based on the power supply capability request is received, a power supply configuration adjustment message is sent to the power supply device according to the second power level; the second power level is not less than the first power level.
[0011] In one implementation, before receiving the power level broadcast message sent by the power supply device, the method further includes:
[0012] If a hard reset request is received from the power supply device, a hard reset operation is performed; the hard reset request is sent by the power supply device after detecting a wired connection with the power supply device.
[0013] In one implementation, if a power level broadcast message sent by a power supply device is received, a power supply configuration request message including a first power level is sent to the power supply device, including:
[0014] If a power gear broadcast message is received, then multiple common power gears included in the power gear broadcast message are obtained;
[0015] Selecting a matching first power gear from among the common power gears;
[0016] Based on the first power level, a power supply configuration request message is sent to the power supply device.
[0017] In one implementation, the universal power levels in the power level broadcast message are sorted in order from small to large or from large to small.
[0018] In one implementation, performing security authentication with a power supply device includes:
[0019] Sending a device information request to the power supply device;
[0020] Receiving power supply equipment information returned by the power supply equipment based on the equipment information request;
[0021] Perform identity authentication on the power supply equipment according to the power supply equipment information;
[0022] If the identity authentication is successful, a request for manufacturer information is sent to the power supply device;
[0023] If the manufacturer identification information returned by the power supply device based on the manufacturer information request is received, the identification verification is performed according to the manufacturer identification information;
[0024] If the identification verification is successful, the power supply device is authenticated to obtain the authentication result;
[0025] If the authentication result indicates that the authentication is successful, it is determined that the security authentication is passed, otherwise, it is determined that the security authentication has failed.
[0026] In one implementation, sending a power supply configuration adjustment message to a power supply device according to the second power level includes:
[0027] Determine a power threshold according to the authentication result;
[0028] Selecting a second power level not higher than a power threshold from among the second power levels;
[0029] Send a power supply configuration adjustment message including the target power level to the power supply device.
[0030] In one aspect, an embodiment of the present disclosure provides a charging method, including:
[0031] After detecting a wired connection with the power-consuming device, a power level broadcast message is sent to the power-consuming device;
[0032] If a power supply configuration request message including a first power level is received from the power-consuming device based on the power level broadcast message, power is supplied to the power-consuming device according to the first power level, and a power supply configuration confirmation message is sent to the power-consuming device;
[0033] If a role exchange request message is received from the power-consuming device, the role exchange operation is performed and a role exchange acceptance message is returned to the power supply device;
[0034] Conduct safety certification with electrical equipment;
[0035] If a power supply capability request is received from the power-consuming device when the power-consuming device determines that the security authentication is passed, a second power level is sent to the power-consuming device;
[0036] If a power supply configuration adjustment message sent by the power-consuming device according to the second power level is received, the power level of the power supply is adjusted based on the power supply configuration message; the second power level is not less than the first power level.
[0037] In one implementation, before sending a power level broadcast message to an electric device, the process includes:
[0038] After detecting a wired connection with the powered device, sending a hard reset request to the powered device so that the powered device performs a hard reset operation;
[0039] Perform power-off operation;
[0040] When the specified power-off duration is reached, the power-on restart operation is performed.
[0041] In one implementation, sending a power level broadcast message to an electric device includes:
[0042] Sending a power level broadcast message including a plurality of common power levels to the power-consuming device;
[0043] Among them, the universal power levels in the power level broadcast message are sorted in order from small to large or from large to small; the first power level is a matching universal power level selected by the electrical equipment from the universal power levels.
[0044] In one implementation, after performing security authentication and before sending a plurality of second power levels to the electrical device, the method further includes:
[0045] Perform current compensation operation.
[0046] In one aspect, an embodiment of the present disclosure provides a charging device, comprising:
[0047] a configuration unit, configured to, if receiving a power level broadcast message sent by the power supply device, send a power supply configuration request message including a first power level to the power supply device, so that the power supply device supplies power according to the first power level;
[0048] The switching unit is configured to send a role exchange request message to the power supply device to exchange roles with the power supply device if a power supply configuration confirmation message returned by the power supply device is received;
[0049] an authentication unit, configured to perform security authentication with the power supply device upon receiving a role exchange acceptance message returned by the power supply device based on the role exchange request message;
[0050] A sending unit, configured to send a power supply capability request to the power supply device if it is determined that the security authentication is passed;
[0051] The adjustment unit is used to send a power supply configuration adjustment message to the power supply device according to the second power level if a second power level returned by the power supply device based on the power supply capability request is received; the second power level is not less than the first power level.
[0052] In one implementation, the configuration unit is further configured to:
[0053] If a hard reset request is received from the power supply device, a hard reset operation is performed; the hard reset request is sent by the power supply device after detecting a wired connection with the power supply device.
[0054] In one implementation, the configuration unit is used to:
[0055] If a power gear broadcast message is received, then multiple common power gears included in the power gear broadcast message are obtained;
[0056] Selecting a matching first power gear from among the common power gears;
[0057] Based on the first power level, a power supply configuration request message is sent to the power supply device.
[0058] In one implementation, the universal power levels in the power level broadcast message are sorted in order from small to large or from large to small.
[0059] In one implementation, the authentication unit is used to:
[0060] Sending a device information request to the power supply device;
[0061] Receiving power supply equipment information returned by the power supply equipment based on the equipment information request;
[0062] Perform identity authentication on the power supply equipment according to the power supply equipment information;
[0063] If the identity authentication is successful, a request for manufacturer information is sent to the power supply device;
[0064] If the manufacturer identification information returned by the power supply device based on the manufacturer information request is received, the identification verification is performed according to the manufacturer identification information;
[0065] If the identification verification is successful, the power supply device is authenticated to obtain the authentication result;
[0066] If the authentication result indicates that the authentication is successful, it is determined that the security authentication is passed, otherwise, it is determined that the security authentication has failed.
[0067] In one implementation, the authentication unit is further configured to:
[0068] Determine a power threshold according to the authentication result;
[0069] Selecting a second power level not higher than a power threshold from among the second power levels;
[0070] Send a power supply configuration adjustment message including the target power level to the power supply device.
[0071] In one aspect, an embodiment of the present disclosure provides a charging device, comprising:
[0072] A detection unit, configured to send a power level broadcast message to the power-consuming device after detecting a wired connection with the power-consuming device;
[0073] a configuration unit, configured to, if receiving a power supply configuration request message including a first power level sent by the power-consuming device based on the power level broadcast message, supply power to the power-consuming device according to the first power level, and send a power supply configuration confirmation message to the power-consuming device;
[0074] The switching unit is configured to perform a role switching operation upon receiving a role switching request message sent by the power-consuming device, and return a role switching acceptance message to the power supply device;
[0075] Authentication unit, used for safety authentication with electrical equipment;
[0076] A sending unit, configured to send a second power level to the power-consuming device upon receiving a power supply capability request sent by the power-consuming device when the power-consuming device determines that the security authentication has passed;
[0077] The adjustment unit is used to adjust the power level of the power supply based on the power supply configuration message if a power supply configuration adjustment message is received from the power-consuming device according to the second power level; the second power level is not less than the first power level.
[0078] In one embodiment, the detection unit is further used for:
[0079] After detecting a wired connection with the powered device, sending a hard reset request to the powered device so that the powered device performs a hard reset operation;
[0080] Perform power-off operation;
[0081] When the specified power-off duration is reached, the power-on restart operation is performed.
[0082] In one embodiment, the detection unit is used to:
[0083] Sending a power level broadcast message including a plurality of common power levels to the power-consuming device;
[0084] Among them, the universal power levels in the power level broadcast message are sorted in order from small to large or from large to small; the first power level is a matching universal power level selected by the electrical equipment from the universal power levels.
[0085] In one implementation, the authentication unit is further configured to:
[0086] Perform current compensation operation.
[0087] In one aspect, an electronic device is provided in an embodiment of the present disclosure, including:
[0088] Processor; and
[0089] A memory stores computer instructions, wherein the computer instructions are used to cause a processor to execute the steps of the method provided in any of the various optional implementations of charging described above.
[0090] On the one hand, an embodiment of the present disclosure provides a computer-readable storage medium storing computer instructions, which are used to enable a computer to execute the steps of the method provided in any of the various optional implementations of charging as described above.
[0091] On the one hand, a computer program product is provided in an embodiment of the present disclosure, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the steps of the method provided in any of the various optional implementations of charging described above.
[0092] The charging method in the embodiment of the present disclosure includes, when performing wired charging, first performing an initial power supply configuration through a universal first power level, and then, after determining that the safety authentication has passed, the power-consuming device can obtain multiple second power levels of the power supply device, so that there are more power options, and then a higher power level can be selected from the multiple second power levels for charging, which can improve the charging efficiency while taking into account safe charging. BRIEF DESCRIPTION OF THE DRAWINGS
[0093] Figure 1 This is a charging scene diagram in an embodiment of the present disclosure.
[0094] Figure 2 It is a flow chart of a charging method in an embodiment of the present disclosure.
[0095] Figure 3 It is an interactive flow chart of a charging method in an embodiment of the present disclosure.
[0096] Figure 4 It is a structural block diagram of a charging device in an embodiment of the present disclosure.
[0097] Figure 5 It is a structural block diagram of another charging device in an embodiment of the present disclosure.
[0098] Figure 6 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0099] The technical solution of the present disclosure will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described implementation is a part of the implementation of the present disclosure, rather than all the implementations. Based on the implementation in the present disclosure, all other implementations obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure. In addition, the technical features involved in the different implementations of the present disclosure described below can be combined with each other as long as they do not conflict with each other.
[0100] In the related art, the power supply equipment usually adopts the default universal power gear for power supply configuration, and then charges the power-consuming equipment. However, in this way, it is usually difficult to charge the power-consuming equipment with a large power while ensuring charging safety, and the charging efficiency is low.
[0101] Based on the defects of the above-mentioned related technologies, the embodiments of the present disclosure provide a charging method, device, equipment, storage medium and product, which aim to improve the charging efficiency while taking into account charging safety.
[0102] A charging method is provided in an embodiment of the present disclosure, which can be applied to electronic devices. The present disclosure does not limit the type of electronic device, and the method can be any type of device suitable for implementation, such as a terminal device and a server, etc. The present disclosure will not elaborate on this.
[0103] See also Figure 1 The figure shows a charging scene. Figure 1The power supply device includes an electric device and a power supply device, and the electric device and the power supply device are connected by a charging cable. The electric device is an electronic device to be charged, such as a mobile phone, and the power supply device is a device used to charge other devices, such as a charger.
[0104] See also Figure 2 As shown, it is a flow chart of a charging method in an embodiment of the present disclosure. Figure 1 The method is described below. The specific implementation process of the method is as follows:
[0105] Step 200: After the power supply device detects a wired connection with the power-consuming device, it sends a power level broadcast message to the power-consuming device.
[0106] In one implementation, when executing step 200, the power supply device may adopt the following steps:
[0107] S2001: After detecting a wired connection with a powered device, a hard reset request is sent to the powered device, so that the powered device performs a hard reset operation.
[0108] As an example, after the charger detects a wired connection with the mobile phone (ie, one end of the charging cable of the charger is plugged into the mobile phone), the charger sends a hard reset signal to the mobile phone.
[0109] In this way, when connected, the charger can initialize the communication with the mobile phone by sending a Hard reset signal, which is equivalent to telling the mobile phone that the charger is ready to start charging and asking the mobile phone if it is also ready. This step is to synchronize the charging readiness status between the charger and the mobile phone to initialize device communication. Furthermore, through the Hardreset signal, the charger can learn the charging protocol, voltage and current requirements supported by the mobile phone, so as to adjust its output to match the needs of the mobile phone.
[0110] In one application scenario, the two ends of the charging cable are a large end (i.e., a plug) and a small end (data interface). Under related technologies, when a power supply device charges a power-consuming device through the charging cable, it is usually not possible to use a fast charging (Power Delivery, PD) protocol based on a universal serial bus (Universal Serial Bus, USB) as a charging protocol. In an embodiment of the present application, a Hard reset signal is used to enable the power supply device and the power-consuming device to charge using the PD protocol as a charging protocol.
[0111] S2002: Execute a power-off operation.
[0112] After a hard reset, the charger will temporarily power off for several milliseconds. This is a protection mechanism to prevent device damage or inefficient charging that may be caused by voltage or current mismatch.
[0113] S2003: When it is determined that the specified power-off duration has been reached, a power-on start operation is performed.
[0114] For example, the power-off duration may be specified to be several ms (milliseconds).
[0115] This gives the charger a chance to re-detect and re-confirm the connection to the phone during a power outage, ensuring that charging can then resume at the correct voltage and current.
[0116] S2004: Send a power level broadcast message including a plurality of common power levels to the power-consuming device.
[0117] The general power levels in the power level broadcast message are sorted in order from small to large or from large to small.
[0118] For example, the general power level is a standard PD protocol level, which may include: a fixed power data object (PowerDataObjects, Fixed PDO) level, and a programmable power supply (Programmable Power Supply, PPS) level.
[0119] As an example, the charger sends a source capability (source cap) message to the mobile phone, that is, a power level broadcast message. The source cap message is a broadcast message, which includes a Fixed PDO level and a PPS level, and in order from small to large, they are the Fixed PDO level and the PPS level.
[0120] In this way, the general power gears are sorted in a specific order, so that the electrical equipment can be selected according to the specific order, thereby improving the convenience of power gear selection.
[0121] Step 201: If a power level broadcast message sent by a power supply device is received, the power-consuming device sends a power supply configuration request message including a first power level to the power supply device.
[0122] Furthermore, the implementation process of step 201 may also include: if a hard reset request sent by the power supply device is received, the powered device performs a hard reset operation; the hard reset request is sent by the power supply device after detecting a wired connection with the power supply device.
[0123] In one implementation, when executing step 201, the electrical device may adopt the following steps:
[0124] S2011: If a power level broadcast message is received, obtain multiple common power levels included in the power level broadcast message.
[0125] S2012: Selecting a matching first power level from among the common power levels.
[0126] The first power level is a matching universal power level selected by the electrical equipment from various universal power levels.
[0127] It should be noted that one or more available power levels are set for each power-consuming device in advance, so that when determining that each general power level includes the available power level corresponding to the power-consuming device, it can be used as the first power level, which can also be called a safety level. This power level can ensure the normal operation of the PD protocol module in the power-consuming device. Therefore, the power corresponding to this power level is usually low, and the charging efficiency is usually low.
[0128] S2013: Based on the first power level, send a power supply configuration request message to the power supply device.
[0129] Step 202: If a power supply configuration request message is received, the power supply device supplies power to the power-consuming device at a first power level, and sends a power supply configuration confirmation message to the power-consuming device.
[0130] In one implementation, after receiving the power configuration request message, the power supply device returns a power configuration response message to the power-consuming device, such as a good cyclic redundancy check message (good CRC), to indicate that the power level requested by the power-consuming device is accepted, and the voltage and current corresponding to the output first power level are output, and a power configuration confirmation message is sent to the power-consuming device, such as a PS_RDY signal. After receiving the power configuration confirmation message, the power-consuming device can also return a configuration confirmation reception message to the power supply device, such as a good CRC.
[0131] Step 200 to step 202 are the initial stages of connecting the power supply device to the power-consuming device, so that the initial connection between the power supply device and the power-consuming device can be achieved.
[0132] Step 203: If the power supply configuration confirmation message returned by the power supply device is received, the powered device sends a role exchange request message to the power supply device.
[0133] Step 204: If the role exchange request message sent by the power-consuming device is received, the power supply device performs a role exchange operation and returns a role exchange acceptance message to the power supply device.
[0134] For example, the mobile phone sends a DR_SWAP role swap command (i.e., role swap request message) to the charger to actively apply for role swap, where the charger needs to support the role swap function. Previously, the charger led the communication, and after completing the role swap, the communication was switched to the mobile phone leading the subsequent charging process. After the switch was successful, an accept message (i.e., role swap acceptance message) was returned.
[0135] The roles include: Upstream Facing Port (UFP) and Downstream Facing Port (DFP). When the power-consuming device needs to be charged, it may be in the UFP role as the receiver of power, and when providing data services or power output to other devices, it may switch to the DFP role. Therefore, in the embodiment of the present application, before the role exchange, the roles of the power-consuming device and the power supply device are: UFP and DFP, respectively, and after the role exchange, the roles of the power-consuming device and the power supply device are: DFP and UFP, respectively.
[0136] In this way, the roles of the power supply device and the power consumption device can be exchanged to switch the device that leads the communication.
[0137] Step 205: If a role exchange acceptance message is received from the power supply device based on the role exchange request message, a security authentication is performed between the power-consuming device and the power supply device.
[0138] In one implementation, when executing step 205, the following steps may be used:
[0139] S2051: Send a device information request to the power supply device.
[0140] In one implementation, the type of the device information request may be a vendor defined message (VDM) message. For example, a Discover Identity (DiscIdentity) message (ie, a device information request) may be sent.
[0141] S2052: Receive power supply equipment information returned by the power supply equipment based on the equipment information request.
[0142] Optionally, the power supply equipment information may include at least one of the following items: a vendor identification code (VenderID, VID) and a product identification code (Product ID, PID).
[0143] S2053: Perform identity authentication on the power supply device according to the power supply device information.
[0144] S2054: If it is determined that the identity authentication is successful, a manufacturer information request is sent to the power supply device.
[0145] As an example, a DiscSVID command (ie, vendor information request) may be sent.
[0146] S2055: If the manufacturer identification information returned by the power supply device based on the manufacturer information request is received, the identification verification is performed according to the manufacturer identification information.
[0147] The manufacturer identification information may be a standard or manufacturer identification code (Standard or Vendor ID, SVID).
[0148] In this way, it is possible to identify whether the power supply device is a charger from a designated manufacturer, and to perform identification verification again based on the SVID information to further improve security. After the identification verification is passed, the private mode of communication can be entered, and the two can communicate through unstructured VDM messages.
[0149] S2056: If the identification verification is passed, the power supply device is authenticated to obtain an authentication result.
[0150] In one implementation, the power supply device can be authenticated using a SHA2-256 hash-based message authentication code (HMAC). During the authentication process, the power supply device generates a first authentication value and the power-consuming device generates a second authentication value. If the two are the same, the authentication is determined to be successful, otherwise, the authentication fails.
[0151] S2056: If the authentication result indicates that the authentication is successful, it is determined that the security authentication is passed; otherwise, it is determined that the security authentication has failed.
[0152] Furthermore, if the security authentication is passed, the power threshold can be determined according to the authentication result so as to reasonably select the subsequent power level. In one embodiment, the power threshold is obtained according to the first authentication value. The power threshold is the power range that the power supply device can provide to the power-consuming device.
[0153] Furthermore, after determining that the safety authentication has passed, the power supply current and can also be monitored, and a current compensation operation can be performed based on the monitoring result.
[0154] Among them, current compensation is to solve the problem of voltage loss caused by wire impedance. When the current passes through the wire, due to the impedance of the wire itself, the voltage actually reaching the device will be lower than the voltage output by the charger. This is especially obvious for high-power charging, because large currents will produce more voltage drops on the wire. In order to compensate for this voltage loss, the charger will increase the output voltage according to the output current. This is called line compensation or line loss compensation. For example, when testing a certain brand of charger, it can be observed that as the current increases, the voltage also increases accordingly, which is the embodiment of the current compensation function. This compensation mechanism ensures that even if there is line loss, the connected device can still receive a stable voltage and sufficient current, thereby speeding up the charging speed.
[0155] Step 206: If it is determined that the security authentication is passed, the power-consuming device sends a power supply capability request to the power supply device.
[0156] As an example, a source capability acquisition (Get source capability, Getsource cap) message, that is, a power supply capability request, is sent to the power supply device.
[0157] Step 207: If a power supply capability request is received from the power-consuming device when the power-consuming device determines that the security authentication is passed, the power supply device sends a plurality of second power levels to the power-consuming device.
[0158] After the power supply device and the power consumption device pass the safety authentication, the power supply device can broadcast all the second power gears supported by the power consumption device for the power consumption device to select.
[0159] Among them, the second power gear broadcast involves the communication protocol between the power supply device and the device (i.e., the power-consuming device). When the power supply device and the device are authenticated, the communication between them will enter a more secure and optimized stage. At this time, the power supply device will broadcast all the second power gears it supports, allowing the device to select the gear that best suits its current battery status and needs. This not only achieves fast charging, but also protects the battery from inappropriate voltage or current. These gears are designed according to the specific needs of the device and can provide more precise charging strategies. The use of the second power gear not only improves the charging efficiency, but also enhances the safety of the charging process. The implementation of this protocol relies on encrypted communication between the power supply device and the device, ensuring the security of data transmission and the correctness of the charging instructions. Only verified power supply devices can communicate efficiently with the device, making the charging process both efficient and safe.
[0160] Step 208: If the second power level returned by the power supply device based on the power supply capability request is received, the power-consuming device sends a power supply configuration adjustment message to the power supply device according to the second power level.
[0161] In one embodiment, there may be one or more second power levels, and a second power level not higher than a power threshold is screened out from each second power level; the maximum power level among the screened out second power levels is determined as the target power level, and a power supply configuration adjustment message including the target power level is sent to the power supply device.
[0162] The second power level is a selection of some power levels other than the general power level, and the second power level is not less than the first power level. Therefore, the charging efficiency can be improved.
[0163] Step 209: If a power supply configuration adjustment message sent by the power-consuming device according to the second power level is received, the power supply device adjusts the power level of the power supply based on the power supply configuration message.
[0164] In one implementation, if a power supply configuration adjustment message including a target power level is received from an electric device, the power supply device supplies power according to the target power level.
[0165] In this way, after identifying and authenticating the power supply device, charging can be performed at the safe maximum power, thereby improving charging efficiency.
[0166] Furthermore, in the above Figure 2 In the process of the charging method shown, if any interactive message between the power-consuming device and the power supply device (such as power level broadcast message, power supply configuration request message, power supply configuration confirmation message, role exchange request message, role exchange acceptance message, power supply capability request and power supply configuration adjustment message, etc.) is not transmitted successfully, power supply is maintained at the first power level.
[0167] See also Figure 3 As shown, it is an interactive flow chart of a charging method, taking the power supply device as a charger and the power consumption device as a mobile phone as an example, combined with Figure 3 , the above embodiments are further illustrated.
[0168] Step 301: After the charger detects that it is connected to the mobile phone by wire, it sends a hard reset signal to the mobile phone.
[0169] Step 302: The charger sends a power level broadcast message including a plurality of common power levels to the mobile phone.
[0170] Step 303: The mobile phone sends a power supply configuration request message including a first power level to the charger.
[0171] Step 304: The charger sends a power supply configuration response message to the mobile phone.
[0172] Step 305: The charger adjusts the power supply configuration and sends a power supply configuration confirmation message to the mobile phone.
[0173] Among them, step 301 to step 305 are the initial stage of connecting the mobile phone and the charger.
[0174] Step 306: The mobile phone sends a DR_SWAP role swap instruction to the charger.
[0175] Step 307: The charger returns an accept message to the mobile phone.
[0176] Among them, step 306-step 307 is the role exchange stage.
[0177] Step 308: Encrypted authentication is performed between the charger and the mobile phone.
[0178] Step 309: Encrypted authentication is performed between the charger and the mobile phone.
[0179] Among them, step 308-step 309 is the encryption authentication and authentication stage.
[0180] Step 310: The charger performs current compensation.
[0181] Wherein, step 310 is the current compensation stage.
[0182] Step 311: The mobile phone sends a Get source cap message to the charger.
[0183] Step 312: The charger broadcasts a plurality of second power levels to the mobile phone.
[0184] Step 313: The mobile phone sends a power supply configuration adjustment message including a target power level to the charger.
[0185] Step 314: The charger supplies power according to the target power level.
[0186] Among them, step 311 to step 314 are the second power level broadcasting and setting stage.
[0187] Among them, when executing step 301 to step 314, the specific steps refer to the above-mentioned step 200 to step 209, which will not be repeated here.
[0188] In an embodiment of the present application, when wired charging is performed, the initial power supply configuration is first performed through a universal first power level, and then, after confirming that the safety authentication has passed, the power-consuming device can obtain multiple second power levels of the power supply device, so that there are more power options, and then a target power level with higher power can be selected from the multiple second power levels for charging, which can improve the charging efficiency while taking into account safe charging.
[0189] Based on the same inventive concept, a charging device is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the above-mentioned device and equipment is similar to that of a charging method, the implementation of the above-mentioned device can refer to the implementation of the method, and the repeated parts will not be repeated. The device can be applied to electronic devices. The present disclosure does not limit the type of electronic device. It can be any type of device suitable for implementation, such as terminal devices and servers, etc. The present disclosure will not repeat this. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the electronic device in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory for execution.
[0190] See also Figure 4 , which is a structural block diagram of a charging device in an embodiment of the present disclosure. In some embodiments, the charging device in the example of the present disclosure includes:
[0191] The configuration unit 401 is configured to send a power supply configuration request message including a first power level to the power supply device if a power level broadcast message sent by the power supply device is received, so that the power supply device supplies power according to the first power level;
[0192] The exchange unit 402 is configured to send a role exchange request message to the power supply device to exchange roles with the power supply device if a power supply configuration confirmation message returned by the power supply device is received;
[0193] The authentication unit 403 is configured to perform security authentication with the power supply device upon receiving a role exchange acceptance message returned by the power supply device based on the role exchange request message;
[0194] The sending unit 404 is used to send a power supply capability request to the power supply device if it is determined that the security authentication is passed;
[0195] The adjustment unit 405 is configured to send a power supply configuration adjustment message to the power supply device according to the second power level if a second power level returned by the power supply device based on the power supply capability request is received; the second power level is not less than the first power level.
[0196] In one implementation, the configuration unit 401 is further configured to:
[0197] If a hard reset request is received from the power supply device, a hard reset operation is performed; the hard reset request is sent by the power supply device after detecting a wired connection with the power supply device.
[0198] In one implementation, the configuration unit 401 is used to:
[0199] If a power gear broadcast message is received, then multiple common power gears included in the power gear broadcast message are obtained;
[0200] Selecting a matching first power gear from among the common power gears;
[0201] Based on the first power level, a power supply configuration request message is sent to the power supply device.
[0202] In one implementation, the universal power levels in the power level broadcast message are sorted in order from small to large or from large to small.
[0203] In one implementation, the authentication unit 403 is used to:
[0204] Sending a device information request to the power supply device;
[0205] Receiving power supply equipment information returned by the power supply equipment based on the equipment information request;
[0206] Perform identity authentication on the power supply equipment according to the power supply equipment information;
[0207] If the identity authentication is successful, a request for manufacturer information is sent to the power supply device;
[0208] If the manufacturer identification information returned by the power supply device based on the manufacturer information request is received, the identification verification is performed according to the manufacturer identification information;
[0209] If the identification verification is successful, the power supply device is authenticated to obtain the authentication result;
[0210] If the authentication result indicates that the authentication is successful, it is determined that the security authentication is passed, otherwise, it is determined that the security authentication has failed.
[0211] In one implementation, the authentication unit 403 is further configured to:
[0212] Determine a power threshold according to the authentication result;
[0213] Selecting a second power level not higher than a power threshold from among the second power levels;
[0214] Send a power supply configuration adjustment message including the target power level to the power supply device.
[0215] See also Figure 5 , which is a structural block diagram of another charging device in an embodiment of the present disclosure. In some embodiments, the charging device of the present disclosure example includes:
[0216] The detection unit 501 is used to send a power level broadcast message to the power device after detecting a wired connection with the power device;
[0217] The configuration unit 502 is configured to, if a power supply configuration request message including a first power level is received from the power-consuming device based on the power level broadcast message, supply power to the power-consuming device according to the first power level, and send a power supply configuration confirmation message to the power-consuming device;
[0218] The switching unit 503 is configured to perform a role switching operation upon receiving a role switching request message sent by the power-consuming device, and return a role switching acceptance message to the power supply device;
[0219] Authentication unit 504, used for performing safety authentication with the electrical equipment;
[0220] The sending unit 505 is configured to send a second power level to the power consuming device if a power supply capability request sent by the power consuming device when the power consuming device determines that the security authentication has passed is received;
[0221] The adjustment unit 506 is used to adjust the power level of the power supply based on the power supply configuration message if a power supply configuration adjustment message sent by the power-consuming device according to the second power level is received; the second power level is not less than the first power level.
[0222] In one implementation, the detection unit 501 is further configured to:
[0223] After detecting a wired connection with the powered device, sending a hard reset request to the powered device so that the powered device performs a hard reset operation;
[0224] Perform power-off operation;
[0225] When the specified power-off duration is reached, the power-on restart operation is performed.
[0226] In one implementation, the detection unit 501 is used to:
[0227] Sending a power level broadcast message including a plurality of common power levels to the power-consuming device;
[0228] Among them, the universal power levels in the power level broadcast message are sorted in order from small to large or from large to small; the first power level is a matching universal power level selected by the electrical equipment from the universal power levels.
[0229] In one implementation, the authentication unit 504 is further configured to:
[0230] Perform current compensation operation.
[0231] The charging method in the embodiment of the present disclosure includes, when performing wired charging, first performing an initial power supply configuration through a universal first power level, and then, after determining that the safety authentication has passed, the power-consuming device can obtain multiple second power levels of the power supply device, so that there are more power options, and then a target power level with higher power can be selected from the multiple second power levels for charging, which can improve the charging efficiency while taking into account safe charging.
[0232] In an embodiment of the present disclosure, an electronic device is also provided, including:
[0233] Processor; and
[0234] The memory stores computer instructions, where the computer instructions are used to enable the processor to execute the method of any of the above embodiments.
[0235] In an embodiment of the present disclosure, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a computer to execute a method in any of the above-mentioned embodiments.
[0236] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device implements any of the above-mentioned embodiments of the method.
[0237] Figure 6 FIG. 6 is a schematic diagram showing the structure of an electronic device 6000. Figure 6 As shown, the electronic device 6000 includes: a processor 6010 and a memory 6020, and optionally, may also include a power supply 6030, a display unit 6040, and an input unit 6050.
[0238] The processor 6010 is the control center of the electronic device 6000. It connects various components using various interfaces and lines, and performs various functions of the electronic device 6000 by running or executing software programs and / or data stored in the memory 6020, thereby monitoring the electronic device 6000 as a whole.
[0239] In the embodiment of the present disclosure, the processor 6010 executes the various steps in the above embodiment when calling the computer program stored in the memory 6020.
[0240] Optionally, the processor 6010 may include one or more processing units; preferably, the processor 6010 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and applications, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 6010. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips.
[0241] The memory 6020 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, various applications, etc.; the data storage area may store data created according to the use of the electronic device 6000, etc. In addition, the memory 6020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices, etc.
[0242] The electronic device 6000 also includes a power source 6030 (such as a battery) for supplying power to various components. The power source can be logically connected to the processor 6010 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.
[0243] The display unit 6040 may be used to display information input by the user or information provided to the user and various menus of the electronic device 6000, and in the embodiment of the present disclosure, is mainly used to display the display interface of each application in the electronic device 6000 and objects such as text and pictures displayed in the display interface. The display unit 6040 may include a display panel 6041. The display panel 6041 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0244] The input unit 6050 may be used to receive information such as numbers or characters input by the user. The input unit 6050 may include a touch panel 6051 and other input devices 6052. The touch panel 6051, also known as a touch screen, may collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any other suitable object or accessory on or near the touch panel 6051).
[0245] Specifically, the touch panel 6051 can detect the user's touch operation, detect the signal brought by the touch operation, convert these signals into touch point coordinates, send them to the processor 6010, and receive and execute the command sent by the processor 6010. In addition, the touch panel 6051 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. Other input devices 6052 can include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, etc.
[0246] Of course, the touch panel 6051 can cover the display panel 6041. When the touch panel 6051 detects a touch operation on or near it, it is transmitted to the processor 6010 to determine the type of touch event. Then the processor 6010 provides corresponding visual output on the display panel 6041 according to the type of touch event. Figure 6 In the embodiment, the touch panel 6051 and the display panel 6041 are used as two independent components to realize the input and output functions of the electronic device 6000, but in some embodiments, the touch panel 6051 and the display panel 6041 can be integrated to realize the input and output functions of the electronic device 6000.
[0247] The electronic device 6000 may also include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, etc. Of course, according to the needs of specific applications, the electronic device 6000 may also include other components such as a camera. Since these components are not the key components used in the embodiments of the present disclosure, Figure 6 It is not shown and will not be described in detail.
[0248] Those skilled in the art will understand that Figure 6 The electronic device is merely an example and does not limit the electronic device, and may include more or less components than those shown in the figure, or may combine certain components, or may include different components.
[0249] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing the present disclosure, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
Claims
1. A charging method, characterized in that: The method comprises: If a power level broadcast message sent by a power supply device is received, a power supply configuration request message including a first power level is sent to the power supply device; If a power supply configuration confirmation message returned by the power supply device is received, sending a role exchange request message to the power supply device to exchange roles with the power supply device; If a role exchange acceptance message returned by the power supply device based on the role exchange request message is received, performing security authentication with the power supply device; If it is determined that the security authentication is passed, a power supply capability request is sent to the power supply device; If a second power level returned by the power supply device based on the power supply capability request is received, a power supply configuration adjustment message is sent to the power supply device according to the second power level; the second power level is not less than the first power level.
2. The method according to claim 1, characterized in that Before receiving the power level broadcast message sent by the power supply equipment, the method further includes: If a hard reset request sent by the power supply device is received, a hard reset operation is performed; the hard reset request is sent by the power supply device after detecting a wired connection with the power supply device.
3. The method according to claim 1, characterized in that If a power level broadcast message sent by a power supply device is received, a power supply configuration request message including a first power level is sent to the power supply device, including: If the power gear broadcast message is received, obtaining a plurality of common power gears contained in the power gear broadcast message; Selecting the first power level that matches the general power level from various general power levels; Based on the first power level, the power supply configuration request message is sent to the power supply device.
4. The method according to claim 3, characterized in that The general power levels in the power level broadcast message are sorted in order from small to large or from large to small.
5. The method according to any one of claims 1 to 4, characterized in that: The performing safety authentication with the power supply device includes: Sending a device information request to the power supply device; receiving power supply equipment information returned by the power supply equipment based on the equipment information request; Performing identity authentication on the power supply device according to the power supply device information; If it is determined that the identity authentication is successful, a request for manufacturer information is sent to the power supply device; If the vendor identification information returned by the power supply device based on the vendor information request is received, performing identification verification according to the vendor identification information; If the identification verification is passed, the power supply device is authenticated to obtain an authentication result; If the authentication result indicates that the authentication is successful, it is determined that the security authentication is passed, otherwise, it is determined that the security authentication has failed.
6. The method according to claim 5, characterized in that The sending a power supply configuration adjustment message to the power supply device according to the second power level includes: Determining a power threshold according to the authentication result; Selecting a second power level not higher than the power threshold from among the second power levels; The maximum power level among the selected second power levels is determined as the target power level; Sending a power supply configuration adjustment message including the target power level to the power supply device.
7. A charging method, characterized in that: The method comprises: After detecting connection with an electric device, sending a power level broadcast message to the electric device; If a power supply configuration request message including a first power level is received from the power-consuming device based on the power level broadcast message, powering the power-consuming device according to the first power level, and sending a power supply configuration confirmation message to the power-consuming device; If a role exchange request message sent by the power-consuming device is received, a role exchange operation is performed, and a role exchange acceptance message is returned to the power supply device; Performing safety authentication with the electrical equipment; If a power supply capability request sent by the power-consuming device when the power-consuming device determines that the security authentication has passed is received, sending a second power level to the power-consuming device; If a power supply configuration adjustment message sent by the power-consuming device according to the second power level is received, the power level of the power supply is adjusted based on the power supply configuration message; the second power level is not less than the first power level.
8. The method according to claim 7, characterized in that Before sending the power level broadcast message to the power-consuming device, the method includes: After detecting a wired connection with the electric device, sending a hard reset request to the electric device so that the electric device performs a hard reset operation; Perform power-off operation; When the specified power-off duration is reached, the power-on restart operation is performed.
9. The method according to claim 7 or 8, characterized in that: The sending of a power level broadcast message to the power-consuming device includes: Sending the power level broadcast message including a plurality of common power levels to the power-consuming device; Among them, the general power levels in the power level broadcast message are sorted in order from small to large or from large to small; the first power level is a matching general power level selected by the electrical equipment from the general power levels.
10. The method according to claim 7 or 8, characterized in that: After performing security authentication and before sending a plurality of second power levels to the electrical device, the method further includes: Perform current compensation operation.
11. A charging device, characterized in that: The device comprises: a configuration unit, configured to, if receiving a power level broadcast message sent by a power supply device, send a power supply configuration request message containing a first power level to the power supply device, so that the power supply device supplies power according to the first power level; a switching unit, configured to send a role exchange request message to the power supply device, if receiving a power supply configuration confirmation message returned by the power supply device, so as to exchange roles with the power supply device; an authentication unit, configured to perform security authentication with the power supply device upon receiving a role exchange acceptance message returned by the power supply device based on the role exchange request message; A sending unit, configured to send a power supply capability request to the power supply device if it is determined that the security authentication is passed; An adjustment unit is configured to send a power supply configuration adjustment message to the power supply device according to the second power level if a second power level returned by the power supply device based on the power supply capability request is received; the second power level is not less than the first power level.
12. A charging device, characterized in that: The device comprises: A detection unit, configured to send a power level broadcast message to the electric device after detecting a wired connection with the electric device; a configuration unit, configured to, if receiving a power supply configuration request message including a first power level sent by the power-consuming device based on the power level broadcast message, supply power to the power-consuming device according to the first power level, and send a power supply configuration confirmation message to the power-consuming device; a switching unit, configured to execute a role switching operation upon receiving a role switching request message sent by the power-consuming device, and return a role switching acceptance message to the power supply device; An authentication unit, used for performing safety authentication with the electrical equipment; a sending unit, configured to send a second power level to the power consuming device upon receiving a power supply capability request sent by the power consuming device when the power consuming device determines that the security authentication has passed; An adjustment unit is used to adjust the power level of the power supply based on the power supply configuration message if a power supply configuration adjustment message sent by the power-consuming device according to the second power level is received; the second power level is not less than the first power level.
13. An electronic device, characterized in that: include: processor; as well as A memory storing computer instructions, wherein the computer instructions are used to enable the processor to execute the method according to any one of claims 1 to 9.
14. A computer-readable storage medium, characterized in that: Computer instructions are stored, and the computer instructions are used to make a computer execute the method according to any one of claims 1 to 9.
15. A computer program product, characterized in that The invention comprises a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code is executed in a processor of an electronic device, the processor in the electronic device performs the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Charging method, charging device and terminal equipment
CN106058967A
Charging control method and device, electric equipment, charging equipment, system and medium
CN111864858A
Charging control method and device, terminal and storage medium
CN115473292A