Data transmission method, electronic device and storage medium
By detecting data transmission events of different functions in electronic devices and dynamically switching data transmission channels, the response delay problem caused by multiple application functions sharing the same data transmission channel is solved, achieving more efficient data transmission and better user experience.
Patent Information
- Application Number
- CN202311376044.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-20
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2043-10-20
AI Technical Summary
In electronic devices, multiple application functions share the same data transmission channel, resulting in delayed application response and affecting user experience.
By detecting data transmission events corresponding to different functions of the target application, dynamically switch to use different data transmission channels, ensuring that each function uses an independent data transmission channel, thereby improving data transmission efficiency and response speed.
It achieves the effect of improving application data transmission rate, reducing response delay, and improving user experience.
Smart Images

Figure CN118467191B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a data transmission method, an electronic device, and a storage medium. Background Art
[0002] In order to improve user experience, electronic devices can install a variety of applications to meet user needs. As a result, a large amount of data transmission work will be involved in the electronic device. Usually, the electronic device will allocate a data transmission channel for the data transmission task corresponding to an application, and transmit the data involved in an application through a data transmission channel to realize the function of the application.
[0003] However, an application may correspond to multiple functions. In this case, these multiple functions share the same data transmission channel. For scenarios where users frequently use these functions of the application, there may be a delay in the application response, which will affect the user experience. Summary of the invention
[0004] The present application provides a data transmission method, an electronic device and a storage medium, which can increase the transmission rate of application data, reduce application response delays, and improve the application user experience.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a data transmission method is provided, the method comprising: when using a first data transmission channel to transmit data corresponding to a first function of a target application, detecting a data transmission event corresponding to a second function of the target application, the data transmission event corresponding to the second function being an event for transmitting data corresponding to a second function among multiple functions. In response to the data transmission event corresponding to the second function, using a second data transmission channel to transmit the data corresponding to the second function, the second data transmission channel being different from the first data transmission channel.
[0007] In the method, the target application includes multiple functions. The first function and the second function are two different functions among the multiple functions of the target application. The electronic device can use multiple data transmission channels to transmit data of different functions of the target application in parallel, so that the data of the target application can be transmitted more efficiently and flexibly, the efficiency and reliability of the data transmission of the target application can be improved, the response delay of the target application can be reduced, and the user experience can be improved.
[0008] In a possible implementation of the first aspect, in response to a data transmission event corresponding to a second function, using a second data transmission channel to transmit data corresponding to the second function includes: in response to the data transmission event corresponding to the second function, determining a second data transmission channel in a preset channel pool, the second data transmission channel being a data transmission channel corresponding to the second function, the preset channel pool including data transmission channels corresponding to some or all of the multiple functions, respectively. Further, using the second data transmission channel to transmit data corresponding to the second function.
[0009] In this implementation, a preset channel pool can be set in the electronic device, and the data transmission channels corresponding to multiple functions of the target application can be managed through the preset channel pool. For example, the electronic device can add or delete data transmission channels corresponding to one or more functions in the preset channel pool. Through the preset channel pool, the electronic device can dynamically adjust the data transmission channel used to transmit the target application data, thereby improving the flexibility of the target application data transmission.
[0010] In another possible implementation of the first aspect, the above method also includes: when the second data transmission channel meets the preset conditions, adding at least one data transmission channel in the preset channel pool as a newly added data transmission channel, or selecting at least one data transmission channel in the preset channel pool as a newly added data transmission channel; using the newly added data transmission channel to transmit data corresponding to the second function.
[0011] In this implementation, the electronic device can add a new data transmission channel in the preset channel pool for data transmission of a function, or select one or more data transmission channels from the existing data transmission channels in the preset channel pool for data transmission of a function. It can be seen that one function can correspond to multiple data transmission channels. When the data transmission load corresponding to a function is large, the data corresponding to the function can be transmitted simultaneously through multiple data transmission channels. In this way, the pressure of a high data transmission load corresponding to a function can be reduced and the efficiency of data transmission can be improved.
[0012] In another possible implementation of the first aspect, after at least one data transmission channel is added to the preset channel pool as a newly added data transmission channel, if there is an idle data transmission channel in the newly added data transmission channel, the idle data transmission channel is deleted from the preset channel pool. The amount of data transmitted per unit time by the idle data transmission channel is less than or equal to the preset data amount.
[0013] In this implementation, in order to save transmission resources of the electronic device, if there is an idle data transmission channel in the newly added data transmission channel, the idle data transmission channel is deleted from the preset channel pool. In this way, the idle data transmission channel can be released, the transmission resource occupation of the electronic device can be reduced, and the performance of the electronic device can be improved.
[0014] In another possible implementation of the first aspect, at least one data transmission channel is selected from a preset channel pool as a newly added data transmission channel, including: selecting at least one data transmission channel from the preset channel pool as a newly added data transmission channel based on the idle time of each data transmission channel in the preset channel pool; or selecting at least one data transmission channel from the preset channel pool as a newly added data transmission channel based on the amount of data transmitted by each data transmission channel in the preset channel pool per unit time.
[0015] In this implementation, when the electronic device selects at least one data transmission channel from the existing data transmission channels in the preset channel pool as a data transmission channel newly added by a function, it can select a data transmission channel with a longer idle time or a smaller data transmission load. In this way, the impact of the data transmission channel newly added by one function on the data transmission of another function can be reduced, and the utilization rate of the data transmission channels in the preset channel pool can also be improved.
[0016] In another possible implementation of the first aspect, the preset condition includes at least one of a data transmission rate reaching a preset rate threshold, a data volume transmitted per unit time reaching a preset peak value, and a usage duration reaching a preset duration. A data transmission channel that meets the preset conditions may be considered a data transmission channel with a relatively large data transmission load pressure, and whether a data transmission load of a data transmission channel is relatively large may be confirmed through one or more conditions.
[0017] In another possible implementation manner of the first aspect, the method further includes: receiving a subscription operation of the user, wherein the subscription operation is used to indicate activation of the second function; and in response to the subscription operation, adding a second data transmission channel to a preset channel pool.
[0018] In this implementation, the electronic device can add a data transmission channel corresponding to a function in the preset channel pool according to the received user operation. In this way, when there is data corresponding to the function waiting to be transmitted, the electronic device can use the data transmission channel corresponding to the function created in the preset channel pool to transmit the data, thereby improving the response rate of data transmission.
[0019] In another possible implementation manner of the first aspect, the method further includes: receiving a user's unsubscribe operation, wherein the unsubscribe operation is used to indicate shutting down the second function; and in response to the unsubscribe operation, deleting the second data transmission channel from the preset channel pool.
[0020] In this implementation, the electronic device can delete a data transmission channel corresponding to a function in the preset channel pool according to the received user operation, thereby saving data transmission resources and reducing the occupation of data transmission resources.
[0021] In another possible implementation manner of the first aspect, the method further includes: setting a preset channel pool, wherein the preset channel pool includes a data transmission channel corresponding to each function of the multiple functions.
[0022] In this implementation, regardless of whether the user subscribes to one or more functions of the target application, the electronic device can create data transmission channels corresponding to all functions in the preset channel pool when setting the preset channel pool. This implementation is simple and easy to implement, and can simplify the management process of data transmission channels.
[0023] In another possible implementation of the first aspect, the target application is an intelligent perception application for perceiving user behavior, and the multiple functions include a face perception function, a gaze perception function, an air gesture perception function, and a code scanning perception function.
[0024] In a second aspect, the present application provides an electronic device, which includes: a memory and one or more processors. The memory is coupled to the processor. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device performs the following steps: when using a first data transmission channel to transmit data corresponding to a first function of a target application, a data transmission event corresponding to a second function is detected, wherein the data transmission event corresponding to the second function is an event for transmitting data corresponding to a second function among multiple functions; in response to the data transmission event corresponding to the second function, the data corresponding to the second function is transmitted using a second data transmission channel, wherein the second data transmission channel is different from the first data transmission channel.
[0025] In a possible implementation of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device further performs the following steps: in response to a data transmission event corresponding to the second function, determine a second data transmission channel in a preset channel pool, wherein the preset channel pool includes data transmission channels corresponding to some or all of the multiple functions, and the second data transmission channel is the data transmission channel corresponding to the second function; and use the second data transmission channel to transmit data corresponding to the second function.
[0026] In another possible implementation of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device further performs the following steps: when the second data transmission channel meets the preset conditions, at least one data transmission channel is added to the preset channel pool as a newly added data transmission channel, or at least one data transmission channel is selected from the preset channel pool as a newly added data transmission channel; and data corresponding to the second function is transmitted using the newly added data transmission channel.
[0027] In another possible implementation of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device further performs the following steps: after adding at least one data transmission channel as a newly added data transmission channel in the preset channel pool, if there is an idle data transmission channel in the newly added data transmission channel, the idle data transmission channel is deleted from the preset channel pool; wherein the amount of data transmitted by the idle data transmission channel per unit time is less than or equal to the preset data amount.
[0028] In another possible implementation of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device further performs the following steps: selecting at least one data transmission channel in the preset channel pool as a newly added data transmission channel based on the idle time of each data transmission channel in the preset channel pool; or selecting at least one data transmission channel in the preset channel pool as a newly added data transmission channel based on the amount of data transmitted by each data transmission channel in the preset channel pool per unit time.
[0029] In another possible implementation of the second aspect, the preset condition includes at least one of the data transmission rate reaching a preset rate threshold, the amount of data transmitted per unit time reaching a preset peak value, and the usage time reaching a preset time length.
[0030] In another possible implementation of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device further performs the following steps: receiving a subscription operation of the user, wherein the subscription operation is used to indicate the activation of the second function; and in response to the subscription operation, adding a second data transmission channel to the preset channel pool.
[0031] In another possible implementation of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device further performs the following steps: receiving an unsubscribe operation from the user, wherein the unsubscribe operation is used to indicate turning off the second function; and in response to the unsubscribe operation, deleting the second data transmission channel from the preset channel pool.
[0032] In another possible implementation of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device further performs the following steps: setting a preset channel pool, wherein the preset channel pool includes a data transmission channel corresponding to each function of the multiple functions.
[0033] In another possible implementation of the second aspect, the target application is an intelligent perception application for perceiving user behavior; the multiple functions include a face perception function, a gaze perception function, an air gesture perception function, and a code scanning perception function.
[0034] In a third aspect, the present application provides a computer-readable storage medium, comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation thereof.
[0035] In a fourth aspect, the present application provides a computer program product including program instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect and any possible implementation thereof. For example, the computer may be the electronic device described above.
[0036] In a fifth aspect, the present application provides a chip system, which is applied to an electronic device. The chip system includes an interface circuit and a processor. The interface circuit and the processor are interconnected by a line. The interface circuit is used to receive a signal from a memory and send a signal to the processor, the signal including a computer instruction stored in the memory. When the processor executes the computer instruction, the electronic device executes the method described in the first aspect and any possible implementation thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of a subscription page for a smart sensing application provided in an embodiment of the present application;
[0038] Figure 2 A schematic diagram of transmitting data through a single data transmission channel provided in an embodiment of the present application;
[0039] Figure 3 A hardware structure block diagram of a mobile phone 100, an example of an electronic device provided in an embodiment of the present application;
[0040] Figure 4 A software structure block diagram of a mobile phone 100, an example of an electronic device provided in an embodiment of the present application;
[0041] Figure 5 A flowchart of an example of a data transmission method provided in an embodiment of the present application;
[0042] Figure 6A flowchart of an example of data transmission channel adjustment provided in an embodiment of the present application;
[0043] Figure 7 A schematic diagram of transmitting data through multiple data transmission channels provided in an embodiment of the present application;
[0044] Figure 8 A schematic diagram of enabling the code scanning sensing function provided in an embodiment of the present application;
[0045] Fig. 9 A schematic diagram of disabling the code scanning sensing function provided in an embodiment of the present application;
[0046] Fig.10 A schematic diagram of managing a preset channel pool provided in an embodiment of the present application;
[0047] Fig.11 A communication block diagram of a software module for transmitting data through multiple data transmission channels provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The electronic device is installed with a target application. The target application includes multiple functions. The electronic device can provide multiple functional services to the user through the target application.
[0049] For example, the target application is a smart perception application for perceiving user behavior. The smart perception application can provide multiple perception functions such as face perception, gaze perception, air gesture perception, and code scanning perception. Users can choose to enable one or more perception functions of the smart perception application according to their own preferences.
[0050] The electronic device may provide a subscription page for the smart perception application. The subscription page for the smart perception application displays setting options for the face perception function, the gaze perception function, the air gesture perception function, and the code scanning perception function. The electronic device may receive a user's subscription operation in the subscription page. In response to the user's subscription operation, the electronic device turns on one or more perception functions indicated by the user's subscription operation. After the electronic device turns on one or more perception functions of the smart perception application, it may provide the user with services corresponding to one or more of the face perception function, the gaze perception function, the air gesture perception function, and the code scanning perception function. Figure 1 In the subscription page shown, the face perception function and gaze perception function are turned on, while the air gesture perception and code scanning perception functions are not turned on.
[0051] The target application of the electronic device includes multiple functions. These functions share the same data transmission channel. The following uses an example to introduce the process of an electronic device transmitting data of the target application through a data transmission channel.
[0052] For example, the target application is the above-mentioned intelligent perception application. Figure 2 As shown in FIG. 1 , the electronic device includes a smart sensing application, a real-time online service (Always-on camera Service, AON Service), a message interface (Msg Inerface), and a sensor control center (Sensor Hub). The smart sensing application is used to provide multiple sensing functions. The real-time online service is used to create a data transmission channel. The message interface is used to transmit messages between the real-time online service and the sensor control center to realize the interaction between the real-time online service and the sensor control center. The sensor control center is used to uniformly manage the data collected by the sensor.
[0053] In the example, the electronic device enables multiple perception functions of the smart perception application. The electronic device collects sensor data through sensors (such as cameras). The sensor control center obtains the sensor data collected by the sensor, and detects the user behaviors corresponding to the multiple perception functions according to the sensor data. For example, take the sensor data as image data collected by the camera. The sensor control center detects the face corresponding to the face perception function in the image data, detects the position of the human eye corresponding to the gaze perception function, detects the gesture corresponding to the air gesture perception function, detects the graphic code corresponding to the code scanning perception function, etc. If the sensor control center detects the user behavior corresponding to any perception function in the image data, the sensor control center transmits the data corresponding to the corresponding perception function to the real-time online service through the message interface via a single data transmission channel. Among them, A, B, and C respectively represent the data of different perception functions transmitted by the sensor control center to the real-time online service. After receiving the data transmitted by the sensor control center, the real-time online service reports the data corresponding to the corresponding perception function to the smart perception application via a single data transmission channel. Among them, A+, B+, and C+ respectively represent the data of different perception functions transmitted by the real-time online service to the smart perception application.
[0054] It can be seen that data of different functions share the same data transmission channel. Electronic devices transmit data of different functions in sequence through the same data transmission channel (or called a single data transmission channel). Data transmission of multiple functions will compete with each other. In the case where electronic devices frequently detect user behaviors corresponding to multiple functions, data transmission of multiple functions inside the electronic device may be blocked, resulting in a lower data transmission rate and a slower response of the target application. Especially during peak hours or in heavy-load scenarios with intensive data transmission, data loss or transmission errors may occur in the target application, which will seriously affect the user experience and satisfaction. The above-mentioned use of a single channel for data transmission has the following shortcomings:
[0055] Transmission rate limitation: The transmission rate of a single data transmission channel is limited. When the amount of data to be transmitted is large, the data transmission efficiency of a single data transmission channel may decrease due to the limitation of the data transmission rate.
[0056] Easy to be blocked: When multiple functions use the same single data transmission channel for data transmission, the data transmission channel may be congested, resulting in a decrease in the speed and quality of data transmission;
[0057] Data loss: Due to the limited data transmission capacity of a single data transmission channel, once the amount of data transmitted is large or the data density is high, it is easy to cause data loss, errors, or transmission interruption;
[0058] Lack of flexibility: Data transmission through a single data transmission channel cannot meet the needs of data transmission in multiple scenarios and with multiple requirements, and it is difficult to adjust and adapt to different application scenarios and requirements.
[0059] In view of this, an embodiment of the present application provides a data transmission method. In the method, if an electronic device acquires a data transmission event corresponding to a second function when using a first data transmission channel to transmit data corresponding to a first function of a target application, the electronic device responds to the data transmission event corresponding to the second function and uses a second data transmission channel to transmit data corresponding to the second function. The second data transmission channel is different from the first data transmission channel.
[0060] In this way, electronic devices can use multiple data transmission channels to simultaneously transmit data of multiple functions of the target application, so that electronic devices can transmit data of the target application more efficiently and flexibly, improve the efficiency and reliability of data transmission of the target application, reduce the response delay of the target application, and enhance the user experience.
[0061] For example, the electronic device described in the embodiments of the present application may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) / virtual reality (VR) device, a media player, a wearable device, etc. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.
[0062] In the embodiment of the present application, the electronic device is a mobile phone 100 as an example, and the hardware structure of the electronic device is introduced through the mobile phone 100. Figure 3As shown, the mobile phone 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0063] Among them, the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (neural-network processing unit, NPU), a driver processor, etc. Among them, different processing units can be independent devices or integrated in one or more processors. The processor 110 can be the nerve center and command center of the mobile phone 100. The processor 110 can generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.
[0064] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0065] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0066] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 may execute the instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.
[0067] The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), a configuration file of the motor 191, etc. The data storage area may store data created during the use of the mobile phone 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0068] The wireless communication function of the mobile phone 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor. In some embodiments, the antenna 1 of the mobile phone 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.
[0069] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0070] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the mobile phone 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
[0071] The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the same device as at least some modules of the processor 110.
[0072] The wireless communication module 160 can provide wireless communication solutions for application in the mobile phone 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0073] In an embodiment of the present application, the mobile phone 100 can transmit data corresponding to multiple functions of the target application to other electronic devices through the mobile communication module 150 or the wireless communication module 160 to achieve data backup of the target application, enhance the reliability and flexibility of data transmission, and reduce the risk of data loss and damage.
[0074] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), MiniLED, MicroLED, Micro-OLED, quantum dot light-emitting diodes (QLED), etc. In the embodiment of the present application, the mobile phone 100 can display the interface of the target application through the display screen 194, such as displaying a subscription page of multiple functions, so that the user can select one or more functions according to their own needs in the subscription page.
[0075] The mobile phone 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor. The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture static images or videos. In the embodiment of the present application, the mobile phone 100 may include multiple cameras 193, such as including one front camera and at least one rear camera. The mobile phone 100 can collect image data in real time through the front camera to detect whether the user uses any function of the target application.
[0076] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments, the electronic device may also include more or fewer modules than those provided in the above embodiments, and different interface connection methods in the above embodiments may be used between the modules, or a combination of multiple interface connection methods. The hardware structure of the electronic device provided in the embodiments of the present application can also refer to the hardware structure of the mobile phone 100 as shown in the figure. The methods in the following embodiments can all be implemented in an electronic device having the above hardware structure.
[0077] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture or a cloud architecture. In the embodiment of the present application, the electronic device is the mobile phone 100, and the software system of the electronic device adopts the layered architecture of the Android system as an example to illustrate the software structure of the electronic device.
[0078] Figure 4 1 is a software structure diagram of the mobile phone 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system may include an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, a hardware abstraction layer (HAL) and a kernel layer.
[0079] The application layer may include a series of application packages. For example, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video and other applications, and the present application embodiment does not impose any restrictions on this. The application layer also includes target applications, such as smart perception applications.
[0080] The application framework layer provides an application programming interface (API) and a programming framework for the application programs of the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager, etc., and the embodiments of the present application do not impose any restrictions on this.
[0081] The Android runtime consists of a core library and a virtual machine. The Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0082] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0083] The HAL layer encapsulates the Linux kernel driver, provides an interface to the upper layer, and shields the implementation details of the underlying hardware. For example, the HAL layer may include a camera HAL module, a Wi-Fi HAL module, a Bluetooth HAL module, and real-time online services.
[0084] The kernel layer is the layer between hardware and software. The kernel layer includes drivers and system service programs. Drivers include at least display drivers, camera drivers, audio drivers, etc.
[0085] The above-mentioned message interface may be located in the HAL layer or the kernel layer of the application processor, which is not limited in the embodiments of the present application.
[0086] The sensor control center may be provided in the kernel layer or as an independent software module, which is not limited in the embodiments of the present application.
[0087] The following takes the case where the application processor of the mobile phone 100 has the above-mentioned layered architecture, and the target application in the layered architecture is a smart sensing application as an example to illustrate the software and hardware workflow of the mobile phone 100.
[0088] In the example, the user controls the mobile phone 100 to slide the interface of the call application through an air gesture operation (i.e., a gesture operation made without touching the mobile phone 100). In addition to the software shown in the above layered architecture, the mobile phone 100 also includes a sensor control center. The mobile phone 100 collects image data through the camera 193. The sensor control center obtains the image data collected by the camera and detects user behaviors corresponding to multiple functions in the image data. If the sensor control center detects a user behavior corresponding to any function in the image data, such as detecting an air gesture operation corresponding to the air gesture function, the sensor control center notifies the real-time online service in the HAL layer of the data transmission event corresponding to the function through the message interface. The real-time online service in the HAL layer responds to the data transmission event and reports the data of the data transmission event to the smart perception application. After receiving the data reported by the HAL layer, the smart perception application instructs the call application to slide the interface so that the mobile phone 100 slides the interface of the call application under the action of the user's air gesture operation.
[0089] As mentioned above, an electronic device can use multiple data transmission channels to simultaneously transmit data of multiple functions of a target application. An electronic device can be provided with multiple data transmission channels for data corresponding to multiple functions of a target application. Each function corresponds to at least one data transmission channel. The multiple functions of the target application include a first function and a second function. The first function is different from the second function. The first function and the second function correspond to different data transmission channels. Among them, the first function corresponds to a first data transmission channel. The second function corresponds to a second data transmission channel.
[0090] It is understandable that the data transmission channel inside the electronic device can be understood as an instance. The instance corresponds to the process of data transmission of the electronic device and the memory allocated for these processes. If most of the data involved in an application are interrelated, the electronic device will usually set up an instance for the data corresponding to an application, that is, set up a data transmission channel. For the target application, the data correlation between all or part of the multiple functions of the target application is not large, so the electronic device can set different instances for different functions of the target application, that is, set different data transmission channels to improve the response rate of the target application. Of course, for some functions with strong correlation in the target application, the electronic device can also set the same data transmission channel for the data transmission of these functions.
[0091] In some implementations, in order to improve the data transmission efficiency of the target application, the electronic device may create multiple data transmission channels for the data transmission of the target application in advance. For example, the electronic device may create multiple data transmission channels corresponding to the functions of the target application after the target application is started. For another example, after receiving the user's subscription operation (the subscription operation is used to indicate the activation of the function of the target application), the electronic device may create a data transmission channel corresponding to the function indicated by the subscription operation in response to the user's subscription operation.
[0092] In this way, the electronic device can complete the creation of data transmission channels corresponding to different functions before detecting the data transmission event of the target application. If the electronic device detects the data transmission event of the target application, it can immediately use the created data transmission channel to transmit the data of the corresponding function. In this way, the time for data transmission of the target application can be saved and the response efficiency of the target application can be improved. Of course, the electronic device can also create a data transmission channel corresponding to the corresponding function when a data transmission event corresponding to the target application is detected.
[0093] In some implementations, an electronic device may set a preset channel pool, which includes multiple instances of data transmission channels. The preset channel pool may also be referred to as an instance pool. The electronic device may manage the data transmission channels corresponding to multiple functions of the target application through the preset channel pool. For example, the electronic device may add or delete data transmission channels corresponding to one or more functions in the preset channel pool. Through the preset channel pool, the electronic device may dynamically adjust the data transmission channel used to transmit the target application data, thereby improving the flexibility of the target application data transmission.
[0094] The following takes the example of the electronic device being a mobile phone and the target application being a smart perception application to introduce the method provided by the embodiment of the present application. For example, the smart perception application includes multiple perception functions such as face perception function, gaze perception function, air gesture perception function, and code scanning perception function. First, the multiple perception functions of the smart perception application are introduced respectively.
[0095] The face sensing function is used to sense the user's face and provide face sensing services to the user. Specifically, when the face sensing function is turned on, if the phone detects a face when the screen is off, the phone will display content such as time, battery level, and push messages in a local area of the screen. Alternatively, if the phone detects a face when the screen is on, the phone will control the content displayed on the screen to keep it consistent with the direction of the face.
[0096] The gaze sensing function is used to sense the user's gaze and provide gaze sensing services to the user. Specifically, when the gaze sensing function is turned on in a mobile phone, if the mobile phone detects that a person is looking at you, the mobile phone will not turn off the screen or reduce the volume of the incoming call.
[0097] The air gesture sensing function is used to sense the user's air gestures and provide air gesture services to the user. Specifically, when the air gesture sensing function is turned on on a mobile phone, if the mobile phone detects the user's air gesture (i.e., a gesture operation performed by the user without touching the phone), the mobile phone controls the screen content to slide or take a screenshot.
[0098] The code scanning perception function is used to perceive the user's scanning operation and provide the user with a code scanning perception service. Specifically, when the code scanning perception function is turned on in the mobile phone, if the mobile phone detects an image code, the mobile phone executes the scanning process corresponding to the code scanning operation.
[0099] The trigger conditions of each perception function of the smart perception application are different, and the corresponding operations of each perception function are also different. These multiple perception functions are independent of each other, and the data corresponding to different perception functions do not affect each other. The mobile phone can set different data transmission channels for these multiple functions, and transmit the data corresponding to different perception functions of the smart perception application through different data transmission channels.
[0100] In this example, the mobile phone manages the data transmission channels of multiple sensing functions of the smart sensing application through a preset channel pool. Figure 5 As shown, the method provided in the embodiment of the present application includes S501-S504.
[0101] S501, the mobile phone creates a preset channel pool.
[0102] After the mobile phone starts the smart sensing application, a preset channel pool can be set for the smart sensing application. For example, the mobile phone can set a preset channel pool through the smart sensing service.
[0103] In one implementation, after starting the smart perception application, the mobile phone can set a preset channel pool including data transmission channels corresponding to each perception function.
[0104] After the mobile phone starts the smart perception application, the mobile phone can allocate a data transmission channel for each perception function of the smart perception application and create a preset channel pool. For example, after the mobile phone starts the smart perception application, it creates 4 data transmission channels and allocates channel identifiers for these 4 data transmission channels to complete the creation of the preset channel pool. A channel identifier is used to uniquely identify a data transmission channel. Each channel identifier is associated with a perception function. In this way, the created preset channel pool includes the data transmission channels corresponding to these 4 perception functions. One perception function corresponds to one data transmission channel.
[0105] In this implementation, even if the user has not subscribed (i.e., not turned on) or has subscribed (i.e., turned on) one or more perception functions of the smart perception application, the preset channel pool created by the mobile phone also includes data transmission channels corresponding to one or more perception functions that the user has not subscribed to or has subscribed to.
[0106] It is understandable that the user can choose to subscribe to one or more perception functions in the subscription page of the smart perception application. After receiving the user's subscription operation, the mobile phone can enable one or more perception functions subscribed by the user.
[0107] In another implementation, after starting the smart perception application, the mobile phone can set a preset channel pool including data transmission channels corresponding to commonly used perception functions. For example, among the multiple perception functions of the smart perception application, the face perception function and the air gesture perception function are the perception functions commonly used by users. After starting the smart perception application, the mobile phone can create two data transmission channels, and respectively assign the channel identifier corresponding to the face perception function and the channel identifier corresponding to the air gesture perception function to these two data transmission channels, thereby completing the creation of the preset channel pool.
[0108] In this implementation, the preset channel pool created by the mobile phone may include data transmission channels corresponding to one or more commonly used perception functions that the user has not subscribed to (ie, not turned on) or has subscribed to (ie, turned on).
[0109] In another implementation, after starting the smart perception application, the mobile phone can determine the perception functions that have been enabled among the multiple perception functions of the smart perception application (i.e., the perception functions that the user has subscribed to). Further, the mobile phone sets a preset channel pool, which includes data transmission channels corresponding to the enabled perception functions.
[0110] For example, if the smart perception application of the mobile phone has enabled the first of the four perception functions, the mobile phone creates a data transmission channel and assigns a channel identifier associated with the first function to the data transmission channel to complete the setting of the preset channel pool. The data transmission channel corresponding to the first function can be called the first data transmission channel.
[0111] In this implementation, if the mobile phone receives a subscription operation for the second perception function after setting the preset channel pool, the subscription operation is used to indicate the activation of the second perception function of the smart perception application. In response to the subscription operation for the second perception function, the mobile phone adds a data transmission channel corresponding to the second perception function in the preset channel pool. The data transmission channel corresponding to the second perception function may be referred to as a second data transmission channel.
[0112] In some implementations, the mobile phone may also store channel information of each data transmission channel in the preset channel pool. In this way, the mobile phone can understand the status of each data transmission channel through the channel information of each data transmission channel. For example, the channel information of a data transmission channel includes information such as channel identification, associated sensing function, channel status (idle state or busy state), and data transmission load.
[0113] S502: The mobile phone uses a first data transmission channel in a preset channel pool to transmit data corresponding to a first function.
[0114] The first function is any perception function that has been turned on in the smart perception application. If the mobile phone detects a data transmission event corresponding to the first function, the mobile phone determines the first data transmission channel associated with the first function from multiple data transmission channels in the preset channel pool, and uses the first data transmission channel to transmit the data corresponding to the first function.
[0115] For example, take the example of the face perception function among the multiple perception functions of the smart perception application as the first function. The mobile phone can collect image data in real time through the front camera, and perform target detection on the image data through the sensor control center. If the sensor control center of the mobile phone detects the user's face in the image data collected by the front camera, it can be considered that a data transmission event corresponding to the face perception function is detected. Furthermore, the sensor control center of the mobile phone determines the first data transmission channel in the preset channel pool, and uses the first data transmission channel to transmit the data of the face perception function to the smart perception application.
[0116] The data transmitted by the mobile phone through the first data transmission channel may include one or more of sensor data (such as image data, posture data, etc.), channel information, and event information. Taking the face perception function as an example, the sensor data transmitted by the first data transmission channel may be image data including faces collected by the camera. The channel information transmitted by the first data transmission channel is the channel information of the first data transmission channel. The event information transmitted by the first data transmission channel is used to indicate the data transmission event corresponding to the face perception function. Of course, the data transmitted by the mobile phone through the first data transmission channel may also include other data, such as transmitting some intermediate variables, parameters and other data, which is not limited by the embodiments of the present application.
[0117] It is understandable that the preset channel pool may include multiple data transmission channels corresponding to the first function. The mobile phone can use multiple first data transmission channels to simultaneously transmit data corresponding to the first function, or use one or part of the multiple first data transmission channels to transmit data corresponding to the first function. The embodiments of the present application are not limited to this.
[0118] In the embodiment of the present application, when the mobile phone uses the first data transmission channel to transmit data corresponding to the first function, the mobile phone can also transmit data of other functions through other data transmission channels at the same time. Of course, the mobile phone can also only use the first data transmission channel to transmit data.
[0119] S503: When the mobile phone uses the first data transmission channel to transmit data corresponding to the first function, the mobile phone detects a data transmission event corresponding to the second function.
[0120] When the mobile phone uses the first data transmission channel to transmit data corresponding to the first function, it will continue to detect data transmission events corresponding to the perception function that has been enabled in the smart perception application. For example, the mobile phone continuously collects sensor data through sensors (such as cameras, gyroscopes, etc.), and determines whether a data transmission event corresponding to a perception function is detected based on the collected sensor data.
[0121] The second function is a perception function that is enabled among the multiple perception functions of the smart perception application and is different from the first function (i.e., another perception function that the user has subscribed to). Take the air gesture perception function as an example. If the mobile phone detects user gestures such as sliding gestures and clicking gestures in the image data collected by the camera, the mobile phone considers that a data transmission event corresponding to the air gesture perception function is detected.
[0122] In some implementations, the mobile phone can detect data transmission events of different perception functions through sensor data of different sensors. For example, the mobile phone detects data transmission events corresponding to the face perception function through image data collected by the camera. The mobile phone collects the posture data of the mobile phone through the gyroscope and acceleration sensor and the image data collected by the camera, and jointly detects the data transmission events corresponding to the scanning perception function.
[0123] S504: In response to the data transmission event corresponding to the second function, the mobile phone transmits data corresponding to the second function using a second data transmission channel in a preset channel pool.
[0124] The preset channel pool includes a data transmission channel corresponding to the second function (i.e., a second data transmission channel). In response to a data transmission event corresponding to the second function, the mobile phone determines a second data transmission channel associated with the second function from among a plurality of data transmission channels in the preset channel pool, and uses the second data transmission channel to transmit data corresponding to the second function.
[0125] The data transmitted by the mobile phone through the second data transmission channel may include one or more of sensor data, channel information, and event information. Taking the second function as the air gesture function as an example, the sensor data transmitted by the second data transmission channel may be image data including user gestures in the image data. The channel information transmitted by the second data transmission channel is the channel information of the second data transmission channel. The event information transmitted by the second data transmission channel is used to indicate the data transmission event corresponding to the air gesture function. Of course, the data transmitted by the mobile phone through the second data transmission channel may also include other data, such as transmitting some intermediate variables, parameters and other data, which is not limited to this embodiment of the present application.
[0126] The following example illustrates how a mobile phone uses multiple data transmission channels to transmit data of different functions of the same application. In the example, a mobile phone uses three data transmission channels to transmit data of different sensing functions of a smart sensing application.
[0127] like Figure 7 As shown, the sensor control center of the mobile phone detects data transmission events of three perception functions, and uses three data transmission channels to transmit the data corresponding to the corresponding perception functions to the real-time online service. The three perception functions can be represented as perception function 1, perception function 2 and perception function 3. The three data transmission channels can be represented as data transmission channel 1, data transmission channel 2 and data transmission channel 3 respectively. Among them, data transmission channel 1 is the data transmission channel corresponding to perception function 1, data transmission channel 2 is the data transmission channel corresponding to perception function 2, and data transmission channel 3 is the data transmission channel corresponding to perception function 3. A, B, and C respectively represent the data of different perception functions transmitted by the sensor control center to the real-time online service through data transmission channel 1, data transmission channel 2, and data transmission channel 3. After receiving the data transmitted by the sensor control center, the real-time online service uses data transmission channel 1, data transmission channel 2, and data transmission channel 3 to report the data corresponding to the corresponding perception function to the smart perception application respectively. Among them, A+, B+, and C+ respectively represent the data of different perception functions transmitted by the real-time online service to the smart perception application through data transmission channel 1, data transmission channel 2, and data transmission channel 3.
[0128] It is understandable that after receiving the data uploaded by the sensor control center, the real-time online service can parse and process the data, so that the data received by the real-time online service is not exactly the same as the data sent to the smart sensing application.
[0129] In the embodiment of the present application, the mobile phone sets different data transmission channels for the multiple perception functions of the smart perception application, and can simultaneously transmit the data of the corresponding perception functions through the multiple data transmission channels. For example, the mobile phone simultaneously transmits the data of the first function through the first data transmission channel and the data of the second function through the second data transmission channel. Different data transmission channels do not affect each other. In this way, even if the user frequently uses the multiple perception functions of the smart perception application, the smart perception application of the mobile phone can respond quickly and provide the user with a better experience.
[0130] When the mobile phone uses the second data transmission channel to transmit the data of the second function, if the data transmission load of the second data transmission channel is high, the response rate of the second function may be affected. In order to reduce the delay in the response of the second function, in some implementations, the mobile phone can add a new data transmission channel to transmit the data of the second function. Specifically, Figure 6 As shown, the method provided in the embodiment of the present application also includes S505-S506.
[0131] S505, the mobile phone determines whether the second data transmission channel meets the preset conditions.
[0132] For example, the mobile phone can determine whether the second data transmission channel meets the preset conditions through a real-time online service.
[0133] The preset condition can be used to indicate whether the data transmission load of the second data transmission channel is high. If the second data transmission channel of the mobile phone meets the preset condition, it can be considered that the data transmission load corresponding to the second data transmission channel is high. If the second data transmission channel continues to be used to transmit the data of the second function, data transmission blockage and delay may occur. In this case, in order to reduce the blockage and delay of data transmission, the mobile phone executes S506. If the second data transmission channel of the mobile phone does not meet the preset condition, it can be considered that the data transmission load corresponding to the second data transmission channel is low. In this case, the mobile phone continues to use the second data transmission channel to transmit the data of the second function.
[0134] Exemplarily, the preset conditions may include at least one of the following: the data transmission rate reaches a preset rate threshold, the amount of data transmitted per unit time reaches a preset peak value, and the usage time reaches a preset time length.
[0135] The data transmission rate can be determined based on the amount of data transmitted per unit time. For example, the data transmission rate is equal to the ratio of the amount of data transmitted per unit time (such as 1 second) to the unit time. If the data transmission rate of the second data transmission channel of the mobile phone reaches the preset rate threshold, it can be considered that the data transmission load of the second data transmission channel is high and the data transmission rate of the second data transmission channel has reached the upper limit. In this case, data transmission may be blocked and delayed.
[0136] If the amount of data transmitted by the second data transmission channel of the mobile phone in a unit time (such as 1 second) reaches a preset peak value, it can be considered that the data transmission load of the second data transmission channel is high and the amount of data transmitted by the second data transmission channel in a unit time reaches the upper limit. In this case, data transmission may also be blocked and delayed.
[0137] If the usage time of the second data transmission channel of the mobile phone reaches the preset time, it can be considered that the data transmission load of the second data transmission channel is high. In this case, data transmission may also be blocked and delayed.
[0138] It is understandable that the above-mentioned preset rate threshold, preset peak value, and preset duration can be set according to actual application scenarios or requirements, and the embodiments of the present application do not limit the specific values of these parameters. For example, the preset rate threshold can be set to values such as 20 megabytes per second (MB / s), 30MB / s, etc. The preset peak value can be set to values such as 20 megabytes (MB), 30MB, etc. The preset duration can be set to values such as 500 milliseconds, 700 milliseconds, etc.
[0139] S506, the mobile phone adds at least one data transmission channel to transmit data of the second function.
[0140] If the second data transmission channel of the mobile phone meets the preset conditions, the mobile phone adds at least one data transmission channel for the data transmission of the second function, shares the data transmission work of the second function through the newly added data transmission channel, and uses the newly added data transmission channel and the previous second data transmission channel to transmit the data of the second function together. For example, the real-time online service of the mobile phone can add one or more data transmission channels for the data transmission of the second function.
[0141] The following uses the example of a preset condition that the amount of data transmitted per unit time reaches a preset peak value to introduce the process of adding a data transmission channel for transmitting the second function in a mobile phone.
[0142] In the example, the real-time online service of the mobile phone receives data transmitted by the sensor control center. After receiving the data transmitted by the sensor control center, the real-time online service of the mobile phone can parse the header information of the data and obtain the amount of data transmitted by the second data transmission channel in the header information. The real-time online service of the mobile phone can calculate the amount of data transmitted by the second data transmission channel per unit time based on the amount of data obtained and the statistical data reception time. If the amount of data transmitted per unit time reaches a preset peak value, the real-time online service will add at least one data transmission channel associated with the second function. In this way, the mobile phone can use the newly added data transmission channel to transmit data for the second function.
[0143] In other examples, the header information of the data may include, in addition to the data volume, a channel identifier of the second data transmission channel. The real-time online service may determine the data transmission channel for transmitting the data based on the channel identifier, thereby updating the channel information of the data transmission channel indicated by the channel identifier. For example, when the second data transmission channel meets the above-mentioned preset conditions, the channel status in the channel information is set to a busy state.
[0144] In some implementations, if the second data transmission channel of the mobile phone meets the above preset conditions, the mobile phone can add at least one data transmission channel in the preset channel pool as a newly added data transmission channel for transmitting the second function.
[0145] For example, taking one of the at least one added data transmission channels as an example, the mobile phone can create a data transmission channel in the preset channel pool, assign a unique channel identifier to the data transmission channel, and establish a corresponding relationship between the data transmission channel and the second function to obtain a newly added data transmission channel. Furthermore, the mobile phone can use the newly added data transmission channel and the previous second data transmission channel to transmit data corresponding to the second function.
[0146] By adding at least one data transmission channel to transmit the data of the second function, the data transmission work of the second function can be shared with the second data transmission channel when the second data transmission channel is under a high data transmission load, thereby reducing data transmission congestion and delay.
[0147] According to S505-S506 above, the preset channel pool may include multiple data transmission channels corresponding to the second function. However, the data transmission of the second function is not always in a high data transmission load state. In order to reduce resource usage and improve mobile phone performance, in some implementations, the mobile phone can also delete at least one data transmission channel newly added in the preset channel pool. Specifically, Figure 6 As shown, the method provided in the embodiment of the present application may also include S507-S508.
[0148] S507, the mobile phone determines whether there is an idle data transmission channel in the newly added data transmission channels.
[0149] An idle data transmission channel refers to a data transmission channel in which the amount of data transmitted per unit time is less than or equal to a preset amount of data.
[0150] The mobile phone can determine whether there is an idle data transmission channel according to the amount of data transmitted per unit time by each of the at least one newly added data transmission channel. For example, the real-time online service of the mobile phone can compare the amount of data transmitted per unit time by each newly added data transmission channel with the preset data amount. If the amount of data transmitted per unit time by any newly added data transmission channel is less than or equal to the preset data amount, it is confirmed that the data transmission channel is in an idle state.
[0151] Alternatively, the mobile phone may determine whether there is an idle data transmission channel according to the channel status of each of the at least one newly added data transmission channel. For example, the real-time online service of the mobile phone obtains the channel status of each newly added data transmission channel, and if the channel status of any newly added data transmission channel is an idle state, it is confirmed that the data transmission channel is an idle data transmission channel.
[0152] If there is an idle data transmission channel among the newly added data transmission channels, the mobile phone executes S508. If there is no idle data transmission channel among the newly added data transmission channels, the mobile phone continues to use at least one newly added data transmission channel to transmit data corresponding to the second function.
[0153] S508: The mobile phone deletes an idle data transmission channel from the preset channel pool.
[0154] If there is an idle data transmission channel in the data transmission channel newly added for the second function, the mobile phone deletes at least one idle data transmission channel in the preset channel pool. For example, the real-time online service of the mobile phone deletes at least one idle data transmission channel in the preset channel pool.
[0155] In this way, when there is an idle data transmission channel in at least one data transmission channel newly added for the second function, the mobile phone can release the idle data transmission channel, thereby reducing the resource usage of the mobile phone and improving the performance of the mobile phone.
[0156] In some other implementations, the mobile phone may also delete a data transmission channel in an idle state among the multiple data transmission channels associated with the second function. The multiple data transmission channels associated with the second function include the second data transmission channel and the newly added data transmission channel.
[0157] In some other implementations, if multiple data transmission channels associated with the second function are all in an idle state, the mobile phone can delete (n-1) data transmission channels associated with the second function in the preset channel pool. Where n is the number of data transmission channels associated with the second function. After the mobile phone deletes (n-1) data transmission channels in the preset channel pool, there is still 1 data transmission channel associated with the second function remaining in the preset channel pool. In this way, the mobile phone can reserve 1 data transmission channel for the data of the second function in the preset channel pool for use by the data of the second function.
[0158] In the above S505-S506, if the second data transmission channel of the mobile phone meets the preset conditions, the mobile phone adds at least one data transmission channel to transmit the data of the second function. In some implementations, the mobile phone can select at least one data transmission channel from the existing data transmission channels in the preset channel pool as the newly added data transmission channel.
[0159] In an example of this implementation, if the second data transmission channel of the mobile phone meets the above preset conditions, the mobile phone selects at least one data transmission channel in the preset channel pool as a newly added data transmission channel according to the idle time of each data transmission channel in the preset channel pool.
[0160] For example, take the example of a mobile phone selecting a data transmission channel in a preset channel pool as a newly added data transmission channel. The real-time online service of the mobile phone can count the idle time of the data transmission channels in the preset channel pool that are in an idle state. If the second data transmission channel meets the above preset conditions, the real-time online service of the mobile phone will associate the data transmission channel with the longest idle time in the preset channel pool with the second function of the smart perception application, so that the data transmission channel with the longest idle time is used as a newly added data transmission channel for transmitting data of the second function.
[0161] It is understandable that the real-time online service of the mobile phone can manage the data transmission channels in the preset channel pool. If the amount of data transmitted per unit time by a data transmission channel in the preset channel pool is less than the preset data amount, it can be considered that the data transmission channel is in an idle state, and the real-time online service of the mobile phone can set the channel state of the data transmission channel to an idle state.
[0162] In another example of this implementation, the mobile phone selects a data transmission channel in the preset channel pool as a newly added data transmission channel according to the amount of data transmitted per unit time by each data transmission channel in the preset channel pool.
[0163] For example, take the example of a mobile phone selecting a data transmission channel in a preset channel pool as a newly added data transmission channel. If the second data transmission channel meets the above preset conditions, the real-time online service of the mobile phone determines at least one data transmission channel in each data transmission channel of the preset channel pool whose data volume transmitted per unit time is less than the preset data volume. Furthermore, the real-time online service of the mobile phone arbitrarily selects a data transmission channel from the at least one data transmission channel as a newly added data transmission channel. Alternatively, the real-time online service of the mobile phone selects the data transmission channel with the smallest data volume transmitted per unit time from the at least one data transmission channel as a newly added data transmission channel.
[0164] If there are idle data transmission channels among the data transmission channels newly added for the second function, in this implementation, the mobile phone can also restore the association relationship between these newly added data transmission channels before they are associated with the second function.
[0165] For example, the preset channel pool includes data transmission channel 1 and data transmission channel 2. Among them, data transmission channel 1 is associated with the code scanning perception function, and data transmission channel 2 is associated with the air gesture perception function. If data transmission channel 2 meets the above preset conditions, the real-time online service of the mobile phone will change the association relationship of data transmission channel 1 to be associated with the air gesture perception function, making data transmission channel 1 a new data transmission channel for the air gesture perception function. Afterwards, if the real-time online service of the mobile phone detects that data transmission channel 1 is in an idle state, it will restore the previous association relationship of data transmission channel 1 and restore the association relationship of data transmission channel 1 to be associated with the code scanning perception function.
[0166] In this way, by changing the association relationship of the data transmission channels, the utilization rate of the data transmission channels can be improved and the situation where the data transmission channels are in an idle state can be reduced.
[0167] It is understandable that the mobile phone can repeatedly perform S505-S508 during the process of activating the second function. In this way, the mobile phone can detect the channel status of the data transmission channel corresponding to the second function in real time to determine whether it is necessary to add or delete the data transmission channel corresponding to the second function.
[0168] In some implementations, if the second function is a perception function that the user frequently uses, or if the data transmission volume of the second function is usually large, in this case, the mobile phone can also set multiple data transmission channels for the perception function at one time when creating a preset channel pool or turning on the perception function. In this way, the data transmission blockage corresponding to the second function can be reduced.
[0169] It is understandable that the above embodiment only takes the second data transmission channel as an example to introduce the process of adding, deleting, and changing a data transmission channel corresponding to a function. The addition, deletion, and change of a data transmission channel corresponding to any function can refer to the above content corresponding to the second data transmission channel, which will not be repeated in this article.
[0170] As mentioned above, the mobile phone manages the data transmission channels corresponding to the multiple functions of the smart sensing application through a preset channel pool. In other implementations, the mobile phone adds or deletes a data transmission channel in the preset channel pool in response to a user operation.
[0171] In one example, a mobile phone responds to a user operation and adds a data transmission channel of a code scanning perception function (an example of a function) to a preset channel pool. The mobile phone first displays a subscription page of a smart perception application to the user. Figure 8 As shown in (1). At this time, the setting option of the code scanning perception function in the subscription page is turned off. The mobile phone does not turn on the code scanning perception function. Then, the mobile phone receives the user's subscription operation on the subscription page. The subscription operation is used to indicate the turning on of the code scanning perception function. In response to the subscription operation, the mobile phone adds a data transmission channel associated with the code scanning perception function to the preset channel pool. At this time, as shown in Figure 8 As shown in (2), the setting option of the code scanning perception function in the subscription page is turned on. The code scanning perception function of the mobile phone is turned on.
[0172] In this example, the mobile phone responds to the subscription operation of the code scanning perception function by adding a data transmission channel associated with the code scanning perception function in the preset channel pool. If the mobile phone involves a large amount of data transmission work of the code scanning perception function after turning on the code scanning perception function, the mobile phone can actively add at least one data transmission channel associated with the code scanning perception function in the preset channel pool.
[0173] In another example, the mobile phone deletes the data transmission channel of the code scanning perception function (an example of a function) in the preset channel pool in response to the user operation. The mobile phone first displays the subscription page of the smart perception application to the user. Fig. 9 As shown in (1). At this time, the setting option of the code scanning perception function in the subscription page is turned on. The mobile phone turns on the code scanning perception function. Then, the mobile phone receives the user's unsubscribe operation on the subscription page. The unsubscribe operation is used to indicate the closure of the code scanning perception function. In response to the unsubscribe operation, the mobile phone deletes the data transmission channel associated with the code scanning perception function in the preset channel pool. At this time, Fig. 9 As shown in (2), the setting option of the code scanning perception function in the subscription page is turned off. The mobile phone turns off the code scanning perception function.
[0174] In this example, the preset channel pool may include multiple data transmission channels associated with the code scanning perception function. In response to the unsubscription operation of the code scanning perception function, the mobile phone may delete all data transmission channels associated with the code scanning perception function in the preset channel pool.
[0175] In order to facilitate understanding of the method provided in the embodiment of the present application, the following is an exemplary description of the interaction process of each software module in the embodiment of the present application in conjunction with the accompanying drawings. Fig.10 As shown, the real-time online service adds a channel dynamic adjustment module. The channel dynamic adjustment module can be used to manage the preset channel pool. The preset channel pool includes data transmission channels corresponding to multiple perception functions of the smart perception application (such as gaze perception function, face perception function, air gesture perception function, and scanning perception function). The channel dynamic adjustment module can create a preset channel pool and add, delete, and change data transmission channels in the preset channel pool.
[0176] In addition, the real-time online service also includes a subscription module, a multi-channel transmission module and a data processing module. The message interface includes a real-time online interface module (which can be represented as SEEAONINTF) and a communication interface module (which can be represented as QMI). The sensor control center includes a sensor execution environment (Sensors Execut ion Environment, SEE) and a real-time online module (which can be represented as AON FW). The following is an application scenario in which a user subscribes to a perception function of a smart perception application (such as the above-mentioned code scanning perception function) to illustrate the process of a mobile phone transmitting data of multiple perception functions at the same time. Fig.11 As shown, the method provided in the embodiment of the present application may include the following steps:
[0177] S1101, the smart perception application notifies the subscription module of the real-time online service of a subscription event of the code scanning perception function. The subscription event is used to indicate the start of the code scanning perception function.
[0178] The mobile phone receives the subscription operation of the code scanning perception function on the subscription page of the smart perception. The subscription operation triggers the smart perception application to send the subscription event to the real-time online service in the HAL layer.
[0179] S1102, the real-time online service responds to the subscription event of the code scanning perception function and notifies the channel dynamic adjustment module of the subscription event of the code scanning perception function.
[0180] S1103: The channel dynamic adjustment module responds to the subscription event of the code scanning perception function and instructs the multi-channel transmission module to add the data transmission channel associated with the code scanning perception function to the preset channel pool.
[0181] The channel dynamic adjustment module is used to manage the preset channel pool, such as adding and deleting data transmission channels in the preset channel pool.
[0182] In addition to the data transmission channels corresponding to the code scanning perception function, the preset channel pool also includes data transmission channels corresponding to other enabled perception functions.
[0183] S1104, the subscription module sends the subscription event of the code scanning perception function to the real-time online interface module in the message interface.
[0184] The real-time online interface module is a functional interface for the real-time online service to communicate with other modules. The real-time online interface module is set in the HAL layer.
[0185] S1105, the real-time online interface module sends the subscription event of the code scanning perception function to the communication interface module.
[0186] QMI is the functional interface for the HAL layer to communicate with the sensor control center.
[0187] S1106, the communication interface module sends the subscription event of the code scanning perception function to the real-time online module of the sensor control center through the sensor execution environment, and the real-time online module starts the code scanning perception function.
[0188] The sensor execution environment is used to uniformly manage the data collected by the sensors. In addition to the camera, the mobile phone is also equipped with sensors such as gyroscopes and acceleration sensors. The sensor execution environment can store the data collected by the sensors and provide the data collected by different sensors to the corresponding modules. For example, the sensor execution environment can provide the real-time online module with the data required by the real-time online module, such as the sensor execution environment can provide the real-time online module with image data collected by the camera, and posture data collected by the gyroscope and acceleration sensor.
[0189] The real-time online module is a detection module in the sensor control center used to detect various sensing functions of intelligent sensing applications. After the real-time online scanning sensing function is turned on, the target (i.e. image code) corresponding to the scanning sensing function can be detected.
[0190] S1107, the mobile phone collects sensor data through the sensor, and stores the collected sensor data in the sensor execution environment.
[0191] When any sensing function of the smart sensing application is turned on, the mobile phone can control sensors (such as front cameras, gyroscopes, etc.) to collect sensing data in real time. The sensing data collected by the sensors can be stored in the sensor execution environment. For example, the mobile phone can collect image data through the camera. For another example, the mobile phone can collect the posture data of the mobile phone through the gyroscope.
[0192] S1108, the real-time online module detects data transmission events corresponding to multiple perception functions based on the sensing data, and instructs the sensor execution environment to report the data of each perception function to the real-time online service through the message interface.
[0193] The real-time online module obtains the sensor data corresponding to the enabled perception function from the sensor execution environment. For example, the real-time online module obtains the image code data of the code scanning perception function, the gesture image data and the posture data of the mobile phone of the air gesture perception function, the face image data of the face perception function, and the eye image data of the gaze perception function from the sensor execution environment.
[0194] The real-time online module further detects the data transmission event process corresponding to different perception functions based on the acquired sensor data. For example, the face corresponding to the face perception function is detected in the image data, the eye position corresponding to the gaze perception function is detected, the gesture corresponding to the air gesture perception function is detected, and the graphic code corresponding to the code scanning perception function is detected. For another example, the code scanning operation (or wrist flipping behavior) is detected based on the posture data.
[0195] If the real-time online module detects a data transmission event corresponding to any perception function, it instructs the sensor execution environment to send the data of each perception function to the real-time online service through the data transmission channel corresponding to each perception function.
[0196] The multi-channel transmission module of the real-time online service receives data of each sensing function through multiple data transmission channels. Different data transmission channels transmit data of different sensing functions. The data of each sensing function may include sensor data corresponding to the sensing function, event information of data transmission events, channel information corresponding to the sensing function, etc.
[0197] S1109, the multi-channel transmission module transmits the data of each perception function to the data processing module, and the data of multiple perception functions are processed separately by the data processing module.
[0198] After receiving the data of multiple perception functions, the multi-channel transmission module of the real-time online service can transmit the data of multiple perception functions to the data processing module, and the data processing module processes the data of each perception function. For example, the data processing module can parse, extract, and process the data of each perception function to obtain the processed data of each perception function.
[0199] S1110, the data processing module returns the data processed by each perception function to the multi-channel transmission module, and the multi-channel transmission module reports the processed data to the intelligent perception application through multiple data transmission channels respectively.
[0200] After the data processing module of the real-time online service obtains the data processed by each perception function, the multi-channel transmission module transmits the data processed by the perception function to the intelligent perception application through the data transmission channel corresponding to each perception function.
[0201] After receiving the data corresponding to each perception function, the smart perception application can perform the operation corresponding to each perception function according to the data corresponding to each perception function. For example, taking the code scanning perception function as an example, after receiving the data of the code scanning perception function (such as image code data, code scanning event information, etc.), the smart perception application can start the code scanning operation to enable the mobile phone to scan the image code.
[0202] The method provided in the embodiment of the present application has the following advantages:
[0203] 1. Dynamic adjustment of data transmission channels can be achieved. According to the actual application scenarios and requirements of data transmission, resources (i.e. data transmission channels) can be adaptively allocated to different functions, which can significantly improve the data transmission rate of multiple functions and the response rate of applications.
[0204] 2. It can improve the reliability of data transmission. Since different data transmission channels are independent of each other, data with different functions can be transmitted independently. Even if the data transmission of one data transmission channel fails, it will not affect the data transmission of other data transmission channels. The data of each function can also be backed up separately. In this way, the reliability and flexibility of data transmission can be enhanced, and the risk of data loss and damage can be reduced.
[0205] 3. It can improve the flexibility of data transmission. The data transmission channel can be flexibly selected and adjusted to meet the needs of data transmission of various functions in various application scenarios.
[0206] 4. It can improve the fault tolerance of data transmission. According to the real-time transmission status of the data transmission channel, if any of the multiple data transmission channels fails (such as blocking, delay, etc.), other data transmission channels can be selected from the available data transmission channels for data transmission in time, thereby meeting the requirements of data transmission for continuity and stability.
[0207] It should be noted that the personal information used in the embodiments of the present application (such as image data of faces and gestures, etc.) is limited to information for which the individual's separate consent has been obtained, including but not limited to notifying and reminding the user to read the relevant user agreement (notification) before the user uses the function, and signing the agreement (authorization) including authorization of relevant user information.
[0208] In some other embodiments of the present application, an electronic device is provided, including: a memory and one or more processors. The memory is coupled to the processor. The memory stores a computer program code, which includes computer instructions. When the computer instructions are executed by the processor, the electronic device can perform each function or step in the above method embodiment. Of course, the electronic device can also include other hardware structures. For example, the electronic device also includes hardware structures such as sensors and communication modules. The structure of the electronic device can refer to Figure 3 The structure of the mobile phone 100 is shown.
[0209] The embodiment of the present application also provides a chip system, which is applied to an electronic device. The chip system includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected by lines. For example, the interface circuit can be used to receive signals from other devices (such as memory). For another example, the interface circuit can be used to send signals to other devices (such as processors). Exemplarily, the interface circuit can read instructions stored in the memory and send the instructions to the processor. When the instruction is executed by the processor, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.
[0210] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step in the above-mentioned method embodiment.
[0211] The present application also provides a computer program product, which, when executed on a computer, enables the computer to perform various functions or steps in the above method embodiment. For example, the computer may be the above electronic device.
[0212] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0213] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0214] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0215] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0216] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0217] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A data transmission method, characterized in that: Applied to an electronic device, the electronic device includes a target application, and the target application includes multiple functions; the method includes: When using the first data transmission channel to transmit data corresponding to the first function of the target application, a data transmission event corresponding to the second function is detected, wherein the data transmission event corresponding to the second function is an event for transmitting data corresponding to the second function among the multiple functions; In response to a data transmission event corresponding to the second function, using a second data transmission channel to transmit data corresponding to the second function, wherein the second data transmission channel is different from the first data transmission channel; When the second data transmission channel meets the preset conditions, the newly added data transmission channel is used to transmit the data corresponding to the second function, wherein the preset conditions include at least one of the data transmission rate reaching a preset rate threshold, the amount of data transmitted per unit time reaching a preset peak value, and the usage time reaching a preset time length.
2. The method according to claim 1, characterized in that The transmitting the data corresponding to the second function by using the second data transmission channel in response to the data transmission event corresponding to the second function includes: In response to a data transmission event corresponding to the second function, determining the second data transmission channel in a preset channel pool, wherein the preset channel pool includes data transmission channels corresponding to some or all of the multiple functions, respectively, and the second data transmission channel is a data transmission channel corresponding to the second function; The data corresponding to the second function is transmitted using the second data transmission channel.
3. The method according to claim 2, characterized in that The using a newly added data transmission channel to transmit data corresponding to the second function when the second data transmission channel meets a preset condition includes: If the second data transmission channel meets a preset condition, at least one data transmission channel is added to the preset channel pool as the newly added data transmission channel, or at least one data transmission channel is selected from the preset channel pool as the newly added data transmission channel; The data corresponding to the second function is transmitted using the newly added data transmission channel.
4. The method according to claim 3, characterized in that After adding at least one data transmission channel in the preset channel pool as the newly added data transmission channel, the method further includes: If there is an idle data transmission channel in the newly added data transmission channels, the idle data transmission channel is deleted from the preset channel pool; wherein the amount of data transmitted by the idle data transmission channel per unit time is less than or equal to the preset data amount.
5. The method according to claim 3, characterized in that: The selecting at least one data transmission channel in the preset channel pool as the newly added data transmission channel includes: According to the idle time of each data transmission channel in the preset channel pool, at least one data transmission channel is selected from the preset channel pool as the newly added data transmission channel; or, According to the amount of data transmitted per unit time by each data transmission channel in the preset channel pool, at least one data transmission channel is selected from the preset channel pool as the newly added data transmission channel.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: receiving a subscription operation from a user, wherein the subscription operation is used to instruct to enable the second function; In response to the subscription operation, the second data transmission channel is added to a preset channel pool.
7. The method according to any one of claims 1 to 5, characterized in that The method further comprises: receiving a user's unsubscribe operation, wherein the unsubscribe operation is used to instruct to close the second function; In response to the unsubscribe operation, the second data transmission channel is deleted from a preset channel pool.
8. The method according to any one of claims 1 to 5, characterized in that The method further comprises: A preset channel pool is set, wherein the preset channel pool includes a data transmission channel corresponding to each function of the multiple functions.
9. The method according to any one of claims 1 to 5, characterized in that The target application is an intelligent perception application for perceiving user behavior; the multiple functions include a face perception function, a gaze perception function, an air gesture perception function, and a code scanning perception function.
10. An electronic device, characterized in that: include: A memory and one or more processors; the memory is coupled to the processor; The memory stores computer program code, which includes computer instructions. When the computer instructions are executed by the processor, the electronic device executes the method as claimed in any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 9.
Citation Information
Patent Citations
An audio data processing method and electronic device
CN113852780B