State switching method and device, electronic equipment and storage medium
By sending request messages between the first and second devices and managing state switching, the problem of inaccurate information transmission is solved, and the reliability of the communication system is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-04-07
AI Technical Summary
In the existing technology, the information transmission between the first device and the second device fails to bring about a state switch, resulting in inaccurate information transmission, which urgently needs to be solved.
The first device sends a request message to the second device to switch to a state that supports obtaining or providing information, and a timer manages the state transition to ensure accurate information transmission.
This enabled accurate information transmission between the first and second devices, improving the reliability of the communication system.
Smart Images

Figure CN121815294A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a state switching method, apparatus, electronic device, and storage medium. Background Technology
[0002] In related technologies, the transmission of information between the first device and the second device does not result in a state switch of the first device and / or the second device. However, a state switch can effectively ensure the accurate transmission of information between the first device and the second device, which is an urgent problem to be solved. Summary of the Invention
[0003] This application aims to at least partially address one of the technical problems in the related art.
[0004] Therefore, this application proposes a state switching method, apparatus, electronic device, and storage medium.
[0005] One embodiment of this application proposes a state switching method, including: a first device sending a first message to a second device, the first message being used to request battery information of the second device; switching to a first state, the first device being in the first state supporting obtaining battery information of the second device from the second device; and / or receiving a second message sent by the second device, the second message being used to request obtaining information of the first device; and switching to a second state, the first device being in the second state supporting providing information of the first device to the second device.
[0006] In some embodiments, the method further includes: the first device receiving a third message sent by the second device, the third message including battery information of the second device; switching to a third state, wherein the first device in the third state does not support obtaining battery information of the second device from the second device.
[0007] In some embodiments, the method further includes: the first device starting or restarting a timer, wherein during the operation of the timer, the first device supports obtaining battery information of the second device from the second device.
[0008] In some embodiments, the method further includes: the first device determining that the timer has expired and has not received a third message from the second device, switching to a third state, wherein the third message includes battery information of the second device, and the first device in the third state does not support obtaining battery information of the second device from the second device.
[0009] In some embodiments, the method further includes: when the first device receives a third message sent by the second device during the operation of the timer, the third message includes battery information of the second device; switching to a third state, in which the first device does not support obtaining battery information of the second device from the second device.
[0010] In some embodiments, the method further includes: the first device sending a fourth message to the second device, the fourth message indicating information of the first device; switching to a fourth state, the first device being in the fourth state not supporting the provision of information of the first device to the second device.
[0011] In some embodiments, the battery information of the second device includes at least one of the following: basic battery information of the second device; real-time battery information of the second device.
[0012] Another embodiment of this application proposes a state switching method, including: a second device receiving a first message sent by a first device, the first message being used to request battery information of the second device; switching to a first device state, the second device being in the first device state and supporting providing battery information of the second device to the first device; and / or sending a second message to the first device, the second message being used to request information of the first device; switching to a second device state, the second device being in the second device state and supporting obtaining information of the first device from the first device.
[0013] In some embodiments, the method further includes: the second device sending a third message to the first device, the third message including battery information of the second device; switching to a third device state, wherein the second device in the third device state does not support providing the battery information of the second device to the first device.
[0014] In some embodiments, the method further includes: the second device receiving a fourth message sent by the first device, the fourth message being used to indicate information of the first device; switching to a fourth device state, wherein the second device in the fourth device state does not support obtaining information of the first device from the first device.
[0015] In some embodiments, the battery information of the second device includes at least one of the following: basic battery information of the second device; real-time battery information of the second device.
[0016] Another embodiment of this application proposes a first device, including: a transceiver module for sending a first message to a second device, the first message being for requesting to obtain battery information of the second device; a processing module for switching to a first state, wherein the first device in the first state supports obtaining battery information of the second device from the second device; and / or a transceiver module for receiving a second message sent by the second device, the second message being for requesting to obtain information of the first device; and a processing module for switching to a second state, wherein the first device in the second state supports providing information of the first device to the second device.
[0017] Another embodiment of this application proposes a second device, including: a transceiver module for receiving a first message sent by a first device, the first message being for requesting to obtain battery information of the second device; a processing module for switching to a first device state, wherein the second device in the first device state supports providing battery information of the second device to the first device; and / or the transceiver module for sending a second message to the first device, the second message being for requesting to obtain information of the first device; and a processing module for switching to a second device state, wherein the second device in the second device state supports obtaining information of the first device from the first device.
[0018] Another embodiment of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the method described in the foregoing aspect.
[0019] Another embodiment of this application proposes a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the foregoing aspect.
[0020] Another embodiment of this application proposes a chip including processing circuitry configured to perform the method described in one aspect above.
[0021] Another embodiment of this application proposes a computer program product that, when executed by a processor, implements the method described in the foregoing aspect.
[0022] The state switching method, apparatus, electronic device, and storage medium proposed in this application enable the first device to switch states, thereby ensuring accurate transmission of information between the first device and the second device and improving the reliability of the communication system.
[0023] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0024] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 A flowchart illustrating a state switching method provided in an embodiment of this application; Figure 2 A flowchart illustrating another state switching method provided in an embodiment of this application; Figure 3A A flowchart of yet another state switching method provided in an embodiment of this application; Figure 3BA flowchart of yet another state switching method provided in an embodiment of this application; Figure 4A This is a structural diagram of a first device provided in an embodiment of this application; Figure 4B This is a structural diagram of a second device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a chip proposed in an embodiment of this application. Detailed Implementation
[0025] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0026] In related technologies, the transmission of information between the first device and the second device does not result in a state switch of the first device and / or the second device. However, a state switch can effectively ensure the accurate transmission of information between the first device and the second device, which is an urgent problem to be solved.
[0027] Based on this, embodiments of this application provide a state switching method, apparatus, electronic device, and storage medium. The method executed by a first device includes: sending a first message to a second device, the first message requesting battery information of the second device; switching to a first state, where the first device is in the first state and supports obtaining the battery information of the second device from the second device; and / or receiving a second message sent by the second device, the second message requesting information of the first device; and switching to a second state, where the first device is in the second state and supports providing the information of the first device to the second device. Thus, the first device can achieve state switching to ensure accurate transmission of information between the first device and the second device and improve the reliability of the communication system.
[0028] The following description, with reference to the accompanying drawings, describes a state switching method, apparatus, electronic device, chip, and storage medium according to embodiments of this application.
[0029] Figure 1 This is an interactive schematic diagram of a state switching method provided in an embodiment of this application. Figure 1 As shown, the method may include, but is not limited to, the following steps: S101, the first device sends a first message to the second device.
[0030] In some embodiments, the first device is a terminal, including at least one of the following: mobile phone, wearable device, Internet of Things device, tablet computer, computer with wireless transceiver function, virtual reality (VR) terminal device, augmented reality (AR) terminal device, wireless terminal device in industrial control, wireless terminal device in self-driving, wireless terminal device in remote medical surgery, wireless terminal device in smart grid, wireless terminal device in transportation safety, wireless terminal device in smart city, and wireless terminal device in smart home, but not limited thereto.
[0031] In some embodiments, the second device stores electrical energy and is able to provide power to the first device. In some embodiments, the second device stores electrical energy and is able to charge the first device.
[0032] In some embodiments, the second device is equipped with an energy storage module capable of storing electrical energy. The energy storage module is, for example, a battery.
[0033] In some embodiments, the second device is a terminal. In some embodiments, the second device is at least one of a power bank or a portable charger.
[0034] In some embodiments, after the first device and the second device are electrically connected, the first device sends a first message to the second device.
[0035] In some embodiments, the first device and the second device establish an electrical connection via a transmission line. For example, if the first device is a mobile phone and the second device is a power bank, the power bank is connected to the mobile phone via a transmission line.
[0036] In some embodiments, after the first device and the second device are electrically connected, before the first device sends a first message to the second device, the method further includes: the first device and the second device authenticating the charging capability, the second device charging the first device, and the first device and the second device entering a charging state.
[0037] In some embodiments, the first message is used to request battery information from the second device.
[0038] In this embodiment, the first device sends a first message to the second device, requesting to obtain the battery information of the second device.
[0039] In some embodiments, after the first device completes the connection and charging capability request with the second device, it enters the charging state and sends a first message to the second device, requesting to obtain the battery information of the second device.
[0040] In some embodiments, the battery information of the second device includes at least one of the following: Basic battery information for the second device; Real-time battery information for the second device.
[0041] In this embodiment of the application, the battery information of the second device includes the basic battery information of the second device.
[0042] In some embodiments, the basic battery information includes at least one of the following: battery material, rated capacity, output voltage, charge / discharge rate, and overload protection function. The overload protection function includes at least one of the following: overcharge protection, over-discharge protection, overcurrent protection, short circuit protection, and temperature protection.
[0043] In this embodiment of the application, the battery information of the second device includes the real-time battery information of the second device.
[0044] In some embodiments, real-time battery information includes at least one of the following: charge / discharge cycles, remaining charge, used charge, and battery health.
[0045] In some embodiments, the first message is a Get PowerBankBattery_Basic_Info message, wherein the first message is used to request the battery basic information of the second device.
[0046] In some embodiments, the first message is a Get PowerBankBattery_Realtime_Info message, wherein the first message is used to request the real-time battery information of the second device.
[0047] In some embodiments, the first message is used for the second device to switch to the first device state upon receiving the first message.
[0048] S102, the first device switches to the first state.
[0049] In some embodiments, the first device is in a first state that supports obtaining battery information of the second device from the second device.
[0050] In this embodiment of the disclosure, when the first device sends a first message to the second device requesting to obtain the battery information of the second device, the first device switches to a first state.
[0051] In some embodiments, the first device switches from a non-first state to a first state, wherein when the first device is in a non-first state, it does not support obtaining battery information of the second device from the second device.
[0052] In some embodiments, the non-first state is a third state, in which the first device does not support communication with the second device. Communication includes the first device sending data and / or messages to the second device, and / or the first device receiving data and / or messages sent by the second device. In some embodiments, the first device in the third state supports the second device providing power to the first device, and supports the second device charging the first device.
[0053] In some embodiments, the first state is the Get_PowerBankBattery_Basic_Info state.
[0054] In this embodiment of the disclosure, the first device sends a first message to the second device. The first message is a Get PowerBankBattery_Basic_Info message, which is used to request the battery basic information of the second device. The first device switches to a first state, which is the Get PowerBankBattery_Basic_Info state.
[0055] In some embodiments, the first state is the Get_PowerBankBattery_Realtime_Info state.
[0056] In this embodiment of the disclosure, the first device sends a first message to the second device. The first message is a Get PowerBankBattery_Realtime_Info message, which is used to request the second device to obtain the real-time battery information. The first device switches to a first state, which is the Get PowerBankBattery_Realtime_Info state.
[0057] S103, the second device switches to the state of the first device.
[0058] S102 and S103 can be executed simultaneously or in reverse order.
[0059] In some embodiments, the second device, in the state of the first device, supports providing the first device with the battery information of the second device.
[0060] In this embodiment of the disclosure, when the second device receives a first message sent by the first device and determines that the first device requests to obtain the battery information of the second device, the first device switches to the first device state.
[0061] In some embodiments, the second device switches from a non-first device state to a first device state, wherein the second device does not support providing battery information of the second device to the first device when it is in a non-first device state.
[0062] In some embodiments, a non-first device state is a third device state, and the second device in the third device state does not support communication with the first device. Communication includes the second device sending data and / or messages to the first device, and / or the second device receiving data and / or messages sent by the first device. In some embodiments, the second device in the third device state supports providing power to the first device, charging the first device.
[0063] In some embodiments, the first device state is the ResponsePowerBankBattery_Basic_Info state.
[0064] In this embodiment of the disclosure, the second device receives a first message sent by the first device. The first message is a Get PowerBankBattery_Basic_Info message, which is used to request the second device to obtain the battery basic information. The second device switches to the first device state, which is a Response PowerBankBattery_Basic_Info state.
[0065] In some embodiments, the first device state is the ResponsePowerBankBattery_Realtime_Info state.
[0066] In this embodiment of the disclosure, the second device receives a first message sent by the first device. The first message is a Get PowerBankBattery_Realtime_Info message, which is used to request the second device to obtain the real-time battery information. The second device switches to the state of the first device, which is the Response PowerBankBattery_Realtime_Info state.
[0067] In some embodiments, when the protocol engine of the second device receives the first message sent by the first device, the protocol engine switches from the third device state to the first device state.
[0068] S104, First device start or restart timer.
[0069] S104 and S102 can be executed simultaneously or in reverse order.
[0070] In some embodiments, during the operation of the timer, the first device supports obtaining battery information of the second device from the second device.
[0071] In this embodiment, the first device sends a first message to the second device, requesting to obtain the battery information of the second device, switches to a first state, and starts or restarts a timer. During the operation of the timer, the first device can obtain the battery information of the second device from the second device.
[0072] In some embodiments, the timer duration is 0.9 milliseconds (ms), 1 ms, or 1.1 ms.
[0073] In some embodiments, when the protocol engine of the first device obtains the status of the power bank battery basic information (PowerBankBattery_Basic_Info) from the device protocol manager, the protocol engine should transition from a non-first state to the first (PE_Get_PowerBankBattery_Basic_Info) state. Upon entering the PE_Get_PowerBankBattery_Basic_Info state, the protocol engine should send a first (Get_PowerBankBattery_Basic_Info) message, initialize and run a timer (CRCReceive Timer).
[0074] S105, the second device sends a third message to the first device.
[0075] S105 and S104 can be executed simultaneously or in reverse order.
[0076] In some embodiments, the third message includes battery information of the second device.
[0077] In this embodiment of the disclosure, the first device sends a first message to the second device, requesting to obtain the battery information of the second device. Upon receiving the first message from the first device, the second device can determine to send a third message to the first device, the third message including the battery information of the second device.
[0078] In some embodiments, the second device receives a first message from the first device requesting to obtain basic battery information of the second device, and determines to send a third message to the first device, the third message including the basic battery information of the second device.
[0079] In some embodiments, the second device receives a first message from the first device requesting to obtain real-time battery information of the second device, and determines to send a third message to the first device, the third message including the real-time battery information of the second device.
[0080] In some embodiments, if the first device receives a third message sent by the second device during the operation of the timer, it stops the timer from running and switches to the third state.
[0081] In this embodiment of the disclosure, the first device sends a first message to the second device, switches to a first state, starts or restarts a timer, and stops the timer from running when a third message is received from the second device during the timer's operation, switching from the first state to the third state.
[0082] In some embodiments, the second device sends a third message to the first device during the operation of the first device's timer.
[0083] In some embodiments, the third message is used for the first device to switch to a third state upon receiving the third message.
[0084] In some embodiments, the third state is the power-on preparation completed (PE_SNK_Ready) state.
[0085] S106, the first device switches to the third state.
[0086] In some embodiments, the first device in a third state does not support obtaining battery information of the second device from the second device.
[0087] In some embodiments, the first device receives a third message sent by the second device and switches from the first state to the third state.
[0088] In some embodiments, the first device in a third state does not support communication with the second device. Communication includes the first device sending data and / or messages to the second device, and / or the first device receiving data and / or messages sent by the second device. In some embodiments, the first device in the third state supports the second device providing power to the first device, and supports the second device charging the first device.
[0089] S107, the second device switches to the third device state.
[0090] S106 and S107 can be executed simultaneously or in reverse order.
[0091] In some embodiments, the second device in the third device state does not support providing the first device with the battery information of the second device.
[0092] In some embodiments, the second device sends a third message to the first device, switching from the first device state to the third device state.
[0093] In some embodiments, the second device in the third device state does not support communication with the first device. Communication includes the second device sending data and / or messages to the first device, and / or the second device receiving data and / or messages sent by the first device. In some embodiments, the second device in the third device state supports providing power to the first device, charging the first device.
[0094] In some embodiments, the third device state is the power supply ready state (PE_SRC_Ready).
[0095] S108, the first device determines that the timer has expired and has not received the third message sent by the second device, and switches to the third state.
[0096] In some embodiments, S108 is executed after S104, in which case S105 to S107 may be omitted.
[0097] In this embodiment of the disclosure, if the first device determines that the timer has expired and has not received the battery information of the second device sent by the second device, it switches from the first state to the third state.
[0098] The description of the third state is as described above and will not be repeated here.
[0099] S109, the second device sends a second message to the first device.
[0100] S109 and S101 can be executed simultaneously or in reverse order.
[0101] In some embodiments, the second message is used to request information about the first device.
[0102] In some embodiments, the information of the first device includes at least one of the following: model, charging voltage, charging current, and amount of charge to be applied.
[0103] In some embodiments, the second message is a Get Cellphone Info message.
[0104] In some embodiments, the second message is used for the first device to switch to the second state upon receiving the second message.
[0105] S110, the second device switches to the second device state.
[0106] In some embodiments, the second device is in a second device state that supports obtaining information about the first device from the first device.
[0107] In this embodiment of the disclosure, the second device sends a second message to the first device to switch to the second device state.
[0108] In some embodiments, the second device sends a second message to the first device, switching from the third device state to the second device state. The description of the third device state is as described above and will not be repeated here.
[0109] In some embodiments, the second device state is a Get Cellphone Info state.
[0110] S111, the first device switches to the second state.
[0111] S110 and S111 can be executed simultaneously or in reverse order.
[0112] In some embodiments, the first device is in a second state that supports providing information about the first device to the second device.
[0113] In this embodiment of the disclosure, the first device receives a second message sent by the second device and switches to the second state.
[0114] In some embodiments, the first device receives a second message sent by the second device and switches from the third state to the second state. The description of the third state is given above and will not be repeated here.
[0115] In some embodiments, the second state is the Response Cellphone Info state.
[0116] S112, the first device sends a fourth message to the second device.
[0117] In some embodiments, the fourth message is used to indicate information about the first device.
[0118] In this embodiment of the disclosure, the first device receives a second message sent by the second device and sends a fourth message to the second device. The fourth message is used to indicate information of the first device.
[0119] In some embodiments, the fourth message is a Response Cellphone Info message.
[0120] In some embodiments, the fourth message is used for the second device to switch to the fourth device state upon receiving the fourth message.
[0121] S113, the first device switches to the fourth state.
[0122] In some embodiments, the first device in the fourth state does not support providing information about the first device to the second device.
[0123] In this embodiment of the disclosure, the first device sends a fourth message to the second device to switch to the fourth state.
[0124] In some embodiments, the first device sends a fourth message to the second device, switching from the second state to the fourth state.
[0125] In some embodiments, the first device in a fourth state does not support communication with the second device. Communication includes the first device sending data and / or messages to the second device, and / or the first device receiving data and / or messages sent by the second device. In some embodiments, the first device in the fourth state supports the second device providing power to the first device, and supports the second device charging the first device.
[0126] In some embodiments, the fourth state is the same as the third state.
[0127] S114, the second device switches to the fourth device state.
[0128] S114 and S113 can be executed simultaneously or in reverse order.
[0129] In some embodiments, the second device in the fourth device state does not support obtaining information about the first device from the first device.
[0130] In this embodiment of the disclosure, the second device receives a fourth message sent by the first device and switches to the fourth device state.
[0131] In some embodiments, the second device receives a fourth message sent by the first device and switches from the second device state to the fourth device state.
[0132] In some embodiments, the second device in the fourth device state does not support communication with the first device. Communication includes the second device sending data and / or messages to the first device, and / or the second device receiving data and / or messages sent by the first device. In some embodiments, the second device in the fourth device state supports providing power to the first device, charging the first device.
[0133] In some embodiments, the fourth device state is the same as the third device state.
[0134] To facilitate understanding of the embodiments of this disclosure, an exemplary embodiment is provided.
[0135] like Figure 2As shown in the exemplary embodiment, the first device is a mobile phone and the second device is a power bank, which is illustrated as an example. The power bank uploads battery health information to the mobile phone via a state transition method. The mobile phone can switch between a request or reply state and a PE_SNK_Ready state, and the power bank can switch between a request or reply state and a PE_SRC_Ready state. This state transition method is shown in the software flowchart of the power bank and mobile phone transmitting battery health information (e.g., ...). Figure 1 During the process of sending GET and replying Response information between the mobile phone and the power bank in the process.
[0136] The power bank connects to the phone via a data cable and enters the charging state after completing the connection and charging capability request.
[0137] The power bank and mobile phone record battery health information upload count flag; if no information has been uploaded, the initial flag is 0.
[0138] When the power bank is charging, it sends an Alter “Battery Status Change Event” request to upload battery health information.
[0139] After receiving the "Battery Status Change Event" Alter, the phone enters a decision-making process. If the user disagrees with the request, the phone replies "Reject" and then goes to a power bank to charge normally. If the user agrees, the phone replies "Accept" and begins sending the request.
[0140] Does the phone determine if the number of times battery health information has been uploaded (Flag) is greater than 0? 1) If FLAG equals 0, proceed to the following process: The mobile phone sends the message "Get PowerBankBattery_Basic_Info" to obtain basic information about the power bank's battery, and then switches from the PE_SNK_Ready state to the "Get_PowerBankBattery_Basic_Info" state.
[0141] After receiving the acquisition message, the power bank switches from the PE_SRC_Ready state to the ResponsePowerBankBattery_Basic_Info state and sends the ResponsePowerBankBattery_Basic_Info to upload the basic information of the power bank battery. Then, it switches from the ResponsePowerBankBattery_Basic_Info state back to the PE_SRC_Ready state.
[0142] When the mobile phone receives the Response PowerBankBattery_Basic_Info sent by the power bank and obtains the basic battery information uploaded by the power bank, the state changes from Get_PowerBankBattery_Basic_Info to PE_SNK_Ready.
[0143] The mobile phone sends the message "Get PowerBankBattery_Realtime_Info" to obtain real-time information about the power bank's battery, and then switches from the PE_SNK_Ready state to the "Get_PowerBankBattery_Realtime_Info" state.
[0144] After receiving the acquisition message, the power bank switches from the PE_SRC_Ready state to the ResponsePowerBankBattery_Realtime_Info state, sends the ResponsePowerBankBattery_Realtime_Info to upload the real-time information of the power bank battery, and then switches from the ResponsePowerBankBattery_Realtime_Info state back to the PE_SRC_Ready state.
[0145] When the mobile phone receives the Response PowerBankBattery_Realtime_Info sent by the power bank and obtains the real-time battery information uploaded by the power bank, the state changes from Get_PowerBankBattery_Realtime_Info to PE_SNK_Ready.
[0146] The power bank sends a "Get Cellphone Info" message to retrieve phone information and switches from the PE_SRC_Ready state to the "Get Cellphone Info" state.
[0147] After receiving the message, the mobile phone switches from the PE_SNK_Ready state to the Response Cellphone Info state, sends the Response Cellphone Info to upload the mobile phone information, and then switches back from the Response Cellphone Info state to the PE_SNK_Ready state.
[0148] When the power bank receives the Response Cellphone Info sent by the mobile phone and obtains the mobile phone information uploaded by the mobile phone, it switches from the Get Cellphone Info state to the PE_SRC_Ready state.
[0149] The number of times the power bank and mobile phone have been marked as uploaded is set to Flag = Flag + 1.
[0150] After the phone obtains the power bank's battery health information, it displays it to the user through the phone's user interface (UI).
[0151] 2) If FLAG is greater than or equal to 0, proceed to the following process: The mobile phone sends the message "Get PowerBankBattery_Realtime_Info" to obtain real-time information about the power bank's battery, and then switches from the PE_SNK_Ready state to the "Get_PowerBankBattery_Realtime_Info" state.
[0152] After receiving the acquisition message, the power bank switches from the PE_SRC_Ready state to the ResponsePowerBankBattery_Realtime_Info state. The power bank then sends the ResponsePowerBankBattery_Realtime_Info to upload the real-time information of the power bank battery, and then switches from the ResponsePowerBankBattery_Realtime_Info state to the PE_SRC_Ready state.
[0153] When the mobile phone receives the Response PowerBankBattery_Realtime_Info sent by the power bank and obtains the real-time battery information uploaded by the power bank, the state changes from Get_PowerBankBattery_Realtime_Info to PE_SNK_Ready.
[0154] The number of times the power bank and mobile phone have been marked as uploaded is set to Flag = Flag + 1.
[0155] After the phone obtains the power bank's battery health information, it displays it to the user through the phone's UI.
[0156] In some embodiments, the information content of the Get / Response “PowerBankBattery_info” is as follows: 0000: PowerBankBattery_Basic_Info (Basic information about the power bank battery); 0001: PowerBankBattery_Realtime_Info (Real-time information about the power bank's battery); ...:Reserved (Reserved information).
[0157] In some embodiments, the information content of Get / Response “Cellphone_Info” is as follows: 0000: Cellphone_Realtime (real-time mobile phone time); ...:Reserved (Reserved information).
[0158] The above power bank battery information and mobile phone information need to be executed according to the standard state transition method, taking GetPowerBankBattery_Basic_Info (get basic power bank battery information) and ResponsePowerBankBattery_Basic_Info (respond with basic power bank battery information) as examples: Switching between the PE_Get_PowerBankBattery_Basic_Info state and the PE_SNK_Ready / PE_SRC_Ready state: Because the request is for PowerBankBattery_Basic_Info (basic information about the power bank battery) from the device protocol manager, the protocol engine should transition from the PE_SRC_Ready or PE_SNK_Ready state to the PE_Get_PowerBankBattery_Basic_Info state.
[0159] Upon entering the PE_Get_PowerBankBattery_Basic_Info state, the protocol engine should send a "Get_PowerBankBattery_Basic_Info" message, initialize and run the CRCReceive Timer.
[0160] When exiting the PE_Get_PowerBankBattery_Basic_Info state, the protocol engine should notify the device protocol manager of the result (status or response timeout).
[0161] When the following two conditions are triggered, the protocol engine should switch back to the PE_SRC_Ready or PE_SNK_Ready state as needed: Received PowerBankBattery_Basic_Info Message; Or the CRCReceive Timer timed out.
[0162] In some embodiments, the PE_Response_PowerBankBattery_Basic_Info state and the PE_SNK_Ready / PE_SRC_Ready state are switched as follows: When the Get_PowerBankBattery_Basic_Info (retrieving basic information about the power bank battery) is received, the protocol engine should transition from the PE_SRC_Ready or PE_SNK_Ready state to the PE_Response_PowerBankBattery_Basic_Info state.
[0163] When entering the PE_Response_PowerBankBattery_Basic_Info state, the protocol engine should obtain the current basic information of the power bank battery from the device policy manager, and then send the basic information status message of the power bank battery based on this information.
[0164] Once the PowerBankBattery_Basic_Info message is successfully sent, the protocol engine should transition back to the PE_SRC_Ready or PE_SNK_Ready state.
[0165] This disclosure provides a state transition method. Through this state transition method, a mobile phone can switch between a request or response state and a PE_SNK_Ready state, and a power bank can switch between a request or response state and a PE_SRC_Ready state.
[0166] By implementing the embodiments of this disclosure, the first device can switch states to ensure accurate transmission of information between the first device and the second device and improve the reliability of the communication system.
[0167] The state switching method involved in the embodiments of this disclosure may include at least one of S101 to S114.
[0168] In some embodiments, steps S104 to S114 are optional, and one or more of these steps may be omitted or substituted in different embodiments.
[0169] In some embodiments, S104, S108 to S114 are optional, and one or more of these steps may be omitted or substituted in different embodiments.
[0170] In some embodiments, steps S109 to S114 are optional, and one or more of these steps may be omitted or substituted in different embodiments.
[0171] In some embodiments, the steps and their optional implementations in other embodiments described before or after this embodiment, as well as other related parts in the specification, can be referred to, and will not be repeated here.
[0172] Figure 3A This is an interactive schematic diagram illustrating a state switching method according to an embodiment of this disclosure. For example... Figure 3A As shown, the embodiments of this disclosure relate to a state switching method, which includes: S301A, the first device sends a first message to the second device.
[0173] In some embodiments, the first message is used to request battery information from the second device.
[0174] In some embodiments, the first message is used for the second device to switch to the first device state upon receiving the first message.
[0175] S302A, the first device switches to the first state.
[0176] In some embodiments, the first device is in a first state that supports obtaining battery information of the second device from the second device.
[0177] S303A, the second device switches to the state of the first device.
[0178] In some embodiments, the second device, in the state of the first device, supports providing the first device with the battery information of the second device.
[0179] In some embodiments, the method further includes: the first device receiving a third message sent by the second device, the third message including battery information of the second device; switching to a third state, wherein the first device in the third state does not support obtaining battery information of the second device from the second device.
[0180] In some embodiments, the method further includes: the second device sending a third message to the first device, the third message including battery information of the second device; switching to a third device state, wherein the second device in the third device state does not support providing the battery information of the second device to the first device.
[0181] In some embodiments, the method further includes: the first device starting or restarting a timer, wherein during the operation of the timer, the first device supports obtaining battery information of the second device from the second device.
[0182] In some embodiments, the method further includes: the first device determining that the timer has expired and has not received a third message from the second device, switching to a third state, wherein the third message includes battery information of the second device, and the first device in the third state does not support obtaining battery information of the second device from the second device.
[0183] In some embodiments, the method further includes: when the first device receives a third message sent by the second device during the operation of the timer, the third message includes battery information of the second device; switching to a third state, in which the first device does not support obtaining battery information of the second device from the second device.
[0184] In some embodiments, the battery information of the second device includes at least one of the following: basic battery information of the second device; real-time battery information of the second device.
[0185] In some embodiments, the steps and their optional implementations in other embodiments described before or after this embodiment, as well as other related parts in the specification, can be referred to, and will not be repeated here.
[0186] Figure 3B This is an interactive schematic diagram illustrating a state switching method according to an embodiment of this disclosure. For example... Figure 3B As shown, the embodiments of this disclosure relate to a state switching method, which includes: S301B, the second device sends a second message to the first device.
[0187] In some embodiments, the second message is used to request information about the first device.
[0188] In some embodiments, the second message is used for the first device to switch to the second state upon receiving the second message.
[0189] S302B, the second device switches to the second device state.
[0190] In some embodiments, the second device is in a second device state that supports obtaining information about the first device from the first device.
[0191] S303B, the first device switches to the second state.
[0192] In some embodiments, the first device is in a second state that supports providing information about the first device to the second device.
[0193] In some embodiments, the method further includes: the second device receiving a fourth message sent by the first device, the fourth message being used to indicate information of the first device; switching to a fourth device state, wherein the second device in the fourth device state does not support obtaining information of the first device from the first device.
[0194] In some embodiments, the method further includes: the first device sending a fourth message to the second device, the fourth message indicating information of the first device; switching to a fourth state, the first device being in the fourth state not supporting the provision of information of the first device to the second device.
[0195] In some embodiments, the steps and their optional implementations in other embodiments described before or after this embodiment, as well as other related parts in the specification, can be referred to, and will not be repeated here.
[0196] This disclosure also proposes an apparatus (also referred to as a communication device, etc.) for implementing any of the above methods. For example, an apparatus is proposed that includes units or modules for implementing the steps performed by the terminal in any of the above methods. Furthermore, another apparatus is proposed that includes units or modules for implementing the steps performed by a network device (e.g., an access network device, a core network functional node, a core network device, etc.) in any of the above methods.
[0197] It should be understood that the division of units or modules in the above device is only a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, the units or modules in the device can be implemented by a processor calling software: for example, the device includes a processor connected to a memory containing instructions. The processor calls the instructions stored in the memory to implement any of the above methods or to implement the functions of the units or modules in the above device. The processor can be, for example, a general-purpose processor, such as a Central Processing Unit (CPU) or a microprocessor, and the memory can be internal or external to the device. Alternatively, the units or modules in the device can be implemented in the form of hardware circuits. The functionality of some or all of the units or modules can be achieved through the design of these hardware circuits, which can be understood as one or more processors. For example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC), and the functionality of some or all of the units or modules is achieved through the design of the logical relationships between the components within the circuit. In another implementation, the hardware circuit can be implemented using a programmable logic device (PLD), such as a field-programmable gate array (FPGA), which can include a large number of logic gates. The connection relationships between the logic gates are configured through configuration files, thereby achieving the functionality of some or all of the units or modules. All units or modules of the above device can be implemented entirely through processor-called software, entirely through hardware circuits, or partially through processor-called software with the remaining parts implemented through hardware circuits.
[0198] In this embodiment, the processor is a circuit with signal processing capabilities. In one implementation, the processor can be a circuit with instruction read and execute capabilities, such as a Central Processing Unit (CPU), a microprocessor, a graphics processing unit (GPU) (which can be understood as a microprocessor), or a digital signal processor (DSP). In another implementation, the processor can implement certain functions through the logical relationships of hardware circuits. The logical relationships of the aforementioned hardware circuits are fixed or reconfigurable. For example, the processor is a hardware circuit implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document and configuring the hardware circuit can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units or modules. Furthermore, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as a Neural Network Processing Unit (NPU), a Tensor Processing Unit (TPU), or a Deep Learning Processing Unit (DPU).
[0199] Figure 4A This is a schematic diagram of the structure of the first device according to an embodiment of this disclosure. The first device 1 is used to perform any of the above methods. In some embodiments, such as Figure 4A As shown, the first device 1 may include at least one of the following: transceiver module 11, processing module 12, etc.
[0200] In some embodiments, the transceiver module 11 is configured to send a first message to the second device, the first message being used to request the acquisition of battery information of the second device; the processing module 12 is configured to switch to a first state, the first device being in the first state supporting the acquisition of battery information of the second device from the second device; and / or the transceiver module 11 is configured to receive a second message sent by the second device, the second message being used to request the acquisition of information of the first device; the processing module 12 is configured to switch to a second state, the first device being in the second state supporting the provision of information of the first device to the second device.
[0201] Optionally, the transceiver module is used to perform at least one of the communication steps (e.g., S101~S114, S301A~S303A, S301B~S303B, but not limited thereto) performed by the first device 1 in any of the above methods, which will not be elaborated here. Optionally, the processing module is used to perform at least one of the other steps (e.g., S101~S114, S301A~S303A, S301B~S303B, but not limited thereto) performed by the first device 1 in any of the above methods, which will not be elaborated here.
[0202] It should be noted that the foregoing explanation of the method embodiments also applies to the apparatus of this embodiment, and will not be repeated here.
[0203] Figure 4B This is a schematic diagram of the structure of the first device according to an embodiment of this disclosure. The second device 2 is used to perform any of the above methods. In some embodiments, such as Figure 4B As shown, the second device 2 may include at least one of the following: transceiver module 21, processing module 22, etc.
[0204] In some embodiments, the transceiver module 21 is configured to receive a first message sent by the first device, the first message being a request to obtain battery information of the second device; the processing module 22 is configured to switch to the first device state, wherein the second device, while in the first device state, supports providing battery information of the second device to the first device; and / or The transceiver module 21 is used to send a second message to the first device, the second message being used to request information from the first device; the processing module 22 is used to switch to the second device state, the second device being in the second device state supporting the acquisition of information from the first device.
[0205] Optionally, the transceiver module is used to perform at least one of the communication steps (e.g., S101~S114, S301A~S303A, S301B~S303B, but not limited thereto) performed by the second device 2 in any of the above methods, which will not be elaborated here. Optionally, the processing module is used to perform at least one of the other steps (e.g., S101~S114, S301A~S303A, S301B~S303B, but not limited thereto) performed by the second device 2 in any of the above methods, which will not be elaborated here.
[0206] It should be noted that the foregoing explanation of the method embodiments also applies to the apparatus of this embodiment, and will not be repeated here.
[0207] To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in the foregoing method embodiments.
[0208] To implement the above embodiments, this application also proposes a computer program product having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in the foregoing method embodiments.
[0209] To implement the above embodiments, this application also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the method described in the foregoing method embodiments.
[0210] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example, the electronic device 800 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0211] Reference Figure 5 The electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input / output (I / O) interface 812, sensor component 814, and communication component 816.
[0212] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0213] Memory 804 is configured to store various types of data to support the operation of electronic device 800. Examples of such data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0214] Power component 806 provides power to various components of electronic device 800. Power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.
[0215] Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0216] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0217] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0218] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 can detect the on / off state of electronic device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or a component of electronic device 800, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0219] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, 4G, or 5G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0220] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0221] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0222] To implement the above embodiments, this application also proposes a chip, including: the chip includes a processing circuit configured to perform the methods provided in the foregoing embodiments.
[0223] Figure 6 This is a schematic diagram of the structure of a chip according to an embodiment of this application. See also... Figure 6 The diagram shown is a schematic representation of the structure of chip 1100, but it is not limited to this.
[0224] Chip 1100 includes processing circuitry 1101, which is configured to perform any of the above methods.
[0225] In some embodiments, chip 1100 further includes one or more interface circuits 1102. Optionally, the interface circuit 1102 is connected to memory 1103, and the interface circuit 1102 can be used to receive signals from memory 1103 or other devices, and the interface circuit 1102 can be used to send signals to memory 1103 or other devices. For example, the interface circuit 1102 can read instructions stored in memory 1103 and send the instructions to processing circuit 1101.
[0226] In some embodiments, the interface circuit 1102 performs at least one of the communication steps such as sending and / or receiving in the above method, while the processing circuit 1101 performs other steps.
[0227] In some embodiments, the terms interface circuit, interface, transceiver pin, transceiver, etc., can be used interchangeably.
[0228] In some embodiments, chip 1100 further includes one or more memories 1103 for storing instructions. Optionally, all or part of the memories 1103 may be located outside of chip 1100.
[0229] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0230] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0231] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0232] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0233] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0234] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0235] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0236] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A state switching method, characterized in that, The method is performed by a first device and includes: Send a first message to the second device, the first message being used to request battery information of the second device; switch to a first state, the first device being in the first state supporting obtaining battery information of the second device from the second device; and / or Receive a second message sent by the second device, the second message being used to request information from the first device; switch to a second state, the first device being in the second state supporting the provision of information from the first device to the second device.
2. The method as described in claim 1, characterized in that, The method further includes: Receive a third message sent by the second device, the third message including battery information of the second device; Switching to the third state, the first device in the third state does not support obtaining the battery information of the second device from the second device.
3. The method as described in claim 1 or 2, characterized in that, The method further includes: Start or restart a timer, wherein during the operation of the timer, the first device supports obtaining battery information of the second device from the second device.
4. The method as described in claim 3, characterized in that, The method further includes: If the timer expires and no third message is received from the second device, the device switches to a third state. The third message includes the battery information of the second device. The first device in the third state does not support obtaining the battery information of the second device from the second device.
5. The method as described in claim 3 or 4, characterized in that, The method further includes: If a third message is received from the second device during the operation of the timer, the operation of the timer is stopped, and the third message includes battery information of the second device; Switching to the third state, the first device in the third state does not support obtaining the battery information of the second device from the second device.
6. The method as described in claim 1, characterized in that, The method further includes: Send a fourth message to the second device, the fourth message being used to indicate information about the first device; Switching to the fourth state, the first device in the fourth state does not support providing information about the first device to the second device.
7. The method as described in claim 1, characterized in that, The battery information of the second device includes at least one of the following: Basic battery information of the second device; Real-time battery information for the second device.
8. A state switching method, characterized in that, The method is performed by a second device and includes: Receive a first message sent by a first device, the first message being used to request battery information from the second device; switch to the first device state, the second device being in the first device state supporting the provision of the second device's battery information to the first device; and / or Send a second message to the first device, the second message being used to request information from the first device; switch to the second device state, the second device being in the second device state supporting the acquisition of information from the first device.
9. The method as described in claim 8, characterized in that, The method further includes: Send a third message to the first device, the third message including the battery information of the second device; Switching to the third device state, the second device in the third device state does not support providing the first device with the battery information of the second device.
10. The method as described in claim 8 or 9, characterized in that, The method further includes: Receive a fourth message sent by the first device, the fourth message being used to indicate information about the first device; Switching to the fourth device state, the second device in the fourth device state does not support obtaining information from the first device.
11. The method as described in claim 8, characterized in that, The battery information of the second device includes at least one of the following: Basic battery information of the second device; Real-time battery information for the second device.
12. A first device, characterized in that, include: The transceiver module is used to send a first message to the second device, the first message being used to request the battery information of the second device; The processing module is used to switch to a first state, in which the first device supports obtaining battery information of the second device from the second device. and / or The transceiver module is used to receive a second message sent by the second device, the second message being used to request information from the first device; The processing module is used to switch to a second state, whereby the first device in the second state supports providing information about the first device to the second device.
13. A second device, characterized in that, include: The transceiver module is used to receive a first message sent by the first device, wherein the first message is used to request the battery information of the second device; The processing module is used to switch to the first device state, and the second device, while in the first device state, supports providing the battery information of the second device to the first device; and / or The transceiver module is used to send a second message to the first device, the second message being used to request information from the first device; The processing module is used to switch to a second device state, wherein the second device in the second device state supports obtaining information of the first device from the first device.
14. A communication system, characterized in that, It includes a first device and a second device, the first device being configured to implement the method as described in any one of claims 1 to 7, and the second device being configured to implement the method as described in any one of claims 8 to 11.
15. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the method as described in any one of claims 1 to 7, 8 to 11.
16. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of the preceding claims 1 to 7, 8 to 11.
17. A computer program product, characterized in that, It includes a computer program, which, when executed by a processor, implements the method as described in any one of claims 1 to 7, 8 to 11.