Artificial intelligence light effect generation method and electronic device applying same

By using a unified computing architecture unit (CUDA) combining neural network processors and graphics processors in a laptop to generate AI-powered lighting effects, the problem of not being able to generate real-time correspondence between button light sources and screen images in existing technologies has been solved, enabling efficient real-time calculation of lighting effect patterns.

CN122261684APending Publication Date: 2026-06-23ACER INC

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ACER INC
Filing Date
2024-12-19
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Current laptop keyboard key backlights cannot generate corresponding lighting effects patterns in real time according to changes in the screen, especially when the central processing unit is under heavy load, they cannot perform real-time calculations.

Method used

Artificial intelligence lighting effects are generated using a unified computing architecture unit (CUDA) that integrates neural network processors and graphics processors. The initial program adjusts the data format of the screen tensor and the model output tensor, and then, in conjunction with the execution programs of the operating system kernel unit, neural network processor, and graphics processor, the lighting effect patterns are calculated in real time.

Benefits of technology

It enables the real-time generation of lighting effect patterns corresponding to the screen display even under high CPU load, improving the real-time performance and accuracy of lighting effect generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122261684A_ABST
    Figure CN122261684A_ABST
Patent Text Reader

Abstract

The present application provides an artificial intelligence light effect generation method and an electronic device applying the same. The artificial intelligence light effect generation method is used to display a light effect pattern corresponding to a screen image on a light effect device. The artificial intelligence light effect generation method includes the following steps. An initial procedure is performed to obtain the content and dimension of the data format of a model input tensor and a model output tensor of an artificial intelligence model. An execution procedure is performed to adjust a frame tensor of the screen image according to the content and dimension of the data format of the model input tensor, and to adjust an inference result of the artificial intelligence model according to the content and dimension of the data format of the model output tensor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for generating lighting effects and an electronic device using the same, and more particularly to an artificial intelligence-based method for generating lighting effects and an electronic device using the same. Background Technology

[0002] Some laptops have integrated backlighting on several individual keys beneath the keyboard. These backlights help users identify keys in the dark and can also be used to create various lighting effects.

[0003] Keypad backlights can serve as lighting effects, providing static or keyboard lighting effects. However, these effects are merely default patterns and cannot be customized to correspond to the screen display.

[0004] Furthermore, due to the rapid changes in screen display, the lighting effects may not be able to be calculated in real time when the central processing unit is under heavy load. Therefore, researchers are working to develop a technology that can calculate the lighting effects in real time according to the screen display. Summary of the Invention

[0005] This invention relates to an artificial intelligence-based lighting effect generation method and an electronic device using the same. The electronic device utilizes a unified computing architecture unit (CUDA) of a neural network processor or a graphics processing unit to perform the artificial intelligence-based lighting effect generation method. In scenarios such as gaming and multimedia creation, the central processing unit (CPU) and graphics processing unit (GPU) are almost fully utilized, but the unified computing architecture unit (CUDA) of the neural network processor and GPU still has computational margin, and is particularly suitable for artificial intelligence computation. Therefore, this invention utilizes computing resources such as the unified computing architecture unit (CUDA) of the neural network processor and GPU to execute the artificial intelligence-based lighting effect generation method, in order to respond to rapid changes in the screen display and calculate the lighting effect image in real time.

[0006] According to one aspect of the present invention, an artificial intelligence-based lighting effect generation method is proposed. This method is used to display a lighting effect pattern corresponding to a screen image using a lighting effect device. The method includes the following steps: Performing an initial procedure to obtain the content and dimensions of the data formats of a model input tensor and a model output tensor of an artificial intelligence model; Performing an execution procedure to adjust a frame tensor of the screen image according to the content and dimensions of the data format of the model input tensor, and to adjust an inference result of the artificial intelligence model according to the content and dimensions of the data format of the model output tensor.

[0007] According to another aspect of the present invention, an electronic device is provided. The electronic device includes a display unit, a lighting effect device, an operating system kernel, a neural network processing unit (NPU), and a graphics processing unit (GPU). The display unit is used to display a screen image. The lighting effect device is used to display a lighting effect image corresponding to the screen image. The operating system kernel is connected to the display unit and the lighting effect device. The neural network processor is connected to the operating system kernel. The graphics processing unit is connected to the operating system kernel. The graphics processing unit includes a Compute Unified Device Architecture (CUDA) unit. The electronic device loads a program to execute an artificial intelligence lighting effect generation method. The artificial intelligence lighting effect generation method includes the following steps: An initial program is performed using the operating system kernel to obtain the content and dimensions of a model input tensor and a model output tensor of an artificial intelligence model. An execution program is run using a unified computing architecture unit of a neural network processor or a graphics processor to adjust a frame tensor of the screen based on the content and dimensions of the data format of the model input tensor, and to adjust an inference result of an artificial intelligence model based on the content and dimensions of the data format of the model output tensor. Attached Figure Description

[0008] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:

[0009] Figure 1 A schematic diagram of an electronic device according to an embodiment of the present invention is shown.

[0010] Figure 2 A schematic diagram of an artificial intelligence-based lighting effect generation method according to an embodiment of the present invention is shown.

[0011] Figure 3 A computational resource allocation diagram is shown for an artificial intelligence-based lighting effect generation method according to an embodiment of the present invention.

[0012] Figure 4 A flowchart illustrating the initial procedure of an artificial intelligence-based lighting effect generation method according to an embodiment of the present invention is shown.

[0013] Figure 5 A schematic diagram of a keyboard according to an embodiment of the present invention is shown.

[0014] Figure 6 A light source distribution diagram of a lighting effect device according to an embodiment of the present invention is shown.

[0015] Figure 7 A lighting matrix is ​​shown according to an embodiment of the present invention.

[0016] Figure 8 The example illustrates steps S122 to S124.

[0017] Figures 9A-9B A flowchart of the execution program of an artificial intelligence-based lighting effect generation method according to an embodiment of the present invention is shown.

[0018] Figure label:

[0019] 100: Electronic devices

[0020] 110: Display Unit

[0021] 120: Keyboard

[0022] 130: Lighting Effect Device

[0023] 140: Application Unit

[0024] 150: Operating System Kernel Unit

[0025] 151: Driver

[0026] 160: Central Processing Unit

[0027] 170: Neural Network Processor

[0028] 180: Graphics Processor

[0029] 181:CUDA

[0030] B: Blue

[0031] FG1: Compression Flag

[0032] FG2: Post-processed merged flag

[0033] FM: Screen display

[0034] FT: Screen Tensor

[0035] G: Green

[0036] IN: Input data

[0037] KY: button

[0038] LD: Light source

[0039] LM: Lighting Effect Diagram

[0040] MD: Artificial Intelligence Model

[0041] MP1: Light Source Distribution Diagram

[0042] MP3: Lighting Effect Matrix

[0043] MT1: Model Input Tensor

[0044] MT2: Model Output Tensor

[0045] PD1: Initial Procedure

[0046] PD2: Executable program

[0047] R: Red

[0048] RS: Conclusion

[0049] S111,S112,S121,S122,S123,S124,S131,S132,S133,S134,S141,S142,S211,S212,S213,S214,S2141,S2142,S215,S216,S2161,S2162,S217,S221,S222,S223,S224,S225,S231,S232,S241,S242,S243,S244,S250: Steps Detailed Implementation

[0050] The technical terms used in this specification are based on common terminology in the field. Where this specification provides further explanation or definition of certain terms, the interpretation of those terms shall be based on the explanation or definition provided in this specification. Each embodiment of the present invention has one or more technical features. Where feasible, those skilled in the art may selectively implement some or all of the technical features in any embodiment, or selectively combine some or all of the technical features in these embodiments.

[0051] Please refer to Figure 1 This diagram illustrates an electronic device 100 according to an embodiment of the present invention. The electronic device 100 is, for example, a laptop computer, a smartphone, or a gaming device. In this invention, a lighting effect device 130 is provided below the keyboard 120 of the electronic device 100. The lighting effect device 130 can display a lighting effect pattern LM corresponding to the screen image FM of the display unit 110.

[0052] In this invention, the screen image FM of the display unit 110 can obtain a lighting effect image LM through inference from an artificial intelligence model MD. Please refer to Figure 2This diagram illustrates a method for generating lighting effects using artificial intelligence according to an embodiment of the present invention. The screen image FM can be used to infer lighting effects LM from the artificial intelligence model MD. However, the input data IN of the artificial intelligence model MD has a specific model input tensor MT1. The frame tensor FT of the screen image FM may not perfectly match this model input tensor MT1.

[0053] The inference result RS of an artificial intelligence model MD has a specific model output tensor MT2. However, the inference result RS of an artificial intelligence model MD may not match the format of the lighting effect image LM. Therefore, this invention proposes a processing architecture that enables the screen image FM to obtain the lighting effect image LM by means of the inference of any artificial intelligence model MD.

[0054] like Figure 2 As shown, the artificial intelligence lighting effect generation method proposed in this invention includes an initial program PD1 and an execution program PD2. The initial program PD1 is used to obtain the content and dimensions of the data format of the model input tensor MT1 and the model output tensor MT2 of the artificial intelligence model MD.

[0055] The execution program PD2 is used to adjust the screen tensor FT of the screen image FM based on the content and dimensions of the data format of the model input tensor MT1; and to adjust the inference result RS based on the content and dimensions of the data format of the model output tensor MT2 to conform to the format of the lighting effect image LM.

[0056] Please refer to Figure 3 This diagram illustrates the computational resource allocation of an artificial intelligence-based lighting effect generation method according to an embodiment of the present invention. The computational resource architecture of the electronic device 100 includes, for example, an application unit 140, an operating system kernel unit 150, a central processing unit (CPU) 160, a neural-network processing unit (NPU) 170, and a graphics processing unit (GPU) 180. The operating system kernel unit includes various drivers 151. The graphics processing unit 180 includes at least a Compute Unified Device Architecture (CUDA) unit 181.

[0057] In this invention, the initial program PD1 is executed using the operating system kernel unit 150; and the execution program PD2 is executed using the unified computing architecture unit (CUDA) 181 of the neural network processor 170 or the graphics processor 180. In scenarios such as gaming and multimedia creation, the central processing unit 160 and the graphics processor 180 are almost fully utilized, but the unified computing architecture unit (CUDA) 181 of the neural network processor 170 and the graphics processor 180 still has computational margin, and the unified computing architecture unit (CUDA) 181 of the neural network processor 170 and the graphics processor 180 is particularly suitable for artificial intelligence computation. Therefore, this invention utilizes computational resources such as the unified computing architecture unit (CUDA) 181 of the neural network processor 170 and the graphics processor 180 to execute an artificial intelligence lighting effect generation method, in order to respond to the rapid changes in the screen display FM and calculate the lighting effect diagram LM in real time.

[0058] Please refer to Figure 4 The diagram illustrates a flowchart of the initial procedure PD1 of an artificial intelligence-based lighting effect generation method according to an embodiment of the present invention. The initial procedure PD1 of the artificial intelligence-based lighting effect generation method includes steps S111-S112, S121-S124, S131-S134, and S141-S142.

[0059] Please refer to Figures 5 and 6. Figure 5 A schematic diagram of a keyboard 120 according to an embodiment of the present invention is shown. Figure 6 MP1 shows a light source distribution diagram of the light source LD of the lighting effect device 130 according to an embodiment of the present invention. In step S111, as shown in Figures 5-6, the light source distribution diagram MP1 of the light source LD of the lighting effect device 130 is obtained. The keys KY of the keyboard 120 are not neatly arranged, and the light source LD of the lighting effect device 130 located below the keyboard 120 is also not neatly arranged. In the light source distribution diagram MP1, most of the keys KY correspond to one light source LD. The light source LD is, for example, an LED lamp.

[0060] Next, please refer to Figure 7 This illustrates a lighting effect matrix MP3 according to an embodiment of the present invention. In step S112, as... Figure 7 As shown, based on the light source distribution diagram MP1, a lighting effect matrix MP3 is established. The lighting effect matrix MP3 plans out the blank blocks that can be lit and the cross-shaped blocks that cannot be lit. These blank blocks that can be lit are used to plan the lighting effect diagram LM mentioned above.

[0061] Then, in step S121, as Figure 2 As shown, the artificial intelligence model MD is scanned to obtain the model input tensor MT1.

[0062] Next, please refer to Figure 8The example illustrates steps S122 to S124. In S122, it is determined whether the input tensor MT1 of the model has the same color in a continuous space. For example... Figure 8 As shown, if the continuous space is the same color (e.g., consecutive red R, consecutive green G, consecutive blue B), then proceed to step S123; if the discontinuous space is the same color (e.g., red R, green G, blue B are arranged alternately), then proceed to step S124.

[0063] In step S123, as Figure 8 As shown, the input tensor MT1 of the decision model is a channel-first data format (e.g., NCHW data format).

[0064] In step S124, as Figure 8 As shown, the input tensor MT1 of the determination model is the data format of the last color channel (e.g., NHWC data format).

[0065] Then, in step S131, as Figure 2 As shown, the artificial intelligence model MD is scanned to obtain the model output tensor MT2.

[0066] Next, in step S132, as Figure 2 As shown, determine whether the first dimension and the last dimension of the model output tensor MT2 are 1. If the first dimension and the last dimension of the model output tensor MT2 are 1, proceed to step S133; if the first dimension or the last dimension of the model output tensor MT2 is not 1, proceed to step S134.

[0067] In step S133, as Figure 3 As shown, a squeeze flag FG1 is set to 1.

[0068] In step S134, as Figure 3 As shown, the compression flag FG1 is set to 0. The compression flag FG1 is used by the PD2 executable to determine whether dimensionality reduction is needed.

[0069] Next, in step S141, as Figure 2 As shown, this determines whether the dimension of one color channel of the model's output tensor MT2 is less than 3. Generally, the input data IN received by the AI ​​model MD is usually color data, and its model output tensor MT2 has a color channel dimension of 3. In some cases, the input data IN received by the AI ​​model MD (shown in...) Figure 2The data may be monochrome, and the color channels of the model output tensor MT2 have a dimension of 1. Alternatively, the color channels of the model output tensor MT2 may also have other values. If the dimension of the color channels of the model output tensor MT2 is less than 3, proceed to step S142; if the dimension of the color channels of the model output tensor MT2 is not less than 3, end the process.

[0070] In step S142, as Figure 3 As shown, the post-process with concatenate flag FG2 is set to 1. The post-process with concatenate flag FG2 is used by the executor PD2 to determine whether data merging is necessary.

[0071] Please refer to Figures 9A-9B The diagram illustrates a flowchart of the execution procedure PD2 of the artificial intelligence-based lighting effect generation method according to an embodiment of the present invention. The execution procedure PD2 of the artificial intelligence-based lighting effect generation method includes steps S211-S217, S221-S225, S231-S232, S241-S244, and S250.

[0072] In step S211, as Figure 1 As shown, the product of the width and height of the lighting effect device 130 and the product of the width and height of the screen image FM are obtained.

[0073] Next, in step S212, it is determined whether the product of the lighting effect's width and height is less than or equal to the product of the screen's width and height. If the product of the lighting effect's width and height is less than or equal to the product of the screen's width and height, then proceed to step S213; if the product of the lighting effect's width and height is greater than the product of the screen's width and height, then proceed to step S215.

[0074] In step S213, as Figure 2 As shown, determine whether the image tensor FT and the model input tensor MT1 are both in a channel-first data format or both in a channel-last data format. If the image tensor FT and the model input tensor MT1 are not both in a channel-first data format and are not both in a channel-last data format, proceed to step S214; if the image tensor FT and the model input tensor MT1 are both in a channel-first data format or both in a channel-last data format, proceed to step S221.

[0075] Step S214 includes steps S2141 and S2142.

[0076] In step S2141, as Figure 2 As shown, the size of the image tensor FT is adjusted so that the size of the image tensor FT is consistent with that of the model input tensor MT1.

[0077] In step S2142, as Figure 2 As shown, the image tensor FT is transposed to make its data format consistent with that of the model input tensor MT1. In other words, step S214 first reduces the size of the image tensor FT and then transposes it to prevent distortion.

[0078] In step S215, as Figure 2 As shown, determine whether the image tensor FT and the model input tensor MT1 are both in a channel-first data format or both in a channel-last data format. If the image tensor FT and the model input tensor MT1 are not both in a channel-first data format and are not both in a channel-last data format, proceed to step S216; if the image tensor FT and the model input tensor MT1 are both in a channel-first data format or both in a channel-last data format, proceed to step S217.

[0079] Step S216 includes steps S2161 and S2162.

[0080] In step S2161, as Figure 2 As shown, the image tensor FT is transposed to make the image tensor FT consistent with the data format of the model input tensor MT1.

[0081] In step S2162, as Figure 2 As shown, the image tensor FT is resized to match the size of the model input tensor MT1. In other words, step S216 first transposes the image tensor FT to prevent distortion, and then enlarges the image tensor FT.

[0082] Next, in step S217, as Figure 2 As shown, the size of the image tensor FT is adjusted so that the size of the image tensor FT is consistent with that of the model input tensor MT1.

[0083] Then, in step S221, as Figure 2 As shown, the dimension of one color channel of the image tensor FT and the dimension of one color channel of the model input tensor MT1 are obtained.

[0084] Next, in step S222, as Figure 2As shown, it determines whether the dimension of the color channels of the image tensor FT is consistent with the dimension of the color channels of the model input tensor MT1. For example, it determines whether they are both 3 or both 1. If the dimension of the color channels of the image tensor FT is consistent with the dimension of the color channels of the model input tensor MT1, then proceed to step S224; if the dimension of the color channels of the image tensor FT is inconsistent with the dimension of the color channels of the model input tensor MT1, then proceed to step S223.

[0085] In step S223, as Figure 2 As shown, a dimensionality transformation is performed on the image tensor (FT) to make the dimension of the color channels of the image tensor (FT) consistent with the dimension of the color channels of the model input tensor (MT1). This step can be performed, for example, through methods such as Convolution.

[0086] In step S224, as Figure 2 As shown, the input screen tensor FT is fed into the artificial intelligence model MD to obtain the inference result RS.

[0087] In step S225, as Figure 2 As shown, the dimensions of the inference result RS are adjusted so that the dimensions of the inference result RS are consistent with the dimensions of the lighting device 130.

[0088] Next, in step S231, as Figure 3 As shown, determine whether the compression flag FG1 is 1. If the compression flag FG1 is 1, proceed to step S232.

[0089] In step S232, the inference result RS is dimensionality reduced. In this step, the inference result RS is squeezed to exclude data with a value of 1 in each dimension. Dimensionality reduction is performed without changing the amount of data, thereby speeding up the instruction cycle and reducing distortion.

[0090] Then, in step S241, as Figure 3 As shown, determine whether the post-merge flag FG2 is 1. If the post-merge flag FG2 is 1, proceed to step S242; if the post-merge flag FG2 is not 1, proceed to step S244.

[0091] In steps S242 and S244, data for the H and W dimensions are obtained from the inference result RS.

[0092] Next, in step S243, the inference result RS is merged. In this step, after obtaining the data from the H and W dimensions of the inference result RS, the matrix data is merged through the Concatenate operation to make the lighting effect diagram LM complete.

[0093] Then, in step S250, a lighting effect diagram LM is generated.

[0094] According to the above embodiments, the electronic device 100 uses the operating system kernel unit 150 to perform the initial program PD1; and uses the unified computing architecture unit (CUDA) 181 of the neural network processor 170 or the graphics processor 180 to perform the execution program PD2. In scenarios such as games and multimedia creation, the central processing unit 160 and the graphics processor 180 are almost fully loaded, but the unified computing architecture unit (CUDA) 181 of the neural network processor 170 and the graphics processor 180 still has computing power, and the unified computing architecture unit (CUDA) 181 of the neural network processor 170 and the graphics processor 180 is particularly suitable for artificial intelligence operations. Therefore, the present invention uses computing resources such as the unified computing architecture unit (CUDA) 181 of the neural network processor 170 and the graphics processor 180 to execute an artificial intelligence lighting effect generation method, so as to respond to the rapid changes of the screen image FM and calculate the lighting effect image LM in real time.

[0095] Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications and improvements without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be defined by the claims.

Claims

1. An artificial intelligence-based lighting effect generation method for displaying a lighting effect pattern corresponding to a screen image on a lighting effect device, the artificial intelligence-based lighting effect generation method comprising: Perform an initial procedure to obtain the content and dimensions of the data format of a model input tensor and a model output tensor of an artificial intelligence model; and An execution program is performed to adjust a frame tensor of the screen based on the content and dimensions of the data format of the input tensor of the model, and to adjust an inference result of the artificial intelligence model based on the content and dimensions of the data format of the output tensor of the model.

2. The artificial intelligence-based lighting effect generation method as described in claim 1, characterized in that, The initial procedure includes: Scan the input tensor of the model; Determine whether the input tensors of the model are of the same color in a continuous space; If the input tensor of the model contains elements of the same color in a continuous space, then the input tensor of the model is in a channel-first data format; and If the input tensor of the model contains different colors in a continuous space, then the input tensor of the model is in the data format of the last color channel.

3. The artificial intelligence-based lighting effect generation method as described in claim 1, characterized in that, The initial procedure includes: Scan the output tensor of the model; Determine whether the first and last dimensions of the output tensor of the model are both 1; If the first or last dimension of the model's output tensor is 1, then a squeezing flag (squeezeflag) is set to 1; and If the first dimension and the last dimension of the output tensor of the model are not 1, then the compression flag is set to 0.

4. The artificial intelligence-based lighting effect generation method as described in claim 1, characterized in that, The initial procedure includes: Scan the output tensor of the model; Determine if the dimension of one color channel of the model's output tensor is less than 3; and If the dimension of the color channel of the output tensor of the model is less than 3, then set the postprocess with concatenate flag to 1.

5. The artificial intelligence-based lighting effect generation method as described in claim 1, characterized in that, The executable program includes: Obtain the product of the width and height of the lighting effect device and the product of the width and height of the screen image; Determine whether the product of the width and height of the lighting effect is less than or equal to the product of the width and height of the image. Determine whether the image tensor and the model input tensor are both in channel-first or channel-last data format; If the product of the lighting effect's width and height is less than or equal to the product of the image's width and height, and the image tensor and the model input tensor are not both in channel-first data format, and the image tensor and the model input tensor are not both in channel-last data format, then first resize the image tensor, and then transpose the image tensor; and If the product of the width and height of the lighting effect is greater than the product of the width and height of the image, and the image tensor and the model input tensor are not both in channel-first data format, and the image tensor and the model input tensor are not both in channel-last data format, then the image tensor is first transposed, and then the size of the image tensor is adjusted.

6. The artificial intelligence-based lighting effect generation method as described in claim 1, characterized in that, The executable program includes: Obtain the dimension of one color channel of the image tensor and the dimension of one color channel of the model input tensor; Determine whether the dimension of the color channel in the image tensor is the same as the dimension of the color channel in the model input tensor; and If the dimension of the color channel of the image tensor is inconsistent with the dimension of the color channel of the model input tensor, then the image tensor is dimensionally transformed.

7. The artificial intelligence-based lighting effect generation method as described in claim 1, characterized in that, The executable program includes: Determine if a squeeze flag is 1. A squeeze flag of 1 indicates that either the first or last dimension of the model's output tensor is 1; and If the compression flag is 1, then the dimensionality of this inference result of the artificial intelligence model will be reduced.

8. The artificial intelligence-based lighting effect generation method as described in claim 1, characterized in that, The executable program includes: Determine if the post-process with concatenate flag is 1. A flag of 1 indicates that the dimension of one color channel in the model's output tensor is less than 3; and If the post-processing merging flag is 1, then the data merging will be performed on the inference result of the artificial intelligence model.

9. An electronic device comprising: A display unit used to display a screen image; A lighting device for displaying a lighting effect image corresponding to the screen image; An operating system kernel unit is connected to the display unit and the lighting effect device; A neural network processing unit (NPU) is connected to the operating system kernel unit; as well as A graphics processing unit (GPU) is connected to the operating system kernel unit, and the GPU includes: A Compute Unified Device Architecture (CUDA) unit, an electronic device loading a program to execute an artificial intelligence-based lighting effect generation method, the artificial intelligence-based lighting effect generation method including: An initial program is run using the operating system kernel unit to obtain the content and dimensions of the data format of a model input tensor and a model output tensor of an artificial intelligence model; and An execution program is performed using the unified computing architecture unit of the neural network processor or the graphics processor to adjust a frame tensor of the screen image based on the content and dimensions of the data format of the model input tensor, and to adjust an inference result of the artificial intelligence model based on the content and dimensions of the data format of the model output tensor.

10. The electronic device as claimed in claim 9, characterized in that, The initial procedure includes: Scan the input tensor of the model; Determine whether the input tensors of the model are of the same color in a continuous space; If the input tensor of the model contains elements of the same color in a continuous space, then the input tensor of the model is in a channel-first data format; and If the input tensor of the model contains different colors in a continuous space, then the input tensor of the model is in the data format of the last color channel.

11. The electronic device as claimed in claim 9, characterized in that, The initial procedure includes: Scan the output tensor of the model; Determine whether the first and last dimensions of the output tensor of the model are both 1; If the first or last dimension of the model's output tensor is 1, then a squeezing flag (squeezeflag) is set to 1; and If the first dimension and the last dimension of the output tensor of the model are not 1, then the compression flag is set to 0.

12. The electronic device as claimed in claim 9, characterized in that, The initial procedure includes: Scan the output tensor of the model; Determine if the dimension of one color channel of the model's output tensor is less than 3; and If the dimension of the color channel of the output tensor of the model is less than 3, then set the postprocess with concatenate flag to 1.

13. The electronic device as claimed in claim 9, characterized in that, The executable program includes: Obtain the product of the width and height of the lighting effect device and the product of the width and height of the screen image; Determine whether the product of the width and height of the lighting effect is less than or equal to the product of the width and height of the image. Determine whether the image tensor and the model output tensor are both in channel-first or channel-last data format; If the product of the lighting effect's width and height is less than or equal to the product of the image's width and height, and the image tensor and the model output tensor are not both in channel-first data format, and the image tensor and the model output tensor are not both in channel-last data format, then first resize the image tensor, and then transpose the image tensor; and If the product of the width and height of the lighting effect is greater than the product of the width and height of the image, and the image tensor and the model output tensor are not both in channel-first data format, and the image tensor and the model output tensor are not both in channel-last data format, then the image tensor is transposed first, and then the size of the image tensor is adjusted.

14. The electronic device as claimed in claim 9, characterized in that, The executable program includes: Obtain the dimension of one color channel of the image tensor and the dimension of one color channel of the model input tensor; Determine whether the dimension of the color channel in the image tensor is the same as the dimension of the color channel in the model input tensor; and If the dimension of the color channel of the image tensor is inconsistent with the dimension of the color channel of the model input tensor, then the image tensor is dimensionally transformed.

15. The electronic device as claimed in claim 9, characterized in that, The executable program includes: Determine if a squeeze flag is 1. A squeeze flag of 1 indicates that either the first or last dimension of the model's output tensor is 1; and If the compression flag is 1, then the inference results of the artificial intelligence model are reduced in dimensionality.

16. The electronic device as claimed in claim 9, characterized in that, The executable program includes: Determine if the post-process with concatenate flag is 1. A flag of 1 indicates that the dimension of one color channel in the model's output tensor is less than 3; and If the post-processing merging flag is 1, then the data merging will be performed on the inference result of the artificial intelligence model.