A method, device, equipment and medium for processing the rhythm of atmosphere light
By acquiring and analyzing human voice audio and music audio data in real time, generating energy value data, and adjusting the brightness and flicker of vehicle ambient lights in real time, it solves the problem that existing vehicle ambient lights cannot achieve rhythm and realizes an interactive music and light show effect. .
Patent Information
- Application Number
- CN202211194119.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-09-28
AI Technical Summary
Existing vehicle-mounted atmosphere lights cannot collect human voices and background music in real time, cannot realize interactive music and light shows, and cannot realize the rhythm of vehicle-mounted atmosphere lights.
Through real-time acquisition of human voice audio data and music audio data, spectrum analysis processing is performed, frequency data is generated, and the working status of the ambient light is adjusted in real time according to the energy value data, including obtaining sound data, performing spectrum analysis, generating energy value data, and passing The controller adjusts the brightness and flicker of the light.
It realizes the real-time rhythm of in-vehicle ambient lights, meets the needs of interactive music and light shows, and enhances the interactivity and fun of in-car ambient lights.
Smart Images

Figure CN115696699B
Abstract
Description
Technical Field
[0001] The present application relates to the field of atmosphere lighting, and in particular to a method, device, equipment and medium for processing the rhythm of an atmosphere lighting. Background Art
[0002] Ambient lights, also known as LED ambient lights, are a perfect choice for theme parks, hotels, homes, exhibitions, businesses, and art lighting, creating the atmosphere people need for their lives. With the improvement of living standards, more and more users choose to install vehicle ambient lights in their vehicles. Existing vehicle ambient lights cannot meet the needs of interactive music light shows, and cannot collect human voices and background music in real time to achieve the rhythm of vehicle ambient lights. Summary of the invention
[0003] In view of the above-mentioned shortcomings of the prior art, the present invention provides a method, device, equipment and medium for processing the rhythm of an ambient light. The present invention can collect human voice and background music in real time to realize the rhythm of the vehicle-mounted ambient light.
[0004] The present invention provides a method for processing the rhythm of an atmosphere light, the method comprising:
[0005] Acquiring sound data in real time, wherein the sound data includes human voice audio data and music audio data;
[0006] Performing spectrum analysis on the sound data to generate corresponding frequency data;
[0007] generating energy value data according to the frequency data;
[0008] The controller adjusts the working state of the atmosphere light in real time based on the energy value data.
[0009] In one embodiment of the present invention, the step of acquiring sound data in real time includes:
[0010] Get human voice audio data in real time;
[0011] Get music audio data in real time;
[0012] The human voice audio data and the music audio data are integrated and processed to generate sound data.
[0013] In one embodiment of the present invention, the step of integrating the human voice audio data and the music audio data to generate sound data includes:
[0014] Converting the vocal audio data and the music audio data into audio files of the same format;
[0015] The segmentation unit segments the audio file of the human voice audio data and the audio file of the music audio data using a preset data value to generate corresponding segmentation files;
[0016] The split files are encrypted and merged for storage to generate sound data.
[0017] In one embodiment of the present invention, the step of performing spectrum analysis on the sound data to generate corresponding frequency data includes:
[0018] Sampling the sound data to generate a byte array, wherein the byte array includes a plurality of sampling values;
[0019] The sampling values are subjected to spectrum analysis processing to generate corresponding frequency data.
[0020] In one embodiment of the present invention, the step of generating energy value data according to the frequency data includes:
[0021] Obtain benchmark data based on the value range of the byte array;
[0022] Sorting the frequency data to obtain maximum frequency data;
[0023] The reference data and the maximum frequency data are normalized to generate corresponding energy value data.
[0024] In one embodiment of the present invention, the step of normalizing the reference data and the maximum frequency data to generate corresponding energy value data includes:
[0025] If the maximum frequency data is less than the reference data, dividing the maximum frequency data by the reference data to obtain energy value data;
[0026] If the maximum frequency data is greater than or equal to the reference data, a preset first value is used as the energy value data.
[0027] In one embodiment of the present invention, the step of the controller adjusting the working state of the atmosphere light in real time based on the energy value data includes:
[0028] The vehicle computer sends the energy value data to the controller via the SOA gateway and Ethernet;
[0029] The controller adjusts the brightness and flickering of the atmosphere light in real time according to the energy value data.
[0030] The present invention also provides a device for processing the rhythm of an atmosphere light, comprising:
[0031] A data acquisition module, used for acquiring sound data in real time, wherein the sound data includes human voice audio data and music audio data;
[0032] A data analysis module, used for performing spectrum analysis on the sound data to generate corresponding frequency data;
[0033] A data conversion module, used to generate energy value data according to the frequency data; and
[0034] A lighting adjustment module is used to adjust the working state of the atmosphere light in real time based on the energy value data.
[0035] The present invention also provides a sub-device, the electronic device comprising:
[0036] one or more processors;
[0037] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the electronic device implements the method for processing the rhythm of the atmosphere light.
[0038] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the method for processing the rhythm of the atmosphere light.
[0039] The beneficial effects of the present invention are as follows: real-time collection of human voice and background music realizes the rhythm of vehicle-mounted atmosphere lights to meet the needs of interactive music light shows.
[0040] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0042] Figure 1 is a schematic diagram of an implementation environment of a method for processing the rhythm of an ambient light, shown in an exemplary embodiment of the present application;
[0043] Figure 2 is a flow chart of a method for processing the rhythm of an ambient light, shown in an exemplary embodiment of the present application;
[0044] Figure 3 yes Figure 2Step S210 in the illustrated embodiment is a flow chart in an exemplary embodiment;
[0045] Figure 4 yes Figure 3 Step S330 in the illustrated embodiment is a flow chart in an exemplary embodiment;
[0046] Figure 5 yes Figure 2 Step S220 in the illustrated embodiment is a flow chart in an exemplary embodiment;
[0047] Figure 6 yes Figure 2 Step S230 in the illustrated embodiment is a flow chart in an exemplary embodiment;
[0048] Figure 7 yes Figure 6 Step S630 in the illustrated embodiment is a flow chart in an exemplary embodiment;
[0049] Figure 8 yes Figure 2 Step S240 in the illustrated embodiment is a flow chart in an exemplary embodiment;
[0050] Fig. 9 is a block diagram of a device for processing the rhythm of an ambient light, shown in an exemplary embodiment of the present application;
[0051] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0052] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0053] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0054] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0055] Figure 1 FIG. 1 is a schematic diagram of an implementation environment of a method for processing the rhythm of an ambient light according to an exemplary embodiment of the present application. Figure 1 As shown, the sound data can be obtained in real time through the intelligent terminal 110, wherein the sound data includes human voice audio data and music audio data, and the sound data is subjected to spectrum analysis processing to generate corresponding frequency data, and energy value data is generated according to the frequency data. The light controller adjusts the working state of the atmosphere light in real time based on the energy value data. Figure 1 The smart terminal 110 shown can be any terminal device that supports the installation of driving record software, such as a smart phone, a car computer, a tablet computer, a laptop computer, or a wearable device, but is not limited thereto. Figure 1 The server 120 shown is a server, for example, it can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms, which are not limited here. The intelligent terminal 110 can communicate with the server 120 through wireless networks such as 3G (third generation mobile information technology), 4G (fourth generation mobile information technology), and 5G (fifth generation mobile information technology), and this is not limited here. Because the current vehicle-mounted atmosphere lights cannot collect human voices and background music in real time to realize the rhythm of vehicle-mounted atmosphere lights. To solve these problems, the embodiments of the present application respectively propose a method for processing the rhythm of an atmosphere light, a device for processing the rhythm of an atmosphere light, an electronic device, a computer-readable storage medium, and a computer program product, and these embodiments will be described in detail below.
[0056] See also Figure 2 , Figure 2 is a flowchart of a method for processing the rhythm of an ambient light, shown in an exemplary embodiment of the present application. The method can be applied to Figure 1The implementation environment shown is specifically executed by the smart terminal 110 in the implementation environment. It should be understood that the method can also be applied to other exemplary implementation environments and be specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment to which the method is applicable.
[0057] like Figure 2 In an exemplary embodiment, the method for processing the rhythm of the ambient light includes at least steps S210 to S240, which are described in detail as follows:
[0058] Step 210: Acquire sound data in real time, wherein the sound data includes human voice audio data and music audio data;
[0059] Step S220, performing spectrum analysis on the sound data to generate corresponding frequency data;
[0060] Step S230, generating energy value data according to the frequency data;
[0061] Step S240: The controller adjusts the working state of the atmosphere light in real time based on the energy value data.
[0062] like Figure 3 In an exemplary embodiment, when step S210 is executed, sound data is acquired in real time, wherein the sound data includes human voice audio data and music audio data. Specifically, step S210 may include the following steps:
[0063] Step S310, acquiring human voice audio data in real time;
[0064] Step S320, acquiring music audio data in real time;
[0065] Step S330: Integrate the human voice audio data and the music audio data to generate sound data.
[0066] In an exemplary embodiment, when step S310 is executed, human voice audio data is obtained in real time. Specifically, when the processing method is applied to the vehicle-mounted atmosphere light, a microphone socket can be reserved on the vehicle computer, and then the central control vehicle computer can be connected through a pluggable microphone to collect human voices and obtain human voice audio data in real time. Among them, the vehicle computer refers to the abbreviation of the vehicle-mounted infotainment product installed in the car. The vehicle computer can functionally realize information communication between people and cars, and cars and the outside world (cars and cars). When the processing method is applied to scenes such as theme parks, hotels, homes, exhibitions, commercial and artistic lighting, human voices can also be collected through a microphone to obtain human voice audio data in real time.
[0067] In an exemplary embodiment, when step S320 is executed, music audio data is obtained in real time. Specifically, the mobile phone can transmit the played music to the car computer via Bluetooth for playback, and then the car computer can play the music in the app on the mobile phone. It is also possible to play music through the music software that comes with the car computer. When it is necessary to obtain music audio data in real time, the sound of the music played outside the car computer can be collected through a microphone to obtain music audio data in real time, or the music being played can be directly decoded in real time through the software inside the car computer to obtain music audio data in real time.
[0068] like Figure 4 As shown, when step S330 is executed, the human voice audio data and the music audio data are integrated and processed to generate sound data. Specifically, step S330 may include the following steps:
[0069] Step S410, converting the human voice audio data and the music audio data into audio files of the same format;
[0070] Step S420, using a preset data value as a segmentation unit to segment the audio file of the human voice audio data and the audio file of the music audio data to generate corresponding segmentation files;
[0071] Step S430: encrypt the divided files and merge them for storage to generate sound data.
[0072] In an exemplary embodiment, when executing step S410, step S420 and step S430, after acquiring the human voice audio data and the music audio data in real time, since the human voice audio data and the music audio data are acquired synchronously, the human voice audio data and the music audio data need to be integrated for subsequent processing. When integrating the human voice audio data and the music audio data, the human voice audio data and the music audio data to be merged can be first converted into audio files of the same format, and the human voice audio data and the music audio data are segmented by a segmentation unit with a preset data value, and the audio file blocks obtained by segmentation are encrypted and then merged and stored in the sound data. At this time, the human voice audio data and the music audio data have been synchronously integrated into the sound data.
[0073] like Figure 5 In an exemplary embodiment, when step S220 is executed, the sound data is subjected to spectrum analysis to generate corresponding frequency data. Specifically, step S220 may include the following steps:
[0074] Step S510: Sample the sound data to generate a byte array, where the byte array includes multiple sampling values, and the size of the sampling value is represented by 2 n , n is a positive integer;
[0075] Step S520: Perform spectrum analysis on the sampled values to generate corresponding frequency data. The frequency data s is represented as
[0076] In an exemplary embodiment, when step S510 is executed, the sound data is sampled and processed to generate a byte array, wherein the byte array includes multiple sampling values. Specifically, after the sound data is obtained, it can be sampled and processed by the vehicle computer. Sound sampling refers to the number of samples of the analog signal by the recording device per unit time. The higher the sampling frequency, the more real and natural the waveform of the mechanical wave is. Sound sampling is the process of converting analog audio into digital audio. The main equipment used is the analog to digital converter (ADC, corresponding to which is the digital to analog converter, DAC). The sampling process actually converts the electrical signal of the usual analog audio signal into binary codes 0 and 1, and these 0 and 1 constitute the digital audio file. The greater the sampling frequency, the more guaranteed the sound quality. Before sound sampling, the sampling value needs to be set in order to process the sound data. The size of the sampling value is 2 to the power of n, expressed as 2 n , n is a positive integer, for example, it can be 128, 256, 512, 1024, 2048, etc. After setting the sampling value, you need to return a byte array. Byte is the unit of information transmission over the network (or storage in the hard disk or memory). In ASCII code, an English letter (not case-sensitive) occupies one byte of space, a Chinese character occupies two bytes of space, English symbols and English punctuation occupies one byte, and Chinese punctuation occupies two bytes. For example, the English period "." occupies 1 byte, and the Chinese period "." occupies 2 bytes. A binary digital sequence, as a digital unit in the computer, is generally an 8-bit binary number, converted to decimal, with a minimum value of 0 and a maximum value of 255. For example, an ASCII code is a byte, and the conversion of such units is: 1KB (Kilobyte) = 1024B, 1MB (Megabyte, also known as "Mega") = 1024KB, 1GB (Gigabyte, also known as "Giga") = 1024MB.
[0077] In an exemplary embodiment, when step S520 is executed, the sampled value is subjected to spectrum analysis to generate corresponding frequency data, and the frequency data s is represented as: Specifically, the frequency data is of byte type and is placed in a byte array. The data in the byte array includes the DC component, real data, and imaginary data. Since the size of the sample value is a power of 2, as shown in the following table, Index can represent the number of the sample values in the byte array, starting from 0 until it reaches 2. n -1. Data can be represented as the DC component of frequency data, the real part of frequency data, and the imaginary part of frequency data. Index0 represents the DC component data, Rf represents the real part of frequency data, and Lf represents the imaginary part of frequency data.
[0078] Index 0 1 2 3 … <![CDATA[2 n -2]]> <![CDATA[2 n -1]]> Data Rf0 Rf(n / 2) Rf1 Lf1 … <![CDATA[Rf(2 n -1) / 2]]> <![CDATA[Lf(2 n -1) / 2]]>
[0079] In an exemplary embodiment, the sampling value of 128 is taken as an example for explanation. There are 128 data in the byte array, as shown in the following table, starting from sequence number 0 to sequence number 127, there are 128 data in total, and there are 1+1+(128-2) / 2=65 valid frequency data in total. The frequency data with sequence number 0 and sequence number 1 are both valid data. In addition, the remaining two adjacent frequency data are the real part and imaginary part of a valid data respectively. For example, the data with sequence number 2 is the real part data of the frequency data, the data with sequence number 3 is the imaginary part data of the frequency data, and the data with sequence number 2 and the data with sequence number 3 are integrated together as a valid data. For another example, the data with sequence number 4 is the real part data of the frequency data, the data with sequence number 5 is the imaginary part data of the frequency data, and the data with sequence number 4 and the data with sequence number 5 are integrated together as a valid data. By analogy, the data with sequence number 6 and the data with sequence number 7 are integrated together as a valid data, and the data with sequence number 8 and the data with sequence number 9 are integrated together as a valid data. The byte array with a sampling value of 128 has a total of 1+1+(128-2) / 2=57 valid frequency data. The byte array with a sampling value of 256 has a total of 1+1+(256-2) / 2=129 valid frequency data. n The byte array has 1+1+(2 n -2) / 2 valid frequency data. In order to calculate the valid frequency data, the real part and the corresponding imaginary part of the frequency data can be squared, added, and then squared. In simple terms, it is square modulo. For example, in order to calculate the third valid frequency data, the third and fourth data can be squared, added, and then squared, expressed as In order to calculate the fourth effective frequency data, the fifth and sixth data can be squared, added, and then squared, expressed as Similarly, in order to calculate the 57th effective frequency data, the 127th data and the 128th data can be squared, added, and then squared to express it as That is, the frequency data s is expressed as
[0080] Index 0 1 2 3 … 126 127 Data Rf0 Rf(n / 2) Rf1 Lf1 … Rf65 Lf65
[0081] like Figure 6 In an exemplary embodiment, when step S230 is executed, energy value data is generated according to the frequency data. Specifically, step S230 may include the following steps:
[0082] Step S610: Obtain reference data m according to the value range of the byte array, expressed as
[0083] Step S620: sort the frequency data to obtain the maximum frequency data s max ;
[0084] Step S630: normalize the reference data and the maximum frequency data to generate corresponding energy value data e, expressed as
[0085] In an exemplary embodiment, when step S610 is executed, the reference data is obtained according to the value range of the byte array. n Therefore, it is necessary to obtain the benchmark data so that the subsequent vehicle computer can convert the frequency data into the corresponding energy value data. The benchmark data can be calculated by the following formula. The benchmark data m is expressed as Take the example of 128 data in the byte array. The value range of the data in the byte array is -128 to 127, and the reference value is the maximum value. Therefore, the data of -128 needs to be taken for calculation, which is expressed as At this time, m is 181.019335984, and m is 181.
[0086] In an exemplary embodiment, when step S620 is executed, the frequency data is sorted to obtain the maximum frequency data. n The byte array has 1+1+(2 n -2) / 2 valid frequency data. After the effective frequency data is calculated, a value can be generated, and then the effective frequency data in the byte array can be sorted, and the largest effective frequency data can be extracted, which is represented as the maximum frequency data s max .
[0087] like Figure 7 In an exemplary embodiment, when step S630 is executed, the reference data and the maximum frequency data are normalized to generate corresponding energy value data. Specifically, step S630 may include the following steps:
[0088] Step S710: if the maximum frequency data is less than the reference data, the maximum frequency data is divided by the reference data to obtain energy value data;
[0089] Step S720: If the maximum frequency data is greater than or equal to the reference data, the preset first value is used as the energy value data.
[0090] In an exemplary embodiment, when executing step S710 and step S720, for a sampling value of 2 n For a byte array, when the maximum frequency data s is obtained max After comparing with the benchmark data m, the following formula can be used to calculate and obtain the corresponding energy value e, expressed as The preset first value may be 1.
[0091] like Figure 8 In an exemplary embodiment, when step S240 is executed, the controller adjusts the working state of the atmosphere light in real time based on the energy value data. Specifically, step S240 may include the following steps:
[0092] Step S810: The vehicle computer sends the energy value data to the controller via the SOA gateway and Ethernet;
[0093] Step S820: The controller adjusts the brightness and flickering of the ambient light in real time according to the energy value data.
[0094] In an exemplary embodiment, when executing step S810 and step S820, after the vehicle computer converts the sound data into corresponding energy value data, the vehicle computer can send the energy value data to the controller through the SOA gateway and Ethernet. After receiving the energy value data, the controller can control the operation of the ambient light in the vehicle in real time so that the ambient light can change accordingly with the change of the sound data. The virtual interface unit (VIU) controller can include a light controller and other controllers. The light controller can control the ambient lights inside and outside the vehicle, adjust the brightness and flickering of the ambient lights, and other controllers can control other functions of the vehicle.
[0095] Fig. 9 is a structural block diagram of an ambient light rhythm processing device shown in an exemplary embodiment of the present application. The device can be applied in Figure 1The exemplary processing device for the rhythm of the ambient light may include a data acquisition module 910, a data analysis module 920, a data conversion module 930, and a light adjustment module 940.
[0096] In an exemplary embodiment, the acquisition module 910 can be used to acquire sound data in real time, wherein the sound data includes human voice audio data and music audio data. Specifically, the acquisition module 910 can be specifically used to acquire human voice audio data in real time, acquire music audio data in real time, integrate and process human voice audio data and music audio data, and generate sound data. Among them, a microphone jack can be reserved on the car computer of the car, and then the central control car computer can be connected through a pluggable microphone to collect human voice and acquire human voice audio data in real time. The sound of the music played outside the car computer can be collected through the microphone, and then the music audio data can be acquired in real time. It is also possible to directly decode the music being played in real time through the software inside the car computer, and then acquire the music audio data in real time. The human voice audio data and the music audio data to be merged can be converted into audio files of the same format first, and the human voice audio data and the music audio data can be segmented with a pre-set data value as a segmentation unit. After the audio file blocks obtained by segmentation are encrypted, they are merged and stored in the sound data. At this time, the human voice audio data and the music audio data have been synchronously integrated into the sound data.
[0097] In an exemplary embodiment, the data analysis module 920 can be used to perform spectrum analysis on the sound data to generate corresponding frequency data. Specifically, the data analysis module 920 can be used to perform sampling on the sound data to generate a byte array, wherein the byte array includes multiple sampling values, and the size of the sampling value is represented by 2 n n is a positive integer. The sampled value is subjected to spectrum analysis to generate the corresponding frequency data. The frequency data s is expressed as Among them, the size of the sample value is 2 to the power of n, expressed as 2 n , n is a positive integer, such as 128, 256, 512, 1024, 2048, etc. The frequency data is of byte type and is placed in a byte array. The data in the byte array includes the DC component, real data, and imaginary data. Since the size of the sample value is 2 to the power of n, as shown in the following table, Index can represent the number of the sample values in the byte array, starting from 0 until it reaches 2. n-1. Data can be represented as the DC component of the frequency data, the real part of the frequency data, and the imaginary part of the frequency data. Index0 represents the DC component data, Rf represents the real part of the frequency data, and Lf represents the imaginary part of the frequency data. The sampling value is 2 n The byte array has 1+1+(2 n -2) / 2 valid frequency data. In order to calculate the effective frequency data, the real part and the corresponding imaginary part of the frequency data can be squared, added, and then squared. In simple terms, it is square modulus. The frequency data s is expressed as
[0098] In an exemplary embodiment, the data conversion module 930 can be used to generate energy value data according to the frequency data. Specifically, the data conversion module 930 can be used to obtain the reference data m according to the value range of the byte array, which is expressed as Sort the frequency data and get the maximum frequency data s max , normalize the benchmark data and the maximum frequency data to generate the corresponding energy value data e, expressed as Among them, since a byte array has 2 n Therefore, it is necessary to obtain the benchmark data so that the subsequent vehicle computer can convert the frequency data into the corresponding energy value data. The benchmark data can be calculated by the following formula. The benchmark data m is expressed as
[0099] In an exemplary embodiment, the lighting adjustment module 940 can be used to adjust the working state of the atmosphere light in real time based on the energy value data. After the vehicle computer converts the sound data into the corresponding energy value data, the vehicle computer can send the energy value data to the controller through the SOA gateway and Ethernet. After receiving the energy value data, the controller can control the operation of the atmosphere light in the car in real time so that the atmosphere light can change accordingly with the change of the sound data. The virtual interface unit (VIU) controller may include a lighting controller and other controllers. The lighting controller can control the atmosphere lights inside and outside the car, adjust the brightness and flickering of the atmosphere lights, and other controllers can control other functions of the entire vehicle.
[0100] It should be noted that the device for processing the rhythm of the ambient light provided in the above embodiment and the method for processing the rhythm of the ambient light provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here. In actual application, the device for processing the rhythm of the ambient light provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0101] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the processing method of the rhythm of the atmosphere light provided in the above-mentioned embodiments.
[0102] Fig.10 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig.10 The computer system 1000 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0103] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage part 1008 to the random access memory (RAM) 1003, such as executing the method described in the above embodiment. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, the ROM 1002 and the RAM 1003 are connected to each other through the bus 1004. The input / output (I / O) interface 1005 is also connected to the bus 1004.
[0104] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc., a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0105] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1009, and / or installed from a removable medium 1011. When the computer program is executed by a central processing unit (CPU) 1001, various functions defined in the system of the present application are executed.
[0106] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0107] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0108] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0109] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the method for processing the rhythm of the atmosphere light as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0110] Another aspect of the present application further provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method for processing the rhythm of the ambient light provided in each of the above embodiments.
[0111] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A method for processing the rhythm of an ambient light, characterized in that: The method comprises: Acquiring sound data in real time, wherein the sound data includes human voice audio data and music audio data; The sound data is sampled to generate a byte array, wherein the byte array includes a plurality of sampling values, and the size of the sampling value is expressed as 2 n , n is a positive integer; Perform spectrum analysis on the sampled values to generate corresponding frequency data s, Rf represents the real part of the frequency data, and Lf represents the imaginary part of the frequency data; According to the value range of the byte array, obtain the benchmark data m, Sort the frequency data to obtain the maximum frequency data s max ; The reference data and the maximum frequency data are normalized to generate corresponding energy value data e, which is expressed as If the maximum frequency data is less than the reference data, dividing the maximum frequency data by the reference data to obtain energy value data; If the maximum frequency data is greater than or equal to the reference data, a preset first value is used as the energy value data; The controller adjusts the working state of the atmosphere light in real time based on the energy value data.
2. The method for processing the rhythm of the ambient light according to claim 1, characterized in that: The step of acquiring sound data in real time comprises: Get human voice audio data in real time; Get music audio data in real time; The human voice audio data and the music audio data are integrated and processed to generate sound data.
3. The method for processing the rhythm of the ambient light according to claim 2, characterized in that: The step of integrating the human voice audio data and the music audio data to generate sound data comprises: Converting the vocal audio data and the music audio data into audio files of the same format; The segmentation unit segments the audio file of the human voice audio data and the audio file of the music audio data using a preset data value to generate corresponding segmentation files; The split files are encrypted and merged for storage to generate sound data.
4. The method for processing the rhythm of the ambient light according to claim 1, characterized in that: The step of the controller adjusting the working state of the atmosphere lamp in real time based on the energy value data comprises: The vehicle computer sends the energy value data to the controller via the SOA gateway and Ethernet; The controller adjusts the brightness and flickering of the atmosphere light in real time according to the energy value data.
5. A device for processing the rhythm of an ambient light, characterized in that: include: A data acquisition module, used for acquiring sound data in real time, wherein the sound data includes human voice audio data and music audio data; A data parsing module is used to sample the sound data and generate a byte array, wherein the byte array includes multiple sampling values, and the size of the sampling value is expressed as 2 n , n is a positive integer, the sampling value is subjected to spectrum analysis to generate corresponding frequency data s, Rf represents the real part of the frequency data, and Lf represents the imaginary part of the frequency data; The data conversion module is used to obtain the reference data m according to the value range of the byte array. Sort the frequency data to obtain the maximum frequency data s max , normalize the reference data and the maximum frequency data to generate corresponding energy value data e, expressed as If the maximum frequency data is less than the reference data, the maximum frequency data is divided by the reference data to obtain energy value data; if the maximum frequency data is greater than or equal to the reference data, a preset first value is used as the energy value data; and The lighting adjustment module is used to adjust the working state of the atmosphere light in real time based on the energy value data.
6. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the method for processing the rhythm of the ambient light as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the method for processing the rhythm of the ambient light according to any one of claims 1 to 4.
