Battery cover color changing method and electronic device
By implementing a battery cover color change method in an electronic device, and using the audio data rhythm in the audio playback process to generate color change data, the problem that the battery cover cannot change color with the audio playback rhythm in the prior art is solved, and the effect of the battery cover and audio discoloration synchronously is achieved.
Patent Information
- Application Number
- CN202210847491.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-01-19
- Filing Date
- 2022-07-19
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2042-07-19
AI Technical Summary
The prior art is difficult to drive the battery cover to change color during the audio playback process of an electronic device, resulting in the battery cover of the electronic device being unable to change color with the audio playback rhythm.
By implementing a battery cover color change method in an electronic device, the method includes emitting audio data to the audio playback process through an application, and generating color change data according to the rhythm of the audio data in the audio playback process, and driving the battery cover color change.
The battery cover of the electronic device can change color with the audio playback rhythm, enhancing the interactiveness and user experience of the electronic device.
Smart Images

Figure CN116506543B_ABST
Abstract
Description
[0001] This application claims priority to a Chinese patent application with application number 202210062342.0 filed on January 19, 2022, and invention name “Battery cover color change control method and electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the technical field of electronic equipment, and in particular to a battery cover color changing method and electronic equipment. Background Art
[0003] With the development and popularization of electronic devices, mobile phones, computers and other electronic devices have become inseparable from people's lives. They can be seen everywhere in life and have greatly improved people's living standards. The aesthetics of electronic devices, such as the aesthetics of electronic device shells, directly affects consumers' willingness to buy. At present, the color of electronic device shells is generally fixed. In order to achieve the interaction between the color of the appearance of electronic devices and users, the battery cover of electronic devices can adopt a color-changing scheme to increase the recognition of the product.
[0004] Electrochromism is a phenomenon in which the optical properties of a material (reflectivity, transmittance, absorptivity, etc.) undergo stable and reversible color changes under the action of an external electric field, which manifests itself in reversible changes in color and transparency. Taking the mobile phone as an example, applying materials with electrochromic properties to the back cover of the mobile phone, i.e. the battery cover, can enable the mobile phone battery cover to change color in different scenarios as the audio plays. However, the audio subsystem in the currently widely used Android system is very complex. How to adapt the audio subsystem of the electronic device so that the battery cover of the electronic device can change color as the audio plays is a problem that needs to be solved. Summary of the invention
[0005] The embodiments of the present application provide a battery cover color changing method and an electronic device, which solve the technical problem of using the audio playback process of the electronic device to drive the battery cover to change color, so that the battery cover of the electronic device can change color with the audio playback rhythm, meeting the usage requirements of various scenarios.
[0006] In order to achieve the above objectives, the embodiments of the present application provide the following technical solutions:
[0007] In a first aspect, the present application provides a battery cover color changing method, which is applied to an electronic device, the electronic device including an application and a battery cover, the method comprising:
[0008] Sending the first audio data to the audio playing process through the application;
[0009] In the audio playback process, color change data is obtained according to the first audio data; wherein the color change data corresponds to the rhythm of the first audio data; and
[0010] The first audio data is played, and at the same time, the battery cover changes color in unison with the rhythm of the first audio data under the drive of the color change data.
[0011] Through the battery cover color changing method applied to an electronic device provided in the embodiment of the present application, the battery cover of the electronic device can change color according to the rhythm of audio playback, thereby solving the technical problem of using the audio playback process of the electronic device to drive the battery cover to change color.
[0012] In a possible implementation, the application is an incoming call application, an alarm clock application, or a calendar application.
[0013] In this embodiment, the incoming call application, alarm clock application or calendar application in the electronic device can enable the battery cover color change function when audio needs to be played, so as to provide reminders to the user from two sensory dimensions: hearing and vision.
[0014] In a possible implementation, the first audio data passes through the application layer, application framework, audio hub service layer, audio hardware abstraction layer and kernel layer in sequence during the audio playback process.
[0015] In one possible implementation, before sending audio data through the application, it is confirmed that the battery cover color change switch is in the on state, and the application sends an audio control signal to the audio hardware abstraction layer, and the audio control signal is used to configure the battery cover path, and the battery cover path is used to transmit and process the color change data.
[0016] In this embodiment, by setting the on and off states of the battery cover color change switch, the user can control whether to enable the battery cover color change function, thereby increasing the operational flexibility of the electronic device. Further, after confirming that the battery cover color change switch is in the on state, the application sends an audio control signal to configure the battery cover color change path, in preparation for the subsequent audio data playback and the sending of the battery cover color change data.
[0017] In a possible implementation, sending the first audio data to the audio playback process through the application specifically includes:
[0018] The application layer sends the first audio data to the application framework layer;
[0019] The application framework layer and the audio hub service layer process the first audio data respectively, and the audio hub service layer outputs second audio data to the audio hardware abstraction layer;
[0020] The audio hardware abstraction layer receives and processes the second audio data to obtain third audio data, and outputs the third audio data to the audio virtual device in the kernel layer.
[0021] In a possible implementation, in the audio playback process, obtaining the color change data according to the first audio data further includes using a conversion algorithm to generate the color change data according to the audio data.
[0022] In a possible implementation, the conversion algorithm is an audio rhythm recognition algorithm, so that the rhythm of the color-changing data corresponds to the rhythm of the first audio data.
[0023] In one possible implementation, in the audio playback process, color change data is obtained based on the first audio data, and the process further includes a conversion algorithm module in the audio hardware abstraction layer obtaining the color change data based on the second audio data, and outputting the color change data to the battery cover virtual device in the kernel layer.
[0024] In this embodiment, a conversion algorithm, specifically an audio rhythm recognition algorithm, is used to obtain color change data in real time according to the audio data during the audio playback process. The color change data corresponding to the rhythm of the audio data to be played can be obtained, so that the battery cover can change color following the rhythm of the audio data under the drive of the color change data.
[0025] In one possible implementation, in the audio playback process, color change data is obtained based on the first audio data, further including the first audio data including the color change data, wherein the color change data is pre-edited and combined with the first audio data; and the color change data is split from the first audio data using a splitting algorithm.
[0026] In one possible implementation, in the audio playback process, color change data is obtained based on the first audio data, and the process further includes an audio splitting module in the audio hardware abstraction layer splitting the second audio data into the third audio data and the color change data, and outputting the third audio data to the audio virtual device in the kernel layer, and outputting the color change data to the battery cover virtual device in the kernel layer.
[0027] In a possible implementation, the color change data is obtained by using an audio rhythm recognition algorithm for the first audio data.
[0028] In this embodiment, a conversion algorithm is used to obtain color change data corresponding to the audio data in advance, and the data is combined with the audio data through manual editing, and then separated in the audio playback process to obtain the color change data, so that the battery cover can change color following the rhythm of the audio data under the drive of the color change data.
[0029] In one possible implementation, in the audio playback process, obtaining color change data based on the first audio data further includes storing the color change data in the electronic device, the audio control signal includes an index corresponding to the first audio data, and the color change data is loaded according to the index, and the color change data corresponds to the first audio data.
[0030] In a possible implementation, in the audio playback process, color change data is obtained according to the first audio data, and further includes a loading module in the audio hardware abstraction layer loading the color change data according to the index and passing it to the audio distribution module in the audio hardware abstraction layer.
[0031] In a possible implementation, the color change data is obtained by using an audio rhythm recognition algorithm for the first audio data.
[0032] In a possible implementation, if the first audio data is external audio data, default color change data corresponding to a default index is loaded.
[0033] In this embodiment, the color change data is pre-stored in the electronic device, the corresponding color change data is loaded according to the audio data to be played, and the audio data and the color change data are transmitted respectively through the audio playback path, so that the battery cover can change color in accordance with the rhythm of the audio data under the drive of the color change data. In addition, when the user chooses to play external audio data, the color change function of the battery cover can also be realized.
[0034] In a second aspect, the present application also provides an electronic device, comprising: one or more processors, a memory and a battery cover; the memory is used to store program code; the one or more processors are used to run the program code, so that the electronic device executes the battery cover color changing method described in the above-mentioned first aspect or any possible implementation method of the first aspect.
[0035] In a third aspect, the present application further provides a computer-readable storage medium, which includes instructions. When the instructions are executed on an electronic device, the electronic device executes the battery cover color changing method described in the first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a partial diagram of a battery cover of an electronic device according to an embodiment of the present application;
[0037] Figure 2 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
[0038] Figure 3A is a menu diagram for setting a color change function in an electronic device according to an embodiment of the present application;
[0039] Figure 3B is a secondary menu diagram for setting a color change function in an electronic device according to an embodiment of the present application;
[0040] Figure 3C This is an interface diagram for setting a color change function in an electronic device according to an embodiment of the present application;
[0041] Figure 4A is a software flow chart of a battery cover color changing method according to an embodiment of the present application;
[0042] Figure 4B According to the embodiment of the present application Figure 4A A flowchart from software to hardware of the battery cover color changing method;
[0043] Figure 5 is a graph of audio data according to an embodiment of the present application;
[0044] Fig. 6A is a software flow chart of another method for changing the color of a battery cover according to an embodiment of the present application;
[0045] Figure 6B According to the embodiment of the present application Fig. 6A A flowchart from software to hardware of the battery cover color changing method;
[0046] Figure 7 is a schematic diagram of an audio data processing process according to an embodiment of the present application;
[0047] Fig. 8A is a software flow chart of yet another battery cover color changing method according to an embodiment of the present application;
[0048] Figure 8B According to the embodiment of the present application Fig. 8A The software to hardware flow chart of the battery cover color changing method. DETAILED DESCRIPTION
[0049] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.
[0050] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0051] The embodiment of the present application provides a method for changing the color of a battery cover, which can be applied to an electronic device. The electronic device can be any electronic device such as a mobile phone, a wearable device, a tablet computer, a laptop computer, etc., and the embodiment of the present application does not impose any restrictions on this. For example, the electronic device is a mobile phone.
[0052] Figure 1 The back cover of the electronic device according to the embodiment of the present application, i.e., the battery cover, is shown. Taking the electronic device as a mobile phone as an example, an electrochromic material is applied to the battery cover of the mobile phone. For example, electrochromic materials are applied in the solid letter O, R, H and other areas 101, and in the outline 102 of the hollow letter O, R, H and the like. In a specific audio playback scene, such as a call ringing, an alarm ringing, or a schedule reminder, according to the battery cover color changing method of the embodiment of the present application, as the electronic device plays audio, the area where the electrochromic material is applied will change color as the audio is played, that is, the electrochromic material in these areas can change color under the drive of the color change data. The color change frequency of the battery cover can vary depending on the rhythm of the audio played. For example, the color of the battery cover will change from blue to white, then from white back to blue, or switch between blue and white, etc. as the audio is played. The original color of the battery cover and the color after electrochromic change depend on the characteristics of the battery cover material and the electrochromic material, which are not limited here.
[0053] At the same time, due to the use of the battery cover color change method of the embodiment of the present application, the electronic device can use the played audio data to obtain the color change data corresponding to the audio data, so that the frequency of the battery cover color change can correspond to the rhythm of the audio data, and this electrochromic characteristic can achieve millisecond-level response, so that the color of the battery cover can change quickly and reach the level of synchronization with the audio playback. In this way, in scenes such as incoming calls, alarm clocks, and schedule reminders, in addition to being able to play audio to prompt the user auditorily, the electronic device can also visually prompt the user by changing the color of the battery cover at the same time, thereby achieving a user experience in multiple sensory dimensions.
[0054] Furthermore, when the battery cover with color-changing function changes color, the battery cover itself does not emit light, but the color of the battery cover changes. Therefore, in a dark environment, the color-changing function of the battery cover will not cause light interference to the user. In addition, the color-changing area on the battery cover may not be limited to the pattern shown in the embodiment of the present application. The electrochromic material may be set in various patterns and text forms to appear when the battery cover changes color, achieving a cool and personalized effect.
[0055] Figure 2 2 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. The electronic device may include a processor 210, a display screen 220, an external memory interface 230, an internal memory 240, a speaker 250 and a battery cover 260, wherein the battery cover 260 may include an electrochromic material 270 and a control circuit 280.
[0056] It is to be understood that the structure shown in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or use different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0057] The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processor (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0058] The external memory interface 230 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 210 through the external memory interface 230 to implement a data storage function. For example, files such as music and videos are stored in the external memory card.
[0059] The internal memory 240 can be used to store computer executable program codes, which may include an operating system, an application required for at least one function (such as an audio playback function), etc. The executable program code includes instructions, and the processor 210 enables the electronic device to perform various functional applications and data processing by running the instructions stored in the internal memory 240. For example, in this embodiment, the processor 210 enables the electronic device to execute the battery cover light control method provided in the embodiment of the present application by executing the instructions in the internal memory 240.
[0060] The internal memory 240 may include a program storage area and a data storage area. The data storage area may store data (such as audio data, phone book, etc.) created during the use of the electronic device. The program storage area may be used to store computer executable program code. In addition, the internal memory 240 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 device (UFS), etc.
[0061] The speaker 240 can be used to play audio, such as incoming call ringtones, message alert tones, music, etc. In particular, the speaker 240 can be equipped with a smart power amplifier SmartPA, which adds feedback to the output signal, and can improve the sound quality to a certain extent while protecting the sound-generating device.
[0062] The battery cover 260 may include an electrochromic material 270 and a control circuit 280. The control circuit 280 is connected to the electrochromic material 270, so that the electrochromic material 270 in the battery cover 260 can change color under the control of the control circuit 280.
[0063] In addition, an operating system is running on the above components, such as the Android open source operating system developed by Google, the Windows operating system developed by Microsoft, and the iOS operating system developed by Apple. Application programs can be installed and run on the operating system.
[0064] The operating system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.
[0065] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. For example, in some embodiments, the Android system is divided into: application layer, application framework layer, hardware abstraction layer and kernel layer.
[0066] It should be noted that although the embodiments of the present application are described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS and Windows.
[0067] In order to enable the electronic device to utilize the audio playback process to realize the function of its battery cover changing color as the audio is played, the embodiment of the present application improves and adapts the audio playback process of the electronic device. The battery cover color changing method according to the embodiment of the present application is further described in detail below.
[0068] Figure 3A is a menu diagram for setting a color change function in an electronic device according to an embodiment of the present application. Figure 3A , a first-level menu entry can be set for the color change function in the "settings" 301 menu of the electronic device. For example, the color change function can be considered to belong to "self-developed and auxiliary functions", and it can be classified as "auxiliary functions" 302. Alternatively, the color change function can also be classified as other functions.
[0069] Click on the "Accessibility" 302 item to enter the next level menu, such as Figure 3B shown. Figure 3B is a secondary menu diagram for setting a color change function in an electronic device according to an embodiment of the present application. Figure 3B , “Accessibility” may include various categories such as accessibility 303, one-handed mode 304, quick launch and gestures 305, etc. The entrance to the color-changing function may be set below the “Accessibility” 303 entry. For example, the color-changing function may be named “Rhythm and Shine” 306, or the color-changing function may be named other names without limitation. In some implementations, the color-changing function may be set above other functions as a featured function, so that after opening the accessibility menu, the user can easily find the newly added “Rhythm and Shine” 306 entry, making it easier to try out and use the color-changing function. In other implementations, the color-changing function may also be placed anywhere in the accessibility menu without limitation. In addition, it may also be placed anywhere in the accessibility menu. Figure 3A The "Settings" 301 menu includes a "Rhythm Sparkle" entry, which places it at the same level as the "Accessibility" 302, and no restriction is made here.
[0070] exist Figure 3B In the menu, you can click the "Rhythm Sparkle" 306 item to enter the next level menu, in which you can set the color change function in detail, such as Figure 3C shown. Figure 3C 1 is an interface diagram of setting a color change function in an electronic device according to an embodiment of the present application. Figure 3C , you can Figure 3C Set the color change function switch for each application in the interface.
[0071] For the incoming call application, after turning on the incoming call reminder color change switch 307, you can further select which contacts' incoming calls can be enabled for the color change function in the next level submenu. For example, click the "Contacts" 3071 item to enter the next level submenu, where you can choose to enable the color change function for all incoming calls, or enable the color change function for incoming calls from specific contacts.
[0072] When selecting specific contacts, any number of contacts can be added; or a limited number of contacts can be added, such as up to three contacts, to highlight the particularity of incoming calls from these contacts, so as to help users more clearly identify incoming contacts. In the latter case, if the number of contacts selected to be added is greater than three, the electronic device will display "Unable to add contact"; if the number of contacts selected to be added is less than or equal to three, the electronic device will display "Contact added successfully". The number three in this article is only used as an example and not as a limitation.
[0073] For the alarm clock application, in the embodiment of the present application, turning on the alarm clock reminder color change switch 308 can make the electronic device realize the synchronous color change of the battery cover when the alarm clock rings. In other embodiments of the present application, when the alarm clock reminder color change switch 308 is turned on, it is also possible to further select which alarm clock to enable the color change function. For example, the color change function can be selected for the alarm clock 1 at 10:00 AM, so that the user can hear the ringtone and see the battery cover change color at the same time, achieving a dual reminder effect of hearing and vision.
[0074] For calendar applications, in an embodiment of the present application, when the schedule reminder color change switch 309 of the electronic device is turned on, the electronic device can implement the battery cover color change function while playing audio to notify the user of a specific schedule.
[0075] The above is only an example of a method for setting a color-changing switch for an application in an electronic device. It should be understood that a color-changing switch can be set for other applications.
[0076] In another possible implementation, the state of the color-changing switch may also be set within each application. The present application does not limit the manner of setting the color-changing switch.
[0077] The following embodiments are all discussed under the condition that the color change switch of the application is turned on.
[0078] Example 1
[0079] Figure 4A It is a software flow chart of the battery cover color changing method according to the embodiment of the present application.
[0080] The application layer can include a series of application packages. The application packages can include call reminders, alarm clocks, schedule reminders, etc. Each application can initiate audio playback in different scenarios and drive the battery cover to change color.
[0081] The application framework layer (Framework, FWK) provides an application programming interface (Application Programming Interface, API) and programming framework for the applications in the application layer. The application framework layer includes some pre-defined functions. The application framework layer can include a window manager, a phone manager, a resource manager, an audio player, etc.
[0082] The hardware abstraction layer (HAL) is an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific hardware platform, provides a virtual hardware platform for the operating system, makes it hardware-independent, and enables the operating system to be ported between multiple hardware platforms.
[0083] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, etc.
[0084] When processing audio, the operating system of the mobile phone can be divided into an application layer, an application framework layer, an audio hub service layer (AudioFlinger), a hardware abstraction layer, and a kernel layer according to the processing logic of the audio service.
[0085] The Audio Hub Service Layer is the audio hub in the Android system and is also a system service that connects the upper layer (provides an access interface for the upper layer) and the lower layer (manages audio devices through the hardware abstraction layer).
[0086] See also Figure 4A In scenarios such as incoming calls, alarms, and schedule reminders, the applications in the application layer 401 (e.g., incoming call application 4011, alarm application 4012, and calendar application 4013) first send an audio control signal 410 to the audio hardware abstraction layer 404 to notify the audio hardware abstraction layer 404 that the playback of the audio data requires the battery cover color change function to be turned on. After receiving the audio control signal 410, the audio hardware abstraction layer 404 configures the battery cover color change path, such as turning on the audio virtual device (PCM) and color change data path corresponding to the color change data. Among them, the color change data path enables the color change data and audio data to be transmitted independently from each other in the audio playback process without interfering with each other. On the other hand, the application can send an audio data stream (such as Figure 4A The audio data stream carries the audio data 41 to be played.
[0087] The application framework layer 402 can initialize the audio player MediaPlayer 4021 in the electronic device after detecting the audio data 41. Then the audio data 41 can be decoded by the audio codec MediaCodec 4022 (the decoding process is a software decoding process, so it can be called soft decoding) to obtain the decoded audio data 42. The audio data 42 is then transferred to the audio hub service layer AudioFlinger 403.
[0088] The audio hub service layer 403 processes the decoded audio data 42 to obtain audio data 43, including but not limited to: resampling, applying sound effects, adjusting volume, and mixing. The processed audio data 43 can then reach the audio hardware abstraction layer AudioHal 404 for further processing.
[0089] The audio hardware abstraction layer 404 can configure the battery cover path when receiving the audio control signal 410 from the application layer 401, and the battery cover path is used to transmit and process the color change data. At this time, the audio hardware abstraction layer 404 needs to determine whether the audio data 43 is to be played by the speaker of the electronic device. If the electronic device is connected to an external device such as a headset or a Bluetooth speaker, causing the audio data to be played by the headset or the Bluetooth speaker instead of the speaker of the electronic device, the audio hardware abstraction layer 404 may not configure the battery cover path, that is, the audio virtual device (PCM) and the color change data path corresponding to the color change data are not turned on. In this case, the audio data only reaches the external device through the audio data path for playback, and the battery cover will not change color. When it is determined that the audio data is to be played by the speaker of the electronic device, the audio hardware abstraction layer 404 configures the battery cover path, as follows.
[0090] Figure 4B According to the embodiment of the present application Figure 4A The software and hardware flow chart of the battery cover color changing method. Figure 4B After the audio data 43 reaches the audio hardware abstraction layer 404, it can be sent by the audio distribution module 4041 to the audio virtual device (PCM) 4051 in the kernel layer 405. The audio virtual device 4051 in the kernel layer 405 can be used to perform digital-to-analog conversion on the audio data 43 to generate audio data 431, and then send the audio data 431 to the hardware device (e.g., speaker 4064) in the hardware layer 406 for playback.
[0091] On the other hand, the audio distribution module 4041 in the audio hardware abstraction layer 404 can also send the audio data 43 to the conversion algorithm module 4042 for processing to generate color change data 44. The generated color change data 44 can be sent to the battery cover virtual device 4052 in the kernel layer 405 to drive the battery cover to change color. Similarly, the battery cover virtual device 4052 in the kernel layer 405 can perform digital-to-analog conversion on the color change data 44 to generate color change data 441, and then send the color change data 441 to the battery cover 4066 in the hardware layer 406 to drive it to change color.
[0092] The conversion algorithm module 4042 may use various forms of conversion algorithms to convert the audio data 43 into the color-changing data 44. For example, the conversion algorithm may be an audio rhythm recognition (On-site Detection) algorithm. In one implementation, the conversion algorithm module 4042 uses the amplitude difference mean curve of the audio data 43 to recognize the rhythm change of the audio data, thereby generating the color-changing data 44 according to the rhythm change.
[0093] Refer to the following Figure 5 The generation process of the color change data 44 is described in detail. Figure 5 is a graph of audio data according to an embodiment of the present application.
[0094] exist Figure 5 In the graph 500, the horizontal axis x of the graph 500 can represent the sampling time point of the audio data. Specifically, the numbers on the horizontal axis (e.g., numbers 1425, 1429, etc.) only represent the relative number of the sampling time point, rather than the absolute sampling time. For example, when the sampling rate is 48k, 48,000 sampling points can be obtained within 1 second. There are four curves 501-504 in the graph 500. For different curves, the vertical axis y of the graph 500 can represent different meanings.
[0095] In curve 501 , the y coordinate may represent the amplitude value of the audio data. Therefore, it can be considered that curve 501 is obtained by sampling the amplitude value of the audio data at a fixed time interval, so curve 501 may be called an amplitude curve 501 of audio data.
[0096] It can be seen that the amplitude curve 501 is at a higher position, that is, the amplitude values of all its sampling points are larger. The amplitude value of the audio data may be affected by the volume of the electronic device playing the audio data. The louder the volume of the electronic device playing the audio data, the larger the amplitude value of the audio data may be. Figure 5If the color change data is generated based on the amplitude curve 501 of the audio data, that is, a certain amplitude threshold is set, and it is stipulated that the color change data is issued when the amplitude value of the audio data is higher than the amplitude threshold, and the color change data is not issued when the amplitude value of the audio data is lower than the amplitude threshold, the following problems will arise:
[0097] When the volume of the audio data played by the electronic device is relatively high, the position of the amplitude curve 501 of the audio data may be relatively high, and the amplitude values of the amplitude curve 501 may all be greater than the amplitude threshold, causing the electronic device to send out color change data all the time when playing the audio data. From the user's perspective, the battery cover of the electronic device may continue to be in the second color state when the ringing sound is heard. On the contrary, when the volume of the audio data played by the electronic device is relatively low, the position of the amplitude curve 501 of the audio data may be relatively low, and the amplitude values of the amplitude curve 501 may all be less than the amplitude threshold, causing the electronic device to be unable to send out color change data when playing the audio data. From the user's perspective, the battery cover of the electronic device may not change color when the ringing sound is heard, that is, the color change function of the battery cover is not realized. To avoid this situation, it is necessary to set a universal standard that is independent of the volume of the electronic device to generate color change data.
[0098] In the embodiment of the present application, based on the amplitude curve 501 of the audio data, the difference between the amplitude values of two adjacent sampling time points is calculated to obtain: Figure 5 The amplitude difference curve 502 shown in . For the amplitude difference curve 502, the y coordinate of the curve graph 500 represents the difference in amplitude. Therefore, by taking the difference of the amplitude curve 501, the influence of the volume of the audio data played by the electronic device on the generation of the color change data can be eliminated. It can be seen in the amplitude difference curve 502 that if the amplitude values of the two sampling time points before and after in the amplitude curve 501 differ greatly, there will be peaks in the amplitude difference curve 502, such as peaks 5021 and 5022; if the amplitude values of the two sampling time points before and after in the amplitude curve 501 are close, then even if the amplitude values of these two sampling time points in the amplitude curve 501 are both large, data points close to zero will be obtained in the amplitude difference curve 502. In this way, no matter what the volume of the audio data played by the electronic device is, the amplitude difference curve 502 of the audio data can reflect the relative change of the amplitude value at different sampling time points in the audio data. The relative change of the amplitude value is used to design the generation rules of the color change data, which helps to obtain a conversion algorithm that is independent of the type and volume of the audio data.
[0099] In the amplitude difference curve 502, the "peaks" therein can be identified as rhythm points, for example, peaks 5021, 5022, etc. can be identified as rhythm points. It can be seen that the amplitude difference of the audio data at the rhythm points is large. The conversion algorithm can stipulate that the electronic device sends a color change signal at each peak of the audio data, and does not send a color change signal in the non-peak area. Then, the battery cover of the electronic device can be shown that when the electronic device plays audio data, the battery cover changes color when it plays to the rhythm point, and does not change color at the non-rhythm point, showing the effect that the battery cover of the electronic device flashes and changes color following the rhythm of the audio data.
[0100] Furthermore, the conversion algorithm in the embodiment of the present application can use an amplitude threshold to identify a rhythm point, that is, when the amplitude difference curve 502 is greater than the set amplitude threshold, the sampling time point can be identified as a rhythm point. However, if the amplitude threshold used to identify the rhythm point is a fixed value, in actual applications, there may still be the situation discussed above, where either the battery cover keeps changing color or the battery cover cannot change color.
[0101] In the embodiment of the present application, the following method can be used to set the amplitude threshold to overcome the above-mentioned defects, thereby more accurately identifying the rhythm point. Figure 5 As shown, the amplitude difference curve 502 is averaged within a certain time interval. For example, taking 0.002s as an example, the amplitude difference of the amplitude difference curve 502 within every 0.002s is averaged to obtain an amplitude difference mean curve 503, as shown in FIG. Figure 5 As shown by the curve 503 in FIG. The data point on the amplitude difference mean value curve 503 can be regarded as the amplitude threshold at the sampling time point.
[0102] At a certain moment, that is, at a certain sampling time point, the sampling time point at which the amplitude difference in the amplitude difference curve 502 is greater than the amplitude threshold in the amplitude difference mean curve 3 can be identified as a rhythm point of the audio data. The conversion algorithm in the embodiment of the present application may stipulate that color change data is sent at each rhythm point to drive the battery cover to change color. When the amplitude difference in the amplitude difference curve 502 falls back to less than the amplitude threshold in the amplitude difference mean curve 503, the color change data is stopped from being sent. Curve 504 in the graph 500 represents the color change signal curve generated using the above conversion algorithm. Its ordinate y represents the signal strength. In some embodiments, the color change data is PCM format audio data.
[0103] By adopting the above-mentioned amplitude difference mean curve 503 to determine the amplitude threshold, the amplitude threshold determination process can be applied to various audio data, so as to more accurately identify the rhythm points of the audio data, thereby generating battery cover color change data according to the rhythm points, thereby achieving the effect that the battery cover of the electronic device flashes and changes color following the playback rhythm of the audio data.
[0104] From the user's perspective, for example, when an electronic device rings, its battery cover will change color at the rhythm of the ringtone. If the ringtone is soothing music, the rhythm points identified by the conversion algorithm are more dispersed in time, and the color change frequency of the battery cover is lower; if the ringtone is rapid music, the rhythm points identified by the conversion algorithm are more compact in time, and the color change frequency of the battery cover is higher.
[0105] Therefore, by using the conversion algorithm module 4042 set in the audio hardware abstraction layer 404, the color-changing data 44 can be generated according to the audio data 43. By appropriately selecting the specific conversion algorithm used by the conversion algorithm module 4042, the volume of the audio data played by the electronic device can be prevented from affecting the generation of the color-changing data, and the rhythm points of the audio data can be more effectively identified.
[0106] See back Figure 4B , the conversion algorithm module 4042 sends the generated color change data 44 to the battery cover virtual device 4052 in the kernel layer 405. A specific battery cover virtual device 4052 can be specified for the color change data 44, and the battery cover virtual device 4052 can represent the battery cover device 4066 in the hardware layer 406. In the kernel layer 405, the battery cover virtual device 4052 and the audio virtual device 4051 are independent of each other, and the audio data 43 and the color change data 44 can be transmitted independently of each other, thereby avoiding interference between the two.
[0107] In the kernel layer 405 , the audio data 43 is further processed to form audio data 431 , which is sent to the audio digital signal processor ADSP 4061 in the hardware layer 406 together with the color change data 44 .
[0108] The audio digital signal processor ADSP 4061 further processes the audio data 431 to obtain audio data 432, and the color change data 44 is transparently transmitted through the ADSP 4061. The audio data 432 and the color change data 44 can be sent to actual hardware components by the ADSP 4061. Specifically, after the audio data 431 is processed by the ADSP 4061, the audio data 432 can be obtained, and the audio data 432 can be sent to the smart power amplifier SmartPA4062. After the digital-to-analog conversion of the SmartPA4062, the final audio data 433 can be generated, and the final audio data 433 is sent to the speaker 4064 for playback.
[0109] On the other hand, the color change data 44 can be sent to the codec 4063, and after digital-to-analog conversion, the color change data 441 can be generated. The color change data 441 can be a 50Hz sine wave signal. The color change data 441 can be sent to the battery cover 4066 to drive the battery cover 4066 to change color. In this way, the audio playback process of the electronic device is utilized, and the battery cover color change data is generated and sent while the electronic device plays the audio data, so that the battery cover of the electronic device can change color with the playback of the audio data.
[0110] Example 2
[0111] Fig. 6A This is a software flow chart of another battery cover color change method according to an embodiment of the present application. The difference between this embodiment and embodiment 1 is that in this embodiment, the audio data can be manually edited in advance, and the battery cover color change data and the audio data are combined into source audio data, which are transmitted through the audio playback process. In the hardware abstraction layer, the color change data is separated from the source audio data, and then sent to the battery cover in the hardware layer to drive its color change.
[0112] See also Fig. 6A In scenarios such as incoming calls, alarms, and schedule reminders, the applications in the application layer 601 (e.g., incoming call application 6011, alarm application 6012, and calendar application 6013) first send an audio control signal 610 to the audio hardware abstraction layer 604 to notify the audio hardware abstraction layer 604 that the playback of the audio data requires the battery cover color change function to be enabled. Upon receiving the audio control signal 610, the audio hardware abstraction layer 604 configures the battery cover color change path, for example, opening the audio virtual device (PCM) and color change data path corresponding to the color change data. On the other hand, the application can send an audio data stream (such as a color change data path) to the application framework layer 602. Fig. 6A The audio data stream may contain source audio data 61 to be played.
[0113] The source audio data 61 may include audio data to be played by the speaker and color change data for driving the battery cover to change color. For example, the color change data may be obtained by converting the audio data using a conversion algorithm, and the conversion algorithm may be, for example, the conversion algorithm described in the above embodiment 1. In other implementations, the conversion algorithm may also be other forms of conversion algorithms. In addition, in other implementations, the color change data may also be color change data that can cause the battery cover to change color at a fixed frequency, and the color change data corresponding to different audio data may have different color change frequencies. The form of the color change data is not limited here.
[0114] The audio data and the color change data can be manually edited in advance, so that they are combined to form source audio data and stored in the memory of the electronic device. When the application needs to play audio, the source audio data can be sent to the application framework layer 602.
[0115] When the application framework layer 602 detects the source audio data 61, it can initialize the audio player 6021 in the electronic device. Then, the source audio data 61 can be decoded by the audio codec 6022 (the decoding process is a software decoding process, so it can be called soft decoding) to obtain the decoded source audio data 62. The decoded source audio data 62 is then transferred to the audio hub service layer 603.
[0116] In the audio hub service layer 603, the audio data in the decoded source audio data 62 is processed, and the processing content includes but is not limited to: resampling (Resample), adding sound effects (Apply Effect), adjusting volume (AdjustVolume) and mixing (Mixer). Among them, the color change data in the source audio data 62 may not be processed in the audio hub service layer 603.
[0117] Figure 7 Schematic diagram of the audio data processing process according to an embodiment of the present application. Figure 7 In the example, the source audio data 62 from the application framework layer 602 is processed at the audio hub service layer 603. Figure 7 As shown, the source audio data 62 from the application framework layer 602 generally includes three data channels (channels): the white box on the left and the gray box in the middle can represent the left channel and right channel data of the audio data respectively, and the black box on the right can represent the color change data added by manual editing. The source audio data 62 can be sent down in cycles. A group of three white boxes, gray boxes and black boxes can represent a source audio data unit. A cycle in the source audio data 62 can include multiple source audio data units. Figure 7 In the example, a period in the source audio data is taken as an example, and the period may include three source audio data units 6201, 6202, and 6203, and the data channels in the source audio data units are numbered 1, 2, and 3, respectively. This ensures that the color change data is aligned with the left channel and right channel data of the audio data in time.
[0118] After receiving a cycle of source audio data 62 from the application framework layer 602, the audio hub service layer 603 may first reorder 701 the left channel data (white boxes 1-3), right channel data (gray boxes 1-3) and color-changing data (black boxes 1-3) in the three source audio data units 6201, 6202 and 6203 in the cycle. Specifically, the reordering 701 may include: picking up the color-changing data 1-3 from each source audio data unit 6201-6203, and arranging them in order at the end of the entire source audio data cycle to obtain source audio data 621. Figure 7 As shown, after rearrangement, all the color-changing data (black frames 1-3) in the source audio data 621 are sequentially located at the end of the source audio data 621.
[0119] Then, the left channel data and the right channel data in the front are processed 702, that is, the left channel data and the right channel data in each source audio data unit 6201-6203 represented by white box 1, gray box 1, white box 2, gray box 2, white box 3, and gray box 3 are processed. This processing is similar to the above-mentioned method, including but not limited to: resampling, adding sound effects, adjusting volume, and mixing, so that the processed left channel data and right channel data can be obtained, which are represented by white dotted line boxes and gray dotted line boxes respectively. At the same time, the color change data (black boxes 1-3) in each source audio data unit can be kept unchanged. In this way, the disordered source audio data 622 can be obtained. In the disordered source audio data 622, the processed left channel data and the processed right channel data are located in front of the color change data.
[0120] Next, the left channel data, right channel data and color-changing data in the disordered source audio data 622 may be rearranged 703. Specifically, the rearrangement 703 may include: inserting the color-changing data 1-3 back to their original positions in the corresponding source audio data units 6201-6203. For example, the color-changing data in the source audio data unit 6201, the black frame 1, is inserted between the processed right channel data (gray dashed frame 1) in the source audio data unit 6201 and the processed left channel data (white dashed frame 2) in the source audio data unit 6202, and so on. The disordered source audio data 622 can be rearranged 703 to obtain the source audio data 63.
[0121] Finally, the obtained source audio data 63 may be sent to the audio hardware abstraction layer 604 for further processing.
[0122] Back reference Figure 6B . Figure 6B According to the embodiment of the present application Fig. 6A The software to hardware flow chart of the battery cover color changing method. Figure 6B After the source audio data 63 is sent to the audio hardware abstraction layer 604, it can be split by the audio splitting module 6041. The audio splitting module 6041 can split the source audio data 63 into audio data 64 and color-changing data 65. Figure 7 Taking the source audio data shown in as an example, the audio splitting module 6041 can separate the left channel data and the right channel data from the color change data in the source audio data, so that the left channel data and the right channel data form one path of data, and the color change data forms another path of data independent of the left channel data and the right channel data.
[0123] Then, the split audio data 64 is sent to the audio virtual device (PCM) 6051 in the kernel layer 605; the split color data 65 is sent to the battery cover virtual device (PCM) 6052 in the kernel layer 605. The audio virtual device 6051 in the kernel layer 605 can be used to perform digital-to-analog conversion on the audio data 64 to generate audio data 641, so as to send it to the hardware device (e.g., speaker 6064) in the hardware layer 606 for playback. Similarly, the battery cover virtual device 6052 in the kernel layer 605 performs digital-to-analog conversion on the color data 65 to generate color data 651, and then sends the color data 651 to the battery cover 6066 in the hardware layer 606 for display.
[0124] A specific battery cover virtual device 6052 can be specified for the color change data 65, and the battery cover virtual device 6052 represents the battery cover component 6066 in the hardware layer 606. In the kernel layer 605, the battery cover virtual device 6052 and the audio virtual device 6051 are independent of each other, and the color change data 65 and the audio data 64 can be transmitted independently of each other, thereby avoiding interference between the two.
[0125] In the kernel layer 605 , the audio data 64 is further processed to form audio data 641 , which is sent to the audio digital signal processor ADSP 6061 of the hardware layer 606 together with the color change data 65 .
[0126] The audio digital signal processor ADSP 6061 further processes the audio data 641 to obtain audio data 642, and the color change data 65 is transparently transmitted through the ADSP 6061. The audio data 642 and the color change data 65 can be sent to actual hardware components by the ADSP 6061. Specifically, after the audio data 641 is processed by the ADSP 6061, the audio data 642 can be obtained, and the audio data 642 can be sent to the smart power amplifier SmartPA6062. After the digital-to-analog conversion of SmartPA6062, the speaker audio data 643 can be generated, and the speaker audio data 643 is sent to the speaker 6064 for playback.
[0127] At the same time, the color change data 65 can be sent to the codec 6063 for digital-to-analog conversion to generate color change data 651, which can be a 50Hz sine wave signal. The color change data 651 can be sent to the battery cover 6066 to drive the battery cover 6066 to change color. In this way, the audio playback process of the electronic device is utilized, and the color change data is sent while the electronic device plays the audio data, so that the battery cover of the electronic device can change color with the playback rhythm of the audio data.
[0128] Example 3
[0129] Fig. 8A This is a software flow chart of another method for changing the color of a battery cover according to an embodiment of the present application. The difference between this embodiment and embodiment 1 is that the color change data is stored in the hardware abstraction layer, and the hardware abstraction layer loads the corresponding color change data according to the index sent by the application program to drive the battery cover to change color.
[0130] In an embodiment of the present application, the audio data to be played by the application is indexed. That is, the audio data in the application such as the incoming call application, the alarm clock application, the calendar application, etc. is serialized. For example, in the case where ten incoming call ringtones are set in the electronic device, that is, the electronic device stores ten ringtones that can be selected by the user to play when a call is incoming, the ten incoming call ringtones can be indexed separately, for example, the index is 0-9. Ten color change data corresponding to the audio data corresponding to the ten ringtones can be stored. For example, these color change data can be obtained by converting the audio data using a conversion algorithm, and the conversion algorithm can be, for example, the conversion algorithm described in the previous embodiment 1. In other implementations, the conversion algorithm can also be a conversion algorithm in other forms. In addition, in other implementations, the color change data can also be color change data that can make the battery cover change color at a fixed frequency, and the color change data corresponding to different audio data can have different color change frequencies. The form of the color change data is not limited here. Further, the color change data can be stored in the audio hardware abstraction layer 804.
[0131] See also Fig. 8AIn scenarios such as incoming calls, alarms, and schedule reminders, the applications in the application layer 801 (e.g., incoming call application 8011, alarm application 8012, and calendar application 8013) first send an audio control signal 810 to the audio hardware abstraction layer 804 to notify the audio hardware abstraction layer 804 that the playback of the audio data this time requires the battery cover color change function to be turned on, and at the same time, the index 811 of the audio data to be played is sent along with the audio control signal 810. Upon receiving the audio control signal 810, the audio hardware abstraction layer 804 configures the battery cover color change path, for example, turning on the audio virtual device (PCM) and color change data path corresponding to the color change data. At the same time, upon receiving the index 811, the audio hardware abstraction layer 804 also performs a more detailed configuration of the color change data, and this process will be explained in detail below. On the other hand, the application can send an audio data stream (such as Fig. 8A The audio data stream may contain audio data 81 to be played.
[0132] When the application framework layer 802 detects the audio data 81, it can initialize the audio player 8021 in the electronic device. Then, the audio data 81 can be decoded by the audio codec 8022 (the decoding process is a software decoding process, so it can be called soft decoding) to obtain the decoded audio data 82. The audio data 82 is then transferred to the audio hub service layer 803.
[0133] The audio hub service layer 803 processes the decoded audio data 82 to obtain audio data 83, including but not limited to: resampling, adding sound effects, adjusting volume, and mixing. The processed audio data 83 can then reach the audio hardware abstraction layer AudioHal 804 for further processing.
[0134] The audio hardware abstraction layer 804 can configure the battery cover path when receiving the audio control signal 810 from the application layer 801. At this time, the audio hardware abstraction layer 804 also needs to determine whether the audio data 83 is to be played by the speaker of the electronic device. If the electronic device is connected to an external device such as a headset or a Bluetooth speaker, causing the audio data to be played by the headset or the Bluetooth speaker instead of the speaker, the audio hardware abstraction layer 804 may not configure the battery cover path, that is, the audio virtual device (PCM) and the color change data path corresponding to the color change data are not turned on. In this case, the audio data only reaches the external device through the audio data path for playback, and the battery cover does not change color. When it is determined that the audio data is to be played by the speaker of the electronic device, the audio hardware abstraction layer 804 configures the battery cover path, as follows.
[0135] See also Figure 8B After the audio data 83 reaches the audio hardware abstraction layer 804, it can be sent by the audio distribution module 8041 to the audio virtual device (PCM) 8051 in the kernel layer 805. The audio virtual device 8051 in the kernel layer 805 can be used to perform digital-to-analog conversion on the audio data 83 to generate audio data 831, and then send the audio data 831 to the hardware device (e.g., speaker 8064) in the hardware layer 806 for playback.
[0136] On the other hand, according to the received index 811, the loading module 8042 in the audio hardware abstraction layer 804 can load the color change data 84 corresponding to the index from the color change data folder 8043. The color change data 84 can be sent by the audio distribution module 8041 to the battery cover virtual device 8052 in the kernel layer 805 to drive the battery cover to change color. Similarly, the battery cover virtual device 8052 in the kernel layer 805 can perform digital-to-analog conversion on the color change data 84 to generate color change data 841, and then send the color change data 841 to the battery cover 8066 in the hardware layer 806 for display.
[0137] A specific battery cover virtual device 8052 can be specified for the color change data 84, and the battery cover virtual device 8052 can represent the battery cover device 8066 in the hardware layer 806. In the kernel layer 805, the battery cover virtual device 8052 and the audio virtual device 8051 are independent of each other, and the audio data 83 and the color change data 84 can be transmitted independently of each other, thereby avoiding interference between the two.
[0138] In the kernel layer 805 , the audio data 83 may be further processed to form audio data 831 , and the audio data 831 and the color change data 84 may be sent to the audio digital signal processor ADSP 8061 of the hardware layer 806 respectively.
[0139] The audio digital signal processor ADSP 8061 further processes the audio data 831 to obtain audio data 832, and the color change data 84 is transparently transmitted through the ADSP 8061. The audio data 832 and the color change data 84 can be sent to actual hardware components by the ADSP 8061. Specifically, after the audio data 831 is processed by the ADSP 8061, the audio data 832 can be obtained, and the audio data 832 can be sent to the smart power amplifier SmartPA 8062. After the digital-to-analog conversion of the SmartPA 8062, the audio data 83 can be generated, and the audio data 833 is sent to the speaker 8064 for playback.
[0140] On the other hand, the color change data 841 can be sent to the codec 8063, and after digital-to-analog conversion, the color change data 842 can be generated. The color change data 842 can be a 50Hz sine wave signal. The color change data 842 can be sent to the battery cover 8066 to drive the battery cover 8066 to change color. In this way, the audio playback process of the electronic device is utilized, and the color change data is played while the electronic device plays the audio data, so that the battery cover of the electronic device can change color with the playback of the audio data.
[0141] In one implementation, the user can select external audio data as the audio data to be played in the above scenarios, that is, in the scenarios of incoming call ringing, alarm ringing, schedule reminder, etc., the user can set the electronic device to play external audio data, that is, audio data that is not built-in when the electronic device leaves the factory, such as songs downloaded by the user from the Internet, or audio from an external memory, etc. The external audio data can be uniformly compiled into a default index value (for example, 0) in the audio system, that is, all external audio data corresponds to index value 0, and the index value 0 can be made to correspond to the default color change data. This allows the electronic device to use the default color change data to achieve the battery cover color change function when playing non-preset audio data.
[0142] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0143] The embodiment of the present application also provides a computer-readable storage medium, which includes instructions. When the instructions are executed on an electronic device, the electronic device executes Figure 4A and 4B , Fig. 6A and 6B , Fig. 8A and 8B The relevant method steps shown are used to implement the battery cover color changing method in the above embodiment.
[0144] This embodiment also provides a computer program product including instructions. When the computer program product is run on an electronic device, the electronic device executes the following Figure 4A and 4B , Fig. 6A and 6B , Fig. 8A and 8BThe relevant method steps in the method embodiment are shown to implement the battery cover color changing method in the above embodiment.
[0145] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0146] In the several embodiments provided in this embodiment, it should be understood that the disclosed battery cover color changing method and device 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 system, 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, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0147] 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 computer-readable storage medium. Based on this understanding, the technical solution of this embodiment 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, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk and other media that can store program codes.
[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A battery cover color changing method, applied to an electronic device, the electronic device comprising an application and a battery cover, characterized in that: The electronic device further includes an audio hardware abstraction layer, and the method includes: The application sends an audio control signal to the audio hardware abstraction layer, the audio control signal is used to configure a battery cover path, and the battery cover path is used to transmit and process color change data; Sending first audio data to the audio playback process through the application program, wherein the first audio data passes through the application program layer, the application program framework, the audio hub service layer, the audio hardware abstraction layer, and the kernel layer in the audio playback process in sequence; In the audio playback process, color change data is obtained according to the first audio data; wherein the color change data corresponds to the rhythm of the first audio data; and Playing the first audio data, while the battery cover changes color in accordance with the rhythm of the first audio data under the drive of the color change data; The configuration of the battery cover passage specifically includes: The audio virtual device and the color-changing data path corresponding to the color-changing data are enabled, wherein the color-changing data path enables the color-changing data and the audio data to be transmitted independently of each other in the audio playback process.
2. The method according to claim 1, wherein: The application is one of the following: Incoming call app, alarm app, and calendar app.
3. The method according to claim 1, characterized in that Sending the first audio data to the audio playing process through the application specifically includes: The application layer sends the first audio data to the application framework layer; The application framework layer and the audio hub service layer process the first audio data respectively, and the audio hub service layer outputs second audio data to the audio hardware abstraction layer; The audio hardware abstraction layer receives and processes the second audio data to obtain third audio data, and outputs the third audio data to the audio virtual device in the kernel layer.
4. The method according to claim 3, characterized in that Before sending the first audio data to the audio playing process through the application, the method further includes: Make sure the battery cover color-changing switch is in the on position.
5. The method according to any one of claims 1 to 4, characterized in that: In the audio playback process, obtaining color change data according to the first audio data further includes: The color change data is generated according to the first audio data by using a conversion algorithm.
6. The method according to claim 5, characterized in that The conversion algorithm is an audio rhythm recognition algorithm, so that the rhythm of the color-changing data corresponds to the rhythm of the first audio data.
7. The method according to claim 5, characterized in that In the audio playback process, obtaining color change data according to the first audio data further includes: The conversion algorithm module in the audio hardware abstraction layer obtains the color change data based on the second audio data, and outputs the color change data to the battery cover virtual device in the kernel layer.
8. The method according to claim 6, characterized in that In the audio playback process, obtaining color change data according to the first audio data further includes: The conversion algorithm module in the audio hardware abstraction layer obtains the color change data based on the second audio data, and outputs the color change data to the battery cover virtual device in the kernel layer.
9. The method according to any one of claims 1 to 4, characterized in that In the audio playback process, obtaining color change data according to the first audio data further includes: The first audio data includes the color change data, wherein the color change data is manually edited and combined into the first audio data in advance; and The color-changing data is separated from the first audio data using a separation algorithm.
10. The method according to claim 9, characterized in that In the audio playback process, obtaining color change data according to the first audio data further includes: The audio splitting module in the audio hardware abstraction layer splits the second audio data into third audio data and the color change data, and outputs the third audio data to the audio virtual device in the kernel layer, and outputs the color change data to the battery cover virtual device in the kernel layer.
11. The method according to claim 10, characterized in that The color change data is obtained by using an audio rhythm recognition algorithm for the first audio data.
12. The method according to any one of claims 1 to 4, characterized in that: In the audio playback process, obtaining color change data according to the first audio data further includes: The color-changing data is stored in the electronic device, the audio control signal includes an index corresponding to the first audio data, the color-changing data is loaded according to the index, and the color-changing data corresponds to the first audio data.
13. The method according to claim 12, characterized in that In the audio playback process, obtaining color change data according to the first audio data further includes: The loading module in the audio hardware abstraction layer loads the color change data according to the index and passes it to the audio distribution module in the audio hardware abstraction layer.
14. The method according to claim 13, characterized in that The color change data is obtained by using an audio rhythm recognition algorithm for the first audio data.
15. The method according to claim 12, characterized in that If the first audio data is external audio data, the default color change data corresponding to the default index is loaded.
16. The method according to claim 13, characterized in that The audio distribution module outputs the color change data to the battery cover virtual device in the kernel layer.
17. The method according to any one of claims 1 to 4, characterized in that: The playing of the first audio data further comprises: The speaker of the electronic device plays the first audio data.
18. An electronic device, characterized in that: The electronic device comprises: one or more processors, a memory and a battery cover; The memory is used to store program code; The one or more processors are used to run the program code so that the electronic device executes the battery cover color changing method as described in any one of claims 1-16.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes instructions, and when the instructions are executed on an electronic device, the electronic device executes the battery cover color changing method according to any one of claims 1 to 17.
Citation Information
Patent Citations
Information display method and mobile terminal
CN107728400A
Audio display method and device, electronic equipment and computer storage medium
CN112883223A