Atmosphere lamp control method and device, equipment, storage medium and program product

By performing spectrum analysis of the audio signal and calling flow animation services to control the length, brightness and color of the atmosphere light, the problem of inflexible atmosphere light control in the existing technology is solved, and an immersive in-car atmosphere experience synchronized with the music rhythm is achieved, which improves the reusability of entertainment and control.

CN120270157APending Publication Date: 2025-07-08CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510555815.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

In the prior art, the control of automotive ambient lights is limited to color and brightness control, and cannot provide a more flexible and immersive interior ambient experience.

Method used

By performing spectrum analysis on the audio signal, pre-encapsulated flow animation service is called to control the length, brightness and color of the atmosphere lights so that it lights up the corresponding luminous unit according to the preset animation effect, and synchronizes with the music rhythm.

Benefits of technology

It enhances the interaction between music and ambient lights, improves the entertaining and immersive experience of the driving process, and improves the reusability and flexibility of ambient light control, reducing development time and cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120270157A_ABST
    Figure CN120270157A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent vehicle-mounted light control, and discloses an atmosphere lamp control method, device and equipment, a storage medium and a program product, an atmosphere lamp is composed of a preset number of light-emitting units, and the method comprises the steps: obtaining an audio signal, carrying out the spectrum analysis of the audio signal, and determining a spectrum energy value of the audio signal; calling a pre-packaged pipeline animation service according to the frequency spectrum energy value; and controlling the atmosphere lamp based on the running animation service so as to enable the atmosphere lamp to lighten the corresponding light-emitting unit according to a preset animation effect. According to the invention, by pre-packaging the flow animation service, the length of the atmosphere lamp can be controlled, the flow effect of the atmosphere lamp can be adjusted in real time according to the music rhythm, and meanwhile, the length control is pre-packaged into the SOA service corresponding to the music rhythm, so that the reusability, expandability and flexibility of atmosphere lamp control can be improved; and immersive in-vehicle atmosphere experience is created for the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent vehicle lighting control, and particularly to a control method, device, equipment, storage medium and program product for ambient lights. Background Art

[0002] The ambient lights in a car are a lighting and decoration system that can change colors and brightness. With the continuous progress of technology and the increasing demand for driving comfort, ambient lights are generally used in current cars to decorate and adjust the interior environment. In the prior art, the control of ambient lights is limited to color control and brightness control, and only basic music rhythm ambient light control is achieved, unable to provide a more flexible and immersive in-vehicle atmosphere experience. Summary of the Invention

[0003] In view of this, the present invention provides a control method, device, equipment, storage medium and program product for ambient lights to solve the problem of inaccurate control of power output for scenarios.

[0004] In a first aspect, the present invention provides a control method for ambient lights, where the ambient lights are composed of a preset number of light-emitting units, and the method includes:

[0005] Obtain an audio signal, perform spectral analysis on the audio signal, and determine the spectral energy value of the audio signal;

[0006] Call a pre-encapsulated flowing water animation service according to the spectral energy value;

[0007] Control the ambient lights based on the flowing water animation service, so that the ambient lights light up the corresponding light-emitting units according to a preset animation effect.

[0008] The control method for ambient lights provided by the present invention determines the spectral energy value by performing spectral analysis on the obtained audio signal, calls a pre-encapsulated flowing water animation service according to the spectral energy value, and controls the ambient lights based on the flowing water animation service, so that the ambient lights light up the corresponding light-emitting units according to a preset animation effect. By pre-encapsulating the flowing water animation service, the present invention can control the length of the ambient lights, adjust the flowing water effect of the ambient lights in real time according to the music rhythm, and at the same time pre-encapsulate the length control as a SOA service (Service-Oriented Architecture) corresponding to the music rhythm, which can improve the reusability, scalability and flexibility of ambient light control and create an immersive in-vehicle atmosphere experience for users.

[0009] In an alternative embodiment, when controlling the ambient light based on the flowing water animation service to cause the ambient light to light up the corresponding light-emitting units according to a preset animation effect, it further includes: determining a target brightness value according to the spectral energy value so that the light-emitting units adjust their brightness according to the target brightness value; and / or performing color mapping according to the spectral energy value to determine a target color value and a color change rate so that the light-emitting units adjust their color according to the target color value and the color change rate.

[0010] By controlling the length, brightness, and color of the ambient light, the present invention can further enhance the emotional expression of music, enabling a perfect integration of vision and hearing. The interaction between music and the ambient light also adds more fun and entertainment to the driving process, further creating an immersive in-vehicle atmosphere experience for users, enhancing the overall in-vehicle entertainment experience, and allowing the occupants to have a better mood and experience in the vehicle.

[0011] In an alternative embodiment, the encapsulation process of the flowing water animation service includes: segmenting the ambient light according to a preset percentage range to determine target light-emitting units; encapsulating the flowing water animation service based on the target light-emitting units, and assigning a service interface to the flowing water animation service.

[0012] By encapsulating the preset ambient light animation effect as a service, the present invention can take the flowing water animation service as an independently callable module. When developing a new vehicle model or a new in-vehicle software function, there is no need to redesign and rewrite the code for the ambient light animation effect. Instead, the original service can be directly called. If the ambient light animation effect needs to be modified or updated, only the adjustment needs to be made in the encapsulated service, without having to modify the code one by one at multiple places where the effect is called, thus greatly saving development time and cost and accelerating the product's market launch cycle. In addition, by calling the encapsulated service, the consistency of the ambient light animation effect can be ensured in different scenarios and applications.

[0013] In an alternative embodiment, calling the pre-encapsulated flowing water animation service according to the spectral energy value includes: normalizing the spectral energy value according to a preset percentage range to obtain a normalized spectral energy value; determining the flowing water animation service corresponding to the percentage equal to the normalized spectral energy value, and calling the service interface of the flowing water animation service.

[0014] By segmenting the ambient light according to a percentage and normalizing the spectral energy value to the corresponding percentage, the present invention can directly call the flowing water animation service according to the audio spectral energy to achieve control of the length of the ambient light, providing users with a different driving experience.

[0015] In an alternative embodiment, determining a target brightness value based on the spectral energy value to enable the light-emitting unit to adjust the brightness according to the target brightness value includes: normalizing the spectral energy value within a preset percentage range to obtain a normalized spectral energy value; dividing the brightness of the light-emitting unit within a preset percentage range, and determining a target brightness value equal to the corresponding percentage of the normalized spectral energy value.

[0016] By normalizing the ambient light brightness to the corresponding percentage, the present invention can control the brightness of the lit ambient light when controlling the length of the ambient light, enhance the emotional expression of the ambient light to music, and enable users to more intuitively feel the changes in music.

[0017] In an alternative embodiment, performing color mapping based on the spectral energy value to determine a target color value and a color change rate to enable the light-emitting unit to adjust the color according to the target color value and the color change rate includes: calculating a comprehensive energy value of the audio signal within a preset frequency band according to the spectral energy value; normalizing the comprehensive energy value within a preset color value range to obtain a normalized frequency band energy value; performing color mapping according to the normalized frequency band energy value to determine the target color value, and performing color smoothing processing according to the target color value and the current color value; determining the spectral centroid according to the spectral energy value, and determining the color change rate according to the spectral centroid.

[0018] By controlling the color of the lit ambient light, the present invention can match corresponding colors to different styles of music, enabling perfect integration of the user's vision and hearing. At the same time, adjusting the color change rate according to the spectral centroid of the audio can synchronize the lighting effect with the music rhythm and enhance the sense of audio-visual synchronization.

[0019] In a second aspect, the present invention provides a control device for an ambient light. The ambient light is composed of a preset number of light-emitting units. The device includes:

[0020] An information processing module, configured to obtain an audio signal, perform spectral analysis on the audio signal, and determine the spectral energy value of the audio signal;

[0021] A service call module, configured to call a pre-encapsulated flowing water animation service according to the spectral energy value;

[0022] A lighting control module, configured to control the ambient light based on the flowing water animation service, so that the ambient light lights up the corresponding light-emitting units according to a preset animation effect.

[0023] In a third aspect, the present invention provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the control method for the ambient light according to the first aspect or any corresponding embodiment thereof.

[0024] Fourthly, the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the control method of the ambient light according to the first aspect or any corresponding embodiment thereof.

[0025] Fifthly, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to cause a computer to execute the control method of the ambient light according to the first aspect or any corresponding embodiment thereof.

[0026] Advantages of the present invention:

[0027] (1) By simultaneously controlling the length, brightness and color of the ambient light, the present invention can adjust the presentation effect of the ambient light in real time according to music rhythm, frequency, etc. The interaction between music and the ambient light increases the interest and entertainment of the driving and riding process, creates an immersive in-vehicle atmosphere experience for users, improves the overall entertainment experience of driving and riding, and enables the driver and passengers to have a better mood and experience in the vehicle.

[0028] (2) By encapsulating the preset ambient light animation effect as a service, the present invention can use the flowing water animation service as an independent module that can be repeatedly called. When developing a new vehicle model or a new in-vehicle software function, there is no need to re-design and write the code of the ambient light animation effect, and the original service can be directly called. If it is necessary to modify or update the ambient light animation effect, only the encapsulated service needs to be adjusted, instead of modifying the code one by one at multiple places where the effect is called, thus greatly saving development time and cost and accelerating the product launch cycle. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required to be used in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0030] Figure 1 is a schematic flowchart of the control method of the ambient light according to an embodiment of the present invention;

[0031] Figure 2 is a schematic diagram of the ambient light segmentation of the control method of the ambient light according to an embodiment of the present invention;

[0032] Figure 3 is a schematic diagram of the animation interface of the control method of the ambient light according to an embodiment of the present invention;

[0033] Figure 4It is a schematic flowchart of another method for controlling an ambient light according to an embodiment of the present invention;

[0034] Figure 5 It is a schematic interaction flowchart of another method for controlling an ambient light according to an embodiment of the present invention;

[0035] Figure 6 It is a schematic flowchart of yet another method for controlling an ambient light according to an embodiment of the present invention;

[0036] Figure 7 It is a structural block diagram of a control device for an ambient light according to an embodiment of the present invention;

[0037] Figure 8 It is a schematic hardware structure diagram of a computer device according to an embodiment of the present invention. Detailed implementation manners

[0038] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0039] The embodiments of the present invention are applicable to the scenario of adjusting the presentation effect of the ambient light according to the played music during the driving of an automobile. The embodiments of the present invention provide a method for controlling an ambient light, which controls the length, brightness and color of the ambient light to enhance the atmosphere in the vehicle.

[0040] According to an embodiment of the present invention, an embodiment of a method for controlling an ambient light is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.

[0041] In this embodiment, a method for controlling an ambient light is provided, which can be used in the intelligent ambient light control system of the above-mentioned automobile. Figure 1 It is a flowchart of a method for controlling an ambient light according to an embodiment of the present invention. As Figure 1 shown, the process includes the following steps:

[0042] Step S101, obtain an audio signal, perform spectrum analysis on the audio signal, and determine the spectral energy value of the audio signal.

[0043] Specifically, in the embodiments of the present invention, the intelligent atmosphere light control system of the vehicle is divided into an audio input unit, an intelligent cockpit domain control unit, an intelligent atmosphere light control unit, and atmosphere lights. Among them, the audio input unit is a microphone deployed inside the vehicle, or a Bluetooth module connected to a terminal device, or a built-in storage reading component of the in-vehicle multimedia system. The atmosphere lights are composed of a preset number of light-emitting units. For example, in-vehicle atmosphere lights are generally composed of multiple LEDs (light-emitting diodes) and are usually deployed at positions such as the vehicle's center console, door interior trim panels, and seat areas. When the user turns on the in-vehicle music player through the soft switch or voice of the in-vehicle computer, thereby playing online music or local music, the audio signal being played can be collected through the microphone, or the audio signal of the online music received by the Bluetooth module, etc., can be directly obtained, or the audio signal of the local music read by the built-in storage reading component can be directly obtained, which is not limited herein. At the same time, the user can also turn on the main switch of the atmosphere lights through the soft switch or voice of the in-vehicle computer.

[0044] In an alternative embodiment, after the audio input unit obtains the audio signal, the intelligent cockpit domain control unit further determines whether there is audio input. If it is determined that there is an audio signal, the Fourier transform is used to perform spectral analysis on the audio signal to determine the spectral energy value of the audio signal. Essentially analyzed, audio is composed of the superposition of multiple sine wave components with different frequencies, which shows different waveforms and rhythms in the time domain and different energy distributions of different frequency components in the frequency domain. The Fourier transform can convert music from the time domain to the frequency domain to obtain its spectrum. The energy levels of different frequency bands in the spectrum reflect the characteristics of the music in each frequency band. For example, music with stronger energy in the low-frequency band may be more impactful, and music with prominent energy in the high-frequency band sounds brighter and clearer. In the embodiments of the present invention, the spectral energy values of each frequency band are obtained through spectral analysis and used as the basis for controlling the atmosphere lights.

[0045] Step S102, call the pre-packaged flowing water animation service according to the spectral energy value.

[0046] Specifically, in the embodiments of the present invention, different flowing water animation effects are preset for the atmosphere lights, and the flowing water animation effects are packaged into corresponding flowing water animation services. Among them, the flowing water animation service is an in-vehicle SOA (Service-Oriented Architecture) service, which is a technical architecture that abstracts various functions of the vehicle into callable services with standard interfaces. The service can be reused by multiple application programs or modules, improving development efficiency and system flexibility. Moreover, each service has independent business logic and data, and can be independently developed, tested, deployed, and upgraded without affecting other services.

[0047] In some alternative embodiments, taking the example that the ambient light is composed of multiple side-by-side LEDs, etc., the embodiments of the present invention segment the ambient light according to a preset percentage range to determine the target light-emitting units; encapsulate the flowing water animation service based on the target light-emitting units, and allocate service interfaces for the flowing water animation service. As Figure 2 shown, the ambient light is segmented in the range of 1% - 100%, and 100% corresponds to the full length of the ambient light group, so as to take each percentage as the basic flowing water animation service. For example, as Figure 3 shown, 110 represents Animation 1, 120 represents Animation 2, 130 represents Animation 3, 140 represents Animation N, and each animation service corresponds to a specific interface. The flowing water animation effect of each segment is encapsulated as an independent service, providing a RESTful API or other forms of call interfaces. Therefore, when the embodiments of the present invention control the ambient light according to the played music, the pre-encapsulated flowing water animation service can be directly called according to the analyzed spectral energy value. In the actual operation process, it can be flexibly set according to the number of LEDs in the ambient light. The animation effect can be set as Figure 2 shown, starting from the LEDs at one end of the ambient light as the starting position to segment the ambient light, or starting from the middle LEDs as the starting position to segment the ambient light, and it can also be not limited to controlling the length, that is, setting the shape according to the deployment of the LEDs, etc.

[0048] Step S103, control the ambient light based on the flowing water animation service, so that the ambient light lights up the corresponding light-emitting units according to the preset animation effect.

[0049] Specifically, in the embodiments of the present invention, multiple LEDs of the ambient light are usually connected to one or more microcontrollers (such as single-chip microcomputers). The microcontroller controls the on / off and brightness of each LED through GPIO (General-Purpose Input / Output) pins. When the intelligent ambient light control unit corresponds the spectral energy value with the flowing water animation service one by one and calls the service interface, the animation instruction is sent to the ambient light through the service interface. For example, the service interface function may include the identification information, parameter information, etc. of the animation, so that the ambient light module can accurately identify and execute. The ambient light then receives the call instruction of the flowing water animation service and executes the flowing water service animation instruction, so that some LEDs in the ambient light are lit. During the playing of music, the real-time collected audio signal is spectroscopically analyzed, and the corresponding flowing water animation service is called according to the real-time calculated spectral energy value, so that the ambient light is lit according to different lengths to present a dynamic flowing water animation effect.

[0050] The control method of the ambient light provided by the present invention determines the spectral energy value by performing spectral analysis on the acquired audio signal, calls the pre-encapsulated flowing water animation service according to the spectral energy value, and controls the ambient light based on the flowing water animation service, so that the ambient light lights up the corresponding light-emitting units according to the preset animation effect. By pre-encapsulating the flowing water animation service, the present invention can control the length of the ambient light, adjust the flowing water effect of the ambient light in real time according to the music rhythm, and at the same time pre-encapsulate the length control as an SOA service corresponding to the music rhythm, which can improve the reusability, scalability and flexibility of the ambient light control, and create an immersive in-vehicle atmosphere experience for users.

[0051] In this embodiment, a control method of an ambient light is provided, which can be used in the intelligent ambient light control system of the above-mentioned vehicle. Figure 4 It is a flowchart of the control method of the ambient light according to the embodiment of the present invention, as Figure 4 shown, and this process includes the following steps:

[0052] Step S401, acquire an audio signal, and perform spectral analysis on the audio signal to determine the spectral energy value of the audio signal. For details, please refer to Figure 1 step S101 of the embodiment shown, which will not be elaborated here.

[0053] Step S402, call the pre-encapsulated flowing water animation service according to the spectral energy value.

[0054] Specifically, the above step S402 includes:

[0055] Step S4021, normalize the spectral energy value according to a preset percentage range to obtain a normalized spectral energy value.

[0056] Specifically, in the embodiment of the present invention, assume that the audio signal is a discrete time series, denoted as x[n], where the range of n is 0≤n<N, and N is the number of sampling points. As Figure 5As shown, after the audio input unit collects the audio signal, the intelligent cockpit domain control unit first determines whether it has received the audio input. If not, it exits. If it has received the audio input, it performs a discrete Fourier transform (DFT) on the time series x[n] corresponding to the audio signal to obtain the frequency domain signal X[k], where k is the index of the frequency component, and the range is 0 ≤ k < N. The essence of the discrete Fourier transform is to decompose a finite-length discrete time-domain signal into a superposition of sine and cosine waves (or complex exponential forms) of different frequencies. X[k] represents the coefficient of the k-th frequency component in the frequency domain, containing the amplitude and phase information of that frequency component. By calculating X[k], the relative intensity and phase relationship of each frequency component in the time-domain signal can be analyzed, thus realizing the conversion from the time domain to the frequency domain, which is helpful for signal processing such as spectrum analysis and filtering.

[0057] In some alternative embodiments, the spectral energy value E[k] of each frequency component is defined as the square of the amplitude, i.e., E[k] = |X[k]| 2 = X[k] · X * [k], X * [k] is the complex conjugate of X[k]. On this basis, the spectral energy value E[k] is normalized according to the percentage range corresponding to the flowing water animation service, that is, the spectral energy value E[k] is mapped to the range of 0 - 100 to obtain the normalized spectral energy value. The normalization process is as follows: find the minimum value E min and the maximum value E max among all spectral energy values E[k], and normalize each spectral energy value E[k] to obtain the normalized spectral energy value E normalized [k]. The formula is as follows:

[0058]

[0059] where, the range of E normalized [k] is 0 - 100.

[0060] Step S4022: Determine the flowing water animation service corresponding to the percentage equal to the normalized spectral energy value, and call the service interface of the flowing water animation service.

[0061] Specifically, in the embodiment of the present invention, the intelligent cockpit domain control unit sends the normalized spectral energy value E normalized [k] to the intelligent atmosphere light control unit, and the intelligent atmosphere light control unit directly maps the normalized spectral energy value E normalized [k] to the length value L[k], that is: L[k] = E normalized[k], so the range of the length value is also 0 - 100. In the embodiment of the present invention, the flowing water animation service is also segmented by percentage, corresponding to the length of the atmosphere light. Therefore, the flowing water animation service with equal percentage can be directly determined according to the length value L[k], and the service interface of the flowing water animation service is called. Finally, the atmosphere light receives the flowing water animation service instruction and executes it.

[0062] Step S403, control the atmosphere light based on the flowing water animation service so that the atmosphere light lights up the corresponding light-emitting units according to the preset animation effect. For details, please refer to Figure 1 Step S103 of the embodiment shown, which will not be elaborated here.

[0063] The control method of the atmosphere light provided by the present invention determines the spectral energy value by performing spectral analysis on the acquired audio signal, calls the pre-encapsulated flowing water animation service according to the spectral energy value, and controls the atmosphere light based on the flowing water animation service so that the atmosphere light lights up the corresponding light-emitting units according to the preset animation effect. By pre-encapsulating the flowing water animation service, the present invention can control the length of the atmosphere light, adjust the flowing water effect of the atmosphere light in real time according to the music rhythm, and at the same time pre-encapsulate the length control as an SOA service corresponding to the music rhythm, which can improve the reusability, scalability and flexibility of the atmosphere light control and create an immersive in-vehicle atmosphere experience for users.

[0064] In this embodiment, a control method of an atmosphere light is provided, which can be used in the intelligent atmosphere light control system of the above-mentioned vehicle. Figure 6 It is a flowchart of the control method of the atmosphere light according to the embodiment of the present invention. As Figure 6 shown, the process includes the following steps:

[0065] Step S601, acquire an audio signal and perform spectral analysis on the audio signal to determine the spectral energy value of the audio signal. For details, please refer to Figure 4 Step S401 of the embodiment shown, which will not be elaborated here.

[0066] Step S602, call the pre-encapsulated flowing water animation service according to the spectral energy value. For details, please refer to Figure 4 Step S402 of the embodiment shown, which will not be elaborated here.

[0067] Step S603, control the atmosphere light based on the flowing water animation service so that the atmosphere light lights up the corresponding light-emitting units according to the preset animation effect. For details, please refer to Figure 4 Step S403 of the embodiment shown, which will not be elaborated here.

[0068] Step S604, determine the target brightness value according to the spectral energy value so that the light-emitting unit adjusts the brightness according to the target brightness value.

[0069] Specifically, the above step S604 includes:

[0070] Step S6041: Normalize the spectral energy values within a preset percentage range to obtain normalized spectral energy values.

[0071] Step S6042: Divide the brightness of the lighting unit within a preset percentage range and determine the target brightness value equal to the corresponding percentage of the normalized spectral energy value.

[0072] Specifically, in the embodiment of the present invention, on the basis of controlling the length of the atmosphere lamp, the brightness of the lit LEDs is controlled. The brightness is divided according to the percentages corresponding to the length and the flowing water animation service, that is, the brightness is mapped within the range of 0 - 100, where 0 represents off and 100 represents the brightest. At the same time, normalization processing is performed according to the above calculation process of the spectral energy value E[k], and the target brightness value with an equal percentage is determined according to the normalized spectral energy value E normalized [k], and then the duty cycle of the pulse signal is adjusted according to the target brightness value to control the average power of the lit LEDs of the atmosphere lamp, thereby changing the brightness of the lit LEDs. Among them, the duty cycle refers to the ratio of the high-level duration within a pulse period to the entire period. The larger the duty cycle, the higher the average power and the brighter the atmosphere lamp; otherwise, it is darker.

[0073] Step S605: Perform color mapping according to the spectral energy value to determine the target color value and the color change rate, so that the lighting unit adjusts the color according to the target color value and the color change rate.

[0074] Specifically, the above step S605 includes:

[0075] Step S6051: Calculate the comprehensive energy value of the audio signal within a preset frequency band according to the spectral energy value.

[0076] Specifically, in the embodiment of the present invention, when controlling the length and brightness of the atmosphere lamp, its color is also controlled. In order to reduce spectral leakage, first perform windowing preprocessing on the time series x[n] corresponding to the frequency signal to obtain the processed time series x'[n], and then refer to the above discrete Fourier transform process to obtain the spectral energy values E[k] of each frequency component in the audio signal. Furthermore, calculate the comprehensive energy value E[p] within a specific frequency band according to the spectral energy values E[k] of each frequency component. The calculation formula is as follows:

[0077]

[0078] Among them, E k [m] represents the energy value at the frequency index m in the k-th analysis (for example, the analysis of the k-th frame of audio signal). Usually E k[m] is obtained by calculating the spectral energy value of each frequency component after performing the discrete Fourier transform on the signal, f p1 and f p2 are respectively the starting frequency index and the ending frequency index of the p-th frequency band. These two indices define the frequency range for which the energy is to be calculated, that is, the boundary of the frequency band. In audio processing, different frequency bands contain different audio information. For example, the low-frequency band is usually related to the bass part of the audio, such as drum beats, etc.; the middle-frequency band contains the fundamental frequency information of most voices and musical instruments; the high-frequency band is related to the details and overtones of the audio. By dividing the frequency band and calculating the energy of each frequency band, the characteristics of the audio can be extracted. In the in-vehicle ambient light control scenario of the embodiment of the present invention, the performance of the ambient light can be controlled according to the energy of different frequency bands. For example, when the energy of the low-frequency band is high, the ambient light can emit a stronger and deeper light effect; when the energy of the high-frequency band is high, the ambient light can blink faster to create a more lively atmosphere.

[0079] In some alternative embodiments, when calculating the comprehensive energy value E[p] in the embodiment of the present invention, it is necessary to determine the number of divided frequency bands and the boundary of each frequency band (that is, f p1 and f p2 ). For example, the entire audio spectrum can be divided into a low-frequency band (0 - 200 Hz), a middle-frequency band (200 - 2000 Hz), and a high-frequency band (2000 Hz - the highest frequency), and then these frequency ranges are converted into corresponding frequency indices. This is only an example and not limited thereto. For each frequency band p, the comprehensive energy value E[p] of all frequency components within this frequency band is calculated according to the above formula.

[0080] Step S6052, normalize the comprehensive energy value according to a preset color value range to obtain a normalized frequency band energy value.

[0081] Specifically, in the embodiment of the present invention, the energy values of different frequency bands may have different value ranges. Through normalization processing, they can be unified to the same scale, so that they can be directly used to control the color intensity of the ambient light. Taking the value range of each channel in the RGB color mode as 0 - 255 as an example, the comprehensive energy value E[p] is normalized according to the range of 0 - 255, and it is mapped into the interval of 0 - 255 to obtain the corresponding normalized frequency band energy value E′[p]. The calculation formula is as follows:

[0082]

[0083] Among them, the range of E′[p] is 0 - 255, E p-min is the minimum value of the energy value of the p-th frequency band, representing the lower limit of the energy of this frequency band; E p-max is the maximum value of the energy value of the p-th frequency band, representing the upper limit of the energy of this frequency band.

[0084] Step S6053: Perform color mapping based on the normalized band energy values to determine the target color values, and perform color smoothing based on the target color values and the current color values.

[0085] Specifically, in the embodiments of the present invention, the energy values E1′, E2′, and E3′ after normalizing the above three frequency bands and mapping them to the range of 0 - 255 respectively correspond to the three channel values R, G, and B in the RGB (Red, Green, Blue) color model, so as to directly determine the target color values of the LEDs lit in the atmosphere light. The color mapping formula is as follows:

[0086] R = E1′, G = E2′, B = E3′

[0087] Among them, in the RGB color model, R, G, and B respectively represent the intensity values of the Red, Green, and Blue channels. The value range of each channel is usually 0 - 255. 0 means that the color channel is completely off, and 255 means that the color channel is completely on. Through different combinations of R, G, and B, about 16.7 million different colors can be represented. Through the above processing, different frequency bands can be mapped to different color channels. For example, the low-frequency band energy is mapped to the red channel, the mid-frequency band energy is mapped to the green channel, and the high-frequency band energy is mapped to the blue channel. When the low-frequency components in the audio are stronger, the red channel value R will increase, and the red component in the atmosphere light will be more obvious; similarly, when the high-frequency components are strong, the blue component will be more prominent, so that the color of the atmosphere light changes dynamically with the rhythm and spectral characteristics of the music, enhancing the audio-visual experience. At the same time, after determining the target color values according to E′[p], it is also necessary to perform color smoothing according to the current color values to ensure that the color change of the atmosphere light does not cause visual discomfort to the user. The smoothing processing formula is as follows:

[0088] C smooth = α·C current +(1 - α)C previous

[0089] Among them, C smooth represents the color value obtained after smoothing processing, C current represents the target color value (R, G, or B), C previousIt represents the current color value (R, G, or B), which is also the color value after smoothing at the previous moment. α is the smoothing coefficient, and its value range is 0 < α < 1. The magnitude of α determines the weights of the target color value and the current color value after the previous smoothing in this smoothing process. The closer α is to 1, the greater the weight of the target color value, the smoother the result is closer to the target color value, and the faster the response speed to data changes, but more noise may be retained; the closer α is to 0, the greater the weight of the previous smoothed value, the more obvious the smoothing effect, the more gentle the data change, but the response speed to data changes will slow down. The determination of α can be determined according to the actual presentation effect of the ambient light or user feedback, and is not limited here. When dynamically adjusting the color of the ambient light according to the audio signal, the energy change of the audio signal may cause frequent color mutations, giving people a visually uncomfortable feeling. However, in the embodiments of the present invention, by smoothing the RGB color channel values, the change of the ambient light color can be made more gentle and natural, achieving a smooth transition effect.

[0090] Step S6054: Determine the spectral centroid according to the spectral energy value, and determine the color change rate according to the spectral centroid.

[0091] Specifically, in the embodiments of the present invention, in order to make the color change rate adapt to the rhythm of the music corresponding to the audio signal, the spectral centroid of the audio signal is determined according to the spectral energy value E[k], so as to adjust the color change rate of the LED lit by the ambient light. Among them, the spectral centroid, also known as the spectral center of mass, is used to reflect the frequency distribution center of the signal and is often used to describe perceptual attributes such as the brightness or sharpness of the audio. The calculation formula is as follows:

[0092]

[0093] In some optional embodiments, in the embodiments of the present invention, according to the above frequency band division results, the value range of the spectral centroid is divided, that is, different frequency bands are corresponding to different value ranges, and a corresponding color change rate is defined for each interval range. For example, the higher the spectral centroid, the more high-frequency components the audio signal has, the brighter and sharper the sound is, and a faster color change rate can be set; the lower the spectral centroid, the more low-frequency components the audio signal has, the lower and softer the sound is, and a slower color change rate can be set. Specifically, it can be determined according to the actual presentation effect of the ambient light or user feedback, and is not limited here.

[0094] The control method of the ambient light provided by the present invention determines the spectral energy value by performing spectral analysis on the acquired audio signal, calls the pre-encapsulated flowing water animation service according to the spectral energy value, and controls the ambient light based on the flowing water animation service, so that the ambient light lights up the corresponding light-emitting units according to the preset animation effect. By pre-encapsulating the flowing water animation service, the present invention can control the length of the ambient light, adjust the flowing water effect of the ambient light in real time according to the music rhythm, and at the same time pre-encapsulate the length control as an SOA service corresponding to the music rhythm, which can improve the reusability, scalability and flexibility of the ambient light control, and create an immersive in-vehicle atmosphere experience for users.

[0095] In this embodiment, a control device for an ambient light is further provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0096] This embodiment provides a control device for an ambient light, as Figure 7 shown, including:

[0097] An information processing module 701, configured to acquire an audio signal, perform spectral analysis on the audio signal, and determine the spectral energy value of the audio signal.

[0098] A service invocation module 702, configured to call a pre-encapsulated flowing water animation service according to the spectral energy value.

[0099] A lighting control module 703, configured to control the ambient light based on the flowing water animation service, so that the ambient light lights up the corresponding light-emitting units according to the preset animation effect.

[0100] In some alternative implementation manners, the device further includes:

[0101] A brightness control module, configured to determine a target brightness value according to the spectral energy value, so that the light-emitting unit adjusts its brightness according to the target brightness value.

[0102] A color control module, configured to perform color mapping according to the spectral energy value, determine a target color value and a color change rate, so that the light-emitting unit adjusts its color according to the target color value and the color change rate.

[0103] In some alternative implementation manners, the device further includes: a service encapsulation module, configured to segment the ambient light according to a preset percentage range, determine the target light-emitting units; encapsulate the flowing water animation service based on the target light-emitting units, and allocate service interfaces for the flowing water animation service.

[0104] In some alternative embodiments, the service call module 702 includes:

[0105] A first normalization unit, configured to normalize the spectral energy value according to a preset percentage range to obtain a normalized spectral energy value.

[0106] A service determination unit, configured to determine a flowing water animation service corresponding to the percentage equal to that of the normalized spectral energy value, and call the service interface of the flowing water animation service.

[0107] In some alternative embodiments, the brightness control module includes:

[0108] A second normalization unit, configured to normalize the spectral energy value according to a preset percentage range to obtain a normalized spectral energy value.

[0109] A brightness determination unit, configured to divide the brightness of the light emitting unit according to a preset percentage range, and determine a target brightness value corresponding to the percentage equal to that of the normalized spectral energy value.

[0110] In some alternative embodiments, the color control module includes:

[0111] An integrated energy calculation unit, configured to calculate an integrated energy value of the audio signal within a preset frequency band according to the spectral energy value.

[0112] A third normalization unit, configured to normalize the integrated energy value according to a preset color value range to obtain a normalized frequency band energy value.

[0113] A color determination unit, configured to perform color mapping according to the normalized frequency band energy value to determine a target color value, and perform color smoothing processing according to the target color value and the current color value.

[0114] A rate calculation unit, configured to determine a spectral centroid according to the spectral energy value, and determine a color change rate according to the spectral centroid.

[0115] The further function descriptions of the above-mentioned various modules and units are the same as those in the corresponding foregoing embodiments, and will not be elaborated herein.

[0116] The control device of the atmosphere lamp in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0117] This embodiment of the present invention further provides a computer device having the Figure 7 control device of the atmosphere lamp as shown above.

[0118] Please refer to Figure 8 , Figure 8 which is a schematic structural diagram of a computer device provided by an alternative embodiment of the present invention. As Figure 8 shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system). Figure 8 In

[0119] FIG. 9, one processor 10 is taken as an example.

[0120] The processor 10 can be a central processing unit, a network processor, or a combination thereof. Among them, the processor 10 can further include a hardware chip. The above hardware chip can be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above programmable logic device can be a complex programmable logic device, a field-programmable gate array, a general array logic, or any combination thereof.

[0121] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiments.

[0122] The memory 20 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the computer device. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 can optionally include a memory remotely set relative to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and a combination thereof.

[0122] The memory 20 can include a volatile memory, such as a random access memory; the memory can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state drive; the memory 20 can also include a combination of the above types of memories.

[0123] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0124] An embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiment is implemented.

[0125] A part of the present invention can be applied as a computer program product, for example, computer program instructions. When executed by a computer, through the operation of the computer, the methods and / or technical solutions according to the present invention can be called or provided. Those skilled in the art should be able to understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible by the computer.

[0126] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A control method for an ambient light, characterized in that, The ambient light is composed of a preset number of light-emitting units, and the method includes: Obtain an audio signal, perform spectral analysis on the audio signal, and determine the spectral energy value of the audio signal; Call a pre-encapsulated flowing water animation service according to the spectral energy value; Control the ambient light based on the flowing water animation service, so that the ambient light lights up the corresponding light-emitting units according to a preset animation effect.

2. The method according to claim 1, characterized in that After controlling the ambient light based on the flowing water animation service so that the ambient light lights up the corresponding light-emitting units according to a preset animation effect, it further includes: Determine a target brightness value according to the spectral energy value, so that the light-emitting units adjust their brightness according to the target brightness value; And / or, perform color mapping according to the spectral energy value to determine a target color value and a color change rate, so that the light-emitting units adjust their color according to the target color value and the color change rate.

3. The method according to claim 1, characterized in that The encapsulation process of the flowing water animation service includes: Segment the ambient light according to a preset percentage range to determine target light-emitting units; Encapsulate the flowing water animation service based on the target light-emitting units and allocate a service interface for the flowing water animation service.

4. The method according to claim 3, characterized in that, The step of calling a pre-encapsulated flowing water animation service according to the spectral energy value includes: Normalize the spectral energy value according to a preset percentage range to obtain a normalized spectral energy value; Determine the flowing water animation service corresponding to the percentage equal to the normalized spectral energy value, and call the service interface of the flowing water animation service.

5. The method according to claim 2, characterized in that The step of determining a target brightness value according to the spectral energy value so that the light-emitting units adjust their brightness according to the target brightness value includes: Normalize the spectral energy value according to a preset percentage range to obtain a normalized spectral energy value; Divide the brightness of the light-emitting units according to a preset percentage range, and determine a target brightness value corresponding to the percentage equal to the normalized spectral energy value.

6. The method according to claim 2, characterized in that The step of performing color mapping according to the spectral energy value to determine a target color value and a color change rate so that the light-emitting units adjust their color according to the target color value and the color change rate includes: Calculate the comprehensive energy value of the audio signal within a preset frequency band according to the spectral energy value; Normalize the comprehensive energy value according to a preset color value range to obtain a normalized frequency band energy value; Perform color mapping according to the normalized frequency band energy value to determine a target color value, and perform color smoothing processing according to the target color value and the current color value; Determine the spectral centroid according to the spectral energy value, and determine the color change rate according to the spectral centroid.

7. A control device for an ambient light, characterized in that, The ambient light is composed of a preset number of light-emitting units, and the device includes: An information processing module, configured to obtain an audio signal, perform spectral analysis on the audio signal, and determine the spectral energy value of the audio signal; A service calling module, configured to obtain an audio signal, perform spectral analysis on the audio signal, and determine the spectral energy value of the audio signal; A lighting control module, configured to obtain an audio signal, perform spectral analysis on the audio signal, and determine the spectral energy value of the audio signal.

8. A computer device, characterized in that, Includes: A memory and a processor, which are communicatively connected to each other. Computer instructions are stored in the memory, and the processor executes the computer instructions to execute the control method of the ambient light according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, Computer instructions are stored on the computer-readable storage medium, and the computer instructions are used to cause a computer to execute the control method of the ambient light according to any one of claims 1 to 6.

10. A computer program product, characterized in that, It includes computer instructions, and the computer instructions are used to cause a computer to execute the control method of the ambient light according to any one of claims 1 to 6.