Movatterモバイル変換


[0]ホーム

URL:


CN115002051B - Luminaire communication method, device and luminaire - Google Patents

Luminaire communication method, device and luminaire
Download PDF

Info

Publication number
CN115002051B
CN115002051BCN202210750152.8ACN202210750152ACN115002051BCN 115002051 BCN115002051 BCN 115002051BCN 202210750152 ACN202210750152 ACN 202210750152ACN 115002051 BCN115002051 BCN 115002051B
Authority
CN
China
Prior art keywords
lamp
data
target
uploaded
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210750152.8A
Other languages
Chinese (zh)
Other versions
CN115002051A (en
Inventor
刘建华
王惠均
陈灿林
李四方
许俊生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Caiyi Technology Co.,Ltd.
Original Assignee
Guangzhou Caiyi Light Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Caiyi Light Co LtdfiledCriticalGuangzhou Caiyi Light Co Ltd
Priority to CN202210750152.8ApriorityCriticalpatent/CN115002051B/en
Publication of CN115002051ApublicationCriticalpatent/CN115002051A/en
Application grantedgrantedCritical
Publication of CN115002051BpublicationCriticalpatent/CN115002051B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本申请涉及一种灯具通信方法、装置和灯具。该方法包括:若目标灯具确定自身当前处于横向通信模式,则在灯具组网中查找服务灯具;目标灯具将第一待上传数据发送至服务灯具,指示服务灯具将第一待上传数据转发至服务器。其中,目标灯具为灯具组网中任一灯具,服务灯具为灯具组网中支持与服务器进行通信的任一灯具;横向通信模式为不支持与服务器进行通信的模式。在本申请中,当目标灯具无法与服务器进行通信时,通过服务灯具将自身的待上传数据发送至服务器中。如此,灯具组网中只要存在一个灯具能够与服务器进行通信,即可保证整个灯具组网中灯具与服务器进行通信,提高了灯具与服务器之间通信的可靠性。

This application relates to a lighting fixture communication method, device and lighting fixture. The method includes: if the target lamp determines that it is currently in the horizontal communication mode, it searches for the service lamp in the lamp network; the target lamp sends the first data to be uploaded to the service lamp, and instructs the service lamp to forward the first data to be uploaded to the server. . Among them, the target lamp is any lamp in the lamp network, the service lamp is any lamp in the lamp network that supports communication with the server; the horizontal communication mode is a mode that does not support communication with the server. In this application, when the target lamp cannot communicate with the server, the service lamp sends its own data to be uploaded to the server. In this way, as long as there is one lamp in the lamp network that can communicate with the server, communication between the lamps and the server in the entire lamp network is ensured, which improves the reliability of communication between the lamps and the server.

Description

Translated fromChinese
灯具通信方法、装置和灯具Luminaire communication method, device and luminaire

技术领域Technical field

本申请涉及网络通信技术领域,特别是涉及一种灯具通信方法、装置和灯具。The present application relates to the field of network communication technology, and in particular to a lamp communication method, device and lamp.

背景技术Background technique

随着文化产业的发展,灯具在剧院、电视台或者演播厅中的作用越来越大。为便于服务器控制灯具系统中多个灯具的运行状态,会在各灯具中增加通信模块,使得灯具可以实时向服务器上传最新的运行数据,同时,接收服务器下发的管控消息。With the development of the cultural industry, lamps and lanterns play an increasingly important role in theaters, TV stations or studios. In order to facilitate the server to control the operating status of multiple lamps in the lighting system, a communication module will be added to each lamp, so that the lamps can upload the latest operating data to the server in real time, and at the same time, receive control messages sent by the server.

然而,当任一灯具与服务器之间的通信出现问题时,该灯具无法上传数据至服务器,造成数据同步失败;同时,服务器无法根据有效数据对灯具下发管控消息,灯具与服务器之间通信中断,通信方式可靠性低。However, when there is a communication problem between any lamp and the server, the lamp cannot upload data to the server, causing data synchronization to fail. At the same time, the server cannot issue control messages to the lamp based on valid data, and the communication between the lamp and the server is interrupted. , the communication method has low reliability.

发明内容Contents of the invention

基于此,有必要针对上述技术问题,提供一种能够提高灯具与服务器之间通信可靠性的灯具通信方法、装置和灯具。Based on this, it is necessary to provide a lamp communication method, device and lamp that can improve the reliability of communication between the lamp and the server in view of the above technical problems.

第一方面,本申请提供了一种灯具通信方法,该方法包括:In the first aspect, this application provides a lamp communication method, which method includes:

若目标灯具确定自身当前处于横向通信模式,则在灯具组网中查找服务灯具;目标灯具为灯具组网中任一灯具,服务灯具为灯具组网中支持与服务器进行通信的任一灯具;横向通信模式为不支持与服务器进行通信的模式;If the target lamp determines that it is currently in horizontal communication mode, it searches for the service lamp in the lamp network; the target lamp is any lamp in the lamp network, and the service lamp is any lamp in the lamp network that supports communication with the server; horizontal The communication mode is a mode that does not support communication with the server;

目标灯具将第一待上传数据发送至服务灯具,指示服务灯具将第一待上传数据转发至服务器。The target lamp sends the first data to be uploaded to the service lamp, and instructs the service lamp to forward the first data to be uploaded to the server.

在其中一个实施例中,在灯具组网中查找服务灯具,包括:In one embodiment, searching for service lamps in the lamp network includes:

目标灯具从灯具节点列表中获取候选灯具;候选灯具为支持与服务器进行通信的灯具;The target lamp obtains candidate lamps from the lamp node list; candidate lamps are lamps that support communication with the server;

目标灯具基于预设的选取策略,从候选灯具中确定服务灯具。The target lamp determines the service lamp from the candidate lamps based on the preset selection strategy.

在其中一个实施例中,灯具节点列表的构建过程,包括:In one embodiment, the construction process of the lamp node list includes:

目标灯具接收灯具组网中其他灯具定时发送的心跳数据包;心跳数据包中至少包括对应灯具的通信模式;The target lamp receives heartbeat data packets sent regularly by other lamps in the lamp network; the heartbeat data packet at least includes the communication mode of the corresponding lamp;

目标灯具根据接收到的心跳数据包,创建灯具节点列表。The target lamp creates a lamp node list based on the received heartbeat data packet.

在其中一个实施例中,该方法还包括:In one embodiment, the method further includes:

目标灯具接收服务灯具发送灯具控制信息;灯具控制信息为服务灯具接收的服务器针对目标灯具下发的控制信息;The target lamp receives the lamp control information sent by the service lamp; the lamp control information is the control information issued by the server for the target lamp received by the service lamp;

目标灯具根据灯具控制信息,对自身的运行参数进行调整。The target lamp adjusts its own operating parameters based on the lamp control information.

在其中一个实施例中,该方法还包括:In one embodiment, the method further includes:

目标灯具接收服务灯具发送的数据上传成功信息;The target lamp receives the data upload success message sent by the service lamp;

目标灯具根据数据上传成功信息,在自身的数据项登记表中对第一待上传数据的上传状态进行更新。The target lamp updates the upload status of the first data to be uploaded in its own data item registration table based on the data upload success information.

在其中一个实施例中,该方法还包括:In one embodiment, the method further includes:

获取目标灯具与服务器之间的通信状态;Get the communication status between the target lamp and the server;

若通信状态为不支持与服务器进行通信,则确定目标灯具处于横向通信模式;If the communication status is that communication with the server is not supported, it is determined that the target lamp is in horizontal communication mode;

若通信状态为支持与服务器进行通信但不支持与灯具组网中的其他灯具进行通信,则确定目标灯具处于纵向通信模式;If the communication status supports communication with the server but does not support communication with other lamps in the lamp network, it is determined that the target lamp is in longitudinal communication mode;

若通信状态为支持与服务器进行通信且支持与灯具组网中至少一个灯具进行通信,则确定目标灯具处于双向通信模式。If the communication status supports communication with the server and supports communication with at least one lamp in the lamp network, it is determined that the target lamp is in the two-way communication mode.

在其中一个实施例中,若目标灯具处于双向通信模式,该方法还包括:In one embodiment, if the target lamp is in the two-way communication mode, the method further includes:

目标灯具向服务器发送第二待上传数据,第二待上传数据包括第一待上传数据和至少一个客户灯具的待上传数据;The target lamp sends second data to be uploaded to the server, where the second data to be uploaded includes the first data to be uploaded and the data to be uploaded of at least one customer lamp;

若发生至少一个客户灯具的待上传数据上传失败,则目标灯具向上传失败的各客户灯具发送数据上传失败信息,并关闭与上传失败的各客户灯具之间的通信连接;数据上传失败信息用于提醒上传失败的各客户灯具重新选择服务灯具。If the upload of data to be uploaded by at least one customer fixture fails, the target fixture sends data upload failure information to each customer fixture that failed to upload, and closes the communication connection with each customer fixture that failed to upload; the data upload failure information is used Remind each customer whose fixtures failed to upload to reselect service fixtures.

在其中一个实施例中,该方法还包括:In one embodiment, the method further includes:

若目标灯具成功将客户灯具的待上传数据发送至服务器,则在自身的数据项登记表中删除上传成功的客户灯具的待上传数据;If the target lamp successfully sends the data to be uploaded to the customer's lamp to the server, it will delete the data to be uploaded to the client's lamp that has been successfully uploaded in its own data item registration table;

目标灯具向上传成功的客户灯具发送数据上传成功信息;数据上传成功信息用于指示客户灯具更新自身的数据项登记表。The target lamp sends a data upload success message to the customer lamp that has been uploaded successfully; the data upload success message is used to instruct the client lamp to update its own data item registration table.

第二方面,本申请还提供了一种灯具通信装置,集成于目标灯具中,目标灯具为灯具组网中任一灯具;该装置包括:In the second aspect, this application also provides a lamp communication device, which is integrated in the target lamp, and the target lamp is any lamp in the lamp network; the device includes:

服务灯具查找模块,用于若确定目标灯具当前处于横向通信模式,则在灯具组网中查找服务灯具;服务灯具为灯具组网中支持与服务器进行通信的任一灯具,横向通信模式为不支持与服务器进行通信的模式;The service lamp search module is used to search for service lamps in the lamp network if it is determined that the target lamp is currently in horizontal communication mode; the service lamp is any lamp in the lamp network that supports communication with the server, and the horizontal communication mode is not supported The mode of communication with the server;

数据上传模块,用于将目标灯具的第一待上传数据发送至服务灯具,指示服务灯具将第一待上传数据转发至服务器。The data upload module is used to send the first data to be uploaded of the target lamp to the service lamp, and instruct the service lamp to forward the first data to be uploaded to the server.

第三方面,本申请还提供了一种灯具,该灯具包括存储器和处理器,存储器存储有计算机程序,处理器执行计算机程序时实现上述第一方面中任一方法实施例的步骤。In a third aspect, the application also provides a lamp, which includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the steps of any method embodiment in the first aspect.

第四方面,本申请还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现上述第一方面中任一方法实施例的步骤。In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of any method embodiment in the above-mentioned first aspect are implemented.

第五方面,本申请还提供了一种计算机程序产品,该计算机程序产品包括计算机程序,计算机程序被处理器执行时实现上述第一方面中任一方法实施例的步骤。In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program. When the computer program is executed by a processor, the steps of any method embodiment in the first aspect are implemented.

上述灯具通信方法、装置和灯具,若目标灯具确定自身当前处于横向通信模式,则在灯具组网中查找服务灯具;目标灯具将第一待上传数据发送至服务灯具,指示服务灯具将第一待上传数据转发至服务器。其中,目标灯具为灯具组网中任一灯具,服务灯具为灯具组网中支持与服务器进行通信的任一灯具;横向通信模式为不支持与服务器进行通信的模式。在本申请中,当灯具组网中的任一灯具无法与服务器进行通信时,可以从灯具组网中确定能和服务器进行通信的服务灯具,从而通过服务灯具将自身的待上传数据发送至服务器中。如此,本申请为灯具提供多条数据上传路径,灯具组网中只要存在一个灯具能够与服务器进行通信,即可保证整个灯具组网中灯具与服务器进行通信,提高了灯具与服务器之间的通信可靠性。According to the above-mentioned lamp communication method, device and lamp, if the target lamp determines that it is currently in the horizontal communication mode, it will search for the service lamp in the lamp network; the target lamp will send the first data to be uploaded to the service lamp, indicating that the service lamp will be the first to be uploaded. Upload data is forwarded to the server. Among them, the target lamp is any lamp in the lamp network, the service lamp is any lamp in the lamp network that supports communication with the server; the horizontal communication mode is a mode that does not support communication with the server. In this application, when any lamp in the lamp network cannot communicate with the server, the service lamp that can communicate with the server can be determined from the lamp network, thereby sending its own data to be uploaded to the server through the service lamp middle. In this way, this application provides multiple data upload paths for lamps. As long as there is one lamp in the lamp network that can communicate with the server, it can ensure that the lamps and servers in the entire lamp network communicate, improving the communication between the lamps and the server. reliability.

附图说明Description of drawings

图1为一个实施例中灯具通信方法的应用环境图;Figure 1 is an application environment diagram of the lighting communication method in one embodiment;

图2为一个实施例中第一种灯具通信方法的流程示意图;Figure 2 is a schematic flowchart of a first lamp communication method in an embodiment;

图3为一个实施例中确定服务灯具的流程示意图;Figure 3 is a schematic flowchart of determining service lamps in one embodiment;

图4为一个实施例中创建灯具节点列表的流程示意图;Figure 4 is a schematic flowchart of creating a lamp node list in one embodiment;

图5为一个实施例中灯具控制方法的流程示意图;Figure 5 is a schematic flowchart of a lighting control method in one embodiment;

图6为一个实施例中更新数据项登记表的流程示意图;Figure 6 is a schematic flowchart of updating the data item registration table in one embodiment;

图7为一个实施例中第二种灯具通信方法的流程示意图;Figure 7 is a schematic flow chart of the second lamp communication method in one embodiment;

图8为一个实施例中第三种灯具通信方法的流程示意图;Figure 8 is a schematic flow chart of a third lighting fixture communication method in one embodiment;

图9为另一个实施例更新数据项登记表的流程示意图;Figure 9 is a schematic flowchart of updating the data item registration table in another embodiment;

图10为一个实施例中第四种灯具通信方法的流程示意图;Figure 10 is a schematic flow chart of the fourth lighting fixture communication method in one embodiment;

图11为一个实施例中灯具通信装置的结构框图;Figure 11 is a structural block diagram of a lighting communication device in one embodiment;

图12为一个实施例中灯具的内部结构图。Figure 12 is an internal structural diagram of a lamp in one embodiment.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.

本申请提供的灯具通信方法,可以应用于如图1所示的应用环境中。其中,灯具组网内的灯具L1、灯具L2、灯具L3和灯具L4具备横向通信功能,可以互连进行横向通信,各灯具可以与服务器进行纵向通信。The lamp communication method provided by this application can be applied in the application environment as shown in Figure 1. Among them, the lamps L1, L2, L3 and L4 in the lamp network have horizontal communication functions and can be interconnected for horizontal communication, and each lamp can communicate vertically with the server.

作为一个示例,灯具组网内的各灯具可以通过蓝牙Mesh、wifi、ZigBee等方式中的任一种进行组网和通信,本实施例对此不做限制。As an example, each lamp in the lamp network can be networked and communicated through any of Bluetooth Mesh, wifi, ZigBee, etc., which is not limited in this embodiment.

需要说明的是,图1仅以一个灯具组网和4个灯具进行举例,在实际应用时,灯具组网内还可以包括更多或更少的灯具。另外,接入到该服务器中的灯具组网也可以为多个,由服务器分别对各个灯具组网内的灯具进行管控。It should be noted that Figure 1 only uses one lighting fixture network and four lighting fixtures as an example. In actual application, the lighting fixture network may also include more or fewer lighting fixtures. In addition, there can be multiple lighting fixtures connected to the server, and the server can separately manage and control the lighting fixtures in each lighting fixtures network.

为了便于服务器有效控制多个灯具的运行状态,需要灯具将自身的最新的运行数据上传给服务器,并接收服务器下发的灯具控制信息。本申请实施例通过对灯具组网的方式,使得灯具具备两个维度的通信功能。在灯具无法与服务器进行通信的情况下,灯具可以在灯具组网内确定数据上传路径,交由其他灯具帮自己上传运行数据,提高了灯具与服务器之间通信的可靠性。In order for the server to effectively control the operating status of multiple lamps, the lamps need to upload their latest operating data to the server and receive the lamp control information sent by the server. The embodiment of the present application enables the lamps to have two-dimensional communication functions by networking the lamps. When the lamp cannot communicate with the server, the lamp can determine the data upload path within the lamp network and let other lamps upload the operating data for itself, which improves the reliability of communication between the lamp and the server.

接下来,将通过实施例并结合附图具体地对本申请实施例的技术方案,以及本申请实施例的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。需要说明的是,本申请实施例提供的一种灯具通信方法,其执行主体可以为任一灯具,也可以为灯具通信装置,该装置可以通过软件、硬件或者软硬件结合的方式实现成为灯具处理器的部分或者全部。显然,所描述的实施例只是本申请实施例一部分实施例,而不是全部的实施例。Next, the technical solutions of the embodiments of the present application and how the technical solutions of the embodiments of the present application solve the above technical problems will be described in detail through the embodiments and in conjunction with the drawings. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. It should be noted that the execution subject of the lamp communication method provided by the embodiment of the present application can be any lamp or a lamp communication device. The device can be implemented as a lamp processing device through software, hardware, or a combination of software and hardware. part or all of the device. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all of the embodiments.

在一个实施例中,如图2所示,提供了一种灯具通信方法,包括以下步骤:In one embodiment, as shown in Figure 2, a lamp communication method is provided, including the following steps:

步骤210:若目标灯具确定自身当前处于横向通信模式,则在灯具组网中查找服务灯具;目标灯具为灯具组网中任一灯具,服务灯具为灯具组网中支持与服务器进行通信的任一灯具;横向通信模式为不支持与服务器进行通信的模式。Step 210: If the target lamp determines that it is currently in the horizontal communication mode, it searches for the service lamp in the lamp network; the target lamp is any lamp in the lamp network, and the service lamp is any lamp in the lamp network that supports communication with the server. Luminaire; horizontal communication mode is a mode that does not support communication with the server.

其中,多个灯具通过蓝牙Mesh、wifi、ZigBee方式中的一种进行组网,组网后的多个灯具在横向上形成互联互通。Among them, multiple lamps are networked through one of Bluetooth Mesh, wifi, and ZigBee methods. After networking, multiple lamps are interconnected horizontally.

在一种可能的实现方式中,步骤210的实现过程为:若目标灯具确定自身当前处于横向通信模式,即自身无法与服务器进行通信,亦无法将自身的运行数据发送给服务器。由于目标灯具处于灯具组网内,因此,目标灯具可以在自身所在的灯具组网中查找能够与服务器通信的服务灯具,以通过该服务灯具将目标灯具的运行数据发送给服务器。In a possible implementation manner, the implementation process of step 210 is as follows: if the target lamp determines that it is currently in the horizontal communication mode, that is, it cannot communicate with the server and cannot send its own operating data to the server. Since the target lamp is in the lamp network, the target lamp can search for a service lamp that can communicate with the server in the lamp network where it is located, so as to send the operation data of the target lamp to the server through the service lamp.

需要说明的是,在一个时刻,目标灯具只能在灯具组网中选择一个灯具作为自身的服务灯具。换言之,目标灯具在同一时刻只采用一个服务灯具上传自身的运行数据,以避免服务器连接灯具数过多,造成服务灯具数据上传效率低的问题。It should be noted that at a moment, the target lamp can only select one lamp as its service lamp in the lamp network. In other words, the target lamp only uses one service lamp to upload its own operating data at the same time to avoid the problem of low efficiency in uploading service lamp data caused by too many lamps connected to the server.

步骤220:目标灯具将第一待上传数据发送至服务灯具,指示服务灯具将第一待上传数据转发至服务器。Step 220: The target lamp sends the first data to be uploaded to the service lamp, and instructs the service lamp to forward the first data to be uploaded to the server.

应该理解的是,由于目标灯具当前处于横向通信模式,无法与服务器进行通信,因此,目标灯具不是任何灯具的服务灯具,目标灯具的第一待上传数据即为目标灯具自身的运行数据。It should be understood that since the target lamp is currently in horizontal communication mode and cannot communicate with the server, the target lamp is not a service lamp of any lamp, and the first data to be uploaded of the target lamp is the operating data of the target lamp itself.

在一种可能的实现方式中,步骤220的实现过程为:目标灯具向服务灯具发送数据代上传请求,该数据代上传请求中携带有目标灯具的第一待上传数据。服务灯具接收到目标灯具发送的数据代上传请求后,则将第一待上传数据转发至服务器。In a possible implementation manner, the implementation process of step 220 is as follows: the target lamp sends a data generation upload request to the service lamp, and the data generation upload request carries the first to-be-uploaded data of the target lamp. After the service lamp receives the data upload request sent by the target lamp, it forwards the first data to be uploaded to the server.

可选地,若服务灯具自身也存在待上传数据,则服务灯具将第一待上传数据和服务灯具自身的待上传数据一并发送至服务器。Optionally, if the service lamp itself also has data to be uploaded, the service lamp sends the first data to be uploaded and the data to be uploaded to the service lamp itself to the server.

需要说明的是,每个待上传数据中均包括该数据所属灯具的身份数据,以使服务器接收到数据后,可以根据身份标识确定接收的数据是哪一个灯具的运行数据。It should be noted that each data to be uploaded includes the identity data of the lamp to which the data belongs, so that after the server receives the data, it can determine which lamp's operating data the received data is based on the identity identifier.

换言之,服务灯具在帮助目标灯具代上传数据时,需要将目标灯具的身份数据也发送给服务器,使得服务器可以根据目标灯具的身份数据,验证目标灯具的身份合法性,在其身份合法的情况下,确定服务灯具上传的第一待上传数据为目标灯具的运行数据。In other words, when the service lamp helps the target lamp upload data, it needs to also send the identity data of the target lamp to the server, so that the server can verify the identity legitimacy of the target lamp based on the identity data of the target lamp. If its identity is legal , determine that the first to-be-uploaded data uploaded by the service lamp is the operating data of the target lamp.

作为一个示例,目标灯具的身份数据可以包括目标灯具的身份标识和身份认证信息。服务器中本身也存储有每个灯具的身份标识和身份认证信息,服务器验证目标灯具身份合法性的过程为:服务器根据服务灯具上传的目标灯具的身份标识,获取该身份标识的目标身份认证信息,进而通过目标身份认证信息对服务灯具上传的身份认证信息进行验证,若两者一致,则确定目标灯具的身份合法,若两者不一致,则确定目标灯具的身份不合法。As an example, the identity data of the target lamp may include the identity identification and identity authentication information of the target lamp. The server itself also stores the identity and authentication information of each lamp. The process for the server to verify the legality of the identity of the target lamp is: the server obtains the target identity authentication information of the target lamp based on the identity of the target lamp uploaded by the service lamp, Then, the identity authentication information uploaded by the service lamp is verified through the target identity authentication information. If the two are consistent, the identity of the target lamp is determined to be legal. If the two are inconsistent, the identity of the target lamp is determined to be illegal.

进一步地,在目标灯具的身份不合法的情况下,服务器可以认为服务灯具上传的第一待上传数据并未目标灯具的有效数据,可以舍弃该时刻接收的数据,等待下一时刻上传的目标灯具的运行数据。Furthermore, when the identity of the target lamp is illegal, the server may consider that the first to-be-uploaded data uploaded by the service lamp is not valid data of the target lamp, and may discard the data received at that moment and wait for the target lamp to be uploaded at the next moment. operating data.

另外,当有运行数据需要上传时,灯具携带自身的身份信息创建与服务器的通讯连接,在向服务器发送灯具的待上传数据时,采用对应的通信链路进行数据传输。如此,在同一时刻,多个灯具可以采用各自对应的通信链路与服务器进行并行通信。In addition, when there is operating data that needs to be uploaded, the lamp carries its own identity information to create a communication connection with the server. When sending the data to be uploaded of the lamp to the server, the corresponding communication link is used for data transmission. In this way, at the same time, multiple lamps can use their corresponding communication links to communicate in parallel with the server.

基于此,在该步骤220中,服务灯具替代目标灯具向服务器发送第一待上传数据时,该服务灯具创建一个专门用来上传目标灯具第一待上传数据的通讯连接,如果服务灯具为N台目标灯具上传数据,则可以创建N条通讯连接,服务灯具与服务器之间的通信链路累计连接数为N+1。Based on this, in step 220, when the service lamp replaces the target lamp to send the first data to be uploaded to the server, the service lamp creates a communication connection specifically used to upload the first data to be uploaded of the target lamp. If the service lamp is N units When the target lamp uploads data, N communication connections can be created, and the cumulative number of communication links between the service lamp and the server is N+1.

上述灯具通信方法中,若目标灯具确定自身当前处于横向通信模式,则在灯具组网中查找服务灯具;目标灯具将第一待上传数据发送至服务灯具,指示服务灯具将第一待上传数据转发至服务器。其中,目标灯具为灯具组网中任一灯具,服务灯具为灯具组网中支持与服务器进行通信的任一灯具;横向通信模式为不支持与服务器进行通信的模式。在本申请中,当灯具组网中的任一灯具无法与服务器进行通信时,可以从灯具组网中确定能和服务器进行通信的服务灯具,从而通过服务灯具将自身的待上传数据发送至服务器中。如此,本申请为灯具提供多条数据上传路径,灯具组网中只要存在一个灯具能够与服务器进行通信,即可保证整个灯具组网中灯具与服务器进行通信,提高了灯具与服务器之间的通信可靠性。In the above lamp communication method, if the target lamp determines that it is currently in the horizontal communication mode, it searches for the service lamp in the lamp network; the target lamp sends the first data to be uploaded to the service lamp, and instructs the service lamp to forward the first data to be uploaded. to the server. Among them, the target lamp is any lamp in the lamp network, the service lamp is any lamp in the lamp network that supports communication with the server; the horizontal communication mode is a mode that does not support communication with the server. In this application, when any lamp in the lamp network cannot communicate with the server, the service lamp that can communicate with the server can be determined from the lamp network, thereby sending its own data to be uploaded to the server through the service lamp middle. In this way, this application provides multiple data upload paths for lamps. As long as there is one lamp in the lamp network that can communicate with the server, it can ensure that the lamps and servers in the entire lamp network communicate, improving the communication between the lamps and the server. reliability.

基于上述实施例,目标灯具在选择自身的服务灯具时,可以从灯具组网中的多个灯具中确定一个灯具,将其作为自身的服务灯具。Based on the above embodiment, when the target lamp selects its own service lamp, it can determine one lamp from multiple lamps in the lamp network and use it as its own service lamp.

在一个实施例中,如图3所示,上述步骤210中目标灯具在灯具组网中查询服务灯具的实现过程,可以包括以下步骤:In one embodiment, as shown in Figure 3, the implementation process of the target lamp querying the service lamp in the lamp network in step 210 may include the following steps:

步骤310:目标灯具从灯具节点列表中获取候选灯具;候选灯具为支持与服务器进行通信的灯具。Step 310: The target lamp obtains candidate lamps from the lamp node list; the candidate lamps are lamps that support communication with the server.

其中,灯具组网中的每个灯具都会创建自身的灯具节点列表,灯具节点列表中包括多个灯具的灯具信息。Among them, each lamp in the lamp network will create its own lamp node list, and the lamp node list includes lamp information of multiple lamps.

作为一个示例,灯具信息包括灯具的单播地址、身份标识、身份认证信息、通信模式、待上传数据量中的一项或多项。单播地址在整个灯具组网中具有唯一性,根据单播地址可以在灯具组网中确定唯一一个灯具。As an example, the lamp information includes one or more of the lamp's unicast address, identity identifier, identity authentication information, communication mode, and amount of data to be uploaded. The unicast address is unique in the entire lighting network. According to the unicast address, the only lighting fixture in the lighting network can be determined.

在一种可能的实现方式中,将灯具节点列表中可以和服务器进行通信的所有灯具确定为候选灯具。In one possible implementation, all lamps in the lamp node list that can communicate with the server are determined as candidate lamps.

需要说明的是,在目标灯具从灯具节点列表中,各灯具的通信模式包括横向通信模式、双向通信模式和纵向通信模式,横向通信模式表征灯具可以与目标灯具通信但不能与服务器通信,双向通信模式表征灯具可以同时与目标灯具和服务器通信,纵向通信模式表征灯具可以与服务器通信但不能与其他灯具(包含目标灯具)通信。It should be noted that in the target lamp node list, the communication modes of each lamp include horizontal communication mode, two-way communication mode and vertical communication mode. The horizontal communication mode indicates that the lamp can communicate with the target lamp but cannot communicate with the server. Two-way communication The mode represents that the lamp can communicate with the target lamp and the server at the same time, and the vertical communication mode represents that the lamp can communicate with the server but cannot communicate with other lamps (including the target lamp).

基于此,步骤310中选择的候选灯具即为灯具节点列表中通信模式为双向通信模式的至少一个灯具。Based on this, the candidate lamp selected in step 310 is at least one lamp whose communication mode is the two-way communication mode in the lamp node list.

步骤320:目标灯具基于预设的选取策略,从候选灯具中确定服务灯具。Step 320: Based on the preset selection strategy, the target lamp determines the service lamp from the candidate lamps.

其中,预设的选取策略为最小负荷策略或最优路径策略。Among them, the preset selection strategy is the minimum load strategy or the optimal path strategy.

若选取策略为最小负荷策略,则步骤320的实现过程可以为:根据灯具节点列表中各灯具的待上传数据量,将待上传数据量最少的一个灯具确定为服务灯具。If the selection strategy is the minimum load strategy, the implementation process of step 320 may be: according to the amount of data to be uploaded of each lamp in the lamp node list, determine the lamp with the smallest amount of data to be uploaded as the service lamp.

若选取策略为最优路径策略,则步骤320的实现过程可以为:获取目标灯具与各候选灯具之间对应的通信路径,预估采用各通信路径进行数据传输时的通信时长,将通信时长最短的通信路径所对应的候选灯具确定为服务灯具。If the selection strategy is the optimal path strategy, the implementation process of step 320 may be: obtaining the corresponding communication paths between the target lamp and each candidate lamp, estimating the communication duration when using each communication path for data transmission, and minimizing the communication duration. The candidate lamp corresponding to the communication path is determined as the service lamp.

需要说明的是,目标灯具在选择自身的服务灯具时,也可以基于灯具节点列表和/或自身待上传数据量,采用其他的选取策略从多个候选灯具中确定服务灯具,本实施例对此不做限制。It should be noted that when the target lamp selects its own service lamp, it can also use other selection strategies to determine the service lamp from multiple candidate lamps based on the lamp node list and/or the amount of data to be uploaded. In this embodiment, No restrictions.

另外,处于横向通信的目标灯具在一次数据上传过程中,为避免连接服务器的灯具数过多,目标灯具只确定一个服务灯具,通过该服务灯具代将目标灯具的第一待上传数据转发给服务器。In addition, during a data upload process for the target lamp in horizontal communication, in order to avoid too many lamps connected to the server, the target lamp only determines one service lamp, and forwards the first data to be uploaded of the target lamp to the server through this service lamp. .

在本实施例中,当目标灯具无法与服务器进行通信时,根据灯具节点列表确定候选灯具,然后采用预设的选取策略从候选灯具中确定目标灯具的服务灯具,进而通过服务灯具上传目标灯具的待上传数据,实现了目标灯具和服务器之间的数据通信。In this embodiment, when the target lamp cannot communicate with the server, candidate lamps are determined according to the lamp node list, and then a preset selection strategy is used to determine the service lamp of the target lamp from the candidate lamps, and then the service lamp of the target lamp is uploaded. The data to be uploaded realizes the data communication between the target lamp and the server.

接上述图3对应的方法实施例,如图4所示,目标灯具构建灯具节点列表构建的实现过程,可以包括以下步骤:Continuing from the method embodiment corresponding to Figure 3 above, as shown in Figure 4, the implementation process of building a target lamp node list may include the following steps:

步骤410:目标灯具接收灯具组网中其他灯具定时发送的心跳数据包。Step 410: The target lamp receives heartbeat data packets periodically sent by other lamps in the lamp network.

其中,心跳数据包中至少包括对应灯具的通信模式。The heartbeat data packet at least includes the communication mode of the corresponding lamp.

需要说明的是,灯具组网中的灯具按照其组网协议栈进行广播与通信。已加入灯具组网中的灯具定时发送心跳数据包(Heartbeat),用于在灯具之间相互交换数据。其中,心跳数据包的依据心跳发表和订阅条件/协议进行设置,本实施例对此不做解释。It should be noted that the lamps in the lamp network broadcast and communicate according to their networking protocol stack. The lamps that have been added to the lamp network regularly send heartbeat data packets (Heartbeat), which are used to exchange data between the lamps. Among them, the heartbeat data packet is set according to the heartbeat publishing and subscription conditions/protocols, which will not be explained in this embodiment.

在一种可能的实现方式中,步骤410的实现过程可以为:灯具组网中的每个灯具都定时发送目标地址值为0xFFFF的心跳数据包,由于0xFFFF是广播地址,因此,灯具组网中的所有网络节点的灯具都能接收到此心跳数据包。网络中的所有节点都能接收到此心跳数据包。In a possible implementation, the implementation process of step 410 can be as follows: each lamp in the lamp network regularly sends a heartbeat data packet with a target address value of 0xFFFF. Since 0xFFFF is a broadcast address, therefore, in the lamp network The lamps of all network nodes can receive this heartbeat data packet. All nodes in the network can receive this heartbeat packet.

可选地,参见下表1,心跳数据包中还可以包括对应灯具的身份标识、身份认证信息和待上传数据量。Optionally, see Table 1 below, the heartbeat data packet may also include the identity of the corresponding lamp, identity authentication information and the amount of data to be uploaded.

表1Table 1

身份标识Identity mark身份认证信息Identity authentication information通信模式communication mode待上传数据量Amount of data to be uploaded

其中,身份标识为灯具在服务器中的身份标识,在服务器存储的灯具身份标识中具有唯一性;身份认证信息用于供服务器验证灯具的身份合法性,服务器中也存储有各灯具的身份认证信息;通信模式包括横向通信模式、纵向通信模式和双向通信模式;待上传数据量可以为空,也可以为一个或多个。Among them, the identity mark is the identity mark of the lamp in the server, which is unique among the lamp identity marks stored in the server; the identity authentication information is used for the server to verify the identity legitimacy of the lamp, and the identity authentication information of each lamp is also stored in the server. ; Communication modes include horizontal communication mode, vertical communication mode and two-way communication mode; the amount of data to be uploaded can be empty, or one or more.

步骤420:目标灯具根据接收到的心跳数据包,创建灯具节点列表。Step 420: The target lamp creates a lamp node list based on the received heartbeat data packet.

其中,对于每个心跳数据包,目标灯具可以将心跳数据包的源地址作为单播地址记录在灯具节点列表中,该单播地址在整个灯具组网中唯一,根据单播地址可以确定灯具节点列表中唯一一条数据。Among them, for each heartbeat data packet, the target lamp can record the source address of the heartbeat data packet as a unicast address in the lamp node list. This unicast address is unique in the entire lamp network. The lamp node can be determined based on the unicast address. The only piece of data in the list.

进一步地,灯具节点列表中,还包括根据各单播地址,从对应的心跳数据包中解析出来的身份标识、身份认证信息、通信模式和待上传数据量。Furthermore, the lamp node list also includes the identity identifier, identity authentication information, communication mode and amount of data to be uploaded parsed from the corresponding heartbeat data packet according to each unicast address.

作为一个示例,灯具节点列表是目标灯具根据接收到的发送心跳数据包所对应灯具的灯具信息创建的,其中也可以包括目标灯具的灯具信息,以通过灯具节点列表获取当前时刻灯具组网中所有灯具的灯具信息。As an example, the lamp node list is created by the target lamp based on the lamp information corresponding to the received heartbeat data packet. It may also include the lamp information of the target lamp to obtain all the lamps in the network at the current moment through the lamp node list. Fixture information for the light fixture.

参见下表2所示的灯具节点列表,假设目标灯具的单播地址为Unicast Address-0,则该灯具节点列表中包括但不限于灯具组网中所有灯具的单播地址、身份标识、身份认证信息、通信模式和待上传数据量。Refer to the lamp node list shown in Table 2 below. Assuming that the unicast address of the target lamp is Unicast Address-0, the lamp node list includes but is not limited to the unicast addresses, identity identifiers, and identity authentication of all lamps in the lamp network. Information, communication patterns and amount of data to be uploaded.

表2Table 2

其中,通信模式中“0”代表灯具处于横向通信模式,“1”代表灯具处于双向通信模式,“2”代表灯具处于纵向通信模式。Among them, "0" in the communication mode means that the lamp is in horizontal communication mode, "1" means that the lamp is in two-way communication mode, and "2" means that the lamp is in vertical communication mode.

根据表2可知,单播地址为Unicast Address-0的目标灯具处于横向通信模式,其待上传的数据量为10条数据。但目标灯具处于横向通信模式,无法向服务器上传自身的10条待上传数据,因此,目标灯具可以根据表2所示的灯具节点列表,将处于双向通信模式的灯具2(即单播地址为Unicast Address-2的灯具)确定为服务灯具。According to Table 2, it can be seen that the target lamp with the unicast address Unicast Address-0 is in horizontal communication mode, and the amount of data to be uploaded is 10 pieces of data. However, the target lamp is in the horizontal communication mode and cannot upload its own 10 pieces of data to be uploaded to the server. Therefore, the target lamp can use the lamp node list shown in Table 2 to send the lamp 2 in the two-way communication mode (that is, the unicast address is Unicast The luminaire of Address-2) is determined as the service luminaire.

作为另一个示例,灯具节点列表包括灯具组网中其他灯具的灯具信息,通过灯具节点列表可以记录当前时刻灯具组网中除目标灯具以外的其他灯具的灯具信息。As another example, the lamp node list includes lamp information of other lamps in the lamp network, and the lamp node list can record lamp information of other lamps in the lamp network except the target lamp at the current moment.

参见下表3所示的灯具节点列表,假设目标灯具的单播地址为Unicast Address-0,则灯具节点列表中包括但不限于灯具组网中其他灯具的单播地址、身份标识、身份认证信息、通信模式和待上传数据量。Refer to the lamp node list shown in Table 3 below. Assuming that the unicast address of the target lamp is Unicast Address-0, the lamp node list includes but is not limited to the unicast addresses, identity identifiers, and identity authentication information of other lamps in the lamp network. , communication mode and amount of data to be uploaded.

表3table 3

单播地址unicast address身份标识Identity mark身份认证信息Identity authentication information通信模式communication mode待上传数据量Amount of data to be uploadedUnicast Address-1Unicast Address-1ID1ID1Identification-1Identification-10033Unicast Address-2Unicast Address-2ID2ID2Identification-2Identification-21155Unicast Address-3Unicast Address-3ID3ID3Identification-3Identification-3111010…………………………Unicast Address-nUnicast Address-nIDnIDnIdentification-nIdentification-n2222

假设目标灯具的待上传数据量为10条数据,且目标灯具处于横向通信模式,无法向服务器上传自身的10条待上传数据,因此,目标灯具可以根据表3所示的灯具节点列表,将处于双向通信模式的灯具2(即单播地址为Unicast Address-2的灯具)和灯具3(即单播地址为Unicast Address-3的灯具)确定为候选务灯具。Assume that the amount of data to be uploaded by the target lamp is 10 pieces of data, and the target lamp is in horizontal communication mode and cannot upload its own 10 pieces of data to be uploaded to the server. Therefore, the target lamp can be in The two-way communication mode lamp 2 (that is, the lamp with the unicast address of Unicast Address-2) and the lamp 3 (that is, the lamp with the unicast address of Unicast Address-3) are determined as candidate lamps.

进一步地,由于灯具2的待上传数据量为5,灯具3的待上传数据量为10,因此,将待上传数据量较少的灯具2确定为目标灯具的服务灯具,由灯具2将目标灯具的10条数据和灯具2自身的5条数据上传至服务器中。Further, since the amount of data to be uploaded for lamp 2 is 5, and the amount of data to be uploaded for lamp 3 is 10, therefore, lamp 2 with a smaller amount of data to be uploaded is determined as the service lamp of the target lamp, and lamp 2 sets the target lamp to 10 pieces of data and 5 pieces of data of lamp 2 itself are uploaded to the server.

在本实施例中,当灯具组网中的灯具定时广播心跳数据包时,目标灯具可以根据接收到的心跳数据包的源地址和心跳数据包中携带的至少一项灯具信息,创建自身的灯具节点列表或者整个灯具组网的灯具节点列表。如此,他用过广播心跳数据包,可以建立准确有效的灯具节点列表,便于目标灯具从中确定自身的服务灯具。In this embodiment, when the lamps in the lamp network regularly broadcast heartbeat data packets, the target lamp can create its own lamp based on the source address of the received heartbeat data packet and at least one piece of lamp information carried in the heartbeat data packet. Node list or lamp node list of the entire lamp network. In this way, he used the broadcast heartbeat data packet to establish an accurate and effective lamp node list, which facilitates the target lamp to determine its own service lamp.

另外,需要说明的是,灯具组网中的灯具每广播一次心跳数据包,目标灯具则根据接收到心跳数据包对创建的灯具节点列表进行更新,以使灯具节点列表中的数据可以准确反映灯具组网中灯具的通信模式和数据上传量等信息。如此,提高了灯具节点列表中灯具信息的实时性和有效性。In addition, it should be noted that every time the lamps in the lamp network broadcast a heartbeat data packet, the target lamp updates the created lamp node list based on the received heartbeat data packet, so that the data in the lamp node list can accurately reflect the lamps. Information such as the communication mode and data upload volume of the lamps in the network. In this way, the real-time and effectiveness of the lamp information in the lamp node list is improved.

基于上述各方法实施例,处于横向模式的目标灯具可以从自身创建的灯具节点列表中选择服务灯具,进而通过服务灯具将目标灯具的第一待上传数据转发至服务器中。由于目标灯具不能与服务器进行通信,则服务器需要向目标灯具发送灯具控制信息时,也可以通过目标灯具的服务灯具进行转发。Based on the above method embodiments, the target lamp in landscape mode can select the service lamp from the lamp node list created by itself, and then forward the first to-be-uploaded data of the target lamp to the server through the service lamp. Since the target lamp cannot communicate with the server, when the server needs to send lamp control information to the target lamp, it can also forward it through the service lamp of the target lamp.

基于此,在一个实施例中,如图5所示,本申请还提供了一种灯具控制方法,包括以下步骤:Based on this, in one embodiment, as shown in Figure 5, this application also provides a lamp control method, including the following steps:

步骤510:目标灯具接收服务灯具发送灯具控制信息。Step 510: The target lamp receives the lamp control information sent by the service lamp.

其中,灯具控制信息为服务灯具接收的服务器针对目标灯具下发的控制信息,灯具控制信息用于指示目标灯具对自身的运行参数进行调整。Among them, the lamp control information is the control information issued by the server for the target lamp received by the service lamp, and the lamp control information is used to instruct the target lamp to adjust its own operating parameters.

也即是,由于目标灯具不能和服务器进行通信,且之前是通过服务灯具向服务器转发目标灯具的第一待上传数据,因此,当服务器需要控制目标灯具的运行状态时,需要通过服务灯具向目标灯具转发灯具控制信息。That is to say, since the target lamp cannot communicate with the server, and the first to-be-uploaded data of the target lamp was forwarded to the server through the service lamp, when the server needs to control the operating status of the target lamp, it needs to send the data to the target through the service lamp. The lamp forwards the lamp control information.

在一种可能的实现方式中,步骤510的实现过程可以为:服务灯具将目标灯具的第一待上传数据转发给服务器后,接收服务器发送的针对目标灯具的灯具控制信息。进一步地,服务灯具将接收到的目标灯具的灯具控制信息转发给目标灯具。In a possible implementation manner, the implementation process of step 510 may be: after the service lamp forwards the first to-be-uploaded data of the target lamp to the server, it receives the lamp control information for the target lamp sent by the server. Further, the service lamp forwards the received lamp control information of the target lamp to the target lamp.

其中,灯具控制信息包括目标灯具中至少一个运行参数的控制方案。The lamp control information includes a control plan for at least one operating parameter of the target lamp.

步骤520:目标灯具根据灯具控制信息,对自身的运行参数进行调整。Step 520: The target lamp adjusts its own operating parameters according to the lamp control information.

其中,灯具的运行参数包括但不限于为通电时长、亮泡时长、错误码等,且在服务灯具和服务器中,目标灯具的运行参数为只读数据,服务灯具无法对目标灯具的运行数据进行编辑和修改。Among them, the operating parameters of the lamp include but are not limited to power-on time, lighting time, error code, etc., and in the service lamp and server, the operating parameters of the target lamp are read-only data, and the service lamp cannot perform operation data on the target lamp. Edit and revise.

在一种可能的实现方式中,步骤520的实现过程可以为:目标灯具根据灯具控制信息,确定需要控制的目标运行参数;进而根据灯具控制信息中给出的控制方案,对目标运行参数进行调整。In a possible implementation, the implementation process of step 520 can be as follows: the target lamp determines the target operating parameters that need to be controlled according to the lamp control information; and then adjusts the target operating parameters according to the control plan given in the lamp control information. .

在本实施例中,目标灯具在确定服务灯具后,不仅可以通过服务灯具向服务器转发自身的运行数据(即第一待上传数据),还可以通过服务灯具转发服务器下发给目标灯具的灯具控制信息。如此,处于横向通信模式的目标灯具可以通过服务灯具实现和服务器之间的双向通信,保证了目标灯具和服务器之间的通信有效性。In this embodiment, after determining the service lamp, the target lamp can not only forward its own operating data (i.e., the first data to be uploaded) to the server through the service lamp, but can also forward the lamp control sent by the server to the target lamp through the service lamp. information. In this way, the target lamp in the horizontal communication mode can achieve two-way communication with the server through the service lamp, ensuring the effectiveness of communication between the target lamp and the server.

基于上述实施例,服务灯具在将目标灯具的第一待上传数据转发给服务器之后,还需要向目标灯具反馈数据上传结果,以使目标灯具可以对自身的数据项登记表进行更新,保证服务灯具每次上传给服务器的都是目标灯具在当前时刻最新的运行数据。Based on the above embodiment, after the service lamp forwards the first to-be-uploaded data of the target lamp to the server, it also needs to feed back the data upload result to the target lamp, so that the target lamp can update its own data item registration table to ensure that the service lamp What is uploaded to the server each time is the latest operating data of the target lamp at the current moment.

基于此,在一个实施例中,如图6所示,目标灯具对数据项登记表进行更新的实现过程,包括以下步骤:Based on this, in one embodiment, as shown in Figure 6, the implementation process of the target lamp updating the data item registration table includes the following steps:

步骤610:目标灯具接收服务灯具发送的数据上传成功信息。Step 610: The target lamp receives the data upload success message sent by the service lamp.

也即是,服务灯具将目标灯具的第一待上传数据转发给服务器后,向目标灯具发送数据上传成功消息。目标灯具接收到服务灯具发送的数据上传成功消息后,即可确定自身的第一待上传数据已经成功发给服务器。That is, after the service lamp forwards the first to-be-uploaded data of the target lamp to the server, it sends a data upload success message to the target lamp. After the target lamp receives the data upload success message sent by the service lamp, it can confirm that its first data to be uploaded has been successfully sent to the server.

需要说明的是,若服务灯具未能成功将目标灯具的第一待上传数据发送给服务器,则在服务灯具自身的数据项登记表中删除目标灯具的数据记录,同时,向目标灯具发送数据上传失败消息。数据上传失败消息用于指示目标灯具重新选择服务灯具。It should be noted that if the service lamp fails to successfully send the first to-be-uploaded data of the target lamp to the server, the data record of the target lamp will be deleted from the data item registration table of the service lamp itself, and at the same time, the data upload will be sent to the target lamp. Failure message. The data upload failure message is used to instruct the target fixture to reselect the service fixture.

步骤620:目标灯具根据数据上传成功信息,在自身的数据项登记表中对第一待上传数据的上传状态进行更新。Step 620: The target lamp updates the upload status of the first data to be uploaded in its own data item registration table based on the data upload success information.

其中,上传成功信息包含第一待上传数据的时间戳及数据标识,目标灯具根据数据标识在自身数据项登记表中找到对应数据项,然后对比该上传成功信息中返回的时间戳与数据项登记表中数据项的时间戳是否相同,如果相同,则更新数据项的上传状态为上传成功;如果时间戳不同且早于数据项登记表中的时间戳,表明该数据项已经在上传数据的间隙中生成了更新的数据,此时不更改该数据项的上传状态,该数据项等待下一次的上传。Among them, the upload success information includes the timestamp and data identification of the first data to be uploaded. The target lamp finds the corresponding data item in its own data item registration table according to the data identification, and then compares the timestamp returned in the upload success information with the data item registration. Whether the timestamps of the data items in the table are the same. If they are the same, the upload status of the updated data item is uploaded successfully. If the timestamps are different and earlier than the timestamp in the data item registration table, it means that the data item has been uploaded in the gap. Updated data is generated in , the upload status of the data item is not changed at this time, and the data item is waiting for the next upload.

其中,目标灯具的数据项登记表包括目标灯具的至少一条数据记录,该数据项登记表中的数据即为目标灯具的第一待上传数据。The data item registration table of the target lamp includes at least one data record of the target lamp, and the data in the data item registration table is the first data to be uploaded of the target lamp.

在一种可能的实现方式中,数据项登记表包括但不限于:单播地址、数据标识、数据值、上传状态、时间戳、校验码。其中,单播地址为该数据项所属灯具的单播地址;已预定义了各种数据标识的值代表的含义,例如,0x11表示通电时长、0x12表示亮泡时长、0x13表示错误码;数据值即为当前数据标识对应的值,比如,某一行的数据标识为0x11,数据值为25,则表示该灯具通电时长为25分钟;上传状态中,0代表该数据项未上传,1代表已上传成功。时间戳为该数据项最新时间点;校验码用于校验本条数据的准确性。In a possible implementation, the data item registration table includes but is not limited to: unicast address, data identifier, data value, upload status, timestamp, and check code. Among them, the unicast address is the unicast address of the lamp to which the data item belongs; the meanings represented by the values of various data identifiers have been predefined, for example, 0x11 represents the power-on duration, 0x12 represents the lighting duration, and 0x13 represents the error code; the data value That is the value corresponding to the current data identification. For example, if the data identification of a certain row is 0x11 and the data value is 25, it means that the lamp is powered on for 25 minutes; in the upload status, 0 means that the data item has not been uploaded, and 1 means that it has been uploaded. success. The timestamp is the latest time point of the data item; the check code is used to verify the accuracy of this data.

其中,时间戳用于服务灯具在后续接收到客户灯具的数据时,判断是否需要替换数据项登记表中的已有数据值。若接收到数据的时间戳较数据项登记表中数据的时间戳而言较新,则需要在数据项登记表中替换已有的数据。Among them, the timestamp is used to determine whether the service lamp needs to replace the existing data value in the data item registration table when it subsequently receives data from the customer's lamp. If the timestamp of the received data is newer than the timestamp of the data in the data item registration table, the existing data needs to be replaced in the data item registration table.

进一步地,服务灯具将数据项登记表中的待上传数据发送给服务器时,需要携带数据项的时间戳,用于服务器与已存储数据进行对比,按照时间戳,只保留每个灯具在各数据标识下的最新数据,以记录各灯具的实时运行状态。Furthermore, when the service lamp sends the data to be uploaded in the data item registration table to the server, it needs to carry the timestamp of the data item for the server to compare with the stored data. According to the timestamp, only the data of each lamp is retained. The latest data under the logo to record the real-time operating status of each lamp.

因此,在该步骤620中,目标灯具根据数据上传成功消息,在自身的数据项登记表中对对应数据项的上传状态进行更新。Therefore, in step 620, the target lamp updates the upload status of the corresponding data item in its own data item registration table according to the data upload success message.

作为一个示例,假设处于横向通信模式的目标灯具的单播地址为UnicastAddress-0,目标灯具的数据项登记表可以参见下表4所示的数据项登记表。As an example, assume that the unicast address of the target lamp in horizontal communication mode is UnicastAddress-0. For the data item registration table of the target lamp, please refer to the data item registration table shown in Table 4 below.

表4Table 4

单播地址unicast address数据标识Data identification数据值data value上传状态Upload status时间戳Timestamp校验码Check codeUnicast Address-0Unicast Address-00x110x11252500T1T1H11H11Unicast Address-0Unicast Address-00x120x12151511T2T2H12H12Unicast Address-0Unicast Address-00x130x130000T3T3H13H13

应该理解的是,由于目标灯具无法与服务器进行通信,因为,目标灯具不存在客户灯具,其数据项登记表中只存储目标灯具的待上传数据,不会存在其他灯具的待上传数据。It should be understood that since the target lamp cannot communicate with the server, because the target lamp does not exist as a customer lamp, its data item registration table only stores data to be uploaded for the target lamp, and there will be no data to be uploaded for other lamps.

作为另一个示例,假设处于横向通信模式的目标灯具的单播地址为UnicastAddress-0,目标灯具的服务灯具为灯具2(单播地址为Unicast Address-1),服务灯具的数据项登记表可以参见下表5所示的数据项登记表。As another example, assume that the unicast address of the target lamp in horizontal communication mode is UnicastAddress-0, and the service lamp of the target lamp is lamp 2 (the unicast address is Unicast Address-1). The data item registration table of the service lamp can be found in The data item registration form shown in Table 5 below.

表5table 5

单播地址unicast address数据标识Data identification数据值data value上传状态Upload status时间戳Timestamp校验码Check codeUnicast Address-0Unicast Address-00x110x11252500T1T1H11H11Unicast Address-0Unicast Address-00x120x12151511T2T2H12H12Unicast Address-0Unicast Address-00x130x130000T3T3H13H13Unicast Address-1Unicast Address-10x140x143300T3T3H14H14Unicast Address-1Unicast Address-10x150x150000T4T4H15H15Unicast Address-2Unicast Address-20x180x180000T5T5H16H16………………………………Unicast Address-mUnicast Address-mItemNItemN0000TnTnHnHn

由表5可知,服务灯具需要上传给服务器的待上传数据包括自身(单播地址为Unicast Address-1)上传状态为“0”的数据项,以及其他客户灯具(单播地址为UnicastAddress-0的目标灯具和其他灯具)中上传状态为“0”的数据项。It can be seen from Table 5 that the data to be uploaded by the service lamps that need to be uploaded to the server includes data items with an upload status of "0" for itself (the unicast address is Unicast Address-1), and other customer lamps (the unicast address is Unicast Address-0). Target lamps and other lamps) upload data items with status "0".

应该理解的是,目标灯具为服务灯具的一个客户灯具,但服务灯具的客户灯具可以为一个,也可以为多个。对服务灯具而言,当自身的客户灯具为多个时,服务灯具的数据项登记表中记录多个客户灯具的待上传数据。It should be understood that the target lamp is a client lamp of the service lamp, but the client lamp of the service lamp can be one or multiple. For service lamps, when there are multiple customer lamps, the data item registration table of the service lamp records the data to be uploaded for multiple client lamps.

可选地,服务灯具在完成数据上传后,也会对自身的数据项登记表中的上传信息进行更新,即更新各数据项的上传状态。Optionally, after completing the data upload, the service lamp will also update the upload information in its own data item registration table, that is, update the upload status of each data item.

关于上述表4和表5,还需要说明的是,每个数据项的校验码可以为奇偶校验码、海明威校验码、循环冗余校验码中的任一种,还可以是通过其他方式生成的校验码,本实施例对此不做限制,可以校验数据安全性即可。Regarding the above Table 4 and Table 5, it should also be noted that the check code of each data item can be any one of parity check code, Hemingway check code, cyclic redundancy check code, or it can be passed This embodiment does not limit the verification code generated by other methods, and the data security can be verified.

在本实施例中,在数据上传成功的情况下,目标灯具和服务灯具可以对自身的数据项登记表中已上传数据的上传状态进行更新,便于后续核对新接收/新采集的灯具运行数据后,只保留最新时间戳的数据。同时,通过对数据项登记表进行更新,可以向服务器发送最新时间戳的对应的灯具运行数据,使得服务器根据灯具的最新运行数据对灯具进行有效控制。In this embodiment, when the data upload is successful, the target lamp and the service lamp can update the upload status of the uploaded data in their own data item registration tables to facilitate subsequent verification of the newly received/newly collected lamp operation data. , only the data with the latest timestamp is retained. At the same time, by updating the data item registration table, the corresponding lamp operation data with the latest timestamp can be sent to the server, so that the server can effectively control the lamps based on the latest operation data of the lamps.

综合上述各方法实施例,如图7所示,在目标灯具处于横向通信模式时,本申请提供的灯具通信方法,包括以下步骤:Based on the above method embodiments, as shown in Figure 7, when the target lamp is in the horizontal communication mode, the lamp communication method provided by this application includes the following steps:

步骤701:目标灯具确定自身当前处于横向通信模式,则从自身创建的灯具节点列表中获取候选灯具。Step 701: The target lamp determines that it is currently in the horizontal communication mode, and obtains candidate lamps from the lamp node list created by itself.

步骤702:目标灯具基于预设的选取策略,从候选灯具中确定服务灯具。Step 702: Based on the preset selection strategy, the target lamp determines the service lamp from the candidate lamps.

步骤703:目标灯具将第一待上传数据发送至服务灯具。Step 703: The target lamp sends the first data to be uploaded to the service lamp.

其中,第一待上传数据为目标灯具自身的待上传数据,存储在目标灯具自身的数据项登记表中;Among them, the first data to be uploaded is the data to be uploaded of the target lamp itself, which is stored in the data item registration table of the target lamp itself;

步骤704:服务灯具接收目标灯具发送的第一待上传数据,将第一待上传数据存储在自身的数据项登记表中。Step 704: The service lamp receives the first data to be uploaded sent by the target lamp, and stores the first data to be uploaded in its own data item registration table.

步骤705:服务灯具将自身数据项登记表中的第二待上传数据发送给服务器。Step 705: The service lamp sends the second data to be uploaded in its own data item registration table to the server.

其中,第二待上传数据包括服务灯具自身的待上传数据中服务灯具的待上传数据和客户灯具的待上传数据(包括目标灯具的第一待上传数据)。The second data to be uploaded includes the data to be uploaded of the service lamp and the data to be uploaded of the customer lamp (including the first data to be uploaded of the target lamp) among the data to be uploaded of the service lamp itself.

步骤706:服务器接收服务灯具发送的第二待上传数据,对第二待上传数据进行校验和存储。Step 706: The server receives the second data to be uploaded sent by the service lamp, and verifies and stores the second data to be uploaded.

步骤707:服务器向服务灯具发送数据上传成功信息。Step 707: The server sends data upload success information to the service lamp.

步骤708:数据上传成功的情况下,服务灯具对自身的数据项登记表中对应待上传数据的上传状态进行更新。Step 708: If the data upload is successful, the service lamp updates the upload status of the corresponding data to be uploaded in its own data item registration table.

步骤709:服务灯具向目标灯具发送数据上传成功信息。Step 709: The service lamp sends a data upload success message to the target lamp.

需要说明的是,步骤706和步骤707可以同时执行。It should be noted that step 706 and step 707 can be executed at the same time.

步骤710:目标灯具根据数据上传成功信息,在自身的数据项登记表中对第一待上传数据的上传状态进行更新。Step 710: The target lamp updates the upload status of the first data to be uploaded in its own data item registration table based on the data upload success information.

通过上述步骤701-步骤710即可实现目标灯具向服务器发送第一待上传数据的方案,便于服务器了解目标灯具的实时运行状态。Through the above-mentioned steps 701 to 710, the target lamp can be implemented to send the first data to be uploaded to the server, so that the server can understand the real-time operating status of the target lamp.

步骤711:服务器针对目标灯具向服务灯具发送灯具控制信息;Step 711: The server sends lamp control information to the service lamp for the target lamp;

步骤712:服务灯具将灯具控制信息发送给目标灯具。Step 712: The service lamp sends the lamp control information to the target lamp.

步骤713:目标灯具接收服务灯具发送的灯具控制信息,根据灯具控制信息对自身的运行参数进行调整。Step 713: The target lamp receives the lamp control information sent by the service lamp, and adjusts its own operating parameters according to the lamp control information.

需要说明的是,本实施例提供的灯具通信方法中各步骤的实现原理和技术效果与前面各方法实施例相类似,具体的限定和解释可参见前面各方法实施例,在此不再赘述。It should be noted that the implementation principles and technical effects of each step in the lamp communication method provided in this embodiment are similar to the previous method embodiments. For specific limitations and explanations, please refer to the previous method embodiments and will not be described again here.

在一个实施例中,目标灯具确定自身通信模式时,可以先获取目标灯具与服务器之间的通信状态,进而根据通信状态判断目标灯具的通信模式。In one embodiment, when the target lamp determines its own communication mode, it can first obtain the communication status between the target lamp and the server, and then determine the communication mode of the target lamp based on the communication status.

在一种可能的实现方式中,灯具组网中的灯具在上电后即启动与服务器之间的通讯检测进程,实时检测灯具与服务器之间的通信状态,以判断灯具是否可以与服务器进行纵向通信。In one possible implementation, the lamps in the lamp network start the communication detection process with the server after being powered on, and detect the communication status between the lamps and the server in real time to determine whether the lamps can communicate with the server vertically. communication.

进一步地,根据通信状态判断目标灯具的通信模式包括以下两种情况:Further, judging the communication mode of the target lamp according to the communication status includes the following two situations:

(1)若通信状态为不支持与服务器进行通信,则确定目标灯具处于横向通信模式。(1) If the communication status is that communication with the server is not supported, determine that the target lamp is in horizontal communication mode.

(2)若通信状态为支持与服务器进行通信,则目标灯具可能处于双向通信模式,也可能处于纵向通信模式,需要根据目标灯具与灯具组网中其他灯具的通信状态进一步判断。(2) If the communication status supports communication with the server, the target lamp may be in two-way communication mode or vertical communication mode. It needs to be further judged based on the communication status of the target lamp and other lamps in the lamp network.

若通信状态为支持与服务器通信但不支持与灯具组网中的其他灯具进行通信,则确定目标灯具处于纵向通信模式;若通信状态为支持与服务器进行通信且支持与灯具组网中至少一个灯具进行通信,则确定目标灯具处于双向通信模式。If the communication status supports communication with the server but does not support communication with other lamps in the lamp network, determine that the target lamp is in the vertical communication mode; if the communication status supports communication with the server and supports communication with at least one lamp in the lamp network To communicate, it is determined that the target lamp is in two-way communication mode.

需要说明的是,若目标灯具处于纵向通信模式,可能是因为目标灯具未加入灯具组网中,或者目标灯具进行灯具组网后信息还未进行同步导致的,本实施例对此不做赘述。It should be noted that if the target lamp is in the vertical communication mode, it may be because the target lamp has not been added to the lamp network, or the information of the target lamp has not been synchronized after the lamp network is implemented. This embodiment will not elaborate on this.

在本实施例中,灯具组网中的任一灯具可以通过检测自身与服务器之间的通信状态和/或与灯具组网中其他灯具的通信状态,即可确定自身所处的通信模式,以根据自身所处的通信模式,确定与服务器进行通信的方式,保证灯具与服务器之间的有效通信。In this embodiment, any lamp in the lamp network can determine the communication mode it is in by detecting the communication status between itself and the server and/or the communication status with other lamps in the lamp network. According to the communication mode it is in, determine the way to communicate with the server to ensure effective communication between the lamp and the server.

通过上述附图2-附图7对应的实施例对目标灯具处于横向通信模式下,目标灯具与服务器进行通信的实现过程进行了解释说明。接下来,结合附图8,对目标灯具处于双向通信模式下,目标灯具与服务器之间的通信过程进行解释说明。The implementation process of communication between the target lamp and the server when the target lamp is in the horizontal communication mode is explained through the embodiments corresponding to the above-mentioned Figures 2 to 7. Next, with reference to Figure 8, the communication process between the target lamp and the server when the target lamp is in the two-way communication mode is explained.

需要说明的是,若目标灯具处于双向通信模式,则目标灯具相当于上述方法实施例中提及的“服务灯具”。一方面,目标灯具可以与灯具组网中的其他灯具进行通信,充当其他至少一个处于横向通信模式下的灯具的服务灯具。另一方面,目标灯具还可以与服务器进行通信,以将自身的待上传数据和至少一个客户灯具的待上传数据发送给服务器。It should be noted that if the target lamp is in the two-way communication mode, the target lamp is equivalent to the "service lamp" mentioned in the above method embodiment. On the one hand, the target lamp can communicate with other lamps in the lamp network and serve as a service lamp for at least one other lamp in the horizontal communication mode. On the other hand, the target lamp can also communicate with the server to send its own data to be uploaded and the data to be uploaded of at least one client lamp to the server.

基于此,在一个实施例中,如图8所示,当目标灯具处于双向通信模式时,本申请提供的灯具通信方法,包括以下步骤:Based on this, in one embodiment, as shown in Figure 8, when the target lamp is in the two-way communication mode, the lamp communication method provided by this application includes the following steps:

步骤810:目标灯具向服务器发送第二待上传数据,第二待上传数据包括第一待上传数据和至少一个客户灯具的待上传数据。Step 810: The target lamp sends second data to be uploaded to the server. The second data to be uploaded includes the first data to be uploaded and the data to be uploaded of at least one customer lamp.

换言之,第二待上传数据为目标灯具自身的数据项登记表中上传状态为未上传的至少一个数据项。In other words, the second data to be uploaded is at least one data item whose upload status is not uploaded in the data item registration table of the target lamp itself.

在一种可能的实现方式中,步骤810的实现过程可以为:目标灯具获取与服务器之间的通信链路,该通信链路为目标灯具有运行数据待上传时,为自身和每个客户灯具创建的专用数据传输链路;目标灯具通过对应的通信链路向服务器发送第二待上传数据。In a possible implementation, the implementation process of step 810 may be: the target lamp obtains a communication link with the server. The communication link is for itself and each customer lamp when the target lamp has operating data to be uploaded. Create a dedicated data transmission link; the target lamp sends the second data to be uploaded to the server through the corresponding communication link.

作为一个示例,若目标灯具需要为2个客户灯具上传数据,则目标灯具可以先创建三个与服务器的通讯连接,其中,两个通信链路用于上传对应客户灯具的待上传数据,另一个通信链路用于上传目标灯具自身的待上传数据。As an example, if the target lamp needs to upload data for two customer lamps, the target lamp can first create three communication connections with the server. Among them, two communication links are used to upload the data to be uploaded corresponding to the customer lamps, and the other The communication link is used to upload the data to be uploaded of the target lamp itself.

需要说明的是,目标灯具在向服务器发送第二待上传数据时,为便于服务器在接收到灯具运行数据后,可以确定数据和灯具之间的对应关系,目标灯具还需要发送各客户灯具的身份标识和身份认证信息等。It should be noted that when the target lamp sends the second data to be uploaded to the server, in order for the server to determine the correspondence between the data and the lamp after receiving the lamp operation data, the target lamp also needs to send the identity of each customer lamp. Identification and identity authentication information, etc.

其中,客户灯具的身份标识和身份认证信息可以从目标灯具自身的灯具节点列表中获取。Among them, the identity identification and identity authentication information of the customer's lamp can be obtained from the lamp node list of the target lamp itself.

另外,在该步骤810中,客户灯具需要通过目标灯具向服务器上传数据,则表征客户灯具处于横向通信模式,无法直接与服务器进行通信,需要借助自身的服务灯具(即本实施例中的目标灯具)来向服务器上传数据。In addition, in step 810, the client lamp needs to upload data to the server through the target lamp, which means that the client lamp is in the horizontal communication mode and cannot directly communicate with the server. It needs to use its own service lamp (i.e., the target lamp in this embodiment). ) to upload data to the server.

步骤820:若发生至少一个客户灯具的待上传数据上传失败,则目标灯具向上传失败的各客户灯具发送数据上传失败信息,并关闭与上传失败的各客户灯具之间的通信连接。Step 820: If the uploading data of at least one customer fixture fails to be uploaded, the target fixture sends data upload failure information to each customer fixture that failed to upload, and closes the communication connection with each customer fixture that failed to upload.

其中,数据上传失败信息用于提醒上传失败的各客户灯具重新选择服务灯具。Among them, the data upload failure information is used to remind each customer's lamp that failed to upload to re-select the service lamp.

也即是,对于目标灯具的任一客户灯具,若目标灯具无法将客户灯具的待上传数据发送给服务器,则需要执行以下几个操作:That is to say, for any customer fixture of the target fixture, if the target fixture cannot send the data to be uploaded to the server, the following operations need to be performed:

(1)向客户灯具发送数据上传失败信息,提示客户灯具重新选择自身的服务灯具;(1) Send a data upload failure message to the customer's fixture, prompting the customer's fixture to reselect its own service fixture;

(2)关闭与客户灯具之间的通信连接,避免客户灯具继续向目标灯具发送待上传数据;(2) Close the communication connection with the customer's lamp to prevent the customer's lamp from continuing to send data to be uploaded to the target lamp;

(3)在自身的数据项登记表中删除客户灯具的待上传数据,避免在客户灯具已选择新的服务灯具的情况下,目标灯具重复上传客户灯具的待上传数据。(3) Delete the data to be uploaded of the customer's lamps in its own data item registration table to avoid the target lamps from repeatedly uploading the data of the customer's lamps to be uploaded when the customer's lamps have selected new service lamps.

在本实施例中,处于双向通信模式的目标灯具可以作为至少一个客户灯具的服务灯具,将自身的待上述数据和至少一个客户灯具的待上传数据发送给服务器。如此,借助该目标灯具,可以实现客户灯具与服务器之间的通信,保证灯具与服务器通信的有效性。In this embodiment, the target lamp in the two-way communication mode can serve as a service lamp for at least one customer lamp, sending its own data to be uploaded and the data to be uploaded to at least one client lamp to the server. In this way, with the help of the target lamp, communication between the client lamp and the server can be realized, ensuring the effectiveness of the communication between the lamp and the server.

接上述图8对应的方法实施例,在一个实施例中,如图9所示,目标灯具对数据项登记表进行更新的实现过程,包括以下步骤:Continuing from the above method embodiment corresponding to Figure 8, in one embodiment, as shown in Figure 9, the implementation process of the target lamp updating the data item registration table includes the following steps:

步骤910:若目标灯具成功将客户灯具的待上传数据发送至服务器,则在自身的数据项登记表中删除上传成功的客户灯具的待上传数据。Step 910: If the target lamp successfully sends the to-be-uploaded data of the customer's lamp to the server, delete the successfully uploaded data of the client's lamp in its own data item registration table.

其中,删除上传成功的客户灯具的待上传数据,可以避免已上传数据重复上传的情况发生。Among them, deleting the data to be uploaded of customer lamps that have been uploaded successfully can avoid repeated uploading of uploaded data.

在一种可能的实现方式中,服务器成功接收数据并验证数据合法性后,可以向目标灯具发送数据上传成功信息。进一步地,目标灯具接收到服务器反馈的数据上传成功信息后,执行步骤910。In one possible implementation, after the server successfully receives the data and verifies the legality of the data, it can send a data upload success message to the target lamp. Further, after the target lamp receives the data upload success information fed back by the server, step 910 is executed.

步骤920:目标灯具向上传成功的客户灯具发送数据上传成功信息;数据上传成功信息用于指示客户灯具更新自身的数据项登记表。Step 920: The target lamp sends a data upload success message to the client lamp that has been uploaded successfully; the data upload success message is used to instruct the client lamp to update its own data item registration table.

进一步地,客户灯具接收到数据上传成功信息后,对自身的数据项登记表中对应数据项的上传状态进行更新,以实现数据项登记表的更新。Further, after receiving the data upload success message, the customer lamp updates the upload status of the corresponding data item in its own data item registration table to update the data item registration table.

在本实施例中,在数据上传成功的情况下,目标灯具和客户灯具可以对自身的数据项登记表中已上传数据的上传状态进行更新,便于后续核对新接收/新采集的灯具运行数据后,只保留最新时间戳的数据。同时,通过对数据项登记表进行更新,可以向服务器发送最新时间戳的对应的灯具运行数据,使得服务器根据灯具的最新运行数据对灯具进行有效控制。In this embodiment, when the data upload is successful, the target lamp and the customer lamp can update the upload status of the uploaded data in their own data item registration tables to facilitate subsequent verification of the newly received/newly collected lamp operation data. , only the data with the latest timestamp is retained. At the same time, by updating the data item registration table, the corresponding lamp operation data with the latest timestamp can be sent to the server, so that the server can effectively control the lamps based on the latest operation data of the lamps.

结合上述图8和图9对应的方法实施例,如图10所示,在目标灯具处于双通信模式时,本申请提供的灯具通信方法,包括以下步骤:Combined with the above method embodiments corresponding to Figures 8 and 9, as shown in Figure 10, when the target lamp is in dual communication mode, the lamp communication method provided by this application includes the following steps:

步骤1001:目标灯具将第二待上传数据发送给服务器,第二待上传数据包括目标灯具的第一待上传数据和至少一个客户灯具的待上传数据。Step 1001: The target lamp sends the second data to be uploaded to the server. The second data to be uploaded includes the first data to be uploaded of the target lamp and the data to be uploaded of at least one customer lamp.

其中,第二待上传数据即为目标灯具的数据项登记表中上传状态为未上传的多个数据项。Among them, the second data to be uploaded are multiple data items whose upload status is not uploaded in the data item registration table of the target lamp.

步骤1002:服务器接收目标灯具发送的第二待上传数据,对第二待上传数据进行校验和存储。Step 1002: The server receives the second data to be uploaded sent by the target lamp, and verifies and stores the second data to be uploaded.

步骤1003:服务器向目标灯具发送数据上传成功信息。Step 1003: The server sends data upload success information to the target lamp.

步骤1004:数据上传成功的情况下,目标灯具在自身的数据项登记表中删除上传成功的客户灯具的待上传数据。Step 1004: If the data upload is successful, the target lamp deletes the data to be uploaded of the successfully uploaded customer lamp in its own data item registration table.

步骤1005:目标灯具向客户灯具发送数据上传成功信息。Step 1005: The target lamp sends a data upload success message to the customer lamp.

其中,上述步骤1004和步骤1005可以同时执行。Among them, the above steps 1004 and 1005 can be executed at the same time.

步骤1006:客户灯具根据数据上传成功信息,在自身的数据项登记表中对待上传数据的上传状态进行更新。Step 1006: Based on the data upload success information, the customer lamp updates the upload status of the data to be uploaded in its own data item registration form.

步骤1007:服务器向目标灯具发送数据上传失败信息。Step 1007: The server sends data upload failure information to the target lamp.

步骤1008:数据上传失败的情况下,目标灯具向上传失败的客户灯具发送数据上传失败信息,数据上传失败信息用于提醒上传失败的各客户灯具重新选择服务灯具。Step 1008: When the data upload fails, the target lamp sends a data upload failure message to the client lamp that failed to upload. The data upload failure message is used to remind each client lamp that failed to upload to reselect the service lamp.

步骤1009:目标灯具关闭与上传失败的客户灯具之间的通信连接。Step 1009: The target lamp closes the communication connection with the client lamp that failed to upload.

步骤1010:客户灯具从自身的灯具节点列表中重新选择服务灯具。Step 1010: The customer fixture reselects the service fixture from its own fixture node list.

应该理解的是,步骤1003-步骤1006是目标灯具上传数据成功情况下执行的操作;步骤1007-步骤1009是目标灯具上传数据失败的情况下执行的操作。It should be understood that steps 1003 to 1006 are operations performed when the target lamp successfully uploads data; steps 1007 to 1009 are operations performed when the target lamp fails to upload data.

需要说明的是,本实施例提供的灯具通信方法中各步骤的实现原理和技术效果与前面各方法实施例相类似,具体的限定和解释可参见前面各方法实施例,在此不再赘述。It should be noted that the implementation principles and technical effects of each step in the lamp communication method provided in this embodiment are similar to the previous method embodiments. For specific limitations and explanations, please refer to the previous method embodiments and will not be described again here.

应该理解的是,虽然如上所述的各实施例所涉及的流程图2-图10的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图2-图10中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps of the flowcharts 2 to 10 involved in the above-mentioned embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts 2 to 10 involved in the above-mentioned embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but may Executed at different times, the execution order of these steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的灯具通信方法的灯具通信装置。该灯具通信装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于目标灯具中的处理器中,也可以以软件形式存储于目标灯具中的存储器中,以便于处理器调用执行以上各个模块对应的操作。其中,目标灯具为灯具组网中的任一灯具。Based on the same inventive concept, embodiments of the present application also provide a lamp communication device for implementing the above-mentioned lamp communication method. Each module in the lighting communication device can be implemented in whole or in part by software, hardware and combinations thereof. Each of the above modules can be embedded in or independent of the processor in the target lamp in the form of hardware, or can be stored in the memory of the target lamp in the form of software, so that the processor can call and execute the operations corresponding to the above modules. Among them, the target lamp is any lamp in the lamp network.

在一个实施例中,如图11所示,本申请提供的灯具通信装置,集成于目标灯具中,目标灯具为灯具组网中任一灯具;该装置1100包括:服务灯具查找模块1110和数据上传模块1120,其中:In one embodiment, as shown in Figure 11, the lamp communication device provided by this application is integrated into the target lamp, and the target lamp is any lamp in the lamp network; the device 1100 includes: a service lamp search module 1110 and a data upload Module 1120, which:

服务灯具查找模块1110,用于若确定目标灯具当前处于横向通信模式,则在灯具组网中查找服务灯具;服务灯具为灯具组网中支持与服务器进行通信的任一灯具,横向通信模式为不支持与服务器进行通信的模式;The service lamp search module 1110 is used to search for service lamps in the lamp network if it is determined that the target lamp is currently in the horizontal communication mode; the service lamp is any lamp in the lamp network that supports communication with the server, and the horizontal communication mode is not Support modes for communicating with the server;

数据上传模块1120,用于将目标灯具的第一待上传数据发送至服务灯具,指示服务灯具将第一待上传数据转发至服务器。The data upload module 1120 is used to send the first data to be uploaded of the target lamp to the service lamp, and instruct the service lamp to forward the first data to be uploaded to the server.

在其中一个实施例中,服务灯具查找模块1110,包括:In one embodiment, the service light fixture search module 1110 includes:

获取单元,用于从灯具节点列表中获取候选灯具;候选灯具为支持与服务器进行通信的灯具;The acquisition unit is used to obtain candidate lamps from the lamp node list; the candidate lamps are lamps that support communication with the server;

确定单元,用于基于预设的选取策略,从候选灯具中确定服务灯具。The determining unit is used to determine service lamps from candidate lamps based on a preset selection strategy.

在其中一个实施例中,该装置1100还包括:In one embodiment, the device 1100 further includes:

第一接收模块,用于接收灯具组网中其他灯具定时发送的心跳数据包;心跳数据包中至少包括对应灯具的通信模式;The first receiving module is used to receive heartbeat data packets sent regularly by other lamps in the lamp network; the heartbeat data packet at least includes the communication mode of the corresponding lamp;

第一创建模块,用于根据接收到的心跳数据包,创建灯具节点列表。The first creation module is used to create a lamp node list based on the received heartbeat data packet.

在其中一个实施例中,该装置1100还包括:In one embodiment, the device 1100 further includes:

第二接收模块,用于接收服务灯具发送灯具控制信息;灯具控制信息为服务灯具接收的服务器针对目标灯具下发的控制信息;The second receiving module is used to receive lamp control information sent by the service lamp; the lamp control information is the control information issued by the server for the target lamp received by the service lamp;

参数调整模块,用于根据灯具控制信息,对自身的运行参数进行调整。The parameter adjustment module is used to adjust its own operating parameters based on the lamp control information.

在其中一个实施例中,该装置1100还包括:In one embodiment, the device 1100 further includes:

第三接收模块,用于接收服务灯具发送的数据上传成功信息;The third receiving module is used to receive the data upload success information sent by the service lamp;

更新模块,用于根据数据上传成功信息,在自身的数据项登记表中对第一待上传数据的上传状态进行更新。The update module is used to update the upload status of the first data to be uploaded in its own data item registration table based on the data upload success information.

在其中一个实施例中,该装置1100还包括:In one embodiment, the device 1100 further includes:

获取模块,用于获取目标灯具与服务器之间的通信状态;Acquisition module, used to obtain the communication status between the target lamp and the server;

第一判断模块,用于若通信状态为不支持与服务器进行通信,则确定目标灯具处于横向通信模式;The first judgment module is used to determine that the target lamp is in the horizontal communication mode if the communication status is that communication with the server is not supported;

第二判断模块,用于若通信状态为支持与服务器进行通信但不支持与灯具组网中的其他灯具进行通信,则确定目标灯具处于纵向通信模式;The second judgment module is used to determine that the target lamp is in the longitudinal communication mode if the communication status supports communication with the server but does not support communication with other lamps in the lamp network;

第三判断模块,用于若通信状态为支持与服务器进行通信且支持与灯具组网中至少一个灯具进行通信,则确定目标灯具处于双向通信模式。The third determination module is used to determine that the target lamp is in the two-way communication mode if the communication status supports communication with the server and supports communication with at least one lamp in the lamp network.

在其中一个实施例中,若目标灯具处于双向通信模式,该装置1100还包括:In one embodiment, if the target lamp is in the two-way communication mode, the device 1100 further includes:

数据上传模块1120,还用于向服务器发送第二待上传数据,第二待上传数据包括第一待上传数据和至少一个客户灯具的待上传数据;The data upload module 1120 is also used to send second data to be uploaded to the server. The second data to be uploaded includes the first data to be uploaded and the data to be uploaded of at least one customer lamp;

第一发送模块,用于若发生至少一个客户灯具的待上传数据上传失败,则向上传失败的各客户灯具发送数据上传失败信息,并关闭与上传失败的各客户灯具之间的通信连接;数据上传失败信息用于提醒上传失败的各客户灯具重新选择服务灯具。The first sending module is used to send data upload failure information to each customer fixture that failed to upload, and close the communication connection with each customer fixture that failed to upload if the upload of data to be uploaded by at least one customer fixture fails; data The upload failure message is used to remind each customer whose fixtures failed to upload to reselect service fixtures.

在其中一个实施例中,该装置1100还包括:In one embodiment, the device 1100 further includes:

更新模块,还用于若成功将客户灯具的待上传数据发送至服务器,则在自身的数据项登记表中删除上传成功的客户灯具的待上传数据;The update module is also used to delete the successfully uploaded data of the customer's lamps in its own data item registration table if the data to be uploaded of the customer's lamps is successfully sent to the server;

第二发送模块,用于向上传成功的客户灯具发送数据上传成功信息;数据上传成功信息用于指示客户灯具更新自身的数据项登记表。The second sending module is used to send data upload success information to customer lamps that have been successfully uploaded; data upload success information is used to instruct the customer lamps to update their own data item registration tables.

需要说明的是,该灯具通信装置所提供的解决问题的实现方案与上述灯具通信方法中所记载的实现方案相似,故在此提供的一个或多个灯具通信装置实施例中的具体限定可以参见上文中对于灯具通信方法的限定,在此不再赘述。It should be noted that the solution to the problem provided by the lamp communication device is similar to the solution recorded in the above-mentioned lamp communication method. Therefore, the specific limitations in one or more lamp communication device embodiments provided here can be found in The limitations on communication methods of lamps mentioned above will not be repeated here.

在一个实施例中,提供了一种灯具,其内部结构图可以如图12所示。该灯具包括通过系统总线连接的处理器、存储器和网络接口。其中,该灯具的处理器用于提供计算和控制能力。该灯具的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该灯具的数据库用于存储该灯具自身的身份数据、状态模式、灯具节点列表和数据项登记表等相关数据。该灯具的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种灯具通信方法。In one embodiment, a lamp is provided, the internal structure diagram of which can be shown in Figure 12 . The luminaire includes a processor, memory, and network interface connected via a system bus. Among them, the processor of the lamp is used to provide computing and control capabilities. The memory of the lamp includes non-volatile storage media and internal memory. The non-volatile storage medium stores operating systems, computer programs and databases. This internal memory provides an environment for the execution of operating systems and computer programs in non-volatile storage media. The database of the lamp is used to store the lamp's own identity data, status mode, lamp node list, data item registration table and other related data. The network interface of the lamp is used to communicate with external terminals through a network connection. The computer program implements a lighting fixture communication method when executed by the processor.

本领域技术人员可以理解,图12中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的灯具的限定,具体的灯具可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in Figure 12 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the lamps to which the solution of the present application is applied. Specific lamps may include: The figures show more or fewer parts, or certain parts combined, or with different arrangements of parts.

在一个实施例中,提供了一种灯具,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现上述各方法实施例中的步骤。In one embodiment, a lamp is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, it implements the steps in the above method embodiments.

在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

在一个实施例中,提供了一种计算机程序产品,该计算机程序产品包括计算机程序,该计算机程序被处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage. In the media, when executed, the computer program may include the processes of the above method embodiments. Any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM).

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined in any way. To simplify the description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, all possible combinations should be used. It is considered to be within the scope of this manual.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-described embodiments only express several implementation modes of the present application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all fall within the protection scope of the present application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims (10)

Translated fromChinese
1.一种灯具通信方法,其特征在于,所述方法包括:1. A lighting communication method, characterized in that the method includes:若目标灯具确定自身当前处于横向通信模式,则在灯具组网中查找服务灯具;所述目标灯具为所述灯具组网中任一灯具,所述服务灯具为所述灯具组网中支持双向通信模式的任一灯具;所述双向通信模式为所述服务灯具同时与所述目标灯具和服务器通信;所述横向通信模式为不支持与所述服务器进行通信的模式;If the target lamp determines that it is currently in the horizontal communication mode, it searches for the service lamp in the lamp network; the target lamp is any lamp in the lamp network, and the service lamp supports two-way communication in the lamp network Any lamp in the mode; the two-way communication mode is that the service lamp communicates with the target lamp and the server at the same time; the horizontal communication mode is a mode that does not support communication with the server;所述目标灯具将第一待上传数据发送至所述服务灯具,指示所述服务灯具将所述第一待上传数据转发至所述服务器;The target lamp sends the first data to be uploaded to the service lamp, and instructs the service lamp to forward the first data to be uploaded to the server;若所述服务灯具自身也存在待上传数据,则所述服务灯具将第一待上传数据和所述服务灯具自身的待上传数据一并发送至所述服务器;其中,所述第一待上传数据和所述服务灯具自身的待上传数据均包括该数据所属灯具的身份数据;其中,所述目标灯具的身份数据包括目标灯具的身份标识和身份认证信息;所述服务器中存储有每个灯具的身份标识和身份认证信息,以使所述服务器接收到数据后,根据身份标识确定接收的数据为哪个灯具的运行数据;If the service lamp itself also has data to be uploaded, the service lamp will send the first data to be uploaded and the data to be uploaded to the service lamp itself to the server; wherein, the first data to be uploaded Both the data to be uploaded and the service lamp itself include the identity data of the lamp to which the data belongs; wherein the identity data of the target lamp includes the identity mark and identity authentication information of the target lamp; the server stores the identity data of each lamp. Identity identification and identity authentication information, so that after the server receives the data, it can determine which lamp's operating data the received data is based on the identification identification;所述服务器根据所述服务灯具转发的目标灯具的身份标识,获取目标灯具的身份标识的目标身份认证信息;The server obtains the target identity authentication information of the target lamp's identity based on the identity of the target lamp forwarded by the service lamp;若所述目标身份认证信息和所述目标灯具的身份认证信息一致,则所述服务器确定所述目标灯具的身份合法,若两者不一致,则所述服务器确定所述目标灯具的身份不合法;If the target identity authentication information is consistent with the identity authentication information of the target lamp, the server determines that the identity of the target lamp is legal; if the two are inconsistent, the server determines that the identity of the target lamp is illegal;在所述目标灯具的身份不合法的情况下,所述服务器确定所述服务灯具转发的第一待上传数据并无所述目标灯具的有效数据,则所述服务器舍弃当前时刻接收的第一待上传数据,等待下一时刻所述服务灯具转发的目标灯具的第一待上传数据;When the identity of the target lamp is illegal and the server determines that the first data to be uploaded forwarded by the service lamp does not contain valid data for the target lamp, the server discards the first data to be uploaded at the current moment. Upload data and wait for the first to-be-uploaded data of the target lamp forwarded by the service lamp at the next moment;在所述目标灯具的身份合法的情况下,所述服务器确定所述服务灯具转发的第一待上传数据为所述目标灯具的运行数据。When the identity of the target lamp is legal, the server determines that the first to-be-uploaded data forwarded by the service lamp is the operation data of the target lamp.2.根据权利要求1所述的方法,其特征在于,所述在灯具组网中查找服务灯具,包括:2. The method according to claim 1, characterized in that the search for service lamps in the lamp network includes:所述目标灯具从灯具节点列表中获取候选灯具;所述候选灯具为支持与所述服务器进行通信的灯具;The target lamp obtains candidate lamps from the lamp node list; the candidate lamps are lamps that support communication with the server;所述目标灯具基于预设的选取策略,从所述候选灯具中确定所述服务灯具。The target lighting fixture determines the service lighting fixture from the candidate lighting fixtures based on a preset selection strategy.3.根据权利要求2所述的方法,其特征在于,所述灯具节点列表的构建过程,包括:3. The method according to claim 2, characterized in that the construction process of the lamp node list includes:所述目标灯具接收所述灯具组网中其他灯具定时发送的心跳数据包;所述心跳数据包中至少包括对应灯具的通信模式;The target lamp receives heartbeat data packets regularly sent by other lamps in the lamp network; the heartbeat data packet at least includes the communication mode of the corresponding lamp;所述目标灯具根据接收到的心跳数据包,创建所述灯具节点列表。The target lamp creates the lamp node list according to the received heartbeat data packet.4.根据权利要求1-3中任一项所述的方法,其特征在于,所述方法还包括:4. The method according to any one of claims 1-3, characterized in that the method further includes:所述目标灯具接收所述服务灯具发送灯具控制信息;所述灯具控制信息为所述服务灯具接收的所述服务器针对所述目标灯具下发的控制信息;The target lamp receives lamp control information sent by the service lamp; the lamp control information is the control information issued by the server for the target lamp received by the service lamp;所述目标灯具根据所述灯具控制信息,对自身的运行参数进行调整。The target lamp adjusts its own operating parameters according to the lamp control information.5.根据权利要求1-3中任一项所述的方法,其特征在于,所述方法还包括:5. The method according to any one of claims 1-3, characterized in that the method further includes:所述目标灯具接收所述服务灯具发送的数据上传成功信息;The target lamp receives the data upload success information sent by the service lamp;所述目标灯具根据所述数据上传成功信息,在自身的数据项登记表中对所述第一待上传数据的上传状态进行更新。The target lamp updates the upload status of the first data to be uploaded in its own data item registration table based on the data upload success information.6.根据权利要求1-3中任一项所述的方法,其特征在于,所述方法还包括:6. The method according to any one of claims 1-3, characterized in that the method further includes:获取所述目标灯具与所述服务器之间的通信状态;Obtain the communication status between the target lamp and the server;若所述通信状态为不支持与所述服务器进行通信,则确定所述目标灯具处于横向通信模式;If the communication status is that communication with the server is not supported, it is determined that the target lamp is in the horizontal communication mode;若所述通信状态为支持与所述服务器进行通信但不支持与所述灯具组网中的其他灯具进行通信,则确定所述目标灯具处于纵向通信模式;If the communication status supports communication with the server but does not support communication with other lamps in the lamp network, it is determined that the target lamp is in the longitudinal communication mode;若所述通信状态为支持与所述服务器进行通信且支持与所述灯具组网中至少一个灯具进行通信,则确定所述目标灯具处于双向通信模式。If the communication status supports communication with the server and supports communication with at least one lamp in the lamp network, it is determined that the target lamp is in a two-way communication mode.7.根据权利要求6所述的方法,其特征在于,所述方法还包括:7. The method according to claim 6, characterized in that the method further comprises:若所述目标灯具处于所述双向通信模式,则所述目标灯具相当于其他至少一个客户灯具的服务灯具,所述其他至少一个客户灯具处于横向通信模式下;If the target lighting fixture is in the two-way communication mode, the target lighting fixture is equivalent to the service lighting fixture of at least one other customer lighting fixture, and the other at least one customer lighting fixture is in the horizontal communication mode;至少一个客户灯具将待上传数据发送至所述目标灯具,指示所述目标灯具将至少一个客户灯具的待上传数据转发至所述服务器;At least one customer lighting fixture sends the data to be uploaded to the target lighting fixture, instructing the target lighting fixture to forward the data to be uploaded to at least one customer lighting fixture to the server;若所述目标灯具自身也存在待上传数据,所述目标灯具向所述服务器发送第二待上传数据,所述第二待上传数据包括所述目标灯具自身的待上传数据和至少一个客户灯具的待上传数据;其中,所述目标灯具自身的待上传数据和至少一个客户灯具的待上传数据均包括该数据所属灯具的身份数据;其中,客户灯具的身份数据包括客户灯具的身份标识和身份认证信息;所述服务器中存储有每个灯具的身份标识和身份认证信息,以使所述服务器接收到数据后,根据身份标识确定接收的数据为哪个灯具的运行数据;If the target lamp itself also has data to be uploaded, the target lamp sends second data to be uploaded to the server. The second data to be uploaded includes the data to be uploaded of the target lamp itself and the data of at least one customer lamp. Data to be uploaded; wherein, the data to be uploaded of the target lamp itself and the data of at least one customer lamp include the identity data of the lamp to which the data belongs; wherein the identity data of the client lamp includes the identity mark and identity authentication of the client lamp Information; the server stores the identity identification and identity authentication information of each lamp, so that after receiving the data, the server determines which lamp the received data is the operating data of according to the identity identifier;所述服务器根据所述目标灯具转发的客户灯具的身份标识,获取客户灯具的身份标识的目标身份认证信息;The server obtains the target identity authentication information of the identity of the client's lamp based on the identity of the client's lamp forwarded by the target lamp;若客户灯具的所述身份标识的目标身份认证信息和客户灯具的身份认证信息一致,则所述服务器确定所述客户灯具的身份合法,若两者不一致,则所述服务器确定所述客户灯具的身份不合法;If the target identity authentication information of the identity mark of the customer lamp is consistent with the identity authentication information of the customer lamp, the server determines that the identity of the customer lamp is legal. If the two are inconsistent, the server determines the identity of the customer lamp. Illegal identity;在所述客户灯具的身份不合法的情况下,所述服务器确定所述目标灯具转发的所述客户灯具的待上传数据中并无所述客户灯具的有效数据,则所述服务器舍弃当前时刻接收的所述客户灯具的待上传数据,等待下一时刻所述目标灯具转发的客户灯具的待上传数据;When the identity of the client lamp is illegal and the server determines that the to-be-uploaded data of the client lamp forwarded by the target lamp does not contain valid data of the client lamp, the server discards the data received at the current moment. The data to be uploaded of the customer's lamps and lanterns is waiting for the data to be uploaded of the customer's lamps and lanterns forwarded by the target lamp at the next moment;在所述客户灯具的身份合法的情况下,所述服务器确定所述目标灯具转发的所述客户灯具的待上传数据为所述客户灯具的运行数据;When the identity of the customer lighting fixture is legal, the server determines that the data to be uploaded of the customer lighting fixture forwarded by the target lighting fixture is the operating data of the customer lighting fixture;若发生至少一个客户灯具的待上传数据上传失败,则所述目标灯具向上传失败的各客户灯具发送数据上传失败信息,并关闭与上传失败的各客户灯具之间的通信连接;所述数据上传失败信息用于提醒上传失败的各客户灯具重新选择服务灯具。If the uploading data of at least one customer's lamp fails to be uploaded, the target lamp sends data upload failure information to each customer's lamp that failed to upload, and closes the communication connection with each customer's lamp that failed to upload; the data upload The failure message is used to remind each customer whose fixtures failed to upload to reselect service fixtures.8.根据权利要求7所述的方法,其特征在于,所述方法还包括:8. The method according to claim 7, characterized in that the method further comprises:若所述目标灯具成功将客户灯具的待上传数据发送至所述服务器,则在自身的数据项登记表中删除上传成功的客户灯具的待上传数据;If the target lamp successfully sends the data to be uploaded of the customer's lamp to the server, it deletes the data to be uploaded of the client's lamp that has been successfully uploaded in its own data item registration table;所述目标灯具向上传成功的客户灯具发送数据上传成功信息;所述数据上传成功信息用于指示所述客户灯具更新自身的数据项登记表。The target lamp sends data upload success information to the successfully uploaded client lamp; the data upload success message is used to instruct the client lamp to update its own data item registration table.9.一种灯具通信装置,其特征在于,集成于目标灯具中,所述目标灯具为灯具组网中任一灯具;所述装置包括:9. A lighting communication device, characterized in that it is integrated into a target lighting fixture, and the target lighting fixture is any lighting fixture in a lighting fixture network; the device includes:服务灯具查找模块,用于若确定所述目标灯具当前处于横向通信模式,则在所述灯具组网中查找服务灯具;所述服务灯具为所述灯具组网中支持双向通信模式的任一灯具;所述双向通信模式为所述服务灯具同时与所述目标灯具和服务器通信;所述横向通信模式为不支持与所述服务器进行通信的模式;A service lamp search module, used to search for service lamps in the lamp network if it is determined that the target lamp is currently in the horizontal communication mode; the service lamp is any lamp in the lamp network that supports two-way communication mode ; The two-way communication mode is that the service lamp communicates with the target lamp and the server at the same time; the horizontal communication mode is a mode that does not support communication with the server;数据上传模块,用于将所述目标灯具的第一待上传数据发送至所述服务灯具,指示所述服务灯具将所述第一待上传数据转发至所述服务器;A data upload module, configured to send the first data to be uploaded of the target lamp to the service lamp, and instruct the service lamp to forward the first data to be uploaded to the server;其中,若所述服务灯具自身也存在待上传数据,则将第一待上传数据和所述服务灯具自身的待上传数据一并发送至所述服务器;其中,所述第一待上传数据和所述服务灯具自身的待上传数据均包括该数据所属灯具的身份数据;其中,所述目标灯具的身份数据包括目标灯具的身份标识和身份认证信息;所述服务器中存储有每个灯具的身份标识和身份认证信息,以使所述服务器接收到数据后,根据身份标识确定接收的数据为哪个灯具的运行数据;Wherein, if the service lamp itself also has data to be uploaded, the first data to be uploaded and the data to be uploaded of the service lamp itself are sent to the server; wherein, the first data to be uploaded and the data to be uploaded are The data to be uploaded of the service lamp itself all includes the identity data of the lamp to which the data belongs; wherein the identity data of the target lamp includes the identity mark and identity authentication information of the target lamp; the identity mark of each lamp is stored in the server and identity authentication information, so that after the server receives the data, it can determine which lamp's operating data the received data is based on the identity identifier;所述服务器,用于根据所述服务灯具转发的目标灯具的身份标识,获取所述目标灯具的身份标识的目标身份认证信息;若所述目标身份认证信息和所述目标灯具的身份认证信息一致,则确定所述目标灯具的身份合法,若两者不一致,则确定所述目标灯具的身份不合法;The server is configured to obtain the target identity authentication information of the target lamp's identity based on the identity of the target lamp forwarded by the service lamp; if the target identity authentication information is consistent with the identity authentication information of the target lamp , then it is determined that the identity of the target lamp is legal; if they are inconsistent, it is determined that the identity of the target lamp is illegal;所述服务器,还用于在所述目标灯具的身份不合法的情况下,确定所述服务灯具转发的第一待上传数据不存在所述目标灯具的有效数据,则舍弃当前时刻接收的第一待上传数据,等待下一时刻所述服务灯具转发的目标灯具的第一待上传数据;还用于在所述目标灯具的身份合法的情况下,确定所述服务灯具转发的第一待上传数据为所述目标灯具的运行数据。The server is also configured to determine that the first data to be uploaded forwarded by the service lamp does not contain valid data of the target lamp when the identity of the target lamp is illegal, and then discard the first data received at the current moment. The data to be uploaded is waiting for the first data to be uploaded of the target lamp forwarded by the service lamp at the next moment; it is also used to determine the first data to be uploaded forwarded by the service lamp if the identity of the target lamp is legal. is the operating data of the target lamp.10.一种灯具,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至8中任一项所述的方法的步骤。10. A lamp, comprising a memory and a processor, the memory stores a computer program, characterized in that when the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented. .
CN202210750152.8A2022-06-292022-06-29 Luminaire communication method, device and luminaireActiveCN115002051B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210750152.8ACN115002051B (en)2022-06-292022-06-29 Luminaire communication method, device and luminaire

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210750152.8ACN115002051B (en)2022-06-292022-06-29 Luminaire communication method, device and luminaire

Publications (2)

Publication NumberPublication Date
CN115002051A CN115002051A (en)2022-09-02
CN115002051Btrue CN115002051B (en)2023-12-15

Family

ID=83036456

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210750152.8AActiveCN115002051B (en)2022-06-292022-06-29 Luminaire communication method, device and luminaire

Country Status (1)

CountryLink
CN (1)CN115002051B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2012127103A1 (en)*2011-03-142012-09-27Dna OyArrangement and method for electronic identification
CN204217170U (en)*2014-10-152015-03-18四川福利来网络工程有限公司City street lamp tele-control system
CN105792477A (en)*2016-02-232016-07-20毛琦Two-way networking method and device for 2.4G wireless dimming lamp
CN107707594A (en)*2017-02-212018-02-16贵州白山云科技有限公司It is a kind of to realize the document transmission method and device accelerated on demand
CN110848612A (en)*2018-07-242020-02-28东旭科技集团有限公司Street lamp and high in clouds server with locate function
CN110868784A (en)*2018-08-082020-03-06广州彩熠灯光有限公司Stage lighting data bidirectional synchronous communication method and system, storage medium and device
CN114423128A (en)*2021-12-282022-04-29深圳市晨北科技有限公司Lamp group control method, system and related equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2008085201A2 (en)*2006-12-292008-07-17Prodea Systems, Inc.Managed file backup and restore at remote storage locations through multi-services gateway device at user premises

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2012127103A1 (en)*2011-03-142012-09-27Dna OyArrangement and method for electronic identification
CN204217170U (en)*2014-10-152015-03-18四川福利来网络工程有限公司City street lamp tele-control system
CN105792477A (en)*2016-02-232016-07-20毛琦Two-way networking method and device for 2.4G wireless dimming lamp
CN107707594A (en)*2017-02-212018-02-16贵州白山云科技有限公司It is a kind of to realize the document transmission method and device accelerated on demand
CN110848612A (en)*2018-07-242020-02-28东旭科技集团有限公司Street lamp and high in clouds server with locate function
CN110868784A (en)*2018-08-082020-03-06广州彩熠灯光有限公司Stage lighting data bidirectional synchronous communication method and system, storage medium and device
CN114423128A (en)*2021-12-282022-04-29深圳市晨北科技有限公司Lamp group control method, system and related equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于逐点路由的路灯组网方案设计;蔡俊涛;梁锡辉;;测控技术(09);全文*

Also Published As

Publication numberPublication date
CN115002051A (en)2022-09-02

Similar Documents

PublicationPublication DateTitle
JP6360254B2 (en) eUICC management method, eUICC, SM platform, and system
WO2017124933A1 (en)Information processing method, device and system
CN107104836A (en)The firmware upgrade method and device of Zigbee equipment
EP3021533B1 (en)Switching device, controller, and method and system for switching device configuration and packet processing
CN103036717A (en)Consistency maintenance system and methods for distributed-type data
WO2018001200A1 (en)Data processing method, cluster manager, resource manager and data processing system
US20140198702A1 (en)Method and system for enabling multicast distribution of mobile device update data
CN113835844A (en)Management method and device of container cluster and cloud computing platform
CN114745358B (en)IP address management method, system and controller in load balancing service
WO2013040906A1 (en)Method and system for managing software version of base station
CN115002051B (en) Luminaire communication method, device and luminaire
CN103997525A (en)Distributed data synchronization method and system
CN110209986A (en)Internal storage state method of data synchronization and device
CN105099721A (en)Multicast member maintenance method and equipment
WO2019019991A1 (en)Creation of aggregation group
CN105474587B (en) A method and device for sending data packets
CN110099128B (en)Authentication data synchronization method and device
CN114297083B (en) Proxy testing method, device, electronic device and readable medium
KR20230000929A (en) Cluster management method, device, electronic device and storage medium
CN114422437A (en) Method and device for forwarding heterogeneous packets
US20180254960A1 (en)Self-adaptive service management method and system thereof
CN115835370B (en)Network distribution method, device, equipment and medium of intelligent equipment
WO2012155814A1 (en)Implementation method and system for configuring route to base station in operation maintenance center
CN115065786B (en)Node lamp control method and system for landscape lighting
CN108933681B (en)Configuration updating method of cloud computing system, control center and cloud computing node

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
CP03Change of name, title or address

Address after:No. 46 Ketai 1st Road, Guangzhou Private Science and Technology Park, Baiyun District, Guangzhou City, Guangdong Province, 510000

Patentee after:Guangzhou Caiyi Technology Co.,Ltd.

Country or region after:China

Address before:No. 46 Ketai 1st Road, Guangzhou Private Science and Technology Park, Baiyun District, Guangzhou City, Guangdong Province

Patentee before:Guangzhou Colourful Lighting Co.,Ltd.

Country or region before:China

CP03Change of name, title or address

[8]ページ先頭

©2009-2025 Movatter.jp