Light effect rendering method and apparatus, light emitting device, and computer storage medium
By separating and storing lighting effect control information and loading and executing it in RAM, the problem of Flash storage capacity limitation is solved, enabling more diverse lighting rendering effects and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-04
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, lighting effect rendering programs are limited by Flash storage capacity, resulting in a limited number of lighting effects, monotonous styles, and a poor user experience.
By dividing the lighting effect control information into two parts, execution environment information and lighting effect control information, which are stored in Flash and other storage devices respectively, and loaded and executed in RAM, a pluggable execution environment is provided to control the lighting effect rendering of the light source.
It reduces the amount of Flash storage required, supports more diverse lighting rendering effects, and improves the user experience.
Smart Images

Figure CN116600451B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of light effect rendering, and in particular to a light effect rendering method and device, a light emitting apparatus, and a computer storage medium. BACKGROUND
[0002] A light emitting apparatus with a light effect rendering function can present different light effects by changing its light emitting mode, such as adjusting light superposition, color mixing, saturation, brightness, etc. The light emitting apparatus generally includes a light emitting component and a controller. The controller stores a light effect rendering program, which sets light emitting parameters of each light emitting point in the light emitting component at different time points. The controller loads and executes the code of different light effect rendering programs to make the light emitting component emit light according to the light emitting mode specified by the light effect rendering program, thereby controlling the light emitting component to produce different light effects.
[0003] However, the light effect rendering program is usually stored in the flash of the controller. Due to the limitation of the flash code storage capacity, the light effect rendering program that can be executed by the light effect rendering program is limited. How to reduce the limitation of flash storage capacity on light effects has become a problem to be solved. SUMMARY
[0004] In view of the above, it is necessary to provide a light effect rendering method, device, light emitting apparatus, and computer storage medium, which can reduce the limitation of flash storage capacity on light effects, support more diversified light rendering effects, and improve user experience.
[0005] In a first aspect, an embodiment of the present application provides a light effect rendering method.
[0006] A light effect rendering method is applied to a light strip control terminal, which communicates with a user terminal. The method comprises: obtaining light effect control information sent by the user terminal in response to a light effect triggering operation, the light effect control information being used to indicate light emitting parameters of a light emitting component; loading the light effect control information and importing pre-stored execution environment information to control the light emitting component to emit light according to the light emitting parameters.
[0007] Optionally, the execution environment information includes a pre-declared local variable, a pointer table first address of a light property function, and a color selection table first address of a color selection table; loading the light effect control information and importing the pre-stored execution environment information includes: loading the light effect control information and importing the pre-stored local variable, the pointer table first address, and the color selection table first address.
[0008] Optionally, the execution environment information includes a pre-declared local variable, a pointer table first address of a light attribute function, a color table first address of a color table, and a memory space address with global attributes, the memory space address being used to indicate a state quantity of historical light effect rendering; the light effect control information is loaded, and the pre-stored execution environment information is imported, including: the light effect control information is loaded, and the pre-stored local variable, the pointer table first address, the color table first address, and the memory space address are imported.
[0009] Optionally, the method further includes: obtaining a linking script, the linking script being used to plug in the light effect control information; compiling the linking script to determine an execution address of the light effect control information in the memory; and loading the light effect control information, including: loading the light effect control information into the execution address for execution.
[0010] Optionally, the method further includes: the user terminal downloading the light effect control information and sending the light effect control information to the light strip control terminal in response to a light effect triggering operation of a user interface.
[0011] Optionally, the user terminal downloading the light effect control information includes: the user terminal downloading the light effect control information from an updatable light effect database.
[0012] In a second aspect, embodiments of the present application provide a light effect rendering method.
[0013] A light effect rendering method is applied to a user terminal, the user terminal being in communication with a light strip control terminal, and the method includes: downloading light effect control information in response to a light effect triggering operation, the light effect control information being used to indicate a light emitting parameter of a light emitting piece; sending the light effect control information to the light strip control terminal; and loading the light effect control information by the light strip control terminal and importing pre-stored execution environment information to control the light emitting piece to emit light according to the light emitting parameter.
[0014] In a third aspect, embodiments of the present application provide a light effect rendering device.
[0015] A light effect rendering device is applied to a light strip control terminal, the light strip control terminal being in communication with a user terminal, and the device includes: a parameter acquisition module, configured to acquire light effect control information sent by the user terminal in response to a light effect triggering operation, the light effect control information being used to indicate a light emitting parameter of a light emitting piece; and a program execution module, configured to load the light effect control information and import pre-stored execution environment information to control the light emitting piece to emit light according to the light emitting parameter.
[0016] In a fourth aspect, embodiments of the present application provide a light emitting device.
[0017] A light emitting device includes: a light emitting piece; a controller; and a storage, configured to store executable instructions of a light strip control terminal, the controller being configured to execute the executable instructions to implement a method according to any one of the above technical solutions.
[0018] In a fifth aspect, an embodiment of the present application provides a computer storage medium.
[0019] A computer storage medium is provided for storing program code executed by a device, the program code being used to implement the method of any of the above technical solutions.
[0020] The lamp effect rendering method, device, light emitting device and computer storage medium provided by the embodiments of the present application reduce the occupation of the lamp effect control information on the Flash code storage capacity, and at the same time, release the restriction of the Flash code storage capacity on the lamp effect control information, so as to provide sufficient lamp effect control information for the lamp strip control terminal to load, so that the light emitting device can support more diversified light rendering effects, and the user experience is improved. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 is a structural schematic diagram of a light emitting device of an embodiment of the present application.
[0022] Figure 2 is a connection schematic diagram of a light emitting device and a user terminal of an embodiment of the present application.
[0023] Figure 3 is a first flow schematic diagram of a lamp effect rendering method of an embodiment of the present application.
[0024] Figure 4 is a second flow schematic diagram of a lamp effect rendering method of an embodiment of the present application.
[0025] Figure 5 is a third flow schematic diagram of a lamp effect rendering method of an embodiment of the present application.
[0026] Figure 6 is a fourth flow schematic diagram of a lamp effect rendering method of an embodiment of the present application.
[0027] Figure 7 is a fifth flow schematic diagram of a lamp effect rendering method of an embodiment of the present application.
[0028] Figure 8 is a principle schematic diagram of a compilation link script of an embodiment of the present application.
[0029] Figure 9 is a sixth flow schematic diagram of a lamp effect rendering method of an embodiment of the present application.
[0030] Figure 10 is a module schematic diagram of a lamp effect rendering device of an embodiment of the present application.
[0031] MAIN ELEMENT SYMBOL EXPLANATION
[0032]
[0033] The following detailed description will further describe the present application with reference to the above-mentioned accompanying drawings. DETAILED DESCRIPTION
[0034] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of the present application.
[0035] The term “and / or” in the present application is a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In this paper, the symbol “ / ” represents the relationship of or, for example, A / B represents A or B.
[0036] In the description of the embodiments of the present application, the words “exemplary” or “for example” are used to mean serving as an example, instance, or illustration. Any embodiment or design solution described as “exemplary” or “for example” in the embodiments of the present application should not be interpreted as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of “exemplary” or “for example” is intended to present relevant concepts in a concrete manner.
[0037] With the development of light technology, people's requirements for the diversification of light effects are getting higher and higher. The light effect refers to the light effect presented by light by adjusting the parameters of light. The most common light effect rendering control method is to control the change of the RGB value of light. The RGB value of light refers to the brightness value corresponding to the color of light. The color of the lamp tube includes red (R), green (G) and blue (B), and the specified color is obtained by mixing the three colors of red, green and blue in different proportions. By controlling the RGB value of the light, the superposition of color light, color mixing, saturation and brightness can be adjusted, so as to present different light effects.
[0038] At the program execution level, the light effect rendering control method is implemented through a light effect rendering control function, which is stored in the Flash (Flash Memory) of the light strip controller. When the light strip needs to emit light according to the specified light effect, the light strip controller calls the light effect rendering control function from the Flash and loads it for execution in the RAM (Random Access Memory).
[0039] However, due to the limitation of the flash code storage capacity, it is difficult to store enough light effect rendering control functions, and therefore, the number of light effects supported by the light strip controller is small and the style is monotonous, which is difficult to meet the user's use demand, resulting in poor user experience.
[0040] To this end, the embodiment of the present application provides a light effect rendering method and device, a light emitting device and a computer storage medium, which can reduce the occupation of light effect rendering control functions to the flash code storage capacity, support more light effect rendering control functions, provide more diversified light effects, and improve the user experience.
[0041] Please refer to Figure 1 , which shows the structure schematic diagram of the light emitting device provided by the embodiment of the present application.
[0042] The light emitting device includes a light emitting part 1 and a light strip control terminal 2. The light emitting part 1 is electrically connected to the light strip control terminal 2, for example, through a cable.
[0043] In a specific embodiment, the light emitting part 1 can be a light strip, a display screen or other electronic devices. The light emitting part 1 includes a plurality of light emitting elements, each of which can independently emit light of different colors.
[0044] In a specific embodiment, the light strip control terminal 2 is used to control the plurality of light emitting elements in the light emitting part 1 to emit light according to the specified RGB value at the specified time point when the specified light effect rendering function is loaded, so as to perform light effect rendering and obtain the corresponding light effect.
[0045] Specifically, the light strip control terminal 2 can store data information through Flash, and import and deliver the data information when needed.
[0046] In the embodiment, the light effect rendering function is divided into two parts. One part is the execution environment information, which is the necessary data information for executing the light effect rendering function, for example, local variables, the pointer table first address of the light attribute function, the color selection table first address of the color selection table and the memory space address with global attributes, etc. The execution environment information is stored in the Flash. The other part is the light effect control information, which is the data information for actually controlling the light effect change by changing the corresponding parameters of the light emitting part 1, for example, the RGB value of the light emitting element at the specified time point. The light effect control information is stored in other storage devices of the Flash other than the light strip control terminal 2, such as hardware storage devices, cloud servers, etc.
[0047] When the light strip control terminal 2 needs to control the light emitting part 1 to emit light according to the specified light effect, the light effect control terminal needs to first obtain the light effect control information corresponding to the light effect, then call the light effect control information to load in the RAM, and pass the execution environment information during the loading process to provide a plug-in execution environment for the light effect rendering function, and then control the light emitting part 1 to emit light according to the specified light effect.
[0048] The above technical solution reduces the occupation of the light effect control information to the Flash code storage capacity, and at the same time liberates the limitation of the Flash code storage capacity to the light effect control information, so as to provide sufficient light effect control information for the light strip control terminal 2 to use, so that the light emitting device can support more diversified light rendering effects, and improve the user experience.
[0049] Please refer to Figure 2 , which shows the connection schematic diagram of the light emitting device and the user terminal 3 provided by an embodiment of the present application.
[0050] The user terminal 3 is in communication connection with the light emitting device. The user terminal 3 is in communication connection with the light strip control terminal 2. The user terminal 3 is used to obtain the light effect control information and send it to the light strip control terminal 2. The communication connection between the user terminal 3 and the light strip control terminal 2 can be in the form of Bluetooth connection, WIFI connection, local area network connection, network connection, etc.
[0051] In the embodiment, the light effect control information is stored in the light effect database in the form of a bin file, and the light effect database is a cloud server database. The user terminal 3 downloads the light effect control information from the light effect database and sends it to the light strip control terminal 2.
[0052] Specifically, the user terminal 3 has an operation page, and a plurality of light effect preview icons are displayed in the operation page. The icon can be a dynamic icon. Each light effect preview icon corresponds to a light effect control information, and the light effect preview icon is used to show the preview effect of the light effect corresponding to the light effect control information. The user can view the corresponding light effect through the light effect preview icon in the operation page.
[0053] When the user selects the corresponding light effect preview icon in the operation page, i.e. touches the light effect preview icon or presses the specified key, the user terminal 3 detects the light effect trigger operation of the operation page. The user terminal 3 will download the corresponding light effect control information in response to the light effect trigger operation of the operation page, and send the light effect control information to the light strip control terminal 2 to control the light emitting part 1 to emit light according to the specified light effect.
[0054] In a specific embodiment, the data in the light effect database can be updated. The light effect designer or developer can add light effect control information to the light effect database, or update or upgrade the light effect control information in the light effect database by uploading light effect control information to the light effect database, thereby updating the light effects supported by the light strip control terminal 2.
[0055] It can be understood that the user terminal 3 includes but is not limited to a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, and a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device, and / or a smart city device, and the present embodiment does not make special limitations thereto.
[0056] Please refer to Figure 3 , which shows a flowchart of the light effect rendering method provided by the present embodiment.
[0057] The light effect rendering method can be applied to the light strip control terminal 2 described in any of the above embodiments, and the light strip control terminal 2 can implement the light effect rendering method by executing pre-stored executable instructions. The light effect rendering method includes the following steps.
[0058] S301, acquiring light effect control information.
[0059] The light effect control information is a light effect rendering control function file, and the light effect control information is used to indicate the light emitting parameters of the light emitting piece 1. The light emitting parameters include the RGB values of the light emitting piece 1 in a preset time sequence, and the time sequence is composed of a plurality of time points.
[0060] In the present embodiment, the light effect control information is information sent by the user terminal 3 to the light strip control terminal 2 in response to a light effect triggering operation.
[0061] S302, loading the light effect control information and importing pre-stored execution environment information.
[0062] The light strip control terminal 2 calls the light effect control information, loads and executes it in the RAM, and passes the execution environment information pre-stored in the Flash to provide a plug-in execution environment for the light effect control information, thereby controlling the light emitting piece 1 to emit light according to the light emitting parameters.
[0063] In the embodiment, the execution environment information includes function data information necessary for executing the lamp effect control information.
[0064] Please refer to Figure 4 In one embodiment, the execution environment information includes pre-declared local variables, a pointer table first address of a light attribute function, and a color table first address of a color table.
[0065] The light attribute function is a pre-set API function, such as a lamp control data refreshing function, a lamp control timing function, etc. The light attribute function is stored in the pointer. When the lamp effect control information is loaded and executed, the imported pointer table first address is passed to obtain the corresponding light attribute function, so that the light emitting member 1 can work normally.
[0066] The color table stores rich RGB values. When the lamp effect control information is loaded and executed, the imported color table first address of the color table is passed to obtain the RGB values in the color table, so that the light emitting member 1 can emit light according to the specified RGB values.
[0067] For example, the code of the execution environment information can be:
[0068] void Render_Func(uint* api_table_ptr,Color* color_table,uint)
[0069] The api_table is the pointer table first address, and the color_table is the color table first address.
[0070] It can be understood that the step S302 specifically comprises: loading the lamp effect control information, and importing the pre-stored local variables, the pointer table first address, and the color table first address.
[0071] Please refer to Figure 5 In another embodiment, in addition to the pre-declared local variables, the pointer table first address of the light attribute function, and the color table first address of the color table, the execution environment information also includes a memory space address with global attributes. The memory space address is used to indicate the state quantity of the historical lamp effect rendering. The storage unit corresponding to the memory space address saves the state quantity in the last rendering process.
[0072] Since the memory space address has global attributes, after each lamp effect rendering is completed, the memory space address will not be automatically erased after the point is dropped, thereby retaining the state quantity before the lamp effect rendering is completed. When the next lamp effect rendering starts, the memory space address can be used to pass the state quantity or rendering control parameter in the last rendering process, so that the lamp effect rendering can be continued according to the progress of the last lamp effect rendering.
[0073] For example, the code of the execution environment information can be:
[0074] void Render_Func(uint* api_table_ptr,Color* color_table,uint* global_mem)
[0075] Wherein, the api_table is the pointer table address, the color_table is the color table address, and the global_mem is the memory space address.
[0076] It can be understood that the step S302 specifically comprises: loading the light effect control information, and importing the pre-stored local variable, the pointer table address, the color table address and the memory space address.
[0077] Please refer to Figure 6 In a specific embodiment, the light effect rendering method further comprises the following steps.
[0078] S601, the user terminal 3 responds to the light effect trigger operation of the user interface, downloads the light effect control information and sends it to the light strip control terminal 2.
[0079] Specifically, the user terminal 3 downloads the light effect control information from the updatable light effect database.
[0080] Please refer to Figure 7 and Figure 8 In a specific embodiment, the light effect rendering method further comprises the following steps.
[0081] S701, get the link script.
[0082] Wherein, the link script is associated with the light effect control information, and the link script is used to plug-in the light effect control information. The link script can be a scat file or an lds file.
[0083] S702, compile the link script to determine the execution address of the light effect control information in the memory.
[0084] Wherein, in the linking stage, the link script is compiled by the compiler to compile the C File class file into the BIN File class file, and the execution address of the light effect control information is linked to a fixed address within the RAM space range of the light strip control terminal 2. The light strip control terminal 2 loads and executes at the fixed address when loading the light effect control information.
[0085] After step Sb02, the light strip control terminal 2 will prohibit other programs from occupying the fixed address, thereby reserving a certain amount of execution memory space for the light effect control information to be loaded.
[0086] The beneficial effects of the light effect rendering method provided in the embodiments of the present application can be referred to the foregoing light emitting device and related descriptions, which will not be repeated here.
[0087] Please refer to Figure 9 , another flowchart of the light effect rendering method provided in the embodiments of the present application is shown.
[0088] The light effect rendering method can be applied to the user terminal 3 described in any of the foregoing embodiments, and the light effect rendering method comprises the following steps.
[0089] S901, downloading light effect control information in response to a light effect triggering operation.
[0090] Specifically, in response to the light effect triggering operation of the user interface, the light effect control information is downloaded from the updatable light effect database.
[0091] S902, sending the light effect control information to the light strip control terminal 2.
[0092] S903, the light strip control terminal 2 loads the light effect control information and imports the pre-stored execution environment information to control the light emitting part 1 to emit light according to the light emitting parameters.
[0093] Specifically, the light strip control terminal 2 loads the light effect control information and imports the pre-stored local variables, pointer table head address, color selection table head address and memory space address.
[0094] The beneficial effects of the light effect rendering method provided in the embodiments of the present application can be referred to the foregoing light emitting device and related descriptions, which will not be repeated here.
[0095] Please refer to Figure 10 , a module diagram of the light effect rendering device provided in the embodiments of the present application is shown.
[0096] The light effect rendering device is applied to the light strip control terminal 2.
[0097] The light effect rendering device comprises:
[0098] The parameter acquisition module 21 is configured to acquire the light effect control information sent by the user terminal 3 in response to the light effect triggering operation, and the light effect control information is configured to indicate the light emitting parameters of the light emitting part 1.
[0099] The program execution module 22 is configured to load the light effect control information and import the pre-stored execution environment information to control the light emitting part 1 to emit light according to the light emitting parameters.
[0100] The beneficial effects of the light effect rendering device provided in the embodiments of the present application can be referred to the foregoing light emitting device and related descriptions, which will not be repeated here.
[0101] The embodiments of the present application also provide a computer storage medium.
[0102] The computer storage medium is used for storing program codes executed by the device, and the program codes comprise codes for executing the light effect rendering method as aforementioned.
[0103] The beneficial effects of the computer storage medium provided by the embodiments of the present application can be referred to the aforementioned light emitting device and related descriptions, which will not be repeated here.
[0104] It is apparent for those skilled in the art that the present application is not limited to the details of the foregoing exemplary embodiments, and the present application can be implemented in other concrete forms without departing from the spirit or essential characteristics of the present application. Therefore, the foregoing embodiments of the present application are to be considered in all aspects as illustrative and not restrictive, and the scope of the present application is defined by the appended claims rather than the foregoing description, and it is intended to embrace all changes falling within the meaning and scope of equivalents of the claims.
Claims
1. A method of lamp effect rendering, characterized by, The method is applied to a lamp strip control terminal, the lamp strip control terminal communicates with a user terminal, and the method comprises: obtaining lamp effect control information sent by the user terminal in response to a lamp effect triggering operation, the lamp effect control information being used to indicate a light emitting parameter of a light emitting component; loading the lamp effect control information and importing pre-stored execution environment information to control the light emitting component to emit light according to the light emitting parameter; the method further comprises: obtaining a linking script, the linking script being used to plug in the lamp effect control information; compiling the linking script to determine an execution address of the lamp effect control information in a memory; the loading of the lamp effect control information comprises: loading the lamp effect control information into the execution address for execution.
2. The light effect rendering method according to claim 1, characterized in that, The execution environment information comprises a pre-declared local variable, a pointer table first address of a light property function and a color selection table first address of a color selection table; the loading of the lamp effect control information and the importing of the pre-stored execution environment information comprises: loading the lamp effect control information and importing the pre-stored local variable, the pointer table first address and the color selection table first address.
3. The light effect rendering method of claim 1, wherein, The execution environment information comprises a pre-declared local variable, a pointer table first address of a light property function, a color selection table first address of a color selection table and a memory space address with a global attribute, the memory space address being used to indicate a state quantity of historical lamp effect rendering; the loading of the lamp effect control information and the importing of the pre-stored execution environment information comprises: loading the lamp effect control information and importing the pre-stored local variable, the pointer table first address, the color selection table first address and the memory space address.
4. The light effect rendering method according to any of the claims 1-3, characterized in that, The method further comprises: the user terminal downloads the lamp effect control information and sends the lamp effect control information to the lamp strip control terminal in response to the lamp effect triggering operation of a user interface.
5. The light effect rendering method according to claim 4, characterized in that, the user terminal downloading the lamp effect control information comprises: the user terminal downloads the lamp effect control information from an updatable lamp effect database.
6. A method of lamp effect rendering, characterized in that, The method is applied to a user terminal, the user terminal communicates with a lamp strip control terminal, the lamp strip control terminal is used to execute the method in any one of claims 1-5, and a lamp effect rendering method of the user terminal comprises: downloading lamp effect control information in response to a lamp effect triggering operation, the lamp effect control information being used to indicate a light emitting parameter of a light emitting component; sending the lamp effect control information to the lamp strip control terminal; the lamp strip control terminal loads the lamp effect control information and imports pre-stored execution environment information to control the light emitting component to emit light according to the light emitting parameter.
7. A light effect rendering apparatus, characterized in that The method is applied to a lamp strip control terminal, the lamp strip control terminal is used to execute the method in any one of claims 1-5, the lamp strip control terminal communicates with a user terminal, and the device comprises: a parameter obtaining module, used to obtain lamp effect control information sent by the user terminal in response to a lamp effect triggering operation, the lamp effect control information being used to indicate a light emitting parameter of a light emitting component; a program execution module, used to load the lamp effect control information and import pre-stored execution environment information to control the light emitting component to emit light according to the light emitting parameter.
8. A light emitting device, characterized by The light emitting device comprises a light emitting member and a light strip control terminal, the light strip control terminal is used for executing executable instructions to realize the method as claimed in any one of claims 1-5.
9. A computer storage medium, characterized in that The computer storage medium is used for storing program codes executed by the device, and the program codes are used for realizing the method as claimed in any one of claims 1-5.
Citation Information
Patent Citations
Lamp effect synthesis control system and method of intelligent colored lamp
CN113709948A