Control method, data communication method, charging device, medium, and product
Patent Information
- Application Number
- CN202611160400.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-10-13
AI Technical Summary
[0003]然而,目前的充电设备仅能提供充电功能,功能较为单一
[0011]本申请实施例中,充电设备设置有用于与待充电设备连接的第一接口,充电设备通过第一接口的第一信号端子与待充电设备进行充电协商,建立充电通道;基于充电通道即可为待充电设备持续充电;而通过第一接口的第二信号端子可与待充电设备建立数据通道,基于数据通道即可与待充电设备进行数据通信,从而使得充电设备不仅可以提供充电功能,还可以提供数据通信功能,丰富了设备功能,且通过不同信号端子建立的充电通道与数据通道彼此独立,互不干扰,充电与数据通信可并行进行,数据通信不会影响充电功率和充电持续性,保证了充电性能,且实现即插即用,无需用户额外操作,提高了用户体验。
Smart Images

Figure CN122908360A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of charging technology, and in particular to a control method, a data communication method, a charging device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] In practical applications, in order to solve the problems of battery life and power consumption of electronic devices, charging devices are usually used to charge electronic devices.
[0003] However, current charging devices only provide charging functionality, which is relatively limited. Summary of the Invention
[0004] This application provides a control method, a data communication method, a charging device, a medium, and a product, which can realize charging and data communication of the charging device, thus enriching the device's functions.
[0005] In a first aspect, this application provides a control method applied to a charging device, the charging device including a first interface; the first interface is used to connect to a device to be charged, the method including: Through the first signal terminal of the first interface, a charging negotiation is conducted with the device to be charged to establish a charging channel; the charging channel is used to charge the device to be charged. A data channel is established with the device to be charged through the second signal terminal of the first interface; Data communication is performed with the device to be charged based on the data channel.
[0006] Secondly, this application provides a control method applied to a device to be charged, the device to be charged including a second interface for connecting to a first interface of a charging device, the method including: Detect the insertion status of the second interface; In response to the insertion state, the device negotiates charging with the charging device through the third signal terminal of the second interface to establish a charging channel; the charging channel is used to acquire the charging energy output by the charging device. A data channel with the charging device is established through the fourth signal terminal of the second interface; the data channel is used for data communication with the charging device.
[0007] Thirdly, this application provides a data communication method applied to a client, wherein the client is deployed in a device to be charged, the device to be charged is connected to a first interface of a charging device, and the charging device is used to establish a charging channel with the device to be charged through a first signal terminal of the first interface, and to establish a data channel with the device to be charged through a second signal terminal of the first interface. The method includes: Detection of charging equipment that establishes a data channel with the device to be charged; Data communication is performed with the charging device based on the data channel.
[0008] Fourthly, this application provides a charging device, including a main control module and a first interface connected to the main control module; the first interface is used to connect a device to be charged. The main control module is used to negotiate a charging channel with the device to be charged through the first signal terminal of the first interface to establish a charging channel; the charging channel is used to charge the device to be charged; and to establish a data channel with the device to be charged through the second signal terminal of the first interface, and to perform data communication with the device to be charged based on the data channel.
[0009] Fifthly, this application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processing component, implements the control method as described in the first aspect above, or the control method as described in the second aspect above, or the data communication method as described in the third aspect above.
[0010] In a sixth aspect, this application provides a computer program product, including a computer program or instructions, which, when executed by a processing component, implement the control method as described in the first aspect above, or the control method as described in the second aspect above, or the data communication method as described in the third aspect above.
[0011] In this embodiment, the charging device is provided with a first interface for connecting to the device to be charged. The charging device negotiates charging with the device to be charged through the first signal terminal of the first interface to establish a charging channel. Based on the charging channel, the charging device can continuously charge the device to be charged. A data channel can be established with the device to be charged through the second signal terminal of the first interface. Based on the data channel, data communication can be carried out with the device to be charged. Thus, the charging device can not only provide charging function, but also data communication function, which enriches the function of the device. Moreover, the charging channel and data channel established through different signal terminals are independent of each other and do not interfere with each other. Charging and data communication can be carried out in parallel. Data communication does not affect the charging power and charging continuity, ensuring charging performance. It also achieves plug-and-play functionality without additional user operation, improving the user experience.
[0012] These or other aspects of this application will become more apparent from the description of the following embodiments. Attached Figure Description
[0013] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This application provides a schematic diagram illustrating the structure of one embodiment of a charging device. Figure 2 This application provides a schematic diagram of the structure of yet another embodiment of a charging device. Figure 3 This application provides a schematic diagram of the structure of yet another embodiment of a charging device. Figure 4 A flowchart of one embodiment of the control method provided in this application is shown; Figure 5 A flowchart of yet another embodiment of the control method provided in this application is shown; Figure 6 A flowchart of one embodiment of a data communication method provided in this application is shown; Figures 7a-7c The following are schematic diagrams of the client interface in a practical application of the embodiments of this application; Figure 8 This application provides a signaling flowchart illustrating yet another embodiment of a control method. Figure 9 This application provides a schematic diagram of an interface screenshot. Figure 10 A schematic diagram of one embodiment of the control device provided in this application is shown; Figure 11This invention provides a schematic diagram of the structure of yet another embodiment of a control device. Figure 12 A schematic diagram of one embodiment of a data communication device provided in this application is shown. Detailed Implementation
[0014] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0015] As can be seen from the background description, current charging devices for electronic devices can only provide charging functionality, and the devices have limited functionality.
[0016] In the process of developing this application, the inventors discovered that in actual use, users have needs such as knowing the status of the charging device itself (e.g., remaining power, temperature, etc.). Furthermore, users also have needs for portable management of the charging device, such as switching charging modes and locating the device. When the device to be charged is a portable mobile device, there is also a need for expanded external storage. Therefore, if the charging device can expand its data communication function, it will greatly satisfy these needs. Based on this, the inventors further discovered that the interface of the charging device can usually support data transmission and charging. However, if data transmission is allowed while charging, it can generally only perform slow charging at, for example, 5V / 500mA, which cannot meet the needs of fast charging. To achieve fast charging, the inventors conceived of using the data channel for charging negotiation; however, this would terminate data communication. Conversely, to perform data communication, charging must be stopped. To achieve switching between charging and communication modes, corresponding buttons need to be set in the charging device, and mode switching is completed through specific button operations, which undoubtedly increases the user's operational burden. In addition, the inventors have considered other implementations that could support charging through an interface, such as configuring a wireless communication module like a Bluetooth module in the charging device to achieve data communication. However, this requires users to configure wireless communication, such as Bluetooth pairing, which would increase the user's operational burden. Furthermore, it would require an additional wireless communication module, which would not only increase costs but also affect the lightweight design of the charging device.
[0017] Based on the above research findings, in order to enrich device functionality and ensure charging performance, the inventors have creatively proposed the technical solution of this application. In the embodiments of this application, the charging device is provided with a first interface for connecting to the device to be charged. The charging device negotiates charging with the device to be charged through the first signal terminal of the first interface to establish a charging channel, enabling continuous charging of the device to be charged. A data channel can be established with the device to be charged through the second signal terminal of the first interface, allowing data communication. This allows the charging device to provide not only charging but also data communication, enriching its functionality. Furthermore, the charging channel and data channel established through different signal terminals are independent and do not interfere with each other, allowing charging and data communication to proceed in parallel. Data communication does not affect charging power or charging continuity. Moreover, fast charging can be achieved through charging negotiation, thus ensuring charging performance and improving user experience. It is also plug-and-play, requiring no additional user operation, further enhancing the user experience.
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] Figure 1 This illustration shows a structural schematic diagram of one embodiment of a charging device provided in this application. The charging device may include a main control module 101 and a first interface 102 connected to the main control module 101. The first interface 102 can be used to connect a device to be charged.
[0020] The main control module 101 can be used to negotiate charging with the device to be charged through the first signal terminal of the first interface 102 to establish a charging channel; and to establish a data channel with the device to be charged through the second signal terminal of the first interface 102, and to communicate data with the device to be charged based on the data channel. The charging channel can then charge the device to be charged.
[0021] The first interface can be a USB (Universal Serial Bus) interface, which has both data transmission and power supply functions. The first signal terminal and the second signal terminal are different signal terminals in the first interface. The first signal terminal is used for charging negotiation, and the second signal terminal is used for data transmission.
[0022] In one alternative approach, the first interface can be a USB-C interface, and the first signal terminal can refer to the negotiation terminal of the USB-C interface, such as the CC (Configuration Channel) pin; the main control module can negotiate with the device to be charged through the CC pin to establish a charging channel in accordance with the USB PD (Power Delivery) protocol.
[0023] The second signal terminal can be a differential signal pin of the USB-C (USB Type-C, a reversible USB interface standard), such as D+ / D- (Data+ / Data-, positive data / negative data) pin or Tx / Rx (Transmit / Receive, data transmission / data reception) pin. Optionally, in order to ensure universality and reduce technical and hardware costs, the second signal terminal can be a D+ / D- pin.
[0024] Of course, this application is not limited to this. Interfaces that provide a first signal terminal for charging negotiation and a second signal terminal for data transmission are also applicable to the technical solutions of this application.
[0025] The device to be charged may include a second interface. The first interface and the second interface have the same interface type, such as both being USB-C interfaces. In one implementation, the first interface can be used to connect directly to the second interface. The first interface can be a male connector, and the second interface can be a female connector. In another implementation, the first interface can be used to connect to the second interface via a data cable. Both the first interface and the second interface can be configured as female connectors, and the two ends of the data cable are respectively configured with male connectors for insertion into the first interface and the second interface, thereby realizing the connection between the first interface and the second interface.
[0026] In practical applications, the device to be charged can be any electronic device that requires charging, such as a mobile phone, camera, tablet computer, laptop, or wearable device. This application does not limit this to such devices.
[0027] The charging device in this embodiment can establish independent charging and data channels with the device to be charged through the first signal terminal and the second signal terminal of the first interface. Thus, the charging device can not only charge the device to be charged, but also realize data communication with the device to be charged, which enriches the device's functions. Moreover, charging and data communication can be carried out in parallel, and data communication will not affect the charging power and charging continuity. Through charging negotiation, fast charging can be achieved, ensuring charging performance and improving user experience. Furthermore, it can be plug-and-play without user operation, further improving the user experience.
[0028] Specifically, the main control module 101 can negotiate charging with the device to be charged through the first signal terminal of the first interface 102, determine charging parameters, and establish a charging channel with the device to be charged through the power terminal of the first interface 102 according to the charging parameters; the charging channel is specifically used to charge the device to be charged through the power terminal according to the charging parameters.
[0029] The main control module 101 can adjust the charging energy according to the charging parameters and output the charging energy to the device to be charged through the power terminal, thereby charging the device. The charging parameters may include, for example, charging power, charging voltage, and charging current.
[0030] The power terminal could be, for example, the VBUS (Voltage Bus) pin and the GND (Ground) pin in a USB-C interface.
[0031] Optionally, the main control module 101 can negotiate charging with the device to be charged according to a charging protocol, such as the USB PD protocol. During the charging negotiation process, the main control module 101 and the device to be charged can send negotiation messages to each other to determine charging parameters. For example, according to the PD protocol, the main control module 101 can send a power capability message to the device to be charged through a first signal terminal. This power capability message can include multiple charging parameters supported by the charging device, such as 5V / 3A, 9V / 3A, 12V / 2A, etc. Upon receiving the power capability message, the device to be charged can select appropriate charging parameters according to its own capabilities and send a reply message based on the selected charging parameters. The main control module 101 can receive the reply message and determine the charging parameters through the first signal terminal, and can also send an acceptance message to the device to be charged through the first signal terminal.
[0032] The main control module 101 can adjust at least one of the charging voltage and charging current according to the charging parameters, and start the power terminal. The charging channel is then established, and the charging energy is output to the device to be charged through the power terminal.
[0033] Optionally, the main control module 101 may detect the power supply terminal of the first interface 102 being powered on, and negotiate charging with the device to be charged through the first signal terminal of the first interface 102 to determine the charging parameters.
[0034] With the device to be charged connected to the first interface 102, the insertion status can be detected through the first signal terminal, confirming that the physical connection has been established. Afterwards, the main control module 101 can adjust the charging power to default parameters, such as 5V / 500mA, and output it to the power terminal, thus powering on the power terminal. At this time, only slow charging of the device to be charged can be performed through the power terminal. Once the main control module detects that the power terminal is powered on, it can negotiate charging with the device to be charged through the first signal terminal to determine the charging parameters suitable for fast charging.
[0035] In this process, the charging device and the device to be charged communicate as different data roles. The data role describes whether the device acts as a host or a slave in data transmission, and can include a host role (DataHost) and a device role (Data Device). Data communication via the interface must be initiated and managed by one device as the host, and the other device as the slave responding. In the USB PD protocol, the host role is typically represented by DFP (Downstream Facing Port), and the device role by UFP (Upstream Facing Port). When the master control module 101 negotiates charging with the device to be charged, it determines that the device to be charged is the power recipient and the charging device is the power supplier. When the device to be charged is the power recipient, its data role is the host role by default.
[0036] To reduce complexity and improve versatility, as another embodiment, the main control module can also exchange data roles with the device to be charged through the first signal terminal to obtain the device role; then the main control module can establish a data channel with the device to be charged through the second signal terminal of the first interface as follows: the device role is used to establish a data channel with the device to be charged through the second signal terminal of the first interface.
[0037] By exchanging data roles, the device to be charged can act as the host, while the charging device acts as the device. The device to be charged can actively enumerate the charging devices, while the charging device only needs to passively respond to the device to be charged and perform data communication operations. Therefore, the hardware complexity of the charging device can be reduced and its versatility can be improved.
[0038] Furthermore, the main control module, acting as a device, can establish a data channel with the device to be charged through the second signal terminal of the first interface, as follows: Obtain the enumeration request sent by the device to be charged through the second signal terminal; the enumeration request is generated after the device to be charged switches to the host role; in response to the enumeration request, send device description information to the device to be charged through the second signal terminal in the device role, so that the device to be charged loads the driver corresponding to the device description information to establish a data channel with the charging device.
[0039] The device description information can be pre-configured in the charging device at the factory. This description can include standard device types supported by the native system of the device being charged, such as, but not limited to, HID (Human Interface Device), CDC (Communications Device Class), Audio (Audio Device Class), and MIDI (Musical Instrument Digital Interface). The native system of the device being charged already has built-in system drivers for these standard device classes, so no additional proprietary drivers are needed. Therefore, the device being charged acts as the host, and the charging device acts as the device, achieving a driverless, plug-and-play effect. By loading the driver, the charging device can be identified, and a data channel can be established between them.
[0040] As described above, during charging negotiation, the main control module 101 and the device to be charged exchange negotiation messages. These messages include a data role field, carrying the default data role. Therefore, in some embodiments, the main control module exchanges data roles with the device to be charged via the first signal terminal to obtain the device role, which can be achieved as follows: The negotiation message received through the first signal terminal is parsed to determine the first data role of the device to be charged; if the first data role is the device role, a data role exchange command is sent to the device to be charged through the first signal terminal, and the second data role of the device is switched to the device role; the data role exchange command is used to instruct the device to be charged to switch the first data role to the host role.
[0041] The negotiation message sent by the device to be charged carries its first data role. This first data role can be determined. If it is a host role, the device can directly establish a data channel with the device through the second signal terminal of the first interface, acting as a device. If it is a device role, a data role swap command can be sent to the device through the first signal terminal, switching the device's second data role to that of a device. When negotiating charging with the device according to the USB PD protocol, this data role swap command could be, for example, the DR_SWAP (Data Role Swap) command.
[0042] The data communication method can be implemented in multiple ways. In one optional method, the above-mentioned data communication between the device to be charged and the data channel can include: The system acquires device status data and sends it to the device to be charged via a data channel, so that the client in the device to be charged can obtain and display the status prompt information corresponding to the device status data on the display interface.
[0043] Device status data may include at least one of the following: charging power, charging voltage, charging current, temperature, remaining power, remaining usable time, full charge time, and number of charge / discharge cycles.
[0044] A corresponding client can be deployed in the device to be charged. The device status data received by the device through the data channel can be provided to the client through the system interface. The client can then obtain and display the corresponding status prompts on the display interface. Through the client's display interface, the device status data of the charging device can be understood in real time, and the specific values are displayed in digital form on the display interface, so as to achieve precise control of the charging device.
[0045] In another alternative approach, the aforementioned data communication with the device to be charged based on the data channel may include: acquiring control commands sent by the client based on the data channel, and executing corresponding control operations according to the control commands.
[0046] For example, the control instruction can be a firmware upgrade instruction, including a firmware program, which the main control module can use to upgrade the device; or, for example, a mode switching instruction, including a request to switch charging parameters, which the main control module can use to adjust the charging power according to the requested parameters; or, for example, a charging strategy, such as a charging cutoff threshold, which the main control module can use to control when the charging channel closes; or, for example, a search instruction, which the main control module can use to control the vibration module in the charging device to vibrate, or control the speaker to emit a specific audio sound, such as a buzzer, or control the indicator light to flash; or, for example, a storage instruction, including data storage, which the charging device can use to save the data to; or, for example, a brightness adjustment instruction, including screen brightness, which the charging device can use to adjust the display module according to the screen brightness; or, for example, a clock setting instruction, including time information, which the charging device can use to adjust the clock module according to the time. It should be noted that the above control instructions are merely illustrative examples and this application is not limited to these.
[0047] In addition, the device description information sent by the main control module 101 in the role of a device may include, for example, VID (Vendor ID) or PID (Product ID), and may also include the identification of the charging device such as SN (Serial Number).
[0048] After the device to be charged loads its driver and establishes a data channel, it can send a device insertion notification. Optionally, the device to be charged can send the device insertion notification via broadcast. After the client detects the device insertion notification, the client can then communicate with the charging device via the data channel.
[0049] The client can call the system interface to detect device insertion notifications. Upon detection, it can retrieve the charging device with an established data channel from the list of devices to be charged and read its description information. The client can identify whether the device is from a specific manufacturer or is a specific product based on the VID or PID in the device description information. If not, the client can refuse data communication with that charging device. The VID or PID can also be displayed on the client's interface.
[0050] In addition, the client can establish a binding relationship with the charging device, specifically a binding relationship between a user account and the charging device's identity identifier, such as a serial number (SN). The binding relationship can be established by the client sending a binding request to the server. The server checks if a binding relationship exists between the user account and the identity identifier; if not, it establishes the binding relationship. Through this binding relationship, the client can synchronize the first preset type of data corresponding to the charging device to the server, so that the server can recognize the binding relationship and save the first preset type of data. After the client sends the binding request, if the server detects an existing binding relationship, it can also send the second preset type of data corresponding to the identity identifier to the client, allowing the client to display the corresponding data prompt information on the display interface.
[0051] The first preset data type may include, for example, one or more of the following: location information of the charging device (i.e., the location information of the device to be charged), charging records such as the number of charging attempts and total discharge amount, and personalized data for the charging device. The personalized data may include, for example, one or more of the following: user-defined device name, interface image, and personalized charging settings. Here, the interface image refers to the user setting the charging interface image via a client based on the data channel, when the charging device has a display module, for display in the display module.
[0052] The second preset data type may include, for example, one or more of the following: the charging device's most recent location information, charging records, and interface personalization data.
[0053] The main control module 101 can be implemented as an independent component, or it can be composed of multiple electronic components. Therefore, as another embodiment, such as Figure 2 The schematic diagram of the charging device shown is consistent with... Figure 1The difference in the charging device shown is that the main control module may include a charging protocol module 201 and a processing module 202; The charging protocol module 201 is used to negotiate charging with the device to be charged through the first signal terminal of the first interface, determine charging parameters, and send the charging parameters to the processing module. The processing module 202 is used to establish a charging channel with the device to be charged according to the charging parameters; and to establish a data channel with the device to be charged through the second signal terminal of the first interface, and to perform data communication with the device to be charged based on the data channel.
[0054] As an optional approach, the main control module may also include a charging control module. The aforementioned processing module 202, according to the charging parameters, establishes a charging channel with the device to be charged, which is further implemented by sending a charging command to the charging control module based on the charging parameters. The charging control module is used to adjust the power supply output of the power module according to the charging command, and output the adjusted charging power to the device to be charged through the power terminal of the first interface to establish a charging channel with the device to be charged.
[0055] Of course, the charging control module and the charging protocol module can be integrated together, or the charging protocol module can be an independent component with charging control functions. Therefore, optionally, the processing module can send a charging command to the charging protocol module according to the charging parameters, and the charging protocol module adjusts the power supply output of the power module according to the charging command, and outputs the adjusted charging power to the device to be charged through the power terminal of the first interface to establish a charging channel with the device to be charged.
[0056] The processing module 202 can be implemented as an independent component, such as an MCU with integrated interface functions and support for device roles. The processing module can directly perform data channel establishment operations, etc.
[0057] Furthermore, the processing module 202 can be composed of multiple electronic components, such as Figure 3 The schematic diagram of the charging device shown is consistent with... Figure 2 The difference in the charging device shown is that the processing module may include a communication protocol module 301 and a control module 302.
[0058] Among them, the communication protocol module 301 is used to establish a data channel with the device to be charged through the second signal terminal of the first interface in the role of a device; The control module 302 is used to establish a charging channel with the device to be charged according to the charging parameters; and to use the communication control module to conduct data communication with the device to be charged based on the data channel.
[0059] In practical applications, when the first interface is a USB interface, the control module can be, for example, a regular MCU that does not support USB functionality, and the communication protocol module can be, for example, a serial-to-USB chip. The MCU can communicate with the serial-to-USB chip via UART, and the serial-to-USB chip is responsible for enumeration and data channel establishment operations.
[0060] In addition, in one implementation, the charging device can be a power bank, optionally, such as... Figure 2 As shown in Figure 3, the charging device may also include a power module 103. Figure 2 In this configuration, the power module 103 can be connected to both the charging protocol module 201 and the processing module 202. Figure 3 In this system, the power module 103 can be connected to the communication protocol module 301 and the control module 302 respectively. The power module can supply power to each module and output charging power to charge the device to be charged.
[0061] Of course, as another implementation, the charging device can be a power adapter or charger. Therefore, the charging device can also include a plug for inserting an external power source. The main control module can convert the electrical energy provided by the external power source into charging energy for output. This external power source can be, for example, 220V AC power. The main control module can convert AC power into DC power and adjust it according to the charging parameters.
[0062] Furthermore, as yet another embodiment, such as Figure 2 As shown in Figure 3, the charging device may also include a data acquisition module 104, such as Figure 2 As shown, the data acquisition module 104 can be connected to the power supply module 103 and the processing module 202, such as... Figure 3 As shown, the data acquisition module 104 can be connected to the power supply module 103 and the control module 302, etc. The data acquisition module 104 can be used to collect at least some device status data, such as temperature, voltage, current, power, remaining battery power, cycle count, etc.; the data acquisition module may include electronic components such as ADCs and sensors.
[0063] Of course, the processing module 202 or the control module 302 can also be responsible for collecting at least some of the device status data, such as the device's operating time. Alternatively, the processing module 202 or the control module 302 can collect data such as voltage, current, power, remaining battery power, and cycle count, while the data acquisition module can be responsible for collecting data such as temperature.
[0064] Furthermore, in practical applications, during the charging process of the charging device charging the device to be charged through the charging channel, there may be charging abnormal events. At this time, the main control module 101 detects the charging abnormal event, can disconnect the charging channel and the data channel, and re-negotiate with the device to be charged through the first signal terminal of the first interface to re-establish the charging channel and re-establish the data channel with the device to be charged through the second signal engine of the first interface. The specific implementation methods of charging negotiation, charging channel and data channel can be found in the previous text, and will not be repeated here.
[0065] Optionally, the main control module 101 may actively disconnect the first signal terminal and turn off the power terminal when a charging abnormality event is detected, so as to cut off the transmitted charging power, thereby disconnecting the charging channel. After the charging channel is disconnected, the data channel will also be disconnected, terminating data communication with the device to be charged.
[0066] After the main control module 101 disconnects the charging channel and the data channel, it may optionally re-negotiate charging with the device to be charged through the first signal terminal of the first interface after a predetermined time interval, so as to re-establish the charging channel. The predetermined time interval is used to ensure that the device to be charged can fully release its resources.
[0067] The main control module 101 can power on the power terminals and activate the first signal terminal to re-negotiate charging and re-execute the data channel establishment operation.
[0068] As described above, the main control module 101 negotiates charging with the device to be charged according to the charging protocol. After the charging channel and data channel are established, if an error occurs in the charging protocol, a charging abnormality event can be generated. The purpose of charging negotiation is to determine the charging parameters so that the charging channel can charge the device to be charged according to the charging parameters and through the power terminal. A scenario where the charging protocol fails could be: during charging, if the temperature becomes too high due to high charging power, the main control module may reduce the charging power to ensure the safe use of the charging device. In this case, a second charging negotiation will be initiated with the device to be charged, but the charging channel and data channel remain open. Due to compatibility issues, the device to be charged may not accept the second charging negotiation, causing the negotiation to fail, thus generating a charging abnormality event. Therefore, in some embodiments, the charging abnormality event can be generated as follows: if the charging parameters meet the adjustment requirements, a second charging negotiation is initiated with the device to be charged through the first signal terminal; if the second charging negotiation fails, the charging abnormality event is generated.
[0069] In this case, the failure of the second charging negotiation may be due to the failure to receive a reply message for the power capability message sent for the second charging negotiation within a predetermined time, or the receipt of an error message sent by the device to be charged. In this case, the charging channel and data channel can be disconnected, and the charging negotiation with the device to be charged can be re-established through the first signal terminal of the first interface based on the adjusted charging parameters.
[0070] Optionally, if the device to be charged detects a disconnection in the charging channel or data channel, it can send a disconnection notification to the client. The client can then display a disconnection message via a pop-up window or similar method to indicate that the charging channel and data channel are disconnected. After the data channel is re-established, the device to be charged can resend a device insertion notification to the client. The client can then restore the data channel with the device to be charged based on this notification.
[0071] Optionally, the client can also verify whether the identity identifier in the device description information is the original charging device. If so, the output disconnection prompt message can be canceled.
[0072] The technical solution of this application will be described below from the perspectives of different devices and method execution entities. Figure 4 This is a flowchart illustrating one embodiment of a control method provided in this application. The technical solution of this embodiment can be executed by a charging device, specifically by a main control module within the charging device. The charging device includes a first interface for connecting a device to be charged. The specific structure of the charging device can be found in the corresponding embodiments described above, and will not be repeated here.
[0073] Figure 4 The control method shown may include the following steps: 401: Through the first signal terminal of the first interface, perform charging negotiation with the device to be charged to establish a charging channel.
[0074] This charging channel is used to charge the device to be charged.
[0075] 402: Establish a data channel with the device to be charged through the second signal terminal of the first interface.
[0076] 403: Data communication with the device to be charged based on the data channel.
[0077] In this embodiment, the charging device can provide both charging and data communication functions, enriching the device's functionality. Furthermore, the charging and data channels established through different signal terminals are independent of each other and do not interfere with each other. Charging and data communication can be carried out in parallel, and data communication will not affect the charging power and charging continuity, ensuring charging performance. Moreover, it achieves plug-and-play functionality without requiring additional user operation, thus improving the user experience.
[0078] As another embodiment, the method may further include: exchanging data roles with the device to be charged through a first signal terminal to obtain a device role; the above-mentioned establishment of a data channel with the device to be charged through the second signal terminal of the first interface can be implemented as: establishing a data channel with the device to be charged through the second signal terminal of the first interface with the device role.
[0079] In one or more embodiments, the above-mentioned exchange of data roles with the device to be charged via the first signal terminal to obtain the device role may include: The negotiation message received through the first signal terminal is parsed to determine the first data role of the device to be charged; if the first data role is the device role, a data role exchange command is sent to the device to be charged through the first signal terminal, and the second data role of the device is switched to the device role; the data role exchange command is used to instruct the device to be charged to switch the first data role to the host role.
[0080] In one or more embodiments, the establishment of a data channel between the device and the device to be charged via the second signal terminal of the first interface, as described above, may include: Obtain the enumeration request sent by the device to be charged through the second signal terminal; the enumeration request is generated after the device to be charged switches to the host role; in response to the enumeration request, send device description information to the device to be charged through the second signal terminal in the device role, so that the device to be charged loads the driver corresponding to the device description information to establish a data channel with the charging device.
[0081] In one or more embodiments, the above-mentioned charging negotiation with the device to be charged via the first signal terminal of the first interface to establish a charging channel may include: The system detects that the power terminal of the first interface is powered on, and negotiates charging parameters with the device to be charged through the first signal terminal of the first interface to determine the charging parameters. According to the charging parameters, a charging channel is established with the device to be charged through the power terminal. The charging channel is specifically used to charge the device to be charged through the power terminal according to the charging parameters.
[0082] In one or more embodiments, the above-described data communication with the device to be charged based on the data channel may include...
[0083] Acquire device status data and send the device status data to the device to be charged via a data channel, so that the client in the device to be charged can obtain and display the status prompt information corresponding to the device status data on the display interface; In one or more embodiments, the above-mentioned data communication with the device to be charged based on the data channel includes: obtaining control commands sent by the client based on the data channel, and performing corresponding control operations according to the control commands.
[0084] In one or more embodiments, the method may further include: detecting a charging abnormality event, disconnecting the charging channel and the data channel; re-negotiating charging with the device to be charged through the first signal terminal of the first interface to re-establish the charging channel, and re-establishing the data channel with the device to be charged through the second signal terminal of the first interface.
[0085] Optionally, a charging anomaly event can be generated as follows: if the charging parameters meet the adjustment requirements, a second charging negotiation is performed with the device to be charged through the first signal terminal; if the second charging negotiation fails, the charging anomaly event is generated.
[0086] Figure 5 This is a flowchart of another embodiment of a control method provided by this application. The technical solution of this embodiment can be executed by the device to be charged, specifically by the operating system of the device to be charged. The device to be charged is provided with a second interface, which is used to connect to the first interface of the charging device.
[0087] This method may include the following steps: 501: Detect the insertion status of the second interface.
[0088] 502: In response to the insertion state, negotiate charging with the charging device through the third signal terminal of the second interface to establish a charging channel.
[0089] The second interface can have the same interface type as the first interface. The third signal terminal of the second interface has the same terminal type as the first signal terminal of the first interface, for example, it can be a configuration channel pin. The fourth signal terminal of the second interface has the same type as the fourth signal terminal of the first interface, for example, it can be a differential signal pin. Additionally, the second interface may also have power terminals. When the first and second interfaces are connected, the first signal terminal of the first interface and the third signal terminal of the second interface will establish a physical connection, as will the second signal terminal of the first interface and the fourth signal terminal of the second interface. The power terminals of the first and second interfaces will also establish a physical connection.
[0090] After the first and second interfaces of the charging device are connected, the device to be charged can detect the insertion status of the second interface. Optionally, the insertion status can be detected through the third signal terminal of the second interface, at which point the physical connection can be confirmed. The charging device will output slow charging power, and the power terminals of the device to be charged will be powered on. Afterwards, charging negotiation can be conducted with the charging device through the third signal terminal of the second interface, thereby establishing a charging channel.
[0091] The device to be charged can obtain the charging energy output by the charging device through the charging channel to charge itself.
[0092] 503: Establish a data channel with the charging device through the fourth signal terminal of the second interface; the data channel is used for data communication with the charging device.
[0093] In another embodiment, the method may further include: in response to a data role exchange command sent by the charging device through the third signal terminal of the second interface, switching its own first data role to a host role; then the establishment of a data channel with the charging device through the fourth signal terminal of the second interface may include: The host sends an enumeration request to the charging device through the fourth signal terminal of the second interface; it obtains the device description information sent by the charging device through the fourth signal terminal of the second interface; and it loads the driver corresponding to the device description information to establish a data channel with the charging device. Data communication with the charging device can then be performed based on this data channel.
[0094] Optionally, in one or more embodiments, a client may be deployed in the device to be charged; therefore, after the data channel is established, the method may further include: Send a device insertion notification. This device insertion notification instructs the client deployed in the device to be charged to communicate with the charging device via the data channel.
[0095] In addition, the client can also establish a binding relationship with the charging device. The device insertion notification can be broadcast. After the client starts, it can scan for the device insertion notification and then obtain the device description information from the operating system. It can then establish a binding relationship with the user account based on the identity identifier in the device description information. Of course, after detecting the device insertion notification, it can also request the charging device to send its identity identifier through this data channel before establishing a binding relationship between the identity identifier and the user account.
[0096] Optionally, in one or more embodiments, the method may further include: detecting a disconnection of the charging channel or the data channel, and sending a disconnection notification. The disconnection notification may instruct the client to output a disconnection message, such as displaying a disconnection message in a pop-up window. The disconnection message may be, for example, "Connection interrupted, retrying," etc.
[0097] Disconnection can be broadcast, and when a client scans for the disconnection notification, it can output a disconnection message.
[0098] Figure 6 This is a flowchart of an embodiment of a data communication method provided by this application. The technical solution of this embodiment can be executed by a client, which is deployed in a device to be charged. The device to be charged is connected to a first interface of a charging device. The charging device is used to establish a charging channel with the device to be charged through a first signal terminal of the first interface, and to establish a data channel with the device to be charged through a second signal terminal of the first interface.
[0099] Figure 6 The data communication method shown may include the following steps: 601: A charging device that establishes a data channel with the device to be charged.
[0100] 602: Data communication with charging equipment based on the data channel.
[0101] In another embodiment, detecting the charging device that has established a data channel with the device to be charged can be done by: detecting the device insertion notification sent by the device to be charged and identifying the charging device; the device insertion notification is generated after the device to be charged and the charging device establish a data channel; obtaining the device identification information of the charging device; and displaying the corresponding device prompt information of the charging device on the display interface based on the device identification information.
[0102] The device identification type information may include at least one of PID and VID. The device prompt information may include the device identification type information. In addition, it may include a card control corresponding to the device identification type information. The device identification information can be displayed in the form of a card control in the display interface.
[0103] In one or more embodiments, the method may further include: detecting a disconnection notification and outputting a disconnection prompt message, such as displaying the disconnection prompt message in a pop-up window.
[0104] This disconnection notification can be sent by the device being charged if it detects that the charging channel or data channel is disconnected.
[0105] In one or more embodiments, the above-described data communication with the charging device based on the data channel may include: The device status data transmitted by the charging device is obtained through the data channel; the status prompt information corresponding to the device status data is displayed on the display interface.
[0106] The status notification information may include a first status notification and a second status notification. The first status notification may be displayed in the aforementioned card control to indicate one or more status data, such as remaining battery power. The second status notification may be displayed on the data details page and may include all device status data. The second status notification may represent device status data in the form of text or charts, etc., and this application does not limit this.
[0107] Furthermore, in one or more embodiments, the method may further include: Display control prompts of at least one control type on the display interface; in response to a control operation triggered for any control type, send a control command to the charging device via the data channel; the control command is used to instruct the charging device to perform the corresponding control operation.
[0108] In one or more embodiments, the method may further include: Based on the identity identifier in the device identification information, a binding request is sent to the server to establish a binding relationship between the identity identifier and the user account.
[0109] In one or more embodiments, sending a binding request to the server based on the identity identifier in the device identifier class information may include: Based on the identity identifier in the device identification information, a query request is sent to the server to check whether the user account is bound to the identity identifier; if the query result from the server determines that the identity identifier is not bound to the user account, a binding request is sent to the server to establish the binding relationship between the identity identifier and the user account. Then, the second preset type of data sent by the server for this identity can be obtained, and the data prompt information corresponding to the second preset type of data can be displayed on the display interface; In addition, the method also includes: synchronizing the first preset type data corresponding to the charging device to the server so that the server can save the first preset type data according to the corresponding binding relationship.
[0110] The client's display interface can show different prompts on different pages, for example, see [link to example]. Figures 7a-7c In the interface diagram shown, device prompt information 701 for each charging device can be displayed on the device list page 70. Alternatively, the device prompt information can be displayed in a card control corresponding to each charging device.
[0111] In addition, after the data channel is established and the device status data is obtained, the first status prompt information 702 can also be displayed in the card control.
[0112] Among them, the trigger operation of the card control corresponding to any charging device can display the corresponding data details page 71, and the second status prompt information 703 can be displayed on the data details page.
[0113] Optionally, if the data channel of any charging device is closed, the card control can be switched to a predetermined display state, such as adjusting the display color to gray.
[0114] In addition, the device list page can also display different navigation controls to switch to different pages. Furthermore, the display interface can also show a control page 73, which can be accessed via corresponding navigation controls. The control page 73 can display control prompts 704 of at least one control type.
[0115] The client can also bind user accounts to identity identifiers by sending a binding request to the server. If the server fails to bind the user, the client can resend the binding request until the binding is successful or the number of retries is reached.
[0116] Furthermore, when displaying the data details page, if a data channel is detected to be closed, a connection prompt can be displayed to remind the user to check whether a connection has been established with the charging device. This connection prompt can be displayed as a pop-up or an overlay, but this application is not limited to these methods.
[0117] For ease of understanding, the following example uses the first and second interfaces as USB-C ports, the device to be charged as a mobile phone, and the charging device as a power bank. Figure 8 The signaling flowchart of the control method shown illustrates the technical solution of this application. Furthermore, Figure 9 The diagram shows a cross-sectional view of a USB-C interface. The USB-C interface has identical terminals on both sides, and the two sides are mirror images of each other, enabling reversible blind insertion. The USB-C interface may include pins such as VBUS, GND, CC, and D+ / D-. It should be noted that... Figure 9 Only a partial pin diagram is shown. Through the CC pin, the power bank 80 and the mobile device 81 can negotiate charging according to the USB PD protocol to establish a charging channel. The power bank 80 then outputs charging power, and the mobile device 81 receives charging power through the charging channel. A data channel is established via USB enumeration through the D+ / D- pins. The charging channel and data channel are physically separated, have independent protocols, and do not require time-division multiplexing, enabling parallel operation.
[0118] Specifically, see Figure 8 The flowchart illustrates that the user can establish a physical connection by inserting the first USB-C port of the power bank 80 into the second USB-C port of the mobile device 81, or by using a full-featured USB-C data cable to connect both the first and second USB-C ports. The power bank 80 detects power on the VBUS pin, confirming the physical connection. Subsequently, the power bank 80 negotiates charging parameters with the mobile device 81 via the CC pin (step 801). Then, it adjusts the output charging power of the power module according to the charging parameters to establish a charging channel (step 802). Charging power then flows into the mobile device's battery through the VBUS pin, and charging officially begins. The charging channel is established independently and operates stably, unaffected by subsequent data operations. The power bank 80 parses the negotiation message to confirm the data role of the mobile device 81. If the mobile device's data role is device, a switching process is triggered; if it is host, the subsequent data channel establishment process can be executed. During the switching process, the power bank 80 switches its role to UFP and sends a DR_SWAP command to the mobile device 81 via the CC pin (step 803). The mobile device 81 receives the DR_SWAP command via the CC pin and switches its role to DFP. Then, the data channel establishment process is executed. After switching to DFP, the mobile device 81 detects a level change on the D+ / D- pins and initiates a USB enumeration request via the D+ / D- pins (step 804). After receiving the enumeration request, the power bank 80 reports device description information to the mobile device 81 via the D+ / D- pins (step 805), which may include device type and device identification information. The mobile device 81 identifies the device type, such as HID or CDC, and automatically loads the corresponding standard class driver in the kernel, thus establishing a data channel without the need to install additional drivers (step 806), and can broadcast a device insertion notification. The mobile device 81 is equipped with a client 82. After the client 82 starts, it will scan for device insertion notifications and detect that the power bank 80 is online (step 806). The client can display the card control corresponding to the power bank in the display interface and display device prompt information in the card control.
[0119] In addition, the client can obtain the identity identifier of the power bank 80 and query the server 83 to see if the identity identifier is bound to a user account. The server 83 can provide the query result. If the query result is that it is not bound, the client 82 can send a binding request to the server 83 (step 807) to request the establishment of a binding relationship between the identity identifier and the user account.
[0120] Among them, the power bank 80 can report device status data through the data channel (step 808), and the client can obtain device status data from the mobile device and display corresponding status prompt information, etc.
[0121] In addition, users can set control parameters in client 82, and client 82 can send control commands to power bank 80 through the data channel (step 809). Client 82 and server 83 can also exchange pre-defined data based on their binding relationship.
[0122] In this embodiment, the mutual exclusion between charging and data communication can be eliminated, enabling the power bank to output power to the mobile device while simultaneously conducting data communication, with the two functions not interfering with each other. Furthermore, no additional user intervention is required; simply inserting the USB-C port automatically completes all initializations, leaving the user unaware of the process. Moreover, the establishment and use of the data channel do not affect charging power or charging continuity, ensuring a seamless charging experience. The power bank acts as a device and requests the establishment of a data channel using a standard device type, allowing the mobile device to automatically enumerate and load its built-in drivers, eliminating the need for additional driver installation, simplifying the design, and achieving plug-and-play functionality.
[0123] It should be noted that the detailed implementation methods and beneficial effects of each step in the method of this application have been described in detail in the foregoing device embodiments, and will not be elaborated here.
[0124] It should be noted that some processes described in the above embodiments and accompanying drawings include multiple operations appearing in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear in this document, or they may be executed in parallel. The operation numbers, such as 401, 402, etc., are merely used to distinguish different operations and do not represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should also be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a chronological order, nor do they limit "first" and "second" to different types.
[0125] Figure 10 This application provides a control device for its embodiments. Figure 10 The control device shown can be implemented as firmware configured in a charging device, which includes a first interface; the first interface is used to connect to a device to be charged, and the control device may include: The first establishment unit 1001 is used to negotiate charging with the device to be charged through the first signal terminal of the first interface to establish a charging channel; the charging channel is used to charge the device to be charged. The second establishment unit 1002 is used to establish a data channel with the device to be charged through the second signal terminal of the first interface; The communication unit 1003 is used to perform data communication with the device to be charged based on the data channel.
[0126] Figure 10 The control device can perform Figure 4 The implementation principle and technical effects of the control method described in the illustrated embodiments will not be repeated here. The specific methods by which each module and unit of the control device in the above embodiments performs its operations have been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0127] Figure 11 A control device provided in the embodiments of this application, Figure 11 The control device shown can be implemented as a system program for deployment in a device to be charged. The device to be charged includes a second interface for connecting to a first interface of a charging device. The control device may include: The status detection unit 1101 is used to detect the insertion status of the second interface; The third establishment unit 1102 is used to respond to the insertion state and negotiate charging with the charging device through the third signal terminal of the second interface to establish a charging channel; the charging channel is used to obtain the charging energy output by the charging device. The fourth establishment unit 1103 is used to establish a data channel with the charging device through the fourth signal terminal of the second interface; the data channel is used for data communication with the charging device.
[0128] Figure 11 The control device can perform Figure 5 The implementation principle and technical effects of the control method described in the illustrated embodiments will not be repeated here. The specific methods by which each module and unit of the control device in the above embodiments performs its operations have been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0129] Figure 12 This application provides a data communication device according to its embodiments. Figure 12 The data communication device shown can be implemented as a client and deployed in a device to be charged. The device to be charged is connected to a first interface of a charging device. The charging device is used to establish a charging channel with the device to be charged through a first signal terminal of the first interface, and to establish a data channel with the device to be charged through a second signal terminal of the first interface. The data communication device may include: The device detection unit 1201 is used to detect charging devices that establish a data channel with the device to be charged; The second communication unit 1202 is used to perform data communication with the charging device based on the data channel.
[0130] Figure 12 The data communication device can perform Figure 6 The implementation principle and technical effects of the data communication method described in the illustrated embodiments will not be repeated here. The specific methods by which each module and unit of the data communication device in the above embodiments performs its operations have been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0131] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed, enables the implementation of the steps in the above-described method embodiments. The computer-readable storage medium includes volatile or non-volatile components, or a combination thereof, and can be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technologies, CD-ROM, Digital Video Disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium.
[0132] Accordingly, this application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed, they can implement the steps in the above-described method embodiments. It should be understood that each step or combination of steps in the above-described method flow can be implemented by the computer program or instructions. Furthermore, these computer programs or instructions can be applied to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device, enabling the processor of the general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to function as an apparatus for implementing the corresponding functions in the above-described method embodiments.
[0133] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0134] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0135] Finally, it should be noted that the above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A control method, characterized in that, Applied to a charging device, the charging device including a first interface; The first interface is used to connect to the device to be charged, and the method includes: Through the first signal terminal of the first interface, a charging negotiation is conducted with the device to be charged to establish a charging channel; the charging channel is used to charge the device to be charged. A data channel is established with the device to be charged through the second signal terminal of the first interface; Data communication is performed with the device to be charged based on the data channel.
2. The method according to claim 1, characterized in that, Before establishing a data channel with the device to be charged via the second signal terminal of the first interface, the method includes: The device role is obtained by exchanging data roles with the device to be charged through the first signal terminal; The establishment of a data channel with the device to be charged via the second signal terminal of the first interface includes: The device establishes a data channel with the device to be charged through the second signal terminal of the first interface.
3. The method according to claim 1, characterized in that, The step of negotiating a charging channel with the device to be charged through the first signal terminal of the first interface to establish a charging channel includes: The system detects that the power terminal of the first interface is powered on, and negotiates charging with the device to be charged through the first signal terminal of the first interface to determine the charging parameters. According to the charging parameters, a charging channel is established between the device to be charged and the power terminal; the charging channel is specifically used to charge the device to be charged through the power terminal according to the charging parameters.
4. The method according to claim 1, characterized in that, The data communication with the device to be charged based on the data channel includes: Acquire device status data and send the device status data to the device to be charged via the data channel, so that the client in the device to be charged can obtain and display the status prompt information corresponding to the device status data in the display interface; or, The control commands sent by the client are obtained based on the data channel, and the corresponding control operations are executed according to the control commands.
5. The method according to claim 2, characterized in that, The step of exchanging data roles with the device to be charged through the first signal terminal to obtain the device role includes: The negotiation message received through the first signal terminal is analyzed to determine the first data role of the device to be charged; When the first data role is a device role, a data role exchange command is sent to the device to be charged through the first signal terminal, and the second data role of itself is switched to the device role; the data role exchange command is used to instruct the device to be charged to switch the first data role to the host role. When the first data role is the host role, the operation of establishing a data channel with the device to be charged through the second signal terminal of the first interface is performed as a device role.
6. The method according to claim 2 or 5, characterized in that, The step of establishing a data channel between the device in the role of the device and the device to be charged through the second signal terminal of the first interface includes: Obtain the enumeration request sent by the device to be charged through the second signal terminal; the enumeration request is generated after the device to be charged switches to the host role; In response to the enumeration request, the device role sends device description information to the device to be charged via the second signal terminal, so that the device to be charged loads the driver corresponding to the device description information to establish a data channel with the charging device.
7. The method according to any one of claims 1 to 4, characterized in that, Also includes: If a charging anomaly is detected, disconnect the charging channel and the data channel. The charging channel is re-established by negotiating with the device to be charged through the first signal terminal of the first interface, and a data channel is re-established with the device to be charged through the second signal terminal of the first interface. The charging anomaly event is generated in the following manner: If the charging parameters meet the adjustment requirements, a second charging negotiation is conducted with the device to be charged through the first signal terminal; In the event that the secondary charging negotiation fails, the charging anomaly event is generated.
8. A control method, characterized in that, The method is applied to a device to be charged, the device to be charged including a second interface for connecting to a first interface of a charging device, the method comprising: Detect the insertion status of the second interface; In response to the insertion state, the device negotiates charging with the charging device through the third signal terminal of the second interface to establish a charging channel; the charging channel is used to acquire the charging energy output by the charging device. A data channel with the charging device is established through the fourth signal terminal of the second interface; the data channel is used for data communication with the charging device.
9. The method according to claim 8, characterized in that, Before establishing a data channel with the charging device via the fourth signal terminal of the second interface, the method further includes: In response to a data role exchange command sent by the charging device through the third signal terminal of the second interface, the device switches its first data role to the host role. The establishment of a data channel with the charging device through the fourth signal terminal of the second interface includes: The host sends an enumeration request to the charging device through the fourth signal terminal of the second interface; The device description information sent by the charging device is obtained through the fourth signal terminal of the second interface; The driver corresponding to the device description information is loaded to establish a data channel with the charging device, and a device insertion notification is sent. The device insertion notification is used to instruct the client deployed in the device to be charged to establish a binding relationship with the charging device and to communicate with the charging device through the data channel.
10. The method according to claim 8, characterized in that, Also includes: If the charging channel or the data channel is detected to be disconnected, a disconnection notification is sent. The disconnect notification is used to instruct the client deployed in the device to be charged to output a disconnect prompt message.
11. A data communication method, characterized in that, The application is applied to a client, which is deployed in a device to be charged. The device to be charged is connected to a first interface of a charging device. The charging device is used to establish a charging channel with the device to be charged through a first signal terminal of the first interface, and to establish a data channel with the device to be charged through a second signal terminal of the first interface. The method includes: Detection of charging equipment that establishes a data channel with the device to be charged; Data communication is performed with the charging device based on the data channel.
12. The method according to claim 11, characterized in that, The data communication with the charging device based on the data channel includes: Based on the data channel, obtain the device status data transmitted by the charging device; The status prompt information corresponding to the device status data is displayed on the display interface; The display interface displays control prompts of at least one control type. In response to a control operation triggered for any control type, a control command is sent to the charging device via the data channel; the control command is used to instruct the charging device to perform the corresponding control operation.
13. The method according to claim 11 or 12, characterized in that, The charging device that establishes a data channel with the device to be charged includes: The device insertion notification sent by the device to be charged is detected to identify the charging device; the device insertion notification is generated after the device to be charged and the charging device establish a data channel. Obtain the device identification information of the charging device; Based on the device identification information, the device prompt information corresponding to the charging device is displayed on the display interface.
14. The method according to claim 13, characterized in that, Also includes: Based on the identity identifier in the device identification information, a binding request is sent to the server to establish a binding relationship between the identity identifier and the user account.
15. The method according to claim 11, characterized in that, Also includes: Upon detecting a disconnection notification from the device to be charged, a power outage warning message is output. The disconnection notification is generated when the device to be charged detects that the charging channel or the data channel is disconnected.
16. A charging device, characterized in that, It includes a main control module and a first interface connected to the main control module; the first interface is used to connect to the device to be charged. The main control module is used to negotiate charging with the device to be charged through the first signal terminal of the first interface to establish a charging channel; The charging channel is used to charge the device to be charged; a data channel is established with the device to be charged through the second signal terminal of the first interface, and data communication is performed with the device to be charged based on the data channel.
17. The device according to claim 16, characterized in that, The main control module includes a charging protocol module and a processing module connected to the charging protocol module; The charging protocol module is used to negotiate charging with the device to be charged through the first signal terminal of the first interface, determine charging parameters, and send the charging parameters to the processing module. The device role is obtained by exchanging data roles with the device to be charged through the first signal terminal, and the device role is then notified to the processing module. The processing module is used to establish a charging channel with the device to be charged according to the charging parameters. In addition, the device establishes a data channel with the device to be charged through the second signal terminal of the first interface, and performs data communication with the device to be charged based on the data channel.
18. The device according to claim 16, characterized in that, The device to be charged includes a second interface; the first interface is used to connect to the second interface, or the first interface is used to connect to the second interface via a data cable; The first signal terminal is a configuration channel terminal; the second signal terminal is a data differential terminal; The first interface is used to connect to the power supply terminal, the configuration channel terminal, and the data differential terminal of the second interface.
19. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed, implements the control method as described in any one of claims 1 to 7, or the control method as described in any one of claims 8 to 10, or the data communication method as described in any one of claims 11 to 14.
20. A computer program product, characterized in that, It includes a computer program or instructions, which, when executed, implement the control method as described in any one of claims 1 to 7, or the control method as described in any one of claims 8 to 10, or the data communication method as described in any one of claims 11 to 14.