Lamp effect control method, device, equipment and medium

文档序号:1300862 发布日期:2020-08-07 浏览:7次 中文

阅读说明:本技术 一种灯效控制方法、装置、设备及介质 (Lamp effect control method, device, equipment and medium ) 是由 王焱俊 于 2020-04-09 设计创作,主要内容包括:本申请公开了一种灯效控制方法、装置、设备及介质,包括:获取用户终端发送的目标设备对应的灯效功能实现函数;将所述目标设备添加至设备链表;获取用户终端发送的所述目标设备对应的灯效控制参数;当获取到用户终端发送的灯效执行指令,则轮询所述设备链表,并调用所述灯效功能实现函数以控制所述目标设备实现所述灯效控制参数对应的灯效。这样,获取用户终端发送的灯效功能实现函数以及灯效控制参数来进行灯效控制,能够提升灯效控制的实现效率以及灯效的平台可移植性。(The application discloses a lamp effect control method, a device, equipment and a medium, comprising the following steps: acquiring a light effect function realization function corresponding to target equipment sent by a user terminal; adding the target device to a device linked list; acquiring a light effect control parameter corresponding to the target equipment sent by a user terminal; when a light effect execution instruction sent by a user terminal is acquired, polling the equipment linked list, and calling the light effect function realization function to control the target equipment to realize the light effect corresponding to the light effect control parameter. Therefore, the light effect function realization function and the light effect control parameter sent by the user terminal are obtained to control the light effect, and the realization efficiency of the light effect control and the platform portability of the light effect can be improved.)

1. A lamp efficiency control method, comprising:

acquiring a light effect function realization function corresponding to target equipment sent by a user terminal;

adding the target device to a device linked list;

acquiring a light effect control parameter corresponding to the target equipment sent by a user terminal;

when a light effect execution instruction sent by a user terminal is acquired, polling the equipment linked list, and calling the light effect function realization function to control the target equipment to realize the light effect corresponding to the light effect control parameter.

2. The light effect control method of claim 1, wherein said polling the device linked list comprises:

and when any polling aiming at the equipment linked list is finished, entering a sleep state until the sleep time reaches a preset sleep time interval, and entering next polling of the equipment linked list.

3. The light effect control method according to claim 2, wherein the obtaining of the light effect control parameter corresponding to the target device sent by the user terminal comprises:

acquiring a first light effect state, flicker turning time and flicker total time which are sent by a user terminal and correspond to the target equipment; the first lamp effect state is lamp flickering.

4. The light effect control method according to claim 3, wherein the polling the device chain table and calling the light effect function implementation function to control the target device to implement the light effect corresponding to the light effect control parameter comprises:

polling the equipment linked list, calling the light effect function realization function and controlling the target equipment to flicker by utilizing the flicker turning time and the preset sleep time interval;

and finishing the flickering of the target equipment by using the total flickering time and the preset sleep time interval.

5. The light effect control method according to claim 1, wherein the obtaining of the light effect control parameter corresponding to the target device sent by the user terminal comprises:

acquiring a second light effect state corresponding to the target equipment sent by the user terminal; the second lamp effect state is that the lamp is on;

correspondingly, the polling the device chain table and calling the light effect function to control the target device to realize the light effect corresponding to the light effect control parameter includes:

and polling the equipment linked list, and calling the light effect function to control the target equipment to be in a lighting state.

6. The light effect control method according to claim 1, wherein the obtaining of the light effect control parameter corresponding to the target device sent by the user terminal comprises:

acquiring a third light effect state corresponding to the target equipment sent by the user terminal; the third lamp effect state is lamp off;

correspondingly, the polling the device chain table and calling the light effect function to control the target device to realize the light effect corresponding to the light effect control parameter includes:

and polling the equipment linked list, and calling the light effect function to control the target equipment to be in an off state.

7. The light effect control method according to any one of claims 1 to 6, wherein the obtaining of the light effect function implementation function corresponding to the target device sent by the user terminal includes:

and acquiring the light effect function realization function sent by the user terminal through a registration interface function.

8. A lamp effect control device, comprising:

the system comprises a light effect function acquisition module, a light effect function acquisition module and a control module, wherein the light effect function acquisition module is used for acquiring a light effect function realization function corresponding to target equipment sent by a user terminal;

the device linked list adding module is used for adding the target device to a device linked list;

the light effect parameter acquisition module is used for acquiring the light effect control parameters corresponding to the target equipment sent by the user terminal;

and the light effect function execution module is used for polling the equipment linked list and calling the light effect function realization function to control the target equipment to realize the light effect corresponding to the light effect control parameter when a light effect execution instruction sent by the user terminal is obtained.

9. A light effect control device comprising a processor and a memory; wherein the content of the first and second substances,

the memory is used for storing a computer program;

the processor for executing the computer program to implement the lamp effect control method according to any one of claims 1 to 7.

10. A computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the lamp effect control method according to any one of claims 1 to 7.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:视觉控制方法、系统、存储介质、计算机程序、控制器

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!