WO2023011186A1 - Device control method and apparatus, and electronic device and storage medium - Google Patents

Device control method and apparatus, and electronic device and storage medium Download PDF

Info

Publication number
WO2023011186A1
WO2023011186A1 PCT/CN2022/106781 CN2022106781W WO2023011186A1 WO 2023011186 A1 WO2023011186 A1 WO 2023011186A1 CN 2022106781 W CN2022106781 W CN 2022106781W WO 2023011186 A1 WO2023011186 A1 WO 2023011186A1
Authority
WO
WIPO (PCT)
Prior art keywords
mode
communication device
occupancy
resource
target resource
Prior art date
Application number
PCT/CN2022/106781
Other languages
French (fr)
Chinese (zh)
Inventor
吕生义
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2023011186A1 publication Critical patent/WO2023011186A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/50Allocation or scheduling criteria for wireless resources
    • H04W72/51Allocation or scheduling criteria for wireless resources based on terminal or device properties
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/50Allocation or scheduling criteria for wireless resources
    • H04W72/53Allocation or scheduling criteria for wireless resources based on regulatory allocation policies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices
    • H04W88/06Terminal devices adapted for operation in multiple networks or having at least two operational modes, e.g. multi-mode terminals

Definitions

  • the present application relates to the technical field of communications, and more specifically, to a device control method, device, electronic device, and storage medium.
  • the Bluetooth communication module can support BR/EDR mode and BLE mode to run simultaneously.
  • the present application proposes a device control method, device, electronic device and storage medium, so as to improve the above problems.
  • the present application provides a device control method applied to electronic devices, the method comprising: if the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode , then acquire a second mode, where the second mode is a mode other than the first mode; reduce the degree of occupancy of the target resource by the second mode, and the target resource is a resource corresponding to the communication device.
  • the present application provides a device control device that runs on an electronic device, and the device includes: a mode acquisition unit configured to, if the communication device of the electronic device is in a multi-mode state, and the communication device passes When the first mode initiates a communication connection, the second mode is obtained, and the second mode is a mode other than the first mode; the control unit is configured to reduce the occupancy degree of the target resource by the second mode, and the target The resource is a resource corresponding to the communication device.
  • the present application provides an electronic device, including one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, The one or more programs are configured to perform the methods described above.
  • the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, wherein the above method is executed when the program code is running.
  • FIG. 1 shows a schematic diagram of an application scenario of a device control method proposed in an embodiment of the present application
  • FIG. 2 shows a flow chart of a device control method proposed in an embodiment of the present application
  • FIG. 3 shows a schematic diagram of the occupancy of target resources in the embodiment of the present application
  • FIG. 4 shows a flow chart of a device control method proposed in another embodiment of the present application.
  • FIG. 5 shows a flow chart of a device control method proposed in another embodiment of the present application.
  • FIG. 6 shows a flow chart of a device control method proposed in another embodiment of the present application.
  • FIG. 7 shows a flowchart of a device control method proposed in another embodiment of the present application.
  • Fig. 8 shows a structural block diagram of an equipment control device proposed by an embodiment of the present application.
  • Fig. 9 shows a structural block diagram of a device control device proposed in another embodiment of the present application.
  • FIG. 10 shows a structural block diagram of an electronic device proposed by the present application.
  • Fig. 11 is a storage unit for storing or carrying program codes for implementing the device control method according to the embodiment of the present application according to the embodiment of the present application.
  • the Bluetooth communication module can support BR/EDR (Basic Rate/Enhanced Data Rate) mode and BLE (Bluetooth Low Energy) mode to run simultaneously.
  • BR/EDR Base Rate/Enhanced Data Rate
  • BLE Bluetooth Low Energy
  • the Bluetooth communication module when the BR/EDR mode and the BLE mode of the Bluetooth communication module are turned on at the same time, if the Bluetooth communication module is triggered to establish a communication connection with other devices based on the BR/EDR mode, and in the communication connection During the establishment process, the Bluetooth communication module may still scan external devices through the BLE mode, so that both the BR/EDR mode and the BLE mode will occupy the corresponding resources of the Bluetooth communication module, so that the BR/EDR mode and the The rate at which other devices establish communication connections slows down, or even fails to successfully establish communication connections.
  • the inventor proposes a device control method, device, electronic device, and storage medium provided in this application.
  • the communication device of the electronic device is in a multi-mode state, if the communication device Initiating a communication connection through the first mode obtains a second mode, wherein the second mode is a mode other than the first mode, thereby reducing the occupancy of resources corresponding to the communication device by the second mode. Therefore, through the above method, in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupation degree of the resources corresponding to the communication device in the second mode, so that the occupation degree of the resources of the communication device in the first mode can be reduced. is improved, so that the communication device can more effectively perform the tasks corresponding to the first mode.
  • the method provided in this embodiment may further include the following procedure: if the communication device successfully establishes the communication connection through the first mode, increasing the degree of occupancy of the target resource by the second mode .
  • the method provided by this embodiment may further include the following process: record the working state corresponding to the second mode as a reference working state; if the communication device successfully establishes the communication connection, based on the reference working state, increase the degree of occupancy of the target resource by the second mode.
  • the method provided in this embodiment may further include the following procedure: if the communication device successfully establishes the communication connection through the first mode, acquiring a transmission task corresponding to the communication connection; Increase the occupancy degree of the target resource by the second mode based on the transmission task.
  • the method provided in this embodiment may further include the following process: acquiring the timeliness parameter corresponding to the transmission task; determining the corresponding improvement range according to the timeliness parameter corresponding to the transmission task; increasing the Occupancy degree of the target resource by the second mode.
  • the method provided in this embodiment may further include the following process: determine the content corresponding to the target resource based on the timeliness parameter corresponding to the transmission task; if the communication connection established through the first mode is used to execute For transmission tasks with high timeliness, determine that the target resource includes all types of resources corresponding to the communication device; if the communication connection established through the first mode is used to perform a transmission task with low timeliness, determine The target resource includes any type of resource corresponding to the communication device.
  • the method provided in this embodiment may further include the following process: if the timeliness parameter corresponding to the transmission task is greater than a specified threshold, determine that the transmission task is a transmission task with high timeliness; if the transmission task The timeliness parameter corresponding to the task is not greater than the specified threshold, and the transmission task is determined to be a transmission task with low timeliness.
  • the method provided in this embodiment may further include the following process: detecting whether the second mode is triggered by the user; If the communication connection is used, the degree of occupancy of the target resource by the second mode is increased.
  • the method provided in this embodiment may further include the following procedures: acquiring tasks corresponding to the second mode; and reducing the occupancy of target resources by the second mode according to the tasks corresponding to the second mode.
  • the communication device is a Bluetooth communication module
  • the multi-mode includes a BR/EDR mode and a BLE mode
  • the first mode is the BR/EDR mode.
  • the method provided in this embodiment may further include the following procedure: suspending the task corresponding to the second mode; or ending the task corresponding to the second mode.
  • the method provided in this embodiment may further include the following procedure: stopping the running of the system program for controlling the second mode, so as to suspend the task corresponding to the second mode.
  • the method provided in this embodiment may further include the following procedure: ending the running of the system program controlling the second mode, so as to end the task corresponding to the second mode.
  • the method provided in this embodiment may further include the following procedure: killing the process of the system program controlling the second mode, and reclaiming the memory allocated to the system program controlling the second mode .
  • the method provided in this embodiment may further include the following process: using a system program to control the communication device to perform the tasks corresponding to each mode, wherein the system program corresponding to the different modes different.
  • the method provided in this embodiment may further include the following process: separately controlling the communication device to perform tasks corresponding to each mode through different threads in the same system program, wherein the different modes are The corresponding thread of control is different.
  • the target resource includes a chip resource and/or an antenna resource
  • the chip resource represents a resource for processing data in the executed task
  • the antenna resource represents a data transmission or reception H.
  • an application scenario involved in the embodiment of the present application includes an electronic device 100 , an electronic device 200 , and an electronic device 210 .
  • the communication device of the electronic device 100 supports starting the first mode and the second mode at the same time. For example, a communication connection can be established with the electronic device 200 through the first mode, and the electronic device 210 can be scanned through the second mode.
  • a device control method provided by an embodiment of the present application is applied to electronic devices, and the method includes:
  • S110 If the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, acquire a second mode, where the second mode is a mode other than the first mode .
  • the involved communication device is a device supporting multiple modes.
  • the supported multi-modes can be understood as multiple communication modes.
  • the communication device is a Bluetooth communication module
  • the multiple communication modes supported by the Bluetooth communication module include BR/EDR mode and BLE mode.
  • the communication device can complete a corresponding task based on the activated mode.
  • the Bluetooth communication module can establish a connection with other devices through the BR/EDR mode, and then complete the connection task.
  • Bluetooth communication can be performed based on the established connection, thereby completing the task of data communication. If the BLE mode of the Bluetooth communication module is activated, the Bluetooth communication module can scan other devices based on the BLE mode, and then complete the device discovery task. Moreover, for the scanned devices, a connection can also be established based on the BLE mode, so as to complete the task of low-power connection.
  • the electronic device may trigger the activation of a certain mode of the communication device, or may trigger the activation of multiple modes of the communication device. And when at least two modes of the communication device are activated, it is determined that the communication device is in a multi-mode state. For example, if both the BR/EDR mode and the BLE mode of the Bluetooth communication module are activated, it is determined that the Bluetooth communication module is in a multi-mode state.
  • the mode used to establish a connection with other devices may be used as the first mode.
  • the Bluetooth communication module as an example, if the electronic device triggers the Bluetooth communication module to establish a communication connection with other devices in BR/EDR mode, then the electronic device will use the BR/EDR mode as the first mode, and the BLE mode as the second mode. model.
  • S120 Reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
  • the multiple modes may occupy resources corresponding to the communication device.
  • the resources corresponding to the communication device include chip resources and antenna resources.
  • the chip resources represent the resources used to process the data in the executed tasks. For example, if the communication device currently needs to send data to other devices, then it may need to consume chip resources to process the data based on the adopted communication protocol.
  • the data to be sent is assembled into the specified format. For example, if an electronic device needs to send the number "1" to other devices, then the communication device will encapsulate the data to be sent into a specified format based on the adopted communication protocol for the number "1". For another example, if the communication device receives data sent by other devices, it needs to consume chip resources to analyze the received data, so as to extract useful data. Wherein, the useful data is data that other devices actually need to transmit to the electronic device.
  • the data sent by other devices received by the communication device of the electronic device will be the data after encapsulating the number "0", and then the communication device will use its chip
  • the resource decapsulates the data to extract the useful information, the number "0".
  • the antenna resource represents a resource for data transmission or reception. It can be understood that after the data that the electronic device needs to transmit to other devices is converted into a corresponding wireless signal by the communication device, the wireless signal needs to be transmitted through the antenna so that other devices can receive the transmitted data through their own antenna. The wireless signal, which in turn enables other devices to extract the transmitted data from the received wireless signal.
  • multiple working modes may occupy resources corresponding to the communication device in a time-division multiplexing manner.
  • the Bluetooth communication module as an example, if both the BR/EDR mode and the BLE mode of the Bluetooth communication module are activated, the BR/EDR mode and the BLE mode will occupy the resources corresponding to the communication device in a time-division multiplexed manner. .
  • the occupancy of resources corresponding to the communication device in the second mode may be reduced.
  • reducing the degree of occupancy of resources corresponding to the communication device by the second mode may be understood as reducing the time that tasks corresponding to the second mode occupy resources corresponding to the communication device.
  • Figure 3 represents the occupancy of a certain resource, where the overall occupancy of the resource can be divided into multiple first time periods, and each first time period can include The first use time and time other than the first use time.
  • the first usage time is the resource occupation time of the first mode
  • the time other than the first usage time is the resource occupation time of the second mode.
  • reducing the degree of occupancy of the target resource by the second mode includes: suspending a task corresponding to the second mode.
  • reducing the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device includes: terminating a task corresponding to the second mode.
  • suspending the task corresponding to the second mode can be understood as temporarily stopping the task corresponding to the second mode, that is to say, the task corresponding to the second mode is still in a reserved state, but the communication device will not execute the corresponding task temporarily.
  • the task corresponding to the current BLE mode is to scan other devices. Then, in the case of suspending the task corresponding to the BLE mode, the electronic device will temporarily stop scanning other devices. Then, in the case of ending the task corresponding to the second mode, the electronic device will directly end the corresponding scanning task without reserving the scanning task.
  • the occupancy degree of the target resource by the second task can be reduced by a part, or the occupancy degree of the target resource by the second task can be reduced to 0 .
  • the occupancy degree of the target resource by the second task will be directly reduced to 0.
  • the electronic device can control the communication device through its own system program.
  • a system program may be used to control the communication device to execute the tasks corresponding to each mode, and the system programs corresponding to different modes may be different.
  • the electronic device controls the first mode of the communication device by running the first system program, for example, controls the communication device to establish a communication connection with other devices based on the first mode by running the first system program.
  • the communication device is controlled to perform data transmission based on the established communication connection by running the first system program.
  • the electronic device controls the second mode of the communication device by running the second system program.
  • the communication device is controlled to scan other devices based on the second mode by running the second system program.
  • the task corresponding to the second mode can be suspended by stopping the running of the system program for controlling the second mode.
  • the system program that controls the second mode is switched to a dormant state, so that the system program that controls the second mode no longer sends control instructions to the communication device, and then the communication device will not perform tasks corresponding to the second mode, so as to reduce Occupancy degree of the target resource by the second mode.
  • the running of the system program controlling the second mode may be terminated directly.
  • ending the running of the system program can be understood as killing the process of the system program controlling the second mode, and reclaiming the memory allocated to the system program controlling the second mode.
  • the process of the system program controlling the second mode will not be killed, and the process allocated to the second mode will not be reclaimed. Memory for system programs.
  • the system programs corresponding to different modes can be different, as another way, different threads in the same system program can also be configured to control the communication devices separately. of different modes.
  • the threads in the system program correspond to the modes of the communication device one by one, so that each mode has a corresponding thread for control. Then in this way, in the case that the task corresponding to the second mode needs to be suspended, the task corresponding to the second mode can be suspended by stopping the running of the thread used to control the second mode.
  • the thread that controls the second mode is switched to a blocked state, so that the system program that controls the second mode no longer sends control instructions to the communication device, and then the communication device will not perform tasks corresponding to the second mode, so as to reduce the second mode.
  • the degree of occupancy of the target resources by the second mode In a case where the task corresponding to the second mode needs to be terminated, the running of the thread controlling the second mode may be terminated directly. Wherein, ending the running of the thread can be understood as killing the thread controlling the second mode, and reclaiming the memory allocated to the thread controlling the second mode.
  • the thread controlling the second mode when the thread controlling the second mode is switched to a blocked state, the thread controlling the second mode will not be killed, and the memory allocated to the thread controlling the second mode will not be reclaimed.
  • the communication device of the electronic device when the communication device of the electronic device is in a multi-mode state, if the communication device initiates a communication connection through the first mode, the second mode is obtained, wherein the second mode It is a mode other than the first mode, thereby reducing the degree of occupancy of resources corresponding to the communication device by the second mode. Therefore, through the above method, in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupation degree of the resources corresponding to the communication device in the second mode, so that the occupation degree of the resources of the communication device in the first mode can be reduced. is improved, so that the communication device can more effectively perform the tasks corresponding to the first mode.
  • a device control method provided by an embodiment of the present application is applied to electronic devices, and the method includes:
  • S210 If the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, acquire a second mode, where the second mode is a mode other than the first mode .
  • S220 Reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
  • the content included in the target resource may be multiple.
  • the corresponding resources during communication include chip resources and antenna resources
  • the target resource may include only chip resources or only antenna resources, or may include both chip resources and antenna resources.
  • the content included in the target resource may be determined according to the current actual situation.
  • the content of the target resource can still be determined through the timeliness of the transmission task.
  • the target resource may include all types of resources corresponding to the communication device. If the communication connection established in the first mode is used to perform a transmission task with low timeliness, then the target resource may include any type of resource corresponding to the communication device.
  • the timeliness of the transmission task may be determined by the timeliness parameter corresponding to the transmission task.
  • the transmission task corresponding to the aging parameter is a transmission task with high timeliness; if the value of the corresponding aging parameter is not greater than the specified threshold, then determine the transmission task corresponding to the aging parameter It is a transmission task with low timeliness.
  • the activation of the second mode of the communication device may be because the electronic device needs to complete the specified task through the second mode, then after the communication device successfully establishes the communication connection through the first mode, in order to enable the communication
  • the second mode of the device can normally execute the task, and then the degree of occupancy of the target resource by the second mode can be increased.
  • reducing the occupancy of target resources by the second mode is achieved by stopping the running of the system program used to control the second mode. Then, in the process of increasing the occupancy degree of the target resource by the second mode, the system program controlling the second mode may be triggered to continue to run or restart to realize the increase of the target resource by the second mode. degree of occupancy.
  • reducing the occupancy of target resources by the second mode is achieved by changing the state of the thread controlling the second mode. Then, in the process of increasing the degree of occupancy of the target resource by the second mode, the degree of occupancy of the target resource by the second mode can also be increased by changing the state of the thread controlling the second mode. For example, if the second mode’s occupation of target resources is reduced by switching the thread in the second mode to the blocked state, the second mode can be improved by switching the thread in the second mode to the running state. How much the pattern occupies the target's resources. If by killing the thread of the second mode to reduce the occupancy degree of the target resource by the second mode, the occupancy degree of the target resource by the second mode can be improved by starting the thread controlling the second mode .
  • a pattern signature file can be established in the electronic device.
  • the current state of each mode of the communication device and the way of switching from the previous state to the current state can be recorded in the mode feature file.
  • the electronic device can obtain the way in which the second mode of the communication device is triggered to reduce the occupancy of target resources by querying the mode feature file, so that the corresponding way can be used to improve the impact of the second mode on the target. resource usage.
  • the first identifier and the second identifier may be stored in the pattern feature file.
  • the first identification can be used to record the current state of each mode of the communication device, and the second identification is used to record the way each mode switches from the previous state to the current state.
  • This embodiment provides a device control method, so that in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupancy of the resources corresponding to the communication device in the second mode, so that The resource occupation of the communication device in the first mode is improved, so that the communication device can more effectively perform tasks corresponding to the first mode. Moreover, in this embodiment, after the communication connection is successfully established through the first mode, the degree of occupancy of the target resources in the second mode will be improved, so that the electronic device can more effectively execute the communication corresponding to the first mode. At the same time, the impact on other modes can be reduced.
  • a device control method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
  • S310 If the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, acquire a second mode, where the second mode is a mode other than the first mode .
  • S320 Record the working state corresponding to the second mode as a reference working state.
  • the working state may include a signal state and/or a time state, wherein the signal state may represent the strength of the wireless signal transmitted based on the second mode, and the time state may represent the time period of the wireless signal transmitted based on the second mode.
  • the second mode may be a BLE mode.
  • the signal state in the working state of the BLE mode can represent the strength of the wireless signal transmitted based on the BLE mode.
  • the time state in the working state of the BLE mode may represent a time period for scanning based on the BLE mode.
  • the time state can be defined through two parameters of the bluetooth communication protocol, the window parameter and the interval parameter. Among them, the interval parameter represents the length of the scanning interval of each cycle, and the window parameter represents the length of the window that the BLE mode will scan in the scanning interval of each cycle. It can be understood that the window parameter corresponds to the degree of occupancy of antenna resources of the communication device. The larger the value of the window parameter, the higher the occupation of antenna resources.
  • S330 Reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
  • the electronic device can determine in what state the second mode is running before reducing the degree of occupancy of the target resource by the second mode of. Then, in the subsequent process of increasing the occupancy degree of the target resource by the second mode, the reference working state can be used as a reference to increase the occupancy degree of the target resource by the second mode to the state indicated by the reference working state. For example, if the reference working state corresponding to the second mode includes a time state, the value of the corresponding interval parameter in the time state is 1200ms, and the value of the corresponding window parameter is 120ms.
  • the value of the window parameter can be changed from 120ms to 0ms, that is, after reducing the occupancy degree, the task corresponding to the second mode of stopping the communication device will be triggered.
  • the value of the window parameter can be changed to 120ms, and then the task corresponding to the second mode of the communication device can be resumed.
  • This embodiment provides a device control method, so that in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupancy of the resources corresponding to the communication device in the second mode, so that The resource occupation of the communication device in the first mode is improved, so that the communication device can more effectively perform tasks corresponding to the first mode.
  • the working status corresponding to the second mode will be recorded as a reference working status, and then after the communication connection is successfully established through the first mode
  • the degree of occupancy of the target resource by the second mode is increased, so that while improving the electronic device to perform tasks corresponding to the first mode more effectively, the impact on other modes can be reduced.
  • a device control method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
  • S410 If the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, acquire a second mode, where the second mode is a mode other than the first mode .
  • S420 Reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
  • S440 Increase the degree of occupancy of the target resource by the second mode based on the transmission task.
  • the communication device After the communication device establishes a connection with other devices based on the first mode, it will continue to perform the transmission task through the established connection, so that the data in the electronic device can be transmitted to other devices, or receive data from other devices. data.
  • the timeliness corresponding to different transmission tasks is different.
  • the timeliness reflects the timeliness requirements of the corresponding transmission tasks for data transmission. For transmission tasks with high timeliness, the transmitted data needs to be transmitted efficiently, while for transmission tasks with low timeliness, the transmitted data may not be transmitted efficiently.
  • the transmission task for transmitting call voice may be a task that requires high timeliness of transmission.
  • the transmission task for transmitting the audio of the played music may be a task that requires less timeliness of transmission.
  • the increasing the degree of occupancy of the target resource by the second mode based on the transmission task includes: acquiring a timeliness parameter corresponding to the transmission task; determining a corresponding increase according to the timeliness parameter corresponding to the transmission task Amplitude: increasing the degree of occupancy of the target resource by the second mode according to the enhancement extent.
  • the timeliness parameter is a parameter representing a timeliness requirement, and a larger value of the timeliness parameter corresponds to a higher timeliness requirement.
  • the correspondence between the target application program and the aging parameter may be pre-established in the electronic device.
  • the target application program is an application program that requires data transmission through a communication device.
  • the application to which the transfer task belongs can be obtained as the target application, and then according to the corresponding relationship between the target application and the aging parameters, the corresponding The aging parameter is used as the aging parameter corresponding to the transmission task.
  • the corresponding relationship includes the aging parameter t1 corresponding to the application program A, the aging parameter t2 corresponding to the application program B, the aging parameter t3 corresponding to the application program C, and the aging parameter t4 corresponding to the application program D. If the application program to which the acquired transmission task belongs is application program C, then since the aging parameter corresponding to application program C is t3, then the aging parameter corresponding to the transmission task is t3.
  • the higher degree of improvement is determined corresponding to the aging parameters that represent higher requirements on timeliness.
  • a higher degree of improvement indicates a higher degree of occupancy of the target resource.
  • This embodiment provides a device control method, so that in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupancy of the resources corresponding to the communication device in the second mode, so that The resource occupation of the communication device in the first mode is improved, so that the communication device can more effectively perform tasks corresponding to the first mode. Moreover, in this embodiment, in the process of increasing the occupancy of target resources in the second mode, it can be flexibly increased based on the transmission task of the communication connection established in the first mode, thereby improving the occupancy of target resources. Increased flexibility.
  • a device control method provided by an embodiment of the present application is applied to electronic devices, and the method includes:
  • S510 If the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, acquire a second mode, where the second mode is a mode other than the first mode .
  • S520 Reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
  • S530 Detect whether the second mode is triggered to start by the user.
  • some modes of the communication device may not be activated by a user's trigger. Then it means that even if the mode that is not triggered by the user is turned off, it will still not interfere with the user experience.
  • the electronic device may determine whether the activated mode is activated by a user's trigger by distinguishing the mode of activation of the triggered mode. For example, for a mode triggered by a control, it may be determined that the mode is triggered by a user. However, for the mode activated by responding to an automatic trigger event, it may be determined that the activation is not triggered by the user.
  • the automatic triggering event may be a timing event, or a program start event, or a power start event of an electronic device, or the like.
  • This embodiment provides a device control method, so that in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupancy of the resources corresponding to the communication device in the second mode, so that The resource occupation of the communication device in the first mode is improved, so that the communication device can more effectively perform tasks corresponding to the first mode. Moreover, in this embodiment, it may be determined whether to increase the degree of occupancy of the target resources in the second mode according to whether the second mode is triggered by the user, thereby improving the degree of intelligence in the control of the communication device.
  • the bluetooth communication module involved in the foregoing embodiments is only exemplary.
  • Other communication devices with multiple modes are within the scope of the embodiments of the present application.
  • the communication device in the embodiment of the present application may also be more than a WiFi communication module with multiple working modes.
  • the multiple working modes of the WiFi communication module may include STA (Station) mode and AP (Access Point) mode. Then, when the WiFi communication module establishes a communication connection with other devices based on the STA mode, the STA mode is the first mode, and correspondingly, the AP mode is the second mode.
  • a device control device 600 provided in the embodiment of the present application, which runs on electronic devices, and the device 600 includes:
  • the mode acquiring unit 610 is configured to acquire a second mode if the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, and the second mode is other than the first mode. a mode other than a mode;
  • the control unit 620 is configured to reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
  • control unit 620 is further configured to increase the occupancy of target resources in the second mode if the communication device successfully establishes the communication connection through the first mode.
  • control unit 620 is further configured to record the working state corresponding to the second mode as a reference working state.
  • the control unit 620 is further specifically configured to, if the communication device successfully establishes the communication connection through the first mode, increase the occupancy of target resources in the second mode based on the reference working state.
  • control unit 620 is further specifically configured to acquire a transmission task corresponding to the communication connection if the communication device successfully establishes the communication connection through the first mode;
  • control unit 620 is also specifically configured to obtain the time-sensitive parameter corresponding to the transmission task; determine the corresponding improvement range according to the time-sensitive parameter corresponding to the transmission task; increase the target value of the second mode according to the improvement range resource usage.
  • control unit 620 is further configured to determine the content corresponding to the target resource based on the timeliness parameter corresponding to the transmission task; if the communication connection established through the first mode is used to execute a transmission task with high timeliness, determine The target resource includes all types of resources corresponding to the communication device; if the communication connection established through the first mode is used to perform a transmission task with low timeliness, it is determined that the target resource includes the communication device resources of any category.
  • control unit 620 is further configured to determine that the transmission task is a transmission task with high timeliness if the timeliness parameter corresponding to the transmission task is greater than a specified threshold; if the timeliness parameter corresponding to the transmission task is not greater than the specified threshold The specified threshold is determined to determine that the transmission task is a transmission task with low timeliness.
  • the target resource includes a chip resource and/or an antenna resource
  • the chip resource represents a resource for processing data in an executed task
  • the antenna resource represents a resource for data transmission or reception .
  • the apparatus 600 further includes: an activation mode detection unit 630, configured to upgrade the second mode to the target resource if the communication device successfully establishes the communication connection through the first mode.
  • the method further includes: detecting whether the second mode is triggered to start by a user.
  • the control unit 620 is configured to execute the step of increasing the occupancy of target resources in the second mode if the communication device successfully establishes the communication connection through the first mode.
  • control unit 620 is further specifically configured to acquire tasks corresponding to the second mode; and reduce the occupancy of target resources by the second mode according to the tasks corresponding to the second mode.
  • control unit 620 is also specifically configured to suspend the task corresponding to the second mode
  • control unit 620 is further configured to stop the running of the system program for controlling the second mode, so as to suspend the task corresponding to the second mode.
  • control unit 620 is further configured to end the running of the system program controlling the second mode, so as to end the task corresponding to the second mode.
  • ending the running of the system program controlling the second mode includes: killing the process of the system program controlling the second mode, and reclaiming the memory allocated to the system program controlling the second mode .
  • control unit 620 is specifically further configured to control the communication device to perform tasks corresponding to each mode through a system program, where different modes correspond to different system programs for control.
  • control unit 620 is specifically further configured to separately control the communication device to perform tasks corresponding to each mode through different threads in the same system program, wherein different modes correspond to different threads for control.
  • the communication device of the electronic device when the communication device of the electronic device is in a multi-mode state, if the communication device initiates a communication connection through the first mode, the second mode is acquired, wherein the second mode It is a mode other than the first mode, thereby reducing the degree of occupancy of resources corresponding to the communication device by the second mode. Therefore, through the above method, in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupation degree of the resources corresponding to the communication device in the second mode, so that the occupation degree of the resources of the communication device in the first mode can be reduced. is improved, so that the communication device can more effectively perform the tasks corresponding to the first mode.
  • each functional module in each embodiment of the present application may be integrated into one processing module, each module may exist separately physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
  • an embodiment of the present application also provides an electronic device 1000 that can implement the aforementioned device control method.
  • the electronic device 1000 includes one or more (only one is shown in the figure) processors 102 , a memory 104 , a camera 106 and an audio collection device 108 coupled to each other.
  • the memory 104 stores programs capable of executing the contents of the foregoing embodiments, and the processor 102 can execute the programs stored in the memory 104 .
  • the processor 102 may include one or more processing cores.
  • the processor 102 uses various interfaces and circuits to connect various parts of the entire electronic device 1000, and executes or executes instructions, programs, code sets, or instruction sets stored in the memory 104, and calls data stored in the memory 104 to execute Various functions of the electronic device 1000 and processing data.
  • the processor 102 may adopt at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). implemented in the form of hardware.
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 102 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a modem, and the like.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • the CPU mainly handles the operating system, user interface and application programs, etc.
  • the GPU is used to render and draw the displayed content
  • the modem is used to handle wireless communication. It can be understood that the above modem may also not be integrated into the processor 102, but implemented by a communication chip alone.
  • the memory 104 may include random access memory (Random Access Memory, RAM), and may also include read-only memory (Read-Only Memory). Memory 104 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
  • the memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like.
  • device control means may be stored in the memory 104 .
  • the device controlled by the device may be the aforementioned device 600 .
  • the electronic device 1000 may further include a network module 110 and a sensor module 112 in addition to the aforementioned devices.
  • the network module 110 is used to implement information interaction between the electronic device 1000 and other devices, for example, transmitting device control instructions, manipulation request instructions, and status information acquisition instructions. However, when the electronic device 200 is specifically a different device, its corresponding network module 110 may be different.
  • the sensor module 112 may include at least one sensor. Specifically, the sensor module 112 may include, but is not limited to: a light sensor, a motion sensor, a pressure sensor, an infrared heat sensor, a distance sensor, an acceleration sensor, and other sensors.
  • the pressure sensor may be a sensor for detecting pressure generated by pressing on the electronic device 1000 . That is, the pressure sensor detects pressure generated by contact or press between the user and the electronic device, for example, pressure generated by contact or press between the user's ear and the mobile terminal. Therefore, the pressure sensor can be used to determine whether contact or pressure occurs between the user and the electronic device 1000, and the magnitude of the pressure.
  • the acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when it is still, and can be used to identify the application of electronic equipment 1000 attitude (such as horizontal and vertical screen switching, related games, magnetometer, etc.) Attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.
  • the electronic device 1000 may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, and a thermometer, which will not be repeated here.
  • the audio collection device 110 is configured to collect audio signals.
  • the audio collection device 110 includes multiple audio collection devices, and the audio collection devices may be microphones.
  • the network module of the electronic device 1000 is a radio frequency module, and the radio frequency module is used to receive and send electromagnetic waves, realize mutual conversion between electromagnetic waves and electrical signals, and communicate with a communication network or other devices.
  • the radio frequency module may include various existing circuit elements for performing these functions, such as antenna, radio frequency transceiver, digital signal processor, encryption/decryption chip, Subscriber Identity Module (SIM) card, memory and so on.
  • SIM Subscriber Identity Module
  • the radio frequency module can interact with external devices by sending or receiving electromagnetic waves.
  • a radio frequency module can send instructions to a target device.
  • FIG. 11 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • Program codes are stored in the computer-readable medium 800, and the program codes can be invoked by a processor to execute the methods described in the foregoing method embodiments.
  • the computer readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium).
  • the computer-readable storage medium 800 has a storage space for program code 810 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products.
  • Program code 810 may, for example, be compressed in a suitable form.
  • the communication device of the electronic device when the communication device of the electronic device is in a multi-mode state, if the communication device initiates a communication connection through the first mode , the second mode is obtained, where the second mode is a mode other than the first mode, thereby reducing the occupancy of resources corresponding to the communication device by the second mode. Therefore, through the above method, in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupation degree of the resources corresponding to the communication device in the second mode, so that the occupation degree of the resources of the communication device in the first mode can be reduced. is improved, so that the communication device can more effectively perform the tasks corresponding to the first mode.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

Disclosed in the embodiments of the present application are a device control method and apparatus, and an electronic device and a storage medium. The method comprises: if a communication device of an electronic device is in a multi-mode state and the communication device initiates a communication connection by means of a first mode, acquiring a second mode, wherein the second mode is a mode other than the first mode; and reducing the degree of occupation of a target resource by the second mode, wherein the target resource is a resource corresponding to the communication device. In this way, during the process of an electronic device triggering a communication device to establish a connection in a first mode, the degree of occupation of a resource, which corresponds to the communication device, by a first mode can be improved by means of reducing the degree of occupation of the resource, which corresponds to the communication device, by a second mode, such that the communication device can more effectively execute a task corresponding to the first mode.

Description

设备控制方法、装置、电子设备及存储介质Device control method, device, electronic device and storage medium
相关申请的交叉引用Cross References to Related Applications
本申请要求于2021年8月6日提交的申请号为202110902260.8的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。This application claims priority to Chinese application No. 202110902260.8 filed on August 6, 2021, which is hereby incorporated by reference in its entirety for all purposes.
技术领域technical field
本申请涉及通信技术领域,更具体地,涉及一种设备控制方法、装置、电子设备及存储介质。The present application relates to the technical field of communications, and more specifically, to a device control method, device, electronic device, and storage medium.
背景技术Background technique
近年来,随着电子设备中的通信器件的功能升级,部分通信器件已经支持多种模式同时运行。例如,蓝牙通信模块可以支持BR/EDR模式以及BLE模式同时运行。In recent years, with the upgrading of the functions of communication devices in electronic equipment, some communication devices already support multiple modes to operate simultaneously. For example, the Bluetooth communication module can support BR/EDR mode and BLE mode to run simultaneously.
发明内容Contents of the invention
鉴于上述问题,本申请提出了一种设备控制方法、装置、电子设备及存储介质,以实现改善上述问题。In view of the above problems, the present application proposes a device control method, device, electronic device and storage medium, so as to improve the above problems.
第一方面,本申请提供了一种设备控制方法,应用于电子设备,所述方法包括:若所述电子设备的通信器件处于多模式的状态,且所述通信器件通过第一模式发起通信连接,则获取第二模式,所述第二模式为除所述第一模式以外的模式;降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源。In a first aspect, the present application provides a device control method applied to electronic devices, the method comprising: if the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode , then acquire a second mode, where the second mode is a mode other than the first mode; reduce the degree of occupancy of the target resource by the second mode, and the target resource is a resource corresponding to the communication device.
第二方面,本申请提供了一种设备控制装置,运行于电子设备,所述装置包括:模式获取单元,用于若所述电子设备的通信器件处于多模式的状态,且所述通信器件通过第一模式发起通信连接,则获取第二模式,所述第二模式为除所述第一模式以外的模式;控制单元,用于降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源。In a second aspect, the present application provides a device control device that runs on an electronic device, and the device includes: a mode acquisition unit configured to, if the communication device of the electronic device is in a multi-mode state, and the communication device passes When the first mode initiates a communication connection, the second mode is obtained, and the second mode is a mode other than the first mode; the control unit is configured to reduce the occupancy degree of the target resource by the second mode, and the target The resource is a resource corresponding to the communication device.
第三方面,本申请提供了一种电子设备,包括一个或多个处理器以及存储器;一个或多个程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述的方法。In a third aspect, the present application provides an electronic device, including one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, The one or more programs are configured to perform the methods described above.
第四方面,本申请提供的一种计算机可读存储介质,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码运行时执行上述的方法。In a fourth aspect, the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, wherein the above method is executed when the program code is running.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的 附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1示出了本申请实施例提出的设备控制方法的应用场景的示意图;FIG. 1 shows a schematic diagram of an application scenario of a device control method proposed in an embodiment of the present application;
图2示出了本申请实施例提出的一种设备控制方法的流程图;FIG. 2 shows a flow chart of a device control method proposed in an embodiment of the present application;
图3示出了本申请实施例中对目标资源占用情况的示意图;FIG. 3 shows a schematic diagram of the occupancy of target resources in the embodiment of the present application;
图4示出了本申请另一实施例提出的一种设备控制方法的流程图;FIG. 4 shows a flow chart of a device control method proposed in another embodiment of the present application;
图5示出了本申请再一实施例提出的一种设备控制方法的流程图;FIG. 5 shows a flow chart of a device control method proposed in another embodiment of the present application;
图6示出了本申请又一实施例提出的一种设备控制方法的流程图;FIG. 6 shows a flow chart of a device control method proposed in another embodiment of the present application;
图7示出了本申请又一实施例提出的一种设备控制方法的流程图;FIG. 7 shows a flowchart of a device control method proposed in another embodiment of the present application;
图8示出了本申请一实施例提出的一种设备控制装置的结构框图;Fig. 8 shows a structural block diagram of an equipment control device proposed by an embodiment of the present application;
图9示出了本申请另一实施例提出的一种设备控制装置的结构框图;Fig. 9 shows a structural block diagram of a device control device proposed in another embodiment of the present application;
图10示出了本申请提出的一种电子设备的结构框图;FIG. 10 shows a structural block diagram of an electronic device proposed by the present application;
图11是本申请实施例的用于保存或者携带实现根据本申请实施例的设备控制方法的程序代码的存储单元。Fig. 11 is a storage unit for storing or carrying program codes for implementing the device control method according to the embodiment of the present application according to the embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of this application.
随着电子设备中的通信器件的功能升级,部分通信器件已经支持多种模式同时运行。例如,以蓝牙通信模块为例,蓝牙通信模块可以支持BR/EDR(Basic Rate/Enhanced Data Rate)模式以及BLE(Bluetooth Low Energy)模式同时运行。With the upgrading of the functions of communication devices in electronic equipment, some communication devices already support multiple modes to run simultaneously. For example, taking the Bluetooth communication module as an example, the Bluetooth communication module can support BR/EDR (Basic Rate/Enhanced Data Rate) mode and BLE (Bluetooth Low Energy) mode to run simultaneously.
但是,发明人在对相关的支持多种模式的通信器件进行研究后发现,在多种模式同时运行的情况下,相关的支持多种模式的通信器件的每种模式都会对通信器件对应的资源进行占用,从而会造成某一种模式对应的任务无法较好的执行。还是以蓝牙通信模块为例,在蓝牙通信模块的BR/EDR模式以及BLE模式同时开启的情况下,若蓝牙通信模块被触发基于BR/EDR模式与其他设备建立通信连接,而在该通信连接的建立过程中,蓝牙通信模块还可能依然再通过BLE模式进行外部设备的扫描,进而使得BR/EDR模式和BLE模式都会对蓝牙通信模块对应的资源进行占用,从而就会使得基于BR/EDR模式与其他设备建立通信连接的速率变慢,甚至是无法成功建立通信连接。However, after researching related communication devices that support multiple modes, the inventors found that when multiple modes are running simultaneously, each mode of the related communication devices that support multiple modes will consume resources corresponding to the communication device. Occupying, which will cause the tasks corresponding to a certain mode cannot be performed well. Still taking the Bluetooth communication module as an example, when the BR/EDR mode and the BLE mode of the Bluetooth communication module are turned on at the same time, if the Bluetooth communication module is triggered to establish a communication connection with other devices based on the BR/EDR mode, and in the communication connection During the establishment process, the Bluetooth communication module may still scan external devices through the BLE mode, so that both the BR/EDR mode and the BLE mode will occupy the corresponding resources of the Bluetooth communication module, so that the BR/EDR mode and the The rate at which other devices establish communication connections slows down, or even fails to successfully establish communication connections.
因此,为了改善该问题,发明人提出了本申请所提供的一种设备控制方法、装置、电子设备及存储介质,在电子设备的通信器件处于多模式的状态的情况下,若所述通信器件通过第一模式发起通信连接,则获取第二模式,其中该第二模式为除所述第一模式以外的模式,进而降低所述第二模式对通信器件对应的资源的占用程度。从而通过上述方式使得电子设备在触发通信器件以第一模式建立连接的过程中,可以通过降低第二模式对通信器件对应的资源的占用程度,来使得第一模式对通信器件的资源的占用程度得 到提升,进而使得通信器件可以更加有效的执行第一模式所对应的任务。Therefore, in order to improve this problem, the inventor proposes a device control method, device, electronic device, and storage medium provided in this application. When the communication device of the electronic device is in a multi-mode state, if the communication device Initiating a communication connection through the first mode obtains a second mode, wherein the second mode is a mode other than the first mode, thereby reducing the occupancy of resources corresponding to the communication device by the second mode. Therefore, through the above method, in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupation degree of the resources corresponding to the communication device in the second mode, so that the occupation degree of the resources of the communication device in the first mode can be reduced. is improved, so that the communication device can more effectively perform the tasks corresponding to the first mode.
在一种实施方式中,本实施例提供的方法还可以包括如下流程:若所述通信器件通过所述第一模式成功建立所述通信连接,则提升所述第二模式对目标资源的占用程度。In an implementation manner, the method provided in this embodiment may further include the following procedure: if the communication device successfully establishes the communication connection through the first mode, increasing the degree of occupancy of the target resource by the second mode .
在一种实施方式中,本实施例提供的方法还可以包括如下流程:记录所述第二模式所对应的工作状态作为参考工作状态;若所述通信器件通过所述第一模式成功建立所述通信连接,则基于所述参考工作状态提升所述第二模式对目标资源的占用程度。In one embodiment, the method provided by this embodiment may further include the following process: record the working state corresponding to the second mode as a reference working state; if the communication device successfully establishes the communication connection, based on the reference working state, increase the degree of occupancy of the target resource by the second mode.
在一种实施方式中,本实施例提供的方法还可以包括如下流程:若所述通信器件通过所述第一模式成功建立所述通信连接,则获取基于所述通信连接所对应的传输任务;基于所述传输任务提升所述第二模式对目标资源的占用程度。In an implementation manner, the method provided in this embodiment may further include the following procedure: if the communication device successfully establishes the communication connection through the first mode, acquiring a transmission task corresponding to the communication connection; Increase the occupancy degree of the target resource by the second mode based on the transmission task.
在一种实施方式中,本实施例提供的方法还可以包括如下流程:获取所述传输任务对应的时效参数;根据所述传输任务对应的时效参数确定对应的提升幅度;根据所述提升幅度提升所述第二模式对目标资源的占用程度。In an implementation manner, the method provided in this embodiment may further include the following process: acquiring the timeliness parameter corresponding to the transmission task; determining the corresponding improvement range according to the timeliness parameter corresponding to the transmission task; increasing the Occupancy degree of the target resource by the second mode.
在一种实施方式中,本实施例提供的方法还可以包括如下流程:基于所述传输任务对应的时效参数确定目标资源对应的内容;若通过所述第一模式所建立的通信连接用于执行时效性较高的传输任务,确定所述目标资源包括所述通信器件所对应的所有类别的资源;若通过所述第一模式所建立的通信连接用于执行时效性较低的传输任务,确定所述目标资源包括所述通信器件所对应的任一类别的资源。In an implementation manner, the method provided in this embodiment may further include the following process: determine the content corresponding to the target resource based on the timeliness parameter corresponding to the transmission task; if the communication connection established through the first mode is used to execute For transmission tasks with high timeliness, determine that the target resource includes all types of resources corresponding to the communication device; if the communication connection established through the first mode is used to perform a transmission task with low timeliness, determine The target resource includes any type of resource corresponding to the communication device.
在一种实施方式中,本实施例提供的方法还可以包括如下流程:若所述传输任务对应的时效参数大于指定阈值,确定所述传输任务为时效性较高的传输任务;若所述传输任务对应的时效参数不大于所述指定阈值,确定所述传输任务为时效性较低的传输任务。In one embodiment, the method provided in this embodiment may further include the following process: if the timeliness parameter corresponding to the transmission task is greater than a specified threshold, determine that the transmission task is a transmission task with high timeliness; if the transmission task The timeliness parameter corresponding to the task is not greater than the specified threshold, and the transmission task is determined to be a transmission task with low timeliness.
在一种实施方式中,本实施例提供的方法还可以包括如下流程:检测第二模式是否由用户触发启动;若是,则执行所述若所述通信器件通过所述第一模式成功建立所述通信连接,则提升所述第二模式对目标资源的占用程度。In an implementation manner, the method provided in this embodiment may further include the following process: detecting whether the second mode is triggered by the user; If the communication connection is used, the degree of occupancy of the target resource by the second mode is increased.
在一种实施方式中,本实施例提供的方法还可以包括如下流程:获取第二模式对应的任务;根据所述第二模式对应的任务降低所述第二模式对目标资源的占用程度。In an implementation manner, the method provided in this embodiment may further include the following procedures: acquiring tasks corresponding to the second mode; and reducing the occupancy of target resources by the second mode according to the tasks corresponding to the second mode.
在一种实施方式中,所述通信器件为蓝牙通信模块,所述多模式包括BR/EDR模式以及BLE模式,所述第一模式为所述BR/EDR模式。In one embodiment, the communication device is a Bluetooth communication module, the multi-mode includes a BR/EDR mode and a BLE mode, and the first mode is the BR/EDR mode.
在一种实施方式中,本实施例提供的方法还可以包括如下流程:暂停所述第二模式对应的任务;或者结束所述第二模式对应的任务。In an implementation manner, the method provided in this embodiment may further include the following procedure: suspending the task corresponding to the second mode; or ending the task corresponding to the second mode.
在一种实施方式中,本实施例提供的方法还可以包括如下流程:停止用于控制所述第二模式的系统程序的运行,以暂停所述第二模式对应的任务。In an implementation manner, the method provided in this embodiment may further include the following procedure: stopping the running of the system program for controlling the second mode, so as to suspend the task corresponding to the second mode.
在一种实施方式中,本实施例提供的方法还可以包括如下流程:结束控制所述第二模式的系统程序的运行,以结束所述第二模式对应的任务。In an implementation manner, the method provided in this embodiment may further include the following procedure: ending the running of the system program controlling the second mode, so as to end the task corresponding to the second mode.
在一种实施方式中,本实施例提供的方法还可以包括如下流程:将控制所述第二模式的系统程序的进程进行杀死,以及回收分配给控制所述第二模式的系统程序的内存。In one implementation, the method provided in this embodiment may further include the following procedure: killing the process of the system program controlling the second mode, and reclaiming the memory allocated to the system program controlling the second mode .
在一种实施方式中,本实施例提供的方法还可以包括如下流程:通过系统程序来控 制所述通信器件执行每个模式各自对应的任务,其中,不同的模式所对应的进行控制的系统程序不同。In one embodiment, the method provided in this embodiment may further include the following process: using a system program to control the communication device to perform the tasks corresponding to each mode, wherein the system program corresponding to the different modes different.
在一种实施方式中,本实施例提供的方法还可以包括如下流程:通过同一个系统程序中的不同线程来分别控制所述通信器件执行每个模式各自对应的任务,其中,不同的模式所对应的进行控制的线程不同。In an implementation manner, the method provided in this embodiment may further include the following process: separately controlling the communication device to perform tasks corresponding to each mode through different threads in the same system program, wherein the different modes are The corresponding thread of control is different.
在一种实施方式中,所述目标资源包括芯片资源和/或天线资源,所述芯片资源表征用于对所执行的任务中的数据进行处理的资源,所述天线资源表征进行数据发送或接收的资源。In one embodiment, the target resource includes a chip resource and/or an antenna resource, the chip resource represents a resource for processing data in the executed task, and the antenna resource represents a data transmission or reception H.
下面先对本申请实施例所涉及的一种应用场景进行介绍。An application scenario involved in the embodiment of the present application is firstly introduced below.
如图1所示,本申请实施例所涉及的一种应用场景中包括有电子设备100、电子设备200以及电子设备210。其中,电子设备100的通信器件支持同时启动第一模式和第二模式。例如,可以通过第一模式与电子设备200建立通信连接,可以通过第二模式扫描到电子设备210。As shown in FIG. 1 , an application scenario involved in the embodiment of the present application includes an electronic device 100 , an electronic device 200 , and an electronic device 210 . Wherein, the communication device of the electronic device 100 supports starting the first mode and the second mode at the same time. For example, a communication connection can be established with the electronic device 200 through the first mode, and the electronic device 210 can be scanned through the second mode.
下面将结合附图具体描述本申请的各实施例。Various embodiments of the present application will be described in detail below with reference to the accompanying drawings.
请参阅图2,本申请实施例提供的一种设备控制方法,应用于电子设备,所述方法包括:Please refer to FIG. 2, a device control method provided by an embodiment of the present application is applied to electronic devices, and the method includes:
S110:若所述电子设备的通信器件处于多模式的状态,且所述通信器件通过第一模式发起通信连接,则获取第二模式,所述第二模式为除所述第一模式以外的模式。S110: If the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, acquire a second mode, where the second mode is a mode other than the first mode .
其中,在本申请实施例中,所涉及的通信器件为支持多模式的器件。其中,所支持的多模式可以理解为多种通信模式。例如,若通信器件为蓝牙通信模块,那么蓝牙通信模块所支持的多种通信模式包括BR/EDR模式以及BLE模式。在通信器件的某种模式处于启动的情况下,则通信器件可以基于所启动的模式完成对应的任务。例如,还是以通信器件为蓝牙通信模块为例,若蓝牙通信模块的BR/EDR模式处于启动的状态,那么蓝牙通信模块则可以通过BR/EDR模式与其他设备建立连接,进而完成连接任务。在建立连接后,可以基于所建立的连接进行蓝牙通信,进而完成数据通信的任务。若蓝牙通信模块的BLE模式处于启动的状态,则蓝牙通信模块则可以基于BLE模式对其他设备进行扫描,进而完成设备发现任务。并且,对于所扫描到的设备还可以基于BLE模式建立连接,进而完成低功耗连接的任务。Wherein, in the embodiment of the present application, the involved communication device is a device supporting multiple modes. Wherein, the supported multi-modes can be understood as multiple communication modes. For example, if the communication device is a Bluetooth communication module, the multiple communication modes supported by the Bluetooth communication module include BR/EDR mode and BLE mode. When a certain mode of the communication device is activated, the communication device can complete a corresponding task based on the activated mode. For example, still taking the communication device as a Bluetooth communication module as an example, if the BR/EDR mode of the Bluetooth communication module is activated, then the Bluetooth communication module can establish a connection with other devices through the BR/EDR mode, and then complete the connection task. After the connection is established, Bluetooth communication can be performed based on the established connection, thereby completing the task of data communication. If the BLE mode of the Bluetooth communication module is activated, the Bluetooth communication module can scan other devices based on the BLE mode, and then complete the device discovery task. Moreover, for the scanned devices, a connection can also be established based on the BLE mode, so as to complete the task of low-power connection.
在通信器件支持多模式的情况下,电子设备可以触发通信器件的某一个模式启动,也可以触发通信器件的多种模式均启动。而当通信器件有至少两种模式处于启动状态的情况下,则确定通信器件处于多模式的状态。例如,若蓝牙通信模块的BR/EDR模式以及BLE模式均处于启动的状态下,则确定蓝牙通信模块处于多模式的状态。In the case that the communication device supports multiple modes, the electronic device may trigger the activation of a certain mode of the communication device, or may trigger the activation of multiple modes of the communication device. And when at least two modes of the communication device are activated, it is determined that the communication device is in a multi-mode state. For example, if both the BR/EDR mode and the BLE mode of the Bluetooth communication module are activated, it is determined that the Bluetooth communication module is in a multi-mode state.
在本申请实施例中,可以将与其他设备建立连接所采用的模式作为第一模式。例如,以蓝牙通信模块为例,若电子设备触发蓝牙通信模块以BR/EDR模式与其他设备建立通信连接,那么则电子设备会将BR/EDR模式作为第一模式,而将BLE模式作为第二模式。In this embodiment of the present application, the mode used to establish a connection with other devices may be used as the first mode. For example, taking the Bluetooth communication module as an example, if the electronic device triggers the Bluetooth communication module to establish a communication connection with other devices in BR/EDR mode, then the electronic device will use the BR/EDR mode as the first mode, and the BLE mode as the second mode. model.
S120:降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源。S120: Reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
需要说明的是,在通信器件的多种模式均处于启动的情况下,则多种模式可能都会对通 信器件对应的资源进行占用。其中,对于通信器件而言所对应的资源包括有芯片资源以及天线资源。It should be noted that, when multiple modes of the communication device are activated, the multiple modes may occupy resources corresponding to the communication device. Wherein, the resources corresponding to the communication device include chip resources and antenna resources.
其中,芯片资源则表征用于对所执行的任务中的数据进行处理的资源,例如,若通信器件当前需要向其他设备发送数据,那么则就可能需要消耗芯片资源来基于所采用的通信协议将所要发送的数据组装为指定的格式。比如,电子设备需要向其他设备发送数字“1”,那么则通信器件则会将数字“1”基于所采用的通信协议将所要发送的数据封装为指定的格式。再例如,若通信器件接收到了其他设备发送的数据,则需要消耗芯片资源来对接收到的数据进行解析,从而提取出有用的数据。其中,该有用的数据为其他设备实际需要传输给电子设备的数据。比如,其他设备需要向电子设备发送数字“0”,那么电子设备的通信器件所接收到的其他设备发送的数据则会是对数字“0”进行封装后的数据,进而通信器件会利用其芯片资源对数据进行解封装,从而提取出有用的信息,即数字“0”。Among them, the chip resources represent the resources used to process the data in the executed tasks. For example, if the communication device currently needs to send data to other devices, then it may need to consume chip resources to process the data based on the adopted communication protocol. The data to be sent is assembled into the specified format. For example, if an electronic device needs to send the number "1" to other devices, then the communication device will encapsulate the data to be sent into a specified format based on the adopted communication protocol for the number "1". For another example, if the communication device receives data sent by other devices, it needs to consume chip resources to analyze the received data, so as to extract useful data. Wherein, the useful data is data that other devices actually need to transmit to the electronic device. For example, if other devices need to send the number "0" to the electronic device, then the data sent by other devices received by the communication device of the electronic device will be the data after encapsulating the number "0", and then the communication device will use its chip The resource decapsulates the data to extract the useful information, the number "0".
其中,天线资源则表征进行数据发送或者接收的资源。可以理解的是,电子设备需要传输给其他设备的数据在被通信器件转换为对应的无线信号后,该无线信号是需要通过天线进行发射的,以便其他设备再通过自己的天线接收到该发射的无线信号,进而使得其他设备从接收到的无线信号中提取出所传输的数据。Wherein, the antenna resource represents a resource for data transmission or reception. It can be understood that after the data that the electronic device needs to transmit to other devices is converted into a corresponding wireless signal by the communication device, the wireless signal needs to be transmitted through the antenna so that other devices can receive the transmitted data through their own antenna. The wireless signal, which in turn enables other devices to extract the transmitted data from the received wireless signal.
作为一种方式,在电子设备的通信器件处于多模式的状态的情况下,多种工作模式可以以时分复用的方式对通信器件所对应的资源进行占用。以蓝牙通信模块为例,若蓝牙通信模块的BR/EDR模式以及BLE模式均处于启动的状态下,则BR/EDR模式和BLE模式会以时分复用的方式对通信器件所对应的资源进行占用。那么在本申请实施例中,为了使得通信器件可以更好的完成第一模式对应的任务,则可以降低第二模式对通信器件对应的资源的占用程度。其中,降低第二模式对通信器件对应的资源的占用程度可以理解为降低第二模式对应的任务占用通信器件对应的资源的时间。As one manner, when the communication device of the electronic device is in a multi-mode state, multiple working modes may occupy resources corresponding to the communication device in a time-division multiplexing manner. Taking the Bluetooth communication module as an example, if both the BR/EDR mode and the BLE mode of the Bluetooth communication module are activated, the BR/EDR mode and the BLE mode will occupy the resources corresponding to the communication device in a time-division multiplexed manner. . Then, in the embodiment of the present application, in order to enable the communication device to better complete the tasks corresponding to the first mode, the occupancy of resources corresponding to the communication device in the second mode may be reduced. Wherein, reducing the degree of occupancy of resources corresponding to the communication device by the second mode may be understood as reducing the time that tasks corresponding to the second mode occupy resources corresponding to the communication device.
例如,若第一模式对应的任务为与其他设备建立连接,第二模式对应的任务为进行设备扫描。那么降低第二模式对目标资源的占用程度,则可以理解为降低进行设备扫描这个任务占用通信器件对应的资源的时间。如图3所示,图3表征的是对于某个资源的占用情况,其中,对于该资源的整体占用情况可以划分为多个第一时间周期,而在每个第一时间周期中可以包括有第一使用时间以及第一使用时间以外的时间。可选的,其中的第一使用时间为第一模式对资源的占用时间,而第一使用时间以外的时间则为第二模式对资源的占用时间。那么在需要降低第二模式对资源的占用程度的情况下,则会缩短第一使用时间以外的时间的时间长度,而使得第一时间周期中的第一使用时间更长。For example, if the task corresponding to the first mode is to establish a connection with other devices, the task corresponding to the second mode is to perform device scanning. Then, reducing the occupancy degree of the target resources in the second mode can be understood as reducing the time for the task of performing device scanning to occupy resources corresponding to the communication device. As shown in Figure 3, Figure 3 represents the occupancy of a certain resource, where the overall occupancy of the resource can be divided into multiple first time periods, and each first time period can include The first use time and time other than the first use time. Optionally, the first usage time is the resource occupation time of the first mode, and the time other than the first usage time is the resource occupation time of the second mode. Then, when it is necessary to reduce the degree of occupation of resources by the second mode, the length of time other than the first usage time will be shortened, so that the first usage time in the first time period will be longer.
其中,在本申请实施例中,对于降低所述第二模式对目标资源的占用程度的方式可以有多种。作为一种方式,降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源,包括:暂停所述第二模式对应的任务。作为另外一种方式,降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源,包括:结束所述第二模式对应的任务。其中,暂停第二模式对应的任务可以理解为暂时停止第二模式对应的任务,也就是说,第二模式对应的任务依然是处于保留状态的,只是通信 器件暂时不会去执行对应的任务。例如,若第二模式为蓝牙通信模块的BLE模式,当前BLE模式对应的任务为进行其他设备的扫描。那么在暂停BLE模式对应的任务的情况下,则电子设备则会暂时停止进行其他设备的扫描。那么在结束所述第二模式对应的任务的这种情况下,电子设备会直接结束对应的扫描任务,而不会对扫描任务进行保留。Wherein, in the embodiment of the present application, there may be multiple ways to reduce the degree of occupancy of the target resource by the second mode. As a manner, reducing the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device, includes: suspending a task corresponding to the second mode. As another manner, reducing the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device, includes: terminating a task corresponding to the second mode. Wherein, suspending the task corresponding to the second mode can be understood as temporarily stopping the task corresponding to the second mode, that is to say, the task corresponding to the second mode is still in a reserved state, but the communication device will not execute the corresponding task temporarily. For example, if the second mode is the BLE mode of the Bluetooth communication module, the task corresponding to the current BLE mode is to scan other devices. Then, in the case of suspending the task corresponding to the BLE mode, the electronic device will temporarily stop scanning other devices. Then, in the case of ending the task corresponding to the second mode, the electronic device will directly end the corresponding scanning task without reserving the scanning task.
需要说明的是,在暂停所述第二模式对应的任务的这种情况下,可以将第二任务对目标资源的占用程度降低一部分,也可以将第二任务对目标资源的占用程度降为0。而在结束所述第二模式对应的任务的这种情况下,则会直接将第二任务对目标资源的占用程度降为0。It should be noted that, in the case of suspending the task corresponding to the second mode, the occupancy degree of the target resource by the second task can be reduced by a part, or the occupancy degree of the target resource by the second task can be reduced to 0 . In the case of ending the task corresponding to the second mode, the occupancy degree of the target resource by the second task will be directly reduced to 0.
需要说明的是,电子设备可以通过本身的系统程序来实现对通信器件的控制。可选的,可以通过系统程序来控制通信器件执行每个模式各自对应的任务,并且对于不同的模式所对应的进行控制的系统程序可以是不同的。作为一种方式,电子设备通过运行第一系统程序来控制通信器件的第一模式,例如,通过运行第一系统程序来控制通信器件基于第一模式与其他设备建立通信连接。再例如,通过运行第一系统程序来控制通信器件基于所建立的通信连接进行数据传输。在这种方式中,电子设备通过运行第二系统程序来控制通信器件的第二模式。例如,通过运行第二系统程序来控制通信器件基于第二模式进行其他设备的扫描。It should be noted that the electronic device can control the communication device through its own system program. Optionally, a system program may be used to control the communication device to execute the tasks corresponding to each mode, and the system programs corresponding to different modes may be different. As a manner, the electronic device controls the first mode of the communication device by running the first system program, for example, controls the communication device to establish a communication connection with other devices based on the first mode by running the first system program. For another example, the communication device is controlled to perform data transmission based on the established communication connection by running the first system program. In this manner, the electronic device controls the second mode of the communication device by running the second system program. For example, the communication device is controlled to scan other devices based on the second mode by running the second system program.
那么在这种方式下,在需要暂停所述第二模式对应的任务的情况下,可以通过停止用于控制第二模式的系统程序的运行来实现暂停所述第二模式对应的任务。例如,将控制第二模式的系统程序切换为休眠状态,从而使得控制第二模式的系统程序不再对通信器件发出控制指令,进而通信器件则不会执行第二模式对应的任务,以实现降低第二模式对目标资源的占用程度。在需要结束所述第二模式对应的任务的情况下,则可以直接结束控制第二模式的系统程序的运行。其中,结束系统程序的运行可以理解为将控制第二模式的系统程序的进程进行杀死,以及回收分配给控制第二模式的系统程序的内存。那么对应的,在将控制第二模式的系统程序切换为休眠状态的情况下,则不会将控制第二模式的系统程序的进程进行杀死,以及也不会回收分配给控制第二模式的系统程序的内存。In this way, in the case that the task corresponding to the second mode needs to be suspended, the task corresponding to the second mode can be suspended by stopping the running of the system program for controlling the second mode. For example, the system program that controls the second mode is switched to a dormant state, so that the system program that controls the second mode no longer sends control instructions to the communication device, and then the communication device will not perform tasks corresponding to the second mode, so as to reduce Occupancy degree of the target resource by the second mode. In a case where the task corresponding to the second mode needs to be terminated, the running of the system program controlling the second mode may be terminated directly. Wherein, ending the running of the system program can be understood as killing the process of the system program controlling the second mode, and reclaiming the memory allocated to the system program controlling the second mode. Correspondingly, when the system program controlling the second mode is switched to a dormant state, the process of the system program controlling the second mode will not be killed, and the process allocated to the second mode will not be reclaimed. Memory for system programs.
再者,除了前述的对于不同的模式所对应的进行控制的系统程序可以是不同的这种方式外,作为另外一种方式,还可以配置由同一个系统程序中的不同线程来分别控制通信器件的不同模式。在这种方式下,系统程序中的线程与通信器件的模式一一对应,从而使得每种模式都有对应的线程进行控制。那么在这种方式下,在需要暂停所述第二模式对应的任务的情况下,可以通过停止用于控制第二模式的线程的运行来实现暂停所述第二模式对应的任务。例如,将控制第二模式的线程切换为阻塞状态,从而使得控制第二模式的系统程序不再对通信器件发出控制指令,进而通信器件则不会执行第二模式对应的任务,以实现降低第二模式对目标资源的占用程度。在需要结束所述第二模式对应的任务的情况下,则可以直接结束控制第二模式的线程的运行。其中,结束线程的运行可以理解为将控制第二模式的线程进行杀死,以及回收分配给控制第二模式的线程的内 存。那么对应的,在将控制第二模式的线程切换为阻塞状态的情况下,则不会将控制第二模式的线程进行杀死,以及也不会回收分配给控制第二模式的线程的内存。Furthermore, in addition to the above-mentioned way that the system programs corresponding to different modes can be different, as another way, different threads in the same system program can also be configured to control the communication devices separately. of different modes. In this way, the threads in the system program correspond to the modes of the communication device one by one, so that each mode has a corresponding thread for control. Then in this way, in the case that the task corresponding to the second mode needs to be suspended, the task corresponding to the second mode can be suspended by stopping the running of the thread used to control the second mode. For example, the thread that controls the second mode is switched to a blocked state, so that the system program that controls the second mode no longer sends control instructions to the communication device, and then the communication device will not perform tasks corresponding to the second mode, so as to reduce the second mode. The degree of occupancy of the target resources by the second mode. In a case where the task corresponding to the second mode needs to be terminated, the running of the thread controlling the second mode may be terminated directly. Wherein, ending the running of the thread can be understood as killing the thread controlling the second mode, and reclaiming the memory allocated to the thread controlling the second mode. Correspondingly, when the thread controlling the second mode is switched to a blocked state, the thread controlling the second mode will not be killed, and the memory allocated to the thread controlling the second mode will not be reclaimed.
本实施例提供的一种设备控制方法,在电子设备的通信器件处于多模式的状态的情况下,若所述通信器件通过第一模式发起通信连接,则获取第二模式,其中该第二模式为除所述第一模式以外的模式,进而降低所述第二模式对通信器件对应的资源的占用程度。从而通过上述方式使得电子设备在触发通信器件以第一模式建立连接的过程中,可以通过降低第二模式对通信器件对应的资源的占用程度,来使得第一模式对通信器件的资源的占用程度得到提升,进而使得通信器件可以更加有效的执行第一模式所对应的任务。In the device control method provided by this embodiment, when the communication device of the electronic device is in a multi-mode state, if the communication device initiates a communication connection through the first mode, the second mode is obtained, wherein the second mode It is a mode other than the first mode, thereby reducing the degree of occupancy of resources corresponding to the communication device by the second mode. Therefore, through the above method, in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupation degree of the resources corresponding to the communication device in the second mode, so that the occupation degree of the resources of the communication device in the first mode can be reduced. is improved, so that the communication device can more effectively perform the tasks corresponding to the first mode.
请参阅图4,本申请实施例提供的一种设备控制方法,应用于电子设备,所述方法包括:Please refer to FIG. 4 , a device control method provided by an embodiment of the present application is applied to electronic devices, and the method includes:
S210:若所述电子设备的通信器件处于多模式的状态,且所述通信器件通过第一模式发起通信连接,则获取第二模式,所述第二模式为除所述第一模式以外的模式。S210: If the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, acquire a second mode, where the second mode is a mode other than the first mode .
S220:降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源。S220: Reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
其中,在通信器件对应的资源有多种资源的情况下,目标资源所包括的内容可以有多种。例如,若通信期间对应的资源有芯片资源和天线资源,那么目标资源可以仅包括芯片资源或者仅包括天线资源,也可以同时包括有芯片资源和天线资源。Wherein, when there are multiple resources corresponding to the communication device, the content included in the target resource may be multiple. For example, if the corresponding resources during communication include chip resources and antenna resources, the target resource may include only chip resources or only antenna resources, or may include both chip resources and antenna resources.
对应的,在本申请实施例中,可以根据当前的实际情况来确定目标资源所包括的内容。可选的,依然可以通过传输任务的时效性来确定目标资源的内容。例如,若通过第一模式所建立的通信连接用于执行时效性较高的传输任务,那么则目标资源可以包括通信器件所对应的所有类别的资源。若通过第一模式所建立的通信连接用于执行时效性较低的传输任务,那么则目标资源可以包括通信器件所对应的任一类别的资源。其中,在本申请实施例中对于传输任务的时效性的高低可以通过传输任务所对应的时效参数来确定。若对应的时效参数的值大于指定阈值,则确定该时效参数对应的传输任务为时效性较高的传输任务,若对应的时效参数的值不大于指定阈值,则确定该时效参数对应的传输任务为时效性较低的传输任务。Correspondingly, in the embodiment of the present application, the content included in the target resource may be determined according to the current actual situation. Optionally, the content of the target resource can still be determined through the timeliness of the transmission task. For example, if the communication connection established in the first mode is used to perform a time-sensitive transmission task, the target resource may include all types of resources corresponding to the communication device. If the communication connection established in the first mode is used to perform a transmission task with low timeliness, then the target resource may include any type of resource corresponding to the communication device. Wherein, in the embodiment of the present application, the timeliness of the transmission task may be determined by the timeliness parameter corresponding to the transmission task. If the value of the corresponding aging parameter is greater than the specified threshold, determine that the transmission task corresponding to the aging parameter is a transmission task with high timeliness; if the value of the corresponding aging parameter is not greater than the specified threshold, then determine the transmission task corresponding to the aging parameter It is a transmission task with low timeliness.
S230:若所述通信器件通过所述第一模式成功建立所述通信连接,则提升所述第二模式对目标资源的占用程度。S230: If the communication device successfully establishes the communication connection through the first mode, increase the occupancy of target resources in the second mode.
需要说明的是,通信器件的第二模式的启动可能是因为电子设备需要通过该第二模式完成指定的任务,那么在通信器件通过所述第一模式成功建立所述通信连接后,为了使得通信器件的第二模式可以正常的进行任务的执行,则可以则提升所述第二模式对目标资源的占用程度。It should be noted that the activation of the second mode of the communication device may be because the electronic device needs to complete the specified task through the second mode, then after the communication device successfully establishes the communication connection through the first mode, in order to enable the communication The second mode of the device can normally execute the task, and then the degree of occupancy of the target resource by the second mode can be increased.
其中,基于前述介绍内容可知,在本申请实施例中,对于降低第二模式对目标资源的占用程度的方式可以有多种。对应的,对于提升第二模式对目标资源的占用程度方式也可以有多种,并且,提升第二模式对目标资源的占用程度方式与降低第二模式对目标资源的占用程度方式是相对应的。Wherein, based on the foregoing introduction, it can be known that in the embodiment of the present application, there may be multiple ways to reduce the degree of occupancy of the target resource by the second mode. Correspondingly, there may be multiple ways to increase the degree of occupancy of the target resource by the second mode, and the way to increase the degree of occupancy of the target resource by the second mode corresponds to the way to reduce the degree of occupancy of the target resource by the second mode .
可选的,若是通过停止用于控制第二模式的系统程序的运行来实现降低所述第二模式对目标资源的占用程度。则在提升所述第二模式对目标资源的占用程度的过程中,可以是通 过触发控制第二模式的系统程序继续运行或者重新开始运行的方式,来实现提升所述第二模式对目标资源的占用程度。Optionally, reducing the occupancy of target resources by the second mode is achieved by stopping the running of the system program used to control the second mode. Then, in the process of increasing the occupancy degree of the target resource by the second mode, the system program controlling the second mode may be triggered to continue to run or restart to realize the increase of the target resource by the second mode. degree of occupancy.
可选的,若是通过改变控制第二模式的线程的状态来实现降低所述第二模式对目标资源的占用程度。则在提升所述第二模式对目标资源的占用程度的过程中,同样可以是通过改变控制第二模式的线程的状态来实现提升所述第二模式对目标资源的占用程度。例如,若是通过将第二模式的线程切换为阻塞状态来实现降低所述第二模式对目标资源的占用程度,则可以通过将将第二模式的线程切换为运行状态来实现提升所述第二模式对目标资源的占用程度。若是通过将第二模式的线程进行杀死来实现降低所述第二模式对目标资源的占用程度,则可以通过启动控制第二模式的线程来实现提升所述第二模式对目标资源的占用程度。Optionally, reducing the occupancy of target resources by the second mode is achieved by changing the state of the thread controlling the second mode. Then, in the process of increasing the degree of occupancy of the target resource by the second mode, the degree of occupancy of the target resource by the second mode can also be increased by changing the state of the thread controlling the second mode. For example, if the second mode’s occupation of target resources is reduced by switching the thread in the second mode to the blocked state, the second mode can be improved by switching the thread in the second mode to the running state. How much the pattern occupies the target's resources. If by killing the thread of the second mode to reduce the occupancy degree of the target resource by the second mode, the occupancy degree of the target resource by the second mode can be improved by starting the thread controlling the second mode .
作为一种方式,在电子设备中可以建立有一个模式特征文件。在该模式特征文件中可以记录有通信器件的每种模式的当前状态,以及由前一状态切换成为当前状态的方式。从而使得电子设备可以通过查询该模式特征文件的方式,来获取得到通信器件的第二模式被触发降低对目标资源资的占用程度的方式,从而可以采用对应的方式来实现提升第二模式对目标资源的占用程度。As a way, a pattern signature file can be established in the electronic device. The current state of each mode of the communication device and the way of switching from the previous state to the current state can be recorded in the mode feature file. In this way, the electronic device can obtain the way in which the second mode of the communication device is triggered to reduce the occupancy of target resources by querying the mode feature file, so that the corresponding way can be used to improve the impact of the second mode on the target. resource usage.
例如,在该模式特征文件中可以存储有第一标识以及第二标识。其中,第一标识可以用于记录通信器件的每种模式当前所处的状态,第二标识用于记录每种模式由前一状态切换为当前所处的状态的方式。For example, the first identifier and the second identifier may be stored in the pattern feature file. Wherein, the first identification can be used to record the current state of each mode of the communication device, and the second identification is used to record the way each mode switches from the previous state to the current state.
本实施例提供的一种设备控制方法,从而通过上述方式使得电子设备在触发通信器件以第一模式建立连接的过程中,可以通过降低第二模式对通信器件对应的资源的占用程度,来使得第一模式对通信器件的资源的占用程度得到提升,进而使得通信器件可以更加有效的执行第一模式所对应的任务。并且,在本实施例中,在通过第一模式成功建立通信连后,还会对第二模式对目标资源的占用程度进行提升,进而使得在提升电子设备在更加有效的执行第一模式所对应的任务的同时,可以降低对其他模式的影响。This embodiment provides a device control method, so that in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupancy of the resources corresponding to the communication device in the second mode, so that The resource occupation of the communication device in the first mode is improved, so that the communication device can more effectively perform tasks corresponding to the first mode. Moreover, in this embodiment, after the communication connection is successfully established through the first mode, the degree of occupancy of the target resources in the second mode will be improved, so that the electronic device can more effectively execute the communication corresponding to the first mode. At the same time, the impact on other modes can be reduced.
请参阅图5,本申请实施例提供的一种设备控制方法,应用于电子设备,所述方法包括:Please refer to Fig. 5, a device control method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
S310:若所述电子设备的通信器件处于多模式的状态,且所述通信器件通过第一模式发起通信连接,则获取第二模式,所述第二模式为除所述第一模式以外的模式。S310: If the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, acquire a second mode, where the second mode is a mode other than the first mode .
S320:记录所述第二模式所对应的工作状态作为参考工作状态。S320: Record the working state corresponding to the second mode as a reference working state.
需要说明的是,通信器件的第二模式在启动时会基于既定的工作参数进行运行,那么该既定的工作参数则决定了第二模式在运行过程中的工作状态。该工作状态可以包括有信号状态和/或时间状态,其中,信号状态可以表征基于第二模式所发射的无线信号的强度,时间状态则可以表征基于第二模式所发射的无线信号的时间周期。It should be noted that, when the second mode of the communication device is started, it will operate based on a predetermined working parameter, and the predetermined working parameter determines the working state of the second mode during the running process. The working state may include a signal state and/or a time state, wherein the signal state may represent the strength of the wireless signal transmitted based on the second mode, and the time state may represent the time period of the wireless signal transmitted based on the second mode.
例如,以蓝牙通信器件为例,第二模式可以为BLE模式。那么BLE模式的工作状态中的信号状态则可以表征基于BLE模式所发射的无线信号的强度。BLE模式的工作状态中的时间状态则可以表征基于BLE模式进行扫描的时间周期。例如,时间状态可以通过蓝牙通信协议中的window参数和interval参数这两个参数进行定义。其中,interval参数 表征每个周期的扫描间隔的长度,window参数则表征每个周期的扫描间隔中BLE模式会进行扫描的窗口的长度。可以理解的是,window参数对应表征的是对通信器件的天线资源的占用程度。window参数的值越大,那么对天线资源的占用程度也就越高。For example, taking a Bluetooth communication device as an example, the second mode may be a BLE mode. Then the signal state in the working state of the BLE mode can represent the strength of the wireless signal transmitted based on the BLE mode. The time state in the working state of the BLE mode may represent a time period for scanning based on the BLE mode. For example, the time state can be defined through two parameters of the bluetooth communication protocol, the window parameter and the interval parameter. Among them, the interval parameter represents the length of the scanning interval of each cycle, and the window parameter represents the length of the window that the BLE mode will scan in the scanning interval of each cycle. It can be understood that the window parameter corresponds to the degree of occupancy of antenna resources of the communication device. The larger the value of the window parameter, the higher the occupation of antenna resources.
S330:降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源。S330: Reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
S340:若所述通信器件通过所述第一模式成功建立所述通信连接,则基于所述参考工作状态提升所述第二模式对目标资源的占用程度。S340: If the communication device successfully establishes the communication connection through the first mode, increase the occupancy of target resources in the second mode based on the reference working state.
其中,在记录有第二模式所对应的工作状态作为参考工作状态的情况下,电子设备则可以确定在降低第二模式对目标资源的占用程度之前,第二模式是以怎么样的状态进行运行的。那么在后续提升第二模式对目标资源的占用程度的过程中,则可以以该参考工作状态为参考,以将第二模式对目标资源的占用程度提升到参考工作状态所示的状态。例如,若第二模式对应的参考工作状态包括有时间状态,该时间状态中对应的interval参数的值为1200ms,对应的window参数的值为120ms。那么在降低第二模式对目标资源的占用程度后,window参数的值可以由120ms变为0ms,也就是说,在降低占用程度后,会触发停止通信器件的第二模式对应的任务。而在后续提升占用程度的阶段,则又可以将window参数的值变为120ms,进而恢复通信器件的第二模式对应的任务。Wherein, when the working state corresponding to the second mode is recorded as the reference working state, the electronic device can determine in what state the second mode is running before reducing the degree of occupancy of the target resource by the second mode of. Then, in the subsequent process of increasing the occupancy degree of the target resource by the second mode, the reference working state can be used as a reference to increase the occupancy degree of the target resource by the second mode to the state indicated by the reference working state. For example, if the reference working state corresponding to the second mode includes a time state, the value of the corresponding interval parameter in the time state is 1200ms, and the value of the corresponding window parameter is 120ms. Then, after reducing the occupancy degree of the second mode to the target resource, the value of the window parameter can be changed from 120ms to 0ms, that is, after reducing the occupancy degree, the task corresponding to the second mode of stopping the communication device will be triggered. In the subsequent stage of increasing the occupancy level, the value of the window parameter can be changed to 120ms, and then the task corresponding to the second mode of the communication device can be resumed.
本实施例提供的一种设备控制方法,从而通过上述方式使得电子设备在触发通信器件以第一模式建立连接的过程中,可以通过降低第二模式对通信器件对应的资源的占用程度,来使得第一模式对通信器件的资源的占用程度得到提升,进而使得通信器件可以更加有效的执行第一模式所对应的任务。并且,在本实施例中,在降低第二模式对目标资源的占用程度之前,还会记录所述第二模式所对应的工作状态作为参考工作状态,进而在通过第一模式成功建立通信连后,还会则基于参考工作状态提升所述第二模式对目标资源的占用程度,进而使得在提升电子设备在更加有效的执行第一模式所对应的任务的同时,可以降低对其他模式的影响。This embodiment provides a device control method, so that in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupancy of the resources corresponding to the communication device in the second mode, so that The resource occupation of the communication device in the first mode is improved, so that the communication device can more effectively perform tasks corresponding to the first mode. Moreover, in this embodiment, before reducing the degree of occupancy of target resources in the second mode, the working status corresponding to the second mode will be recorded as a reference working status, and then after the communication connection is successfully established through the first mode Furthermore, based on the reference working state, the degree of occupancy of the target resource by the second mode is increased, so that while improving the electronic device to perform tasks corresponding to the first mode more effectively, the impact on other modes can be reduced.
请参阅图6,本申请实施例提供的一种设备控制方法,应用于电子设备,所述方法包括:Please refer to FIG. 6, a device control method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
S410:若所述电子设备的通信器件处于多模式的状态,且所述通信器件通过第一模式发起通信连接,则获取第二模式,所述第二模式为除所述第一模式以外的模式。S410: If the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, acquire a second mode, where the second mode is a mode other than the first mode .
S420:降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源。S420: Reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
S430:若所述通信器件通过所述第一模式成功建立所述通信连接,则获取基于所述通信连接所对应的传输任务。S430: If the communication device successfully establishes the communication connection through the first mode, acquire a transmission task corresponding to the communication connection.
S440:基于所述传输任务提升所述第二模式对目标资源的占用程度。S440: Increase the degree of occupancy of the target resource by the second mode based on the transmission task.
需要说明的是,通信器件在基于第一模式与其他设备建立连接后,会通过所建立的连接继续执行传输任务,以便可以将电子设备中的数据传输给其他设备,或者接收其他设备传输来的数据。其中,对于不同的传输任务所对应的时效性是不同的。时效性反映了所对应的传输任务对于数据传输的时效性的高低要求。对于时效性较高的传输任务,则所传输的数据需 要高效的进行传输,而对于时效性较低的传输任务,所传输的数据可以不用被高效的进行传输。It should be noted that after the communication device establishes a connection with other devices based on the first mode, it will continue to perform the transmission task through the established connection, so that the data in the electronic device can be transmitted to other devices, or receive data from other devices. data. Wherein, the timeliness corresponding to different transmission tasks is different. The timeliness reflects the timeliness requirements of the corresponding transmission tasks for data transmission. For transmission tasks with high timeliness, the transmitted data needs to be transmitted efficiently, while for transmission tasks with low timeliness, the transmitted data may not be transmitted efficiently.
例如,用于传输通话语音的传输任务可以为对传输的时效性要求较高的任务。用于传输所播放音乐的音频的传输任务可以为对传输的时效性要求较低的任务。For example, the transmission task for transmitting call voice may be a task that requires high timeliness of transmission. The transmission task for transmitting the audio of the played music may be a task that requires less timeliness of transmission.
作为一种方式,所述基于所述传输任务提升所述第二模式对目标资源的占用程度,包括:获取所述传输任务对应的时效参数;根据所述传输任务对应的时效参数确定对应的提升幅度;根据所述提升幅度提升所述第二模式对目标资源的占用程度。其中,时效参数为表征对时效性要求的参数,时效参数的值越大,那么所对应的对时效性的要求也就越高。As a manner, the increasing the degree of occupancy of the target resource by the second mode based on the transmission task includes: acquiring a timeliness parameter corresponding to the transmission task; determining a corresponding increase according to the timeliness parameter corresponding to the transmission task Amplitude: increasing the degree of occupancy of the target resource by the second mode according to the enhancement extent. Wherein, the timeliness parameter is a parameter representing a timeliness requirement, and a larger value of the timeliness parameter corresponds to a higher timeliness requirement.
可选的,在电子设备中可以预先建立目标应用程序与时效参数之间的对应关系。其中,目标应用程序为有通过通信器件进行数据传输需求的应用程序。在这种方式下,在获取到传输任务后,可以获取传输任务所属的应用程序作为目标应用程序,进而再根据目标应用程序与时效参数之间的对应关系,来获取得到目标应用程序所对应的时效参数作为传输任务对应的时效参数。示例性的,对应关系中包括有应用程序A对应时效参数t1,应用程序B对应时效参数t2,应用程序C对应时效参数t3以及应用程序D对应时效参数t4。若获取的传输任务所属的应用程序为应用程序C,那么因为应用程序C对应的时效参数为t3,进而该传输任务所对应的时效参数则为t3。Optionally, the correspondence between the target application program and the aging parameter may be pre-established in the electronic device. Wherein, the target application program is an application program that requires data transmission through a communication device. In this way, after the transfer task is obtained, the application to which the transfer task belongs can be obtained as the target application, and then according to the corresponding relationship between the target application and the aging parameters, the corresponding The aging parameter is used as the aging parameter corresponding to the transmission task. Exemplarily, the corresponding relationship includes the aging parameter t1 corresponding to the application program A, the aging parameter t2 corresponding to the application program B, the aging parameter t3 corresponding to the application program C, and the aging parameter t4 corresponding to the application program D. If the application program to which the acquired transmission task belongs is application program C, then since the aging parameter corresponding to application program C is t3, then the aging parameter corresponding to the transmission task is t3.
在这种方式下,表征对时效性的要求越高的时效参数所对应确定的提升程度越高。其中,提升程度越高表征对目标资源的占用程度的提升越高。In this way, the higher degree of improvement is determined corresponding to the aging parameters that represent higher requirements on timeliness. Wherein, a higher degree of improvement indicates a higher degree of occupancy of the target resource.
本实施例提供的一种设备控制方法,从而通过上述方式使得电子设备在触发通信器件以第一模式建立连接的过程中,可以通过降低第二模式对通信器件对应的资源的占用程度,来使得第一模式对通信器件的资源的占用程度得到提升,进而使得通信器件可以更加有效的执行第一模式所对应的任务。并且,在本实施例中,在提升第二模式对目标资源的占用程度的过程中,可以灵活的根据基于第一模式所建立的通信连接的传输任务来进行提升,进而提升了对于目标资源占用程度提升的灵活性。This embodiment provides a device control method, so that in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupancy of the resources corresponding to the communication device in the second mode, so that The resource occupation of the communication device in the first mode is improved, so that the communication device can more effectively perform tasks corresponding to the first mode. Moreover, in this embodiment, in the process of increasing the occupancy of target resources in the second mode, it can be flexibly increased based on the transmission task of the communication connection established in the first mode, thereby improving the occupancy of target resources. Increased flexibility.
请参阅图7,本申请实施例提供的一种设备控制方法,应用于电子设备,所述方法包括:Please refer to FIG. 7, a device control method provided by an embodiment of the present application is applied to electronic devices, and the method includes:
S510:若所述电子设备的通信器件处于多模式的状态,且所述通信器件通过第一模式发起通信连接,则获取第二模式,所述第二模式为除所述第一模式以外的模式。S510: If the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, acquire a second mode, where the second mode is a mode other than the first mode .
S520:降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源。S520: Reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
S530:检测第二模式是否由用户触发启动。S530: Detect whether the second mode is triggered to start by the user.
S540:若是,则执行若通信器件通过所述第一模式成功建立所述通信连接,则提升所述第二模式对目标资源的占用程度。S540: If yes, if the communication device successfully establishes the communication connection through the first mode, increase the occupancy degree of the target resource in the second mode.
若否,则不用再提升所述第二模式对目标资源的占用程度。If not, there is no need to increase the degree of occupancy of the target resource by the second mode.
需要说明的是,对于一些电子设备而言,其通信器件中的部分模式可能并不是因为用户的触发而启动的。那么也就意味着,即使关闭该部分并不是由用户触发而启动的模 式,则依然不会对用户的使用体验造成干扰。例如,在电子设备中,电子设备可以通过区分触发模式启动的方式来确定所启动的模式是否有用户触发启动。例如,对于通过控件触发启动的模式,则可以确定是由用户触发启动的。而对于通过响应于自动触发事件而启动的模式则可以确定不是由用户所触发启动的。该自动触发事件可以为定时事件,也可以为程序启动事件,或者电子设备的电源启动事件等。It should be noted that, for some electronic devices, some modes of the communication device may not be activated by a user's trigger. Then it means that even if the mode that is not triggered by the user is turned off, it will still not interfere with the user experience. For example, in an electronic device, the electronic device may determine whether the activated mode is activated by a user's trigger by distinguishing the mode of activation of the triggered mode. For example, for a mode triggered by a control, it may be determined that the mode is triggered by a user. However, for the mode activated by responding to an automatic trigger event, it may be determined that the activation is not triggered by the user. The automatic triggering event may be a timing event, or a program start event, or a power start event of an electronic device, or the like.
本实施例提供的一种设备控制方法,从而通过上述方式使得电子设备在触发通信器件以第一模式建立连接的过程中,可以通过降低第二模式对通信器件对应的资源的占用程度,来使得第一模式对通信器件的资源的占用程度得到提升,进而使得通信器件可以更加有效的执行第一模式所对应的任务。并且,在本实施例中,可以根据第二模式是否由用户自己触发来确定是否提升第二模式对目标资源的占用程度,进而提升了对于通信器件的控制的智能化程度。This embodiment provides a device control method, so that in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupancy of the resources corresponding to the communication device in the second mode, so that The resource occupation of the communication device in the first mode is improved, so that the communication device can more effectively perform tasks corresponding to the first mode. Moreover, in this embodiment, it may be determined whether to increase the degree of occupancy of the target resources in the second mode according to whether the second mode is triggered by the user, thereby improving the degree of intelligence in the control of the communication device.
需要说明说明的是,前述实施例内容中所涉及的蓝牙通信模块仅仅是示例性的。其他的具有多种模式的通信器件均在本申请实施例所包括的范围内。例如,本申请实施例中的通信器件也可以为多于具有多种工作模式的WiFi通信模块。其中,WiFi通信模块的多种工作模式可以包括有STA(Station)模式和AP(Access Point)模式。那么在WiFi通信模块基于STA模式与其他设备建立通信连接的过程中,STA模式则为第一模式,对应的,AP模式则为第二模式。It should be noted that the bluetooth communication module involved in the foregoing embodiments is only exemplary. Other communication devices with multiple modes are within the scope of the embodiments of the present application. For example, the communication device in the embodiment of the present application may also be more than a WiFi communication module with multiple working modes. Wherein, the multiple working modes of the WiFi communication module may include STA (Station) mode and AP (Access Point) mode. Then, when the WiFi communication module establishes a communication connection with other devices based on the STA mode, the STA mode is the first mode, and correspondingly, the AP mode is the second mode.
请参阅图8,本申请实施例提供的一种设备控制装置600,运行于电子设备,所述装置600包括:Please refer to FIG. 8 , a device control device 600 provided in the embodiment of the present application, which runs on electronic devices, and the device 600 includes:
模式获取单元610,用于若所述电子设备的通信器件处于多模式的状态,且所述通信器件通过第一模式发起通信连接,则获取第二模式,所述第二模式为除所述第一模式以外的模式;The mode acquiring unit 610 is configured to acquire a second mode if the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, and the second mode is other than the first mode. a mode other than a mode;
控制单元620,用于降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源。The control unit 620 is configured to reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
作为一种方式,控制单元620,还用于若所述通信器件通过所述第一模式成功建立所述通信连接,则提升所述第二模式对目标资源的占用程度。As a manner, the control unit 620 is further configured to increase the occupancy of target resources in the second mode if the communication device successfully establishes the communication connection through the first mode.
可选的,控制单元620,还用于记录所述第二模式所对应的工作状态作为参考工作状态。控制单元620,还具体用于若所述通信器件通过所述第一模式成功建立所述通信连接,则基于所述参考工作状态提升所述第二模式对目标资源的占用程度。Optionally, the control unit 620 is further configured to record the working state corresponding to the second mode as a reference working state. The control unit 620 is further specifically configured to, if the communication device successfully establishes the communication connection through the first mode, increase the occupancy of target resources in the second mode based on the reference working state.
作为一种方式,控制单元620,还具体用于若所述通信器件通过所述第一模式成功建立所述通信连接,则获取基于所述通信连接所对应的传输任务;As a manner, the control unit 620 is further specifically configured to acquire a transmission task corresponding to the communication connection if the communication device successfully establishes the communication connection through the first mode;
基于所述传输任务提升所述第二模式对目标资源的占用程度。可选的,控制单元620,还具体用于获取所述传输任务对应的时效参数;根据所述传输任务对应的时效参数确定对应的提升幅度;根据所述提升幅度提升所述第二模式对目标资源的占用程度。Increase the occupancy degree of the target resource by the second mode based on the transmission task. Optionally, the control unit 620 is also specifically configured to obtain the time-sensitive parameter corresponding to the transmission task; determine the corresponding improvement range according to the time-sensitive parameter corresponding to the transmission task; increase the target value of the second mode according to the improvement range resource usage.
可选的,控制单元620还用于基于所述传输任务对应的时效参数确定目标资源对应的内容;若通过所述第一模式所建立的通信连接用于执行时效性较高的传输任务,确 定所述目标资源包括所述通信器件所对应的所有类别的资源;若通过所述第一模式所建立的通信连接用于执行时效性较低的传输任务,确定所述目标资源包括所述通信器件所对应的任一类别的资源。Optionally, the control unit 620 is further configured to determine the content corresponding to the target resource based on the timeliness parameter corresponding to the transmission task; if the communication connection established through the first mode is used to execute a transmission task with high timeliness, determine The target resource includes all types of resources corresponding to the communication device; if the communication connection established through the first mode is used to perform a transmission task with low timeliness, it is determined that the target resource includes the communication device resources of any category.
可选的,控制单元620具体还用于若所述传输任务对应的时效参数大于指定阈值,确定所述传输任务为时效性较高的传输任务;若所述传输任务对应的时效参数不大于所述指定阈值,确定所述传输任务为时效性较低的传输任务。Optionally, the control unit 620 is further configured to determine that the transmission task is a transmission task with high timeliness if the timeliness parameter corresponding to the transmission task is greater than a specified threshold; if the timeliness parameter corresponding to the transmission task is not greater than the specified threshold The specified threshold is determined to determine that the transmission task is a transmission task with low timeliness.
综上,其中,所述目标资源包括芯片资源和/或天线资源,所述芯片资源表征用于对所执行的任务中的数据进行处理的资源,所述天线资源表征进行数据发送或接收的资源。To sum up, the target resource includes a chip resource and/or an antenna resource, the chip resource represents a resource for processing data in an executed task, and the antenna resource represents a resource for data transmission or reception .
如图9所示,所述装置600还包括:启动方式检测单元630,用于在若所述通信器件通过所述第一模式成功建立所述通信连接,则提升所述第二模式对目标资源的占用程度之前还包括:检测第二模式是否由用户触发启动。对应的,若是,则控制单元620,用于则执行所述若所述通信器件通过所述第一模式成功建立所述通信连接,则提升所述第二模式对目标资源的占用程度。As shown in FIG. 9, the apparatus 600 further includes: an activation mode detection unit 630, configured to upgrade the second mode to the target resource if the communication device successfully establishes the communication connection through the first mode. Before the degree of occupancy, the method further includes: detecting whether the second mode is triggered to start by a user. Correspondingly, if yes, the control unit 620 is configured to execute the step of increasing the occupancy of target resources in the second mode if the communication device successfully establishes the communication connection through the first mode.
作为一种方式,控制单元620,还具体用于获取第二模式对应的任务;根据所述第二模式对应的任务降低所述第二模式对目标资源的占用程度。As a manner, the control unit 620 is further specifically configured to acquire tasks corresponding to the second mode; and reduce the occupancy of target resources by the second mode according to the tasks corresponding to the second mode.
作为一种方式,控制单元620,还具体用于暂停所述第二模式对应的任务;As a manner, the control unit 620 is also specifically configured to suspend the task corresponding to the second mode;
或者结束所述第二模式对应的任务。Or end the task corresponding to the second mode.
可选的,控制单元620具体还用于停止用于控制所述第二模式的系统程序的运行,以暂停所述第二模式对应的任务。Optionally, the control unit 620 is further configured to stop the running of the system program for controlling the second mode, so as to suspend the task corresponding to the second mode.
可选的,控制单元620具体还用于结束控制所述第二模式的系统程序的运行,以结束所述第二模式对应的任务。其中,所述结束控制所述第二模式的系统程序的运行,包括:将控制所述第二模式的系统程序的进程进行杀死,以及回收分配给控制所述第二模式的系统程序的内存。Optionally, the control unit 620 is further configured to end the running of the system program controlling the second mode, so as to end the task corresponding to the second mode. Wherein, the ending the running of the system program controlling the second mode includes: killing the process of the system program controlling the second mode, and reclaiming the memory allocated to the system program controlling the second mode .
可选的,控制单元620具体还用于通过系统程序来控制所述通信器件执行每个模式各自对应的任务,其中,不同的模式所对应的进行控制的系统程序不同。Optionally, the control unit 620 is specifically further configured to control the communication device to perform tasks corresponding to each mode through a system program, where different modes correspond to different system programs for control.
可选的,控制单元620具体还用于通过同一个系统程序中的不同线程来分别控制所述通信器件执行每个模式各自对应的任务,其中,不同的模式所对应的进行控制的线程不同。Optionally, the control unit 620 is specifically further configured to separately control the communication device to perform tasks corresponding to each mode through different threads in the same system program, wherein different modes correspond to different threads for control.
本实施例提供的一种设备控制装置,在电子设备的通信器件处于多模式的状态的情况下,若所述通信器件通过第一模式发起通信连接,则获取第二模式,其中该第二模式为除所述第一模式以外的模式,进而降低所述第二模式对通信器件对应的资源的占用程度。从而通过上述方式使得电子设备在触发通信器件以第一模式建立连接的过程中,可以通过降低第二模式对通信器件对应的资源的占用程度,来使得第一模式对通信器件的资源的占用程度得到提升,进而使得通信器件可以更加有效的执行第一模式所对应的任务。In the device control device provided in this embodiment, when the communication device of the electronic device is in a multi-mode state, if the communication device initiates a communication connection through the first mode, the second mode is acquired, wherein the second mode It is a mode other than the first mode, thereby reducing the degree of occupancy of resources corresponding to the communication device by the second mode. Therefore, through the above method, in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupation degree of the resources corresponding to the communication device in the second mode, so that the occupation degree of the resources of the communication device in the first mode can be reduced. is improved, so that the communication device can more effectively perform the tasks corresponding to the first mode.
需要说明的是,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描 述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性。另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described devices and units can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here. . In several embodiments provided in the present application, the coupling between the modules may be electrical. In addition, each functional module in each embodiment of the present application may be integrated into one processing module, each module may exist separately physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
下面将结合图10对本申请提供的一种电子设备进行说明。An electronic device provided by the present application will be described below with reference to FIG. 10 .
请参阅图10,基于上述的设备控制方法、装置,本申请实施例还提供的一种可以执行前述设备控制方法的电子设备1000。电子设备1000包括相互耦合的一个或多个(图中仅示出一个)处理器102、存储器104、摄像头106以及音频采集装置108。其中,该存储器104中存储有可以执行前述实施例中内容的程序,而处理器102可以执行该存储器104中存储的程序。Please refer to FIG. 10 , based on the above-mentioned device control method and apparatus, an embodiment of the present application also provides an electronic device 1000 that can implement the aforementioned device control method. The electronic device 1000 includes one or more (only one is shown in the figure) processors 102 , a memory 104 , a camera 106 and an audio collection device 108 coupled to each other. Wherein, the memory 104 stores programs capable of executing the contents of the foregoing embodiments, and the processor 102 can execute the programs stored in the memory 104 .
其中,处理器102可以包括一个或者多个处理核。处理器102利用各种接口和线路连接整个电子设备1000内的各个部分,通过运行或执行存储在存储器104内的指令、程序、代码集或指令集,以及调用存储在存储器104内的数据,执行电子设备1000的各种功能和处理数据。可选地,处理器102可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器102可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器102中,单独通过一块通信芯片进行实现。Wherein, the processor 102 may include one or more processing cores. The processor 102 uses various interfaces and circuits to connect various parts of the entire electronic device 1000, and executes or executes instructions, programs, code sets, or instruction sets stored in the memory 104, and calls data stored in the memory 104 to execute Various functions of the electronic device 1000 and processing data. Optionally, the processor 102 may adopt at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). implemented in the form of hardware. The processor 102 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a modem, and the like. Among them, the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used to render and draw the displayed content; the modem is used to handle wireless communication. It can be understood that the above modem may also not be integrated into the processor 102, but implemented by a communication chip alone.
存储器104可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器104可用于存储指令、程序、代码、代码集或指令集。存储器104可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。例如,存储器104中可以存储有设备控制的装置。该设备控制的装置可以为前述的装置600。The memory 104 may include random access memory (Random Access Memory, RAM), and may also include read-only memory (Read-Only Memory). Memory 104 may be used to store instructions, programs, codes, sets of codes, or sets of instructions. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like. For example, device control means may be stored in the memory 104 . The device controlled by the device may be the aforementioned device 600 .
再者,电子设备1000除了前述所示的器件外,还可以包括网络模块110以及传感器模块112。Furthermore, the electronic device 1000 may further include a network module 110 and a sensor module 112 in addition to the aforementioned devices.
所述网络模块110用于实现电子设备1000与其他设备之间的信息交互,例如,传输设备控制指令、操纵请求指令以及状态信息获取指令等。而当电子设备200具体为不同的设备时,其对应的网络模块110可能会有不同。The network module 110 is used to implement information interaction between the electronic device 1000 and other devices, for example, transmitting device control instructions, manipulation request instructions, and status information acquisition instructions. However, when the electronic device 200 is specifically a different device, its corresponding network module 110 may be different.
传感器模块112可以包括至少一种传感器。具体地,传感器模块112可包括但并不限于:光传感器、运动传感器、压力传感器、红外热传感器、距离传感器、加速度传感器、以及其他传感器。The sensor module 112 may include at least one sensor. Specifically, the sensor module 112 may include, but is not limited to: a light sensor, a motion sensor, a pressure sensor, an infrared heat sensor, a distance sensor, an acceleration sensor, and other sensors.
其中,压力传感器可以检测由按压在电子设备1000产生的压力的传感器。即,压力传感 器检测由用户和电子设备之间的接触或按压产生的压力,例如由用户的耳朵与移动终端之间的接触或按压产生的压力。因此,压力传感器可以用来确定在用户与电子设备1000之间是否发生了接触或者按压,以及压力的大小。Wherein, the pressure sensor may be a sensor for detecting pressure generated by pressing on the electronic device 1000 . That is, the pressure sensor detects pressure generated by contact or press between the user and the electronic device, for example, pressure generated by contact or press between the user's ear and the mobile terminal. Therefore, the pressure sensor can be used to determine whether contact or pressure occurs between the user and the electronic device 1000, and the magnitude of the pressure.
其中,加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别电子设备1000姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等。另外,电子设备1000还可配置陀螺仪、气压计、湿度计、温度计等其他传感器,在此不再赘述。Among them, the acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when it is still, and can be used to identify the application of electronic equipment 1000 attitude (such as horizontal and vertical screen switching, related games, magnetometer, etc.) Attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc. In addition, the electronic device 1000 may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, and a thermometer, which will not be repeated here.
音频采集装置110,用于进行音频信号采集。可选的,音频采集装置110包括有多个音频采集器件,该音频采集器件可以为麦克风。The audio collection device 110 is configured to collect audio signals. Optionally, the audio collection device 110 includes multiple audio collection devices, and the audio collection devices may be microphones.
作为一种方式,电子设备1000的网络模块为射频模块,该射频模块用于接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯。所述射频模块可包括各种现有的用于执行这些功能的电路元件,例如,天线、射频收发器、数字信号处理器、加密/解密芯片、用户身份模块(SIM)卡、存储器等等。例如,该射频模块可以通过发送或者接收的电磁波与外部设备进行交互。例如,射频模块可以向目标设备发送指令。As one way, the network module of the electronic device 1000 is a radio frequency module, and the radio frequency module is used to receive and send electromagnetic waves, realize mutual conversion between electromagnetic waves and electrical signals, and communicate with a communication network or other devices. The radio frequency module may include various existing circuit elements for performing these functions, such as antenna, radio frequency transceiver, digital signal processor, encryption/decryption chip, Subscriber Identity Module (SIM) card, memory and so on. For example, the radio frequency module can interact with external devices by sending or receiving electromagnetic waves. For example, a radio frequency module can send instructions to a target device.
请参考图11,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质800中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to FIG. 11 , which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. Program codes are stored in the computer-readable medium 800, and the program codes can be invoked by a processor to execute the methods described in the foregoing method embodiments.
计算机可读存储介质800可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质800包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质800具有执行上述方法中的任何方法步骤的程序代码810的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码810可以例如以适当形式进行压缩。The computer readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium). The computer-readable storage medium 800 has a storage space for program code 810 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products. Program code 810 may, for example, be compressed in a suitable form.
综上所述,本申请提供的一种设备控制方法、装置、电子设备及存储介质,在电子设备的通信器件处于多模式的状态的情况下,若所述通信器件通过第一模式发起通信连接,则获取第二模式,其中该第二模式为除所述第一模式以外的模式,进而降低所述第二模式对通信器件对应的资源的占用程度。从而通过上述方式使得电子设备在触发通信器件以第一模式建立连接的过程中,可以通过降低第二模式对通信器件对应的资源的占用程度,来使得第一模式对通信器件的资源的占用程度得到提升,进而使得通信器件可以更加有效的执行第一模式所对应的任务。To sum up, in the device control method, device, electronic device, and storage medium provided by the present application, when the communication device of the electronic device is in a multi-mode state, if the communication device initiates a communication connection through the first mode , the second mode is obtained, where the second mode is a mode other than the first mode, thereby reducing the occupancy of resources corresponding to the communication device by the second mode. Therefore, through the above method, in the process of triggering the communication device to establish a connection in the first mode, the electronic device can reduce the occupation degree of the resources corresponding to the communication device in the second mode, so that the occupation degree of the resources of the communication device in the first mode can be reduced. is improved, so that the communication device can more effectively perform the tasks corresponding to the first mode.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not drive the essence of the corresponding technical solutions away from the spirit and scope of the technical solutions of the various embodiments of the present application.

Claims (20)

  1. 一种设备控制方法,其中,应用于电子设备,所述方法包括:A device control method, which is applied to an electronic device, the method comprising:
    若所述电子设备的通信器件处于多模式的状态,且所述通信器件通过第一模式发起通信连接,则获取第二模式,所述第二模式为除所述第一模式以外的模式;If the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, then acquire a second mode, where the second mode is a mode other than the first mode;
    降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源。Reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
  2. 根据权利要求1所述的方法,其中,所述降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源之后还包括:The method according to claim 1, wherein said reducing the degree of occupancy of the target resource by the second mode, after the target resource is a resource corresponding to the communication device, further includes:
    若所述通信器件通过所述第一模式成功建立所述通信连接,则提升所述第二模式对目标资源的占用程度。If the communication device successfully establishes the communication connection through the first mode, increasing the occupancy of target resources in the second mode.
  3. 根据权利要求2所述的方法,其中,所述降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源之前还包括:The method according to claim 2, wherein said reducing the degree of occupancy of the target resource by the second mode, before the target resource is a resource corresponding to the communication device, further includes:
    记录所述第二模式所对应的工作状态作为参考工作状态;Recording the working state corresponding to the second mode as a reference working state;
    所述若所述通信器件通过所述第一模式成功建立所述通信连接,则恢复所述第二模式对目标资源的占用程度,包括:If the communication device successfully establishes the communication connection through the first mode, restoring the occupancy of target resources in the second mode includes:
    若所述通信器件通过所述第一模式成功建立所述通信连接,则基于所述参考工作状态提升所述第二模式对目标资源的占用程度。If the communication device successfully establishes the communication connection through the first mode, increasing the occupancy of target resources in the second mode based on the reference working state.
  4. 根据权利要求2所述的方法,其中,所述若所述通信器件通过所述第一模式成功建立所述通信连接,则提升所述第二模式对目标资源的占用程度包括:The method according to claim 2, wherein if the communication device successfully establishes the communication connection through the first mode, increasing the occupancy of target resources in the second mode comprises:
    若所述通信器件通过所述第一模式成功建立所述通信连接,则获取基于所述通信连接所对应的传输任务;If the communication device successfully establishes the communication connection through the first mode, acquiring a transmission task corresponding to the communication connection;
    基于所述传输任务提升所述第二模式对目标资源的占用程度。Increase the occupancy degree of the target resource by the second mode based on the transmission task.
  5. 根据权利要求4所述的方法,其中,所述基于所述传输任务提升所述第二模式对目标资源的占用程度,包括:The method according to claim 4, wherein said increasing the degree of occupancy of the target resource by the second mode based on the transmission task comprises:
    获取所述传输任务对应的时效参数;Acquiring a time-sensitive parameter corresponding to the transmission task;
    根据所述传输任务对应的时效参数确定对应的提升幅度;determining the corresponding improvement range according to the aging parameter corresponding to the transmission task;
    根据所述提升幅度提升所述第二模式对目标资源的占用程度。The degree of occupancy of the target resource by the second mode is increased according to the increase range.
  6. 根据权利要求5所述的方法,其中,所述方法还包括:The method according to claim 5, wherein the method further comprises:
    基于所述传输任务对应的时效参数确定目标资源对应的内容;determining the content corresponding to the target resource based on the timeliness parameter corresponding to the transmission task;
    若通过所述第一模式所建立的通信连接用于执行时效性较高的传输任务,确定所述目标资源包括所述通信器件所对应的所有类别的资源;If the communication connection established through the first mode is used to perform a time-sensitive transmission task, determine that the target resource includes all types of resources corresponding to the communication device;
    若通过所述第一模式所建立的通信连接用于执行时效性较低的传输任务,确定所述目标资源包括所述通信器件所对应的任一类别的资源。If the communication connection established through the first mode is used to execute a transmission task with low timeliness, it is determined that the target resource includes any type of resource corresponding to the communication device.
  7. 根据权利要求6所述的方法,其中,所述基于所述传输任务对应的时效参数确定 目标资源对应的内容之前还包括:The method according to claim 6, wherein, before determining the content corresponding to the target resource based on the aging parameter corresponding to the transmission task, it also includes:
    若所述传输任务对应的时效参数大于指定阈值,确定所述传输任务为时效性较高的传输任务;If the timeliness parameter corresponding to the transmission task is greater than a specified threshold, determine that the transmission task is a transmission task with high timeliness;
    若所述传输任务对应的时效参数不大于所述指定阈值,确定所述传输任务为时效性较低的传输任务。If the timeliness parameter corresponding to the transmission task is not greater than the specified threshold, it is determined that the transmission task is a transmission task with low timeliness.
  8. 根据权利要求2所述的方法,其中,所述若所述通信器件通过所述第一模式成功建立所述通信连接,则提升所述第二模式对目标资源的占用程度之前还包括:The method according to claim 2, wherein if the communication device successfully establishes the communication connection through the first mode, before increasing the degree of occupancy of target resources in the second mode, further comprising:
    检测第二模式是否由用户触发启动;Detecting whether the second mode is triggered by a user;
    若是,则执行所述若所述通信器件通过所述第一模式成功建立所述通信连接,则提升所述第二模式对目标资源的占用程度。If yes, performing the step of increasing the occupancy of target resources in the second mode if the communication device successfully establishes the communication connection through the first mode.
  9. 根据权利要求1-8任一所述的方法,其中,所述降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源包括:The method according to any one of claims 1-8, wherein said reducing the occupancy degree of said second mode to a target resource, where said target resource is a resource corresponding to said communication device comprises:
    获取第二模式对应的任务;Obtain the task corresponding to the second mode;
    根据所述第二模式对应的任务降低所述第二模式对目标资源的占用程度。According to the task corresponding to the second mode, the degree of occupancy of the target resource by the second mode is reduced.
  10. 根据权利要求1-8任一所述的方法,其中,所述通信器件为蓝牙通信模块,所述多模式包括BR/EDR模式以及BLE模式,所述第一模式为所述BR/EDR模式。The method according to any one of claims 1-8, wherein the communication device is a Bluetooth communication module, the multi-mode includes a BR/EDR mode and a BLE mode, and the first mode is the BR/EDR mode.
  11. 根据权利要求1所述的方法,其中,所述降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源,包括:The method according to claim 1, wherein said reducing the degree of occupancy of the target resource by the second mode, the target resource being a resource corresponding to the communication device, comprises:
    暂停所述第二模式对应的任务;suspend the task corresponding to the second mode;
    或者结束所述第二模式对应的任务。Or end the task corresponding to the second mode.
  12. 根据权利要求11所述的方法,其中,所述暂停所述第二模式对应的任务,包括:The method according to claim 11, wherein the suspending the task corresponding to the second mode comprises:
    停止用于控制所述第二模式的系统程序的运行,以暂停所述第二模式对应的任务。Stopping the running of the system program for controlling the second mode, so as to suspend the task corresponding to the second mode.
  13. 根据权利要求11所述的方法,其中,所述结束所述第二模式对应的任务,包括:The method according to claim 11, wherein said ending the task corresponding to the second mode comprises:
    结束控制所述第二模式的系统程序的运行,以结束所述第二模式对应的任务。ending the running of the system program controlling the second mode, so as to end the task corresponding to the second mode.
  14. 根据权利要求13所述的方法,其中,所述结束控制所述第二模式的系统程序的运行,包括:The method according to claim 13, wherein the terminating the execution of the system program controlling the second mode comprises:
    将控制所述第二模式的系统程序的进程进行杀死,以及回收分配给控制所述第二模式的系统程序的内存。killing the process of the system program controlling the second mode, and reclaiming the memory allocated to the system program controlling the second mode.
  15. 根据权利要求11-14任一所述的方法,其中,所述降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源之前还包括:The method according to any one of claims 11-14, wherein said reducing the degree of occupancy of the target resource by the second mode, before the target resource is a resource corresponding to the communication device, further includes:
    通过系统程序来控制所述通信器件执行每个模式各自对应的任务,其中,不同的模式所对应的进行控制的系统程序不同。The communication device is controlled by a system program to perform tasks corresponding to each mode, wherein different modes correspond to different system programs for control.
  16. 根据权利要求11-14任一所述的方法,其中,所述降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源之前还包括:The method according to any one of claims 11-14, wherein said reducing the degree of occupancy of the target resource by the second mode, before the target resource is a resource corresponding to the communication device, further includes:
    通过同一个系统程序中的不同线程来分别控制所述通信器件执行每个模式各自对应的任务,其中,不同的模式所对应的进行控制的线程不同。The communication device is controlled to execute tasks corresponding to each mode through different threads in the same system program, wherein different modes correspond to different threads for control.
  17. 根据权利要求1-16任一所述的方法,其中,所述目标资源包括芯片资源和/或天线资源,所述芯片资源表征用于对所执行的任务中的数据进行处理的资源,所述天线资源表征进行数据发送或接收的资源。The method according to any one of claims 1-16, wherein the target resource includes a chip resource and/or an antenna resource, and the chip resource represents a resource for processing data in an executed task, the Antenna resources represent resources for data transmission or reception.
  18. 一种设备控制装置,其中,运行于电子设备,所述装置包括:An equipment control device, wherein, running on electronic equipment, the device includes:
    模式获取单元,用于若所述电子设备的通信器件处于多模式的状态,且所述通信器件通过第一模式发起通信连接,则获取第二模式,所述第二模式为除所述第一模式以外的模式;A mode acquiring unit, configured to acquire a second mode if the communication device of the electronic device is in a multi-mode state, and the communication device initiates a communication connection through the first mode, and the second mode is a mode other than the first mode. a pattern other than a pattern;
    控制单元,用于降低所述第二模式对目标资源的占用程度,所述目标资源为所述通信器件对应的资源。A control unit, configured to reduce the degree of occupancy of the target resource by the second mode, where the target resource is a resource corresponding to the communication device.
  19. 一种电子设备,其中,包括一个或多个处理器以及存储器;An electronic device comprising one or more processors and memory;
    一个或多个程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行权利要求1-17任一所述的方法。One or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any one of claims 1-17.
  20. 一种计算机可读存储介质,其中,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码被处理器运行时执行权利要求1-17任一所述的方法。A computer-readable storage medium, wherein a program code is stored in the computer-readable storage medium, wherein the method according to any one of claims 1-17 is executed when the program code is run by a processor.
PCT/CN2022/106781 2021-08-06 2022-07-20 Device control method and apparatus, and electronic device and storage medium WO2023011186A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110902260.8 2021-08-06
CN202110902260.8A CN113676881B (en) 2021-08-06 2021-08-06 Equipment control method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2023011186A1 true WO2023011186A1 (en) 2023-02-09

Family

ID=78541776

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/106781 WO2023011186A1 (en) 2021-08-06 2022-07-20 Device control method and apparatus, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN113676881B (en)
WO (1) WO2023011186A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113676881B (en) * 2021-08-06 2024-05-07 Oppo广东移动通信有限公司 Equipment control method, device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106559737A (en) * 2015-09-28 2017-04-05 展讯通信(上海)有限公司 Bluetooth operating mode switching control method and device
CN106559811A (en) * 2015-09-28 2017-04-05 展讯通信(上海)有限公司 Bluetooth data reception control method and device
CN109152057A (en) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 Timeslice distribution method, device and electronic equipment
CN109688570A (en) * 2018-12-20 2019-04-26 惠州Tcl移动通信有限公司 Bluetooth connecting method, system and storage medium
CN110113739A (en) * 2019-04-15 2019-08-09 联想(北京)有限公司 Information processing method and electronic equipment
US20210227603A1 (en) * 2020-01-22 2021-07-22 Samsung Electronics Co., Ltd. Electronic device for performing wireless communication and wireless communication method
CN113676881A (en) * 2021-08-06 2021-11-19 Oppo广东移动通信有限公司 Device control method, device, electronic device and storage medium

Family Cites Families (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9137849B1 (en) * 2008-12-09 2015-09-15 Cypress Semiconductor Corporation Dynamically switching communication modes in multi-standard wireless communication devices
KR102092063B1 (en) * 2013-04-26 2020-03-23 삼성전자 주식회사 Method And Apparatus For Performing Communication Service
CN104218976B (en) * 2013-06-03 2019-01-08 飞比特公司 Use the self-adapting data transmission equipment and method of bluetooth
US9635495B2 (en) * 2014-12-03 2017-04-25 Silverplus, Inc. Supporting virtually simultaneous operation of dual wireless protocols in a single device
CN110460985B (en) * 2017-03-23 2022-09-16 展讯通信(上海)有限公司 Bluetooth slave equipment and service configuration method
CN109086124B (en) * 2017-06-13 2021-08-20 龙芯中科技术股份有限公司 Method and device for adjusting time, electronic equipment and storage medium
CN109788461B (en) * 2017-11-15 2022-06-28 深圳市优必选科技有限公司 Bluetooth dual-mode data communication method and device
CN207869107U (en) * 2017-12-28 2018-09-14 三维通信股份有限公司 A kind of indoor distributed antenna system far-end unit using bluetooth module
CN109993525B (en) * 2017-12-29 2022-06-10 Oppo广东移动通信有限公司 Application program processing method and device, electronic equipment and computer readable storage medium
CN109992438A (en) * 2017-12-29 2019-07-09 广东欧珀移动通信有限公司 Information processing method, device, computer equipment and computer readable storage medium
CN108551670B (en) * 2018-03-30 2021-06-25 深圳市冠旭电子股份有限公司 Bluetooth connection method and device and intelligent terminal
CN108924805B (en) * 2018-07-13 2021-05-14 杭州网易云音乐科技有限公司 Bluetooth connection method, medium, first electronic device, second electronic device and computing device
CN109151861A (en) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 Encoding rate method of adjustment, device and electronic equipment
CN112020079A (en) * 2019-05-31 2020-12-01 百度在线网络技术(北京)有限公司 Wireless communication device and method for electronic device, and storage medium
CN110290278A (en) * 2019-08-02 2019-09-27 惠州Tcl移动通信有限公司 Data transmission method, device, storage medium and terminal based on bluetooth
CN112469015B (en) * 2019-09-06 2022-04-12 华为技术有限公司 Bluetooth connection method and electronic equipment
CN110727473B (en) * 2019-10-10 2023-11-03 Oppo广东移动通信有限公司 Resource control method, device, system, storage medium and electronic equipment
CN112822663B (en) * 2019-10-31 2022-06-14 华为技术有限公司 Bluetooth connection method and related device
CN111050199B (en) * 2019-11-19 2022-01-28 海信视像科技股份有限公司 Display device and scheduling method of Bluetooth communication resources of display device
CN111405536B (en) * 2020-03-18 2023-03-24 深圳创维数字技术有限公司 Network distribution method, equipment and storage medium
CN112203365A (en) * 2020-09-29 2021-01-08 博流智能科技(南京)有限公司 Wireless multimode chip based on double antennas

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106559737A (en) * 2015-09-28 2017-04-05 展讯通信(上海)有限公司 Bluetooth operating mode switching control method and device
CN106559811A (en) * 2015-09-28 2017-04-05 展讯通信(上海)有限公司 Bluetooth data reception control method and device
CN109152057A (en) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 Timeslice distribution method, device and electronic equipment
CN109688570A (en) * 2018-12-20 2019-04-26 惠州Tcl移动通信有限公司 Bluetooth connecting method, system and storage medium
CN110113739A (en) * 2019-04-15 2019-08-09 联想(北京)有限公司 Information processing method and electronic equipment
US20210227603A1 (en) * 2020-01-22 2021-07-22 Samsung Electronics Co., Ltd. Electronic device for performing wireless communication and wireless communication method
CN113676881A (en) * 2021-08-06 2021-11-19 Oppo广东移动通信有限公司 Device control method, device, electronic device and storage medium

Also Published As

Publication number Publication date
CN113676881B (en) 2024-05-07
CN113676881A (en) 2021-11-19

Similar Documents

Publication Publication Date Title
CN109803347B (en) Service processing method and mobile communication terminal
WO2023020240A1 (en) Device control method and apparatus, and chip, electronic device and storage medium
CN110730504B (en) Paging indication method, device and system
CN110972102A (en) Resource selection method and terminal
EP3471450B1 (en) Network bandwidth management method, terminal and computer storage medium
CN109376053B (en) Data processing method and device and mobile terminal
CN109257732B (en) Equipment control method and device and electronic equipment
WO2023011186A1 (en) Device control method and apparatus, and electronic device and storage medium
CN110958710B (en) Channel access method, configuration method, terminal and network side equipment
RU2767521C1 (en) Method of processing information on capabilities of terminal device, terminal and network device
CN110719647B (en) Random access method, terminal and network equipment
CN110461041B (en) Operation control method, mobile communication terminal and network side equipment
CN111182654B (en) Secondary link Radio Resource Control (RRC) connection triggering method and terminal
KR20220120653A (en) Message notification method, terminal and network device
CN114173315B (en) Bluetooth reconnection method and terminal equipment
CN112654097A (en) Resource sharing method, terminal and network equipment
CN113133126A (en) Method, terminal and network equipment for converting working frequency points
CN111435902A (en) Control signal sending method and transmission node
CN111615155B (en) Terminal switching method and communication equipment
CN111436138A (en) Signal transmission method, device and system
CN110972212A (en) QoS parameter configuration method, device and system for PC5 interface
CN110891284B (en) Method for acquiring and sending periodic traffic pattern information, base station and communication network element
WO2023246045A1 (en) Device connection method and apparatus, audio playing device and apparatus, and storage medium
CN109195185B (en) Service processing method and related equipment
CN114556872B (en) Wireless communication method, device, electronic equipment and storage medium

Legal Events

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

Ref document number: 22851900

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE