Automatic control method, device and equipment of lighting appliance and storage medium

By using visual algorithms to calculate the brightness average value and weight coefficient in lighting fixtures, it is divided into different control ends to adjust the lighting intensity, which solves the problem of large lighting control error in the prior art and improves the lighting effect and service life.

CN119255442AActive Publication Date: 2025-01-03YUNNAN WALLBASE OPTOELECTRONIC TECH CO LTD

Patent Information

Application Number
CN202411028140.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2025-01-03
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

The intelligent control methods of existing lighting fixtures are easily affected by season, weather and human factors, resulting in large errors in lighting start and end time and poor lighting effects.

Method used

By obtaining the image data of the environment to be illuminated under the same time stamp, using a visual algorithm to calculate the brightness average value, and defining the weight coefficient according to the visible light brightness, classifying and determining the coefficient difference, and dividing it into different control ends for lighting intensity adjustment to ensure the lighting effect unity.

Benefits of technology

It reduces the over-lighting and insufficient lighting of lighting equipment, improves lighting performance, and extends the service life of lighting fixtures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119255442A_ABST
    Figure CN119255442A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic control method, device and equipment of an illumination lamp and a storage medium, and relates to the technical field of electric digital data processing. The method comprises the following steps: defining a weight difference value by identifying a brightness difference of the same to-be-illuminated environment under a lamp turning-on condition and a lamp turning-off condition; the to-be-illuminated environment with the larger brightness difference pays more attention to the illumination performance of the illumination lamp, the illumination performance is improved by increasing the gears of the illumination lamp when necessary, and then the illumination lamp is divided into a gear which does not need to be adjusted and a gear which needs to be adjusted by setting the threshold value of the weight difference to be controlled respectively. The problems of over-illumination and insufficient illumination of the illumination appliance are reduced or eliminated, and the service life of the illumination lamp is ensured while the illumination performance of the illumination lamp is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic digital data processing, and in particular to an automatic control method, device, equipment and storage medium for lighting fixtures. Background Art

[0002] Lighting fixtures, commonly known as lamps, are an indispensable part of the development of human civilization. Lighting fixtures are divided into two categories: fixed and mobile. Each category includes various types of light-emitting lamps, such as incandescent lamps, halogen lamps, fluorescent lamps, inert gas lamps, LEDs, etc.

[0003] In modern times, a large number of fixed lamps are used in building lighting, road lighting, outdoor lighting and other places, and a large number of mobile lamps are used in construction operations, mobile lighting, portable lighting and other places. The lighting fixtures in the same scene are usually controlled uniformly by intelligent lighting control.

[0004] Intelligent lighting control is an important means to achieve automated control of lighting appliances. It refers to the means of unified management of lighting systems through data information and wireless and wired communication technologies. It usually involves the integration of automation systems and intelligent devices, so that lighting systems can be automatically adjusted according to environmental conditions or predetermined rules. It is suitable for various environments, such as residential areas, commercial buildings, public spaces and urban infrastructure.

[0005] At present, intelligent lighting control of lighting fixtures usually adopts manual control, light control, clock control, voice control, etc. The aforementioned control methods are easily affected by seasons, weather, human factors, etc., resulting in large errors in the start and end time of lighting fixtures and poor lighting effects due to human subjective factors. Summary of the invention

[0006] The main purpose of the present application is to provide an automatic control method, device, equipment and storage medium for lighting fixtures to solve the problems in the prior art of lighting fixture control such as large errors in lighting start and end times and poor lighting effects caused by human subjective factors.

[0007] In order to achieve the above objectives, this application provides the following technical solutions:

[0008] An automatic control method for a lighting fixture, wherein the lighting fixture has a plurality of lighting environments to be illuminated and is applied to different scenes, and the lighting fixture includes at least two lighting intensities with increasing lighting brightness, and the automatic control method comprises:

[0009] Step S1, at the same timestamp and when all lighting fixtures are in an off state, first image data of each lighting environment are respectively obtained, and a first image brightness average value of each first image data is respectively obtained by a visual algorithm;

[0010] Step S2, at the same timestamp and when all lighting fixtures are in the turned-on state, respectively obtain the second image data of each environment to be illuminated, and respectively obtain the second image brightness average value of each second image data by using the visual algorithm;

[0011] Step S3, defining at least two continuous brightness intervals in order from low to high according to the value of the visible light brightness;

[0012] Step S4, defining a weight coefficient based on each brightness interval, and the magnitudes of all weight coefficients decrease from large to small as the values ​​of all visible light brightness increase from low to high;

[0013] Step S5, classifying all first image brightness averages and all second image brightness averages into all brightness intervals by a classification algorithm, obtaining a first weight coefficient based on each first image brightness average, and obtaining a second weight coefficient based on each second image brightness average;

[0014] Step S6, obtaining a coefficient difference between a first weight coefficient and a second weight coefficient of the same lighting fixture, and determining whether the current coefficient difference exceeds a preset threshold;

[0015] Step S7, connecting all lighting fixtures corresponding to the coefficient differences that do not exceed the preset threshold to the first control end, and connecting all lighting fixtures corresponding to the coefficient differences that exceed the preset threshold to the second control end;

[0016] Step S8, in response to an external start signal, turn on all lighting fixtures that are communicatively connected to the first control end, turn on and gradually increase the lighting intensity of all lighting fixtures that are communicatively connected to the second control end, until the coefficient difference of all lighting fixtures that are communicatively connected to the second control end does not exceed the preset threshold.

[0017] As a further improvement of the present application, in step S8, in response to an external start signal, all lighting fixtures in communication connection with the first control end are turned on, and the lighting intensity of all lighting fixtures in communication connection with the second control end is turned on and gradually increased until the coefficient difference of all lighting fixtures in communication connection with the second control end does not exceed the preset threshold value, and then, the method includes:

[0018] Step S10, if the coefficient difference of all lighting appliances in communication connection with the second control end after reaching the maximum lighting intensity still exceeds the preset threshold, then generating a lighting shortage signal;

[0019] Step S20, sending the insufficient lighting signal to an external decision-making end.

[0020] As a further improvement of the present application, step S1, at the same timestamp and when all lighting fixtures are not turned on, respectively obtain the first image data of each lighting environment, and respectively obtain the first image brightness average of each first image data through a visual algorithm, including:

[0021] Step S11, at the same timestamp and when all lighting fixtures are in an off state, respectively obtain first image data of each environment to be illuminated;

[0022] Step S12, importing the cv2 software package through the python import statement;

[0023] Step S13, reading each first image data respectively through the cv2.imread function of the cv2 software package and storing them in the img variable;

[0024] Step S14, converting all the first image data in the img variable into a first grayscale image through the cv2.cvtColor function of the cv2 software package and storing it in the gray variable;

[0025] Step S15, obtaining the first average brightness of each first grayscale image in the gray variable by using the cv2.mean function of the cv2 software package and storing it in the average_brightness variable;

[0026] Step S16, defining all first average brightnesses in the average_brightness variable as average brightnesses of all first images.

[0027] As a further improvement of the present application, step S2, at the same timestamp and when all lighting fixtures are in the turned-on state, respectively obtain the second image data of each lighting environment, and respectively obtain the second image brightness average value of each second image data through the visual algorithm, including:

[0028] Step S21, acquiring second image data of each environment to be illuminated respectively at the same timestamp and when all lighting fixtures are in an on state;

[0029] Step S22, initializing the img variable, the gray variable, and the average_brightness variable;

[0030] Step S23, reading each second image data respectively through the cv2.imread function and storing them in the img variable;

[0031] Step S24, converting all the second image data in the img variable into a second grayscale image through the cv2.cvtColor function and storing it in the gray variable;

[0032] Step S25, obtaining the second average brightness of each second grayscale image in the gray variable through the cv2.mean function and storing it in the average_brightness variable;

[0033] Step S26, defining all second average brightnesses in the average_brightness variable as average brightnesses of all second images.

[0034] As a further improvement of the present application, step S5, classifying all first image brightness averages and all second image brightness averages into all brightness intervals by a classification algorithm, obtaining a first weight coefficient based on each first image brightness average, and obtaining a second weight coefficient based on each second image brightness average, includes:

[0035] Step S51, defining a first set of data to be classified according to the average brightness of all first images and the average brightness of all second images and the second set of data to be classified Among them, X (1) is the first set of data to be classified, is the average brightness value of the jth first image in the first set of data to be classified, m is the number of average brightness values ​​of all first images, X (2) is the second data set to be classified, is the average brightness value of the i-th second image in the second to-be-classified data set, and n is the number of average brightness values ​​of all second images;

[0036] Step S52: define a category set C = {y1, y2, ..., y k ,…,y o}, where y k is the kth brightness interval in the category set C, and o is the number of all brightness intervals;

[0037] Step S53, calculating the conditional probability of the average brightness value of each first image in the first set of data to be classified in each brightness interval according to formula (1):

[0038]

[0039] Among them, P(X (1) y k) is the conditional probability of the first set of data to be classified in the kth brightness interval, P(y k ) is the edge probability of the kth brightness interval, P(x j y k ) is the conditional probability of the jth first image brightness average value in the kth brightness interval;

[0040] Step S54, classifying the average brightness values ​​of each first image into the brightness intervals with the highest conditional probability;

[0041] Step S55, defining the weight coefficient of the current brightness interval as a first weight coefficient of the average brightness of all first images within the current brightness interval;

[0042] Step S56, clearing all first image brightness averages in all brightness intervals;

[0043] Step S57, calculating the conditional probability of the average brightness value of each second image in the second to-be-classified data set in each brightness interval according to formula (2):

[0044]

[0045] Among them, P(X (2) y k ) is the conditional probability of the second set of data to be classified in the kth brightness interval, P(x i |y k ) is the conditional probability of the average brightness of the i-th second image in the k-th brightness interval;

[0046] Step S58, classifying each second image brightness average value into its respective brightness interval with the highest conditional probability, and defining the weight coefficient of the current brightness interval as the second weight coefficient of all second image brightness average values ​​within the current brightness interval.

[0047] As a further improvement of the present application, in step S8, in response to an external start signal, all lighting fixtures in communication connection with the first control end are turned on, and the lighting intensity of all lighting fixtures in communication connection with the second control end is turned on and gradually increased until the coefficient difference of all lighting fixtures in communication connection with the second control end does not exceed the preset threshold value, and then, the method includes:

[0048] Step S100, respectively obtaining the sunrise time and sunset time of each lighting environment;

[0049] Step S200, generating a closing signal based on the sunrise time of the current environment to be illuminated, and generating the opening signal based on the sunset time of the current environment to be illuminated;

[0050] Step S300, turning off the lighting fixture of the current lighting environment according to the turning-off signal of the current lighting environment;

[0051] Step S400: Turn on the lighting fixture of the current environment to be illuminated based on the turn-on signal of the current environment to be illuminated.

[0052] As a further improvement of the present application, in step S8, in response to an external start signal, all lighting fixtures in communication connection with the first control end are turned on, and the lighting intensity of all lighting fixtures in communication connection with the second control end is turned on and gradually increased until the coefficient difference of all lighting fixtures in communication connection with the second control end does not exceed the preset threshold value, and then, the method includes:

[0053] Step S1000, monitoring the lighting intensity of all lighting fixtures in real time, and defining a lighting fixture with a lighting intensity of zero as a faulty lighting fixture;

[0054] Step S2000, obtaining the geographic location of the faulty lighting fixture and sending it to an external decision-making end.

[0055] In order to achieve the above objectives, this application also provides the following technical solutions:

[0056] An automatic control device for a lighting fixture, the automatic control device is applied to the automatic control method for the lighting fixture as described above, the automatic control device comprises:

[0057] The module for acquiring the average brightness value in the non-on state is used to acquire the first image data of each environment to be illuminated at the same time stamp and when all lighting fixtures are in the non-on state, and to acquire the first image brightness average value of each first image data through a visual algorithm;

[0058] An on-state brightness average value acquisition module is used to respectively acquire the second image data of each environment to be illuminated when all lighting fixtures are in the on state at the same timestamp, and respectively acquire the second image brightness average value of each second image data by using the visual algorithm;

[0059] A brightness interval definition module, used to define at least two consecutive brightness intervals in order from low to high according to the value of visible light brightness;

[0060] The weight coefficient definition module is used to define a weight coefficient based on each brightness interval, and the size of all weight coefficients decreases from large to small as the value of all visible light brightness increases from low to high;

[0061] A brightness average classification module, used to classify all first image brightness averages and all second image brightness averages into all brightness intervals by a classification algorithm, and obtain a first weight coefficient based on each first image brightness average and a second weight coefficient based on each second image brightness average;

[0062] A coefficient difference acquisition and judgment module, used to obtain the coefficient difference between the first weight coefficient and the second weight coefficient of the same lighting fixture, and to judge whether the current coefficient difference exceeds a preset threshold;

[0063] A lighting fixture communication connection module, used to respectively connect the lighting fixtures corresponding to the coefficient differences that do not exceed the preset threshold value to the first control end for communication, and respectively connect the lighting fixtures corresponding to the coefficient differences that exceed the preset threshold value to the second control end for communication;

[0064] A lighting fixture start-up module is used to respond to an external start-up signal to turn on all lighting fixtures that are communicatively connected to the first control end, and to turn on and gradually increase the lighting intensity of all lighting fixtures that are communicatively connected to the second control end until the coefficient difference of all lighting fixtures that are communicatively connected to the second control end does not exceed the preset threshold.

[0065] In order to achieve the above objectives, this application also provides the following technical solutions:

[0066] An electronic device comprises a processor and a memory coupled to the processor, wherein the memory stores program instructions executable by the processor; when the processor executes the program instructions stored in the memory, the automatic control method of the lighting fixture as described above is implemented.

[0067] To achieve the above objectives, this application also provides the following technical solutions:

[0068] A storage medium stores program instructions, and when the program instructions are executed by a processor, the automatic control method of the lighting fixture as described above can be implemented.

[0069] The present application obtains the first image data of each environment to be illuminated at the same timestamp and when all lighting fixtures are not turned on, and obtains the first image brightness average of each first image data through a visual algorithm; obtains the second image data of each environment to be illuminated at the same timestamp and when all lighting fixtures are turned on, and obtains the second image brightness average of each second image data through a visual algorithm; defines at least two continuous brightness intervals from low to high according to the numerical value of visible light brightness; defines a weight coefficient based on each brightness interval, and the size of all weight coefficients decreases from large to small as the numerical value of all visible light brightness increases from low to high; and classifies all the first image brightness averages and all the second image brightness averages into all A brightness interval is obtained by obtaining a first weight coefficient based on the average brightness of each first image and a second weight coefficient based on the average brightness of each second image; obtaining the coefficient difference between the first weight coefficient and the second weight coefficient of the same lighting fixture, and judging whether the current coefficient difference exceeds a preset threshold; respectively communicating and connecting all lighting fixtures corresponding to the coefficient differences that do not exceed the preset threshold to the first control end, and respectively communicating and connecting all lighting fixtures corresponding to the coefficient differences that exceed the preset threshold to the second control end; in response to an external start signal, turning on all lighting fixtures that are connected to the first control end, turning on and gradually increasing the lighting intensity of all lighting fixtures that are connected to the second control end, until the coefficient difference of all lighting fixtures that are connected to the second control end does not exceed the preset threshold. The present application defines a weight difference by identifying the brightness difference between the same lighting environment under the light-on condition and the light-off condition, so that the lighting environment with a larger brightness difference pays more attention to the lighting performance of the lighting fixture, and when necessary, the lighting performance is improved by increasing the gear of the lighting fixture. Then, through the threshold setting of the weight difference, the lighting fixture is divided into two parts, one that does not require gear adjustment and the other that requires gear adjustment, and these parts are managed and controlled separately, thereby reducing or eliminating the problems of over-lighting and under-lighting of the lighting fixture, ensuring the lighting performance of the lighting fixture while also ensuring the service life of the lighting fixture. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 A schematic diagram of a step flow chart of an embodiment of the automatic control method of a lighting fixture of the present application;

[0071] Figure 2 A schematic diagram of functional modules of an embodiment of an automatic control device for lighting fixtures of the present application;

[0072] Figure 3 This is a schematic diagram of the structure of an embodiment of the electronic device of the present application;

[0073] Figure 4 This is a schematic diagram of the structure of an embodiment of the storage medium of the present application. DETAILED DESCRIPTION

[0074] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0075] The terms "first", "second" and "third" in this application are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second" and "third" can explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. All directional indications in the embodiments of the present application (such as up, down, left, right, front, back...) are only used to explain the relative position relationship, movement, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication also changes accordingly. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.

[0076] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0077] like Figure 1As shown, this embodiment provides an embodiment of an automatic control method for lighting fixtures. In this embodiment, there are several lighting fixtures and they are applied to lighting environments in different scenarios, such as indoor residential houses, commercial buildings, corridors and other facilities with roofs, and outdoor roads, landscapes, construction sites, playgrounds, parking lots and other facilities without roofs; the lighting fixtures include lamps fixedly installed in fixed positions such as ceilings, walls, and floors, and lamps that are moved or portable by brackets or carts, and each lamp has at least two lighting intensities with increasing lighting brightness, such as a first gear with a lighting intensity of 100l ux, a second gear with a lighting intensity of 300l ux, a third gear with a lighting intensity of 500 lux, and so on, and lamps with lighting intensity gear switching are mature existing technologies, and this embodiment will not repeat the detailed structures, models, etc. of various lamps.

[0078] It is worth noting that the above examples are only used to provide numerical examples of the "increase" in light intensity, and the above numerical values ​​are not used to limit this embodiment, and the same applies below.

[0079] Specifically, the automatic control method of this embodiment includes the following steps:

[0080] Step S1, at the same timestamp and when all lighting fixtures are in an off state, first image data of each lighting environment are obtained respectively, and a first image brightness average value of each first image data is obtained respectively through a visual algorithm.

[0081] Step S2, at the same timestamp and when all lighting fixtures are in the on state, obtain the second image data of each lighting environment respectively, and obtain the second image brightness average value of each second image data respectively through a visual algorithm.

[0082] Preferably, the first image data and the second image data can be directly captured by an external camera terminal without difficulty, but the same shooting angle should be adopted as much as possible to ensure the accuracy of subsequent brightness detection.

[0083] Step S3, defining at least two continuous brightness intervals in order from low to high according to the numerical value of the visible light brightness.

[0084] For example, four brightness intervals may be defined in sequence, namely [0, 100), [100, 300), [300, 500), and [500, +∞), and the critical value may be adjusted according to actual needs.

[0085] Step S4, defining a weight coefficient based on each brightness interval, and the sizes of all weight coefficients decrease from large to small as the values ​​of all visible light brightness increase from low to high.

[0086] Preferably, since the brightness increases in sequence, the first interval represents the least bright interval, and the weight coefficients of the above four intervals may be 4, 3, 2, and 1 respectively.

[0087] Step S5, classifying all first image brightness averages and all second image brightness averages into all brightness intervals through a classification algorithm, obtaining a first weight coefficient based on each first image brightness average, and obtaining a second weight coefficient based on each second image brightness average.

[0088] Preferably, the classification algorithm of this embodiment adopts Naive Bayes classification to prevent subjective errors in manual classification.

[0089] Step S6, obtaining the coefficient difference between the first weight coefficient and the second weight coefficient of the same lighting fixture, and determining whether the current coefficient difference exceeds a preset threshold.

[0090] Preferably, the preset threshold can be set to half of the median of all weight coefficients. Using the above 4, 3, 2, 1, the median is 2.5, and half of the median is 1.25.

[0091] Step S7, all lighting fixtures corresponding to the coefficient differences that do not exceed the preset threshold are respectively connected to the first control end for communication, and all lighting fixtures corresponding to the coefficient differences that exceed the preset threshold are respectively connected to the second control end for communication.

[0092] Preferably, the first control end has an advantage over the second control end in that the first control end does not have the risk of insufficient brightness, so there is no need to enhance the gear position of the lamp connected thereto.

[0093] Preferably, the first control end and the second control end are turned on or off according to sunrise and sunset times, real-time ambient brightness, etc.

[0094] Step S8, in response to the external start signal, turn on all lighting fixtures that are communicatively connected to the first control end, turn on and gradually increase the lighting intensity of all lighting fixtures that are communicatively connected to the second control end, until the coefficient difference of all lighting fixtures that are communicatively connected to the second control end does not exceed a preset threshold.

[0095] Further, in step S8, in response to the external start signal, all lighting fixtures in communication connection with the first control terminal are turned on, and the lighting intensity of all lighting fixtures in communication connection with the second control terminal is turned on and gradually increased until the coefficient difference of all lighting fixtures in communication connection with the second control terminal does not exceed a preset threshold, and then, the steps include:

[0096] Step S10: if the coefficient difference of all lighting fixtures in communication connection with the second control end after reaching the maximum lighting intensity still exceeds a preset threshold, an insufficient lighting signal is generated.

[0097] Step S20, sending an insufficient lighting signal to an external decision-making end.

[0098] Furthermore, step S1, at the same timestamp and when all lighting appliances are not turned on, first image data of each lighting environment are respectively obtained, and the first image brightness average value of each first image data is respectively obtained by a visual algorithm, including:

[0099] Step S11, at the same time stamp and when all lighting fixtures are in an off state, first image data of each environment to be illuminated is obtained respectively.

[0100] Step S12, importing the cv2 software package through the python import statement.

[0101] Step S13, reading each first image data respectively through the cv2.imread function of the cv2 software package and storing it in the img variable.

[0102] Step S14: convert all first image data in the img variable into a first grayscale image through the cv2.cvtColor function of the cv2 software package and store it in the gray variable.

[0103] Step S15, using the cv2.mean function of the cv2 software package, respectively obtain the first average brightness of each first grayscale image in the gray variable and store it in the average_brightness variable.

[0104] Step S16, defining all first average brightnesses in the average_brightness variable as average brightnesses of all first images.

[0105] Preferably, the codes of step S11 to step S16 are mainly embodied as follows:

[0106]

[0107]

[0108] Further, step S2, at the same timestamp and when all lighting fixtures are in the on state, respectively obtain the second image data of each lighting environment, and respectively obtain the second image brightness average value of each second image data through the visual algorithm, including:

[0109] Step S21 , at the same time stamp and when all lighting fixtures are in an on state, second image data of each environment to be illuminated is acquired respectively.

[0110] Step S22, initialize the img variable, gray variable, and average_brightness variable.

[0111] Step S23, read each second image data respectively through the cv2.imread function and store it in the img variable.

[0112] Step S24: convert all the second image data in the img variable into a second grayscale image through the cv2.cvtColor function and store it in the gray variable.

[0113] Step S25, obtaining the second average brightness of each second grayscale image in the gray variable through the cv2.mean function and storing it in the average_brightness variable.

[0114] Step S26, defining all second average brightnesses in the average_brightness variable as average brightnesses of all second images.

[0115] Preferably, the codes of step S21 to step S26 are the same as the codes of step S11 to step S16 described above.

[0116] Further, step S5, classifying all first image brightness averages and all second image brightness averages into all brightness intervals by a classification algorithm, obtaining a first weight coefficient based on each first image brightness average, and obtaining a second weight coefficient based on each second image brightness average, including:

[0117] Step S51, defining a first set of data to be classified according to the average brightness of all first images and the average brightness of all second images and the second set of data to be classified Among them, X (1) is the first data set to be classified, is the average brightness value of the jth first image in the first set of data to be classified, m is the number of average brightness values ​​of all first images, X (2) is the second data set to be classified, is the average brightness value of the i-th second image in the second data set to be classified, and n is the number of average brightness values ​​of all second images.

[0118] Step S52: define a category set C = {y1, y2, ..., y k ,…,y o}, where y k is the kth brightness interval in the category set C, and o is the number of all brightness intervals.

[0119] Step S53, calculate the conditional probability of the average brightness value of each first image in the first to-be-classified data set in each brightness interval according to formula (1):

[0120]

[0121] Among them, P(X (1) |y k ) is the conditional probability of the first set of data to be classified in the kth brightness interval, P(y k ) is the edge probability of the kth brightness interval, P(x j |y k ) is the conditional probability of the jth first image brightness average in the kth brightness interval.

[0122] Step S54: classify the average brightness values ​​of each first image into the brightness intervals with the highest conditional probabilities.

[0123] Step S55 : defining the weight coefficient of the current brightness interval as a first weight coefficient of the average brightness of all first images within the current brightness interval.

[0124] Step S56, clearing all first image brightness averages in all brightness intervals.

[0125] Step S57, calculate the conditional probability of the average brightness value of each second image in the second to-be-classified data set in each brightness interval according to formula (2):

[0126]

[0127] Among them, P(X (2) y k ) is the conditional probability of the second set of data to be classified in the kth brightness interval, P(x i |y k ) is the conditional probability of the average brightness of the i-th second image in the k-th brightness interval.

[0128] Step S58, classifying each second image brightness average value into its respective brightness interval with the highest conditional probability, and defining the weight coefficient of the current brightness interval as the second weight coefficient of all second image brightness average values ​​within the current brightness interval.

[0129] Specifically, Naive Bayes is defined as follows:

[0130] ① Let x = {a1, a2, a3, ..., an} be an item to be classified, and each a is a feature of x.

[0131] ②There is a category set c = {y1, y2, y3, ..., y m}.

[0132] ③ Calculate P(y1|x), P(y2|x), ..., P(y m |x).

[0133] ④If P(y k |x)=max{P(y1|x),P(y2|x),...,P(y m |x)}, then x∈y k .

[0134] Then calculate the conditional probabilities in step ③ through the following steps:

[0135] 1. Find a set of items to be classified with known classifications. This set is called a training sample set.

[0136] 2. Statistically obtain the conditional probability estimate of each feature attribute under each category. That is:

[0137] P(a1|y1),P(a2|y1),……,P(a n |y1)

[0138] P(a1|y2),P(a2|y2),……,P(a n |y2);

[0139] …

[0140] P(a1|y m ),P(a2|y m ),……,P(a n |y m );

[0141] 3. Assuming that each feature attribute is conditionally independent, according to the Bayesian principle:

[0142] P(y i |x)=P(x|y i )P(y i ) / p(x).

[0143] Since the denominator is a constant for all categories, we only need to maximize the numerator. And because each feature attribute is conditionally independent, then:

[0144] P(x|y i )P(y i )=P(a1|y i )P(a2|y i )……P(a n |y i )P(y i ).

[0145] It should be noted that the above preferred contents are also explanations of the principles, and the meanings of their symbols are not interchangeable with the meanings of the symbols of other formulas in this embodiment.

[0146] Further, in step S8, in response to the external start signal, all lighting fixtures in communication connection with the first control terminal are turned on, and the lighting intensity of all lighting fixtures in communication connection with the second control terminal is turned on and gradually increased until the coefficient difference of all lighting fixtures in communication connection with the second control terminal does not exceed a preset threshold, and then, the steps include:

[0147] Step S100, respectively obtaining the sunrise time and sunset time of each lighting environment.

[0148] Step S200, generating a closing signal based on the sunrise time of the current environment to be illuminated, and generating a opening signal based on the sunset time of the current environment to be illuminated.

[0149] Step S300, turning off the lighting fixtures of the current lighting environment according to the turning-off signal of the current lighting environment.

[0150] Step S400: Turn on the lighting fixture of the current environment to be illuminated based on the turn-on signal of the current environment to be illuminated.

[0151] Further, in step S8, in response to the external start signal, all lighting fixtures in communication connection with the first control terminal are turned on, and the lighting intensity of all lighting fixtures in communication connection with the second control terminal is turned on and gradually increased until the coefficient difference of all lighting fixtures in communication connection with the second control terminal does not exceed a preset threshold, and then, the steps include:

[0152] Step S1000: monitor the lighting intensity of all lighting fixtures in real time, and define a lighting fixture with a lighting intensity of zero as a faulty lighting fixture.

[0153] Step S2000, obtaining the geographic location of the faulty lighting fixture and sending it to an external decision-making end.

[0154] In this embodiment, at the same timestamp and when all lighting fixtures are not turned on, the first image data of each environment to be illuminated is obtained respectively, and the first image brightness average value of each first image data is obtained respectively through a visual algorithm; at the same timestamp and when all lighting fixtures are turned on, the second image data of each environment to be illuminated is obtained respectively, and the second image brightness average value of each second image data is obtained respectively through a visual algorithm; at least two continuous brightness intervals are defined in order from low to high according to the numerical value of visible light brightness; a weight coefficient is defined based on each brightness interval, and the sizes of all weight coefficients are from large to small as the numerical values ​​of all visible light brightness are from low to high; and all the first image brightness average values ​​and all the second image brightness average values ​​are classified into the classified values ​​by a classification algorithm respectively. There is a brightness interval, a first weight coefficient is obtained based on the average brightness of each first image, and a second weight coefficient is obtained based on the average brightness of each second image; the coefficient difference between the first weight coefficient and the second weight coefficient of the same lighting fixture is obtained, and it is determined whether the current coefficient difference exceeds a preset threshold; all lighting fixtures corresponding to the coefficient differences that do not exceed the preset threshold are respectively connected to the first control end for communication, and all lighting fixtures corresponding to the coefficient differences that exceed the preset threshold are respectively connected to the second control end for communication; in response to an external start signal, all lighting fixtures connected to the first control end for communication are turned on, and the lighting intensity of all lighting fixtures connected to the second control end for communication is turned on and gradually increased until the coefficient difference of all lighting fixtures connected to the second control end for communication does not exceed the preset threshold. This embodiment defines the weight difference by identifying the brightness difference between the same lighting environment under the light-on condition and the light-off condition, so that the lighting environment with a larger brightness difference pays more attention to the lighting performance of the lighting fixture, and when necessary, the lighting performance is improved by increasing the gear of the lighting fixture. Then, through the threshold setting of the weight difference, the lighting fixture is divided into two parts, one that does not need to adjust the gear and the other that needs to be adjusted, and they are managed and controlled separately, thereby reducing or eliminating the problems of over-lighting and under-lighting of the lighting fixture, ensuring the lighting performance of the lighting fixture while also ensuring the service life of the lighting fixture.

[0155] like Figure 2 As shown, this embodiment provides an embodiment of an automatic control device for a lighting fixture, and the automatic control device is applied to the automatic control method in the above embodiment.

[0156] Specifically, the automatic control device includes a non-turned-on state average brightness acquisition module 1, a turned-on state average brightness acquisition module 2, a brightness interval definition module 3, a weight coefficient definition module 4, a brightness average classification module 5, a coefficient difference acquisition and judgment module 6, a lighting fixture communication connection module 7, and a lighting fixture turning-on module 8, which are electrically connected in sequence.

[0157] Among them, the off-state brightness average value acquisition module 1 is used to obtain the first image data of each environment to be illuminated at the same timestamp and when all lighting fixtures are in the off-state, and obtain the first image brightness average value of each first image data through a visual algorithm; the on-state brightness average value acquisition module 2 is used to obtain the second image data of each environment to be illuminated at the same timestamp and when all lighting fixtures are in the on state, and obtain the second image brightness average value of each second image data through a visual algorithm; the brightness interval definition module 3 is used to define at least two consecutive brightness intervals in sequence from low to high according to the numerical value of visible light brightness; the weight coefficient definition module 4 is used to define a weight coefficient based on each brightness interval, and the size of all weight coefficients decreases from large to small as the numerical value of all visible light brightness increases from low to high; the brightness average value classification module 5 is used to classify the brightness average values ​​of all first images, all The second image brightness average value is classified into all brightness intervals, and a first weight coefficient is obtained based on each first image brightness average value, and a second weight coefficient is obtained based on each second image brightness average value; the coefficient difference acquisition and judgment module 6 is used to obtain the coefficient difference between the first weight coefficient and the second weight coefficient of the same lighting fixture, and judge whether the current coefficient difference exceeds the preset threshold; the lighting fixture communication connection module 7 is used to communicate and connect all lighting fixtures corresponding to the coefficient differences that do not exceed the preset threshold with the first control end, and communicate and connect all lighting fixtures corresponding to the coefficient differences that exceed the preset threshold with the second control end; the lighting fixture start-up module 8 is used to respond to an external start-up signal, turn on all lighting fixtures that are communicatively connected to the first control end, and turn on and gradually increase the lighting intensity of all lighting fixtures that are communicatively connected to the second control end until the coefficient difference of all lighting fixtures that are communicatively connected to the second control end does not exceed the preset threshold.

[0158] Furthermore, the automatic control device also includes an insufficient lighting signal generating module and an insufficient lighting signal sending module which are electrically connected in sequence; the insufficient lighting signal generating module is electrically connected to the lighting appliance starting module.

[0159] Among them, the insufficient lighting signal generating module is used to generate an insufficient lighting signal if the coefficient difference of all lighting fixtures connected to the second control end in communication reaches the maximum lighting intensity still exceeds the preset threshold; the insufficient lighting signal sending module is used to send the insufficient lighting signal to the external decision-making end.

[0160] Furthermore, the module for obtaining the average brightness value in the unopened state specifically includes a first unopened state average brightness acquisition submodule, a second unopened state average brightness acquisition submodule, a third unopened state average brightness acquisition submodule, a fourth unopened state average brightness acquisition submodule, a fifth unopened state average brightness acquisition submodule, and a sixth unopened state average brightness acquisition submodule, which are electrically connected in sequence; the sixth unopened state average brightness acquisition submodule is electrically connected to the turned-on state average brightness acquisition module.

[0161] Among them, the first non-open state brightness average value acquisition submodule is used to obtain the first image data of each lighting environment at the same timestamp and when all lighting fixtures are in the non-open state; the second non-open state brightness average value acquisition submodule is used to import the cv2 software package through the python import statement; the third non-open state brightness average value acquisition submodule is used to read each first image data through the cv2.imread function of the cv2 software package and store it in the img variable; the fourth non-open state brightness average value acquisition submodule is used to convert all the first image data in the img variable into a first grayscale image through the cv2.cvtColor function of the cv2 software package and store it in the gray variable; the fifth non-open state brightness average value acquisition submodule is used to obtain the first average brightness of each first grayscale image in the gray variable through the cv2.mean function of the cv2 software package and store it in the average_brightness variable; the sixth non-open state brightness average value acquisition submodule is used to define all the first average brightnesses in the average_brightness variable as the average brightness of all first images.

[0162] Furthermore, the on-state brightness average value acquisition module specifically includes a first on-state brightness average value acquisition submodule, a second on-state brightness average value acquisition submodule, a third on-state brightness average value acquisition submodule, a fourth on-state brightness average value acquisition submodule, a fifth on-state brightness average value acquisition submodule, and a sixth on-state brightness average value acquisition submodule, which are electrically connected in sequence; the first on-state brightness average value acquisition submodule is electrically connected to the sixth non-on-state brightness average value acquisition submodule, and the sixth on-state brightness average value acquisition submodule is electrically connected to the brightness interval definition module.

[0163] Among them, the first on-state brightness average value acquisition submodule is used to obtain the second image data of each lighting environment at the same timestamp and when all lighting fixtures are in the on state; the second on-state brightness average value acquisition submodule is used to initialize the img variable, the gray variable, and the average_brightness variable; the third on-state brightness average value acquisition submodule is used to read each second image data through the cv2.imread function and store it in the img variable; the fourth on-state brightness average value acquisition submodule is used to convert all the second image data in the img variable into a second grayscale image through the cv2.cvtColor function and store it in the gray variable; the fifth on-state brightness average value acquisition submodule is used to obtain the second average brightness of each second grayscale image in the gray variable through the cv2.mean function and store it in the average_brightness variable; the sixth on-state brightness average value acquisition submodule is used to define all the second average brightnesses in the average_brightness variable as the average brightness of all second images.

[0164] Furthermore, the brightness average value classification module specifically includes a first brightness average value classification submodule, a second brightness average value classification submodule, a third brightness average value classification submodule, a fourth brightness average value classification submodule, a fifth brightness average value classification submodule, a sixth brightness average value classification submodule, a seventh brightness average value classification submodule, and an eighth brightness average value classification submodule, which are electrically connected in sequence.

[0165] The first brightness average classification submodule is used to define the first to-be-classified data set according to the brightness averages of all first images and the brightness averages of all second images. and the second set of data to be classified Among them, X (1) is the first data set to be classified, is the average brightness value of the jth first image in the first set of data to be classified, m is the number of average brightness values ​​of all first images, X (2) is the second data set to be classified, is the average brightness value of the i-th second image in the second data set to be classified, and n is the number of average brightness values ​​of all second images.

[0166] The second brightness average classification submodule is used to define a category set C = {y1, y2, ..., y k ,…,y o}, where y k is the kth brightness interval in the category set C, and o is the number of all brightness intervals.

[0167] The third brightness average classification submodule is used to calculate the conditional probability of the brightness average of each first image in the first to-be-classified data set in each brightness interval according to formula (1):

[0168]

[0169] Among them, P(X (1) |y k ) is the conditional probability of the first set of data to be classified in the kth brightness interval, P(y k ) is the edge probability of the kth brightness interval, P(x j y k ) is the conditional probability of the jth first image brightness average in the kth brightness interval.

[0170] The fourth brightness average classification submodule is used to classify the brightness average of each first image into the brightness interval with the highest conditional probability.

[0171] The fifth brightness average classification submodule is used to define the weight coefficient of the current brightness interval as the first weight coefficient of the brightness average of all first images within the current brightness interval.

[0172] The sixth brightness average classification submodule is used to clear all first image brightness averages in all brightness intervals.

[0173] The seventh brightness average classification submodule is used to calculate the conditional probability of the brightness average of each second image in the second to-be-classified data set in each brightness interval according to formula (2):

[0174]

[0175] Among them, P(X (2) |y k ) is the conditional probability of the second set of data to be classified in the kth brightness interval, P(x i y k ) is the conditional probability of the average brightness of the i-th second image in the k-th brightness interval.

[0176] The eighth brightness average classification submodule is used to classify each second image brightness average into its respective brightness interval with the highest conditional probability, and define the weight coefficient of the current brightness interval as the second weight coefficient of all second image brightness averages within the current brightness interval.

[0177] Furthermore, the automatic control device also includes a sunrise time and sunset time acquisition module, a closing signal and opening signal generation module, a lamp closing module, and a lamp opening module, which are electrically connected in sequence; the sunrise time and sunset time acquisition module is electrically connected to the lighting fixture opening module.

[0178] Among them, the sunrise time and sunset time acquisition module is used to obtain the sunrise time and sunset time of each environment to be illuminated respectively; the closing signal and opening signal generation module is used to generate a closing signal based on the sunrise time of the current environment to be illuminated, and generate a turning on signal according to the sunset time of the current environment to be illuminated; the lamp closing module is used to close the lighting fixtures of the current environment to be illuminated according to the closing signal of the current environment to be illuminated; the lamp turning on module is used to turn on the lighting fixtures of the current environment to be illuminated based on the turning on signal of the current environment to be illuminated.

[0179] Furthermore, the automatic control device also includes a fault lighting fixture definition module and a geographic location acquisition and transmission module which are electrically connected in sequence; the fault lighting fixture definition module is electrically connected to the lighting fixture start module.

[0180] Among them, the faulty lighting fixture definition module is used to monitor the lighting intensity of all lighting fixtures in real time, and define the lighting fixture with zero lighting intensity as a faulty lighting fixture; the geographic location acquisition and transmission module is used to obtain the geographic location of the faulty lighting fixture and send it to the external decision-making end.

[0181] It should be noted that this embodiment is a functional module item embodiment based on the above method embodiment. For additional contents such as the optimization, expansion, and example illustration of this embodiment, please refer to the above method embodiment, and this embodiment will not be repeated.

[0182] In this embodiment, at the same timestamp and when all lighting fixtures are not turned on, the first image data of each environment to be illuminated is obtained respectively, and the first image brightness average value of each first image data is obtained respectively through a visual algorithm; at the same timestamp and when all lighting fixtures are turned on, the second image data of each environment to be illuminated is obtained respectively, and the second image brightness average value of each second image data is obtained respectively through a visual algorithm; at least two continuous brightness intervals are defined in order from low to high according to the numerical value of visible light brightness; a weight coefficient is defined based on each brightness interval, and the sizes of all weight coefficients are from large to small as the numerical values ​​of all visible light brightness are from low to high; and all the first image brightness average values ​​and all the second image brightness average values ​​are classified into the classified values ​​by a classification algorithm respectively. There is a brightness interval, a first weight coefficient is obtained based on the average brightness of each first image, and a second weight coefficient is obtained based on the average brightness of each second image; the coefficient difference between the first weight coefficient and the second weight coefficient of the same lighting fixture is obtained, and it is determined whether the current coefficient difference exceeds a preset threshold; all lighting fixtures corresponding to the coefficient differences that do not exceed the preset threshold are respectively connected to the first control end for communication, and all lighting fixtures corresponding to the coefficient differences that exceed the preset threshold are respectively connected to the second control end for communication; in response to an external start signal, all lighting fixtures connected to the first control end for communication are turned on, and the lighting intensity of all lighting fixtures connected to the second control end for communication is turned on and gradually increased until the coefficient difference of all lighting fixtures connected to the second control end for communication does not exceed the preset threshold. This embodiment defines the weight difference by identifying the brightness difference between the same lighting environment under the light-on condition and the light-off condition, so that the lighting environment with a larger brightness difference pays more attention to the lighting performance of the lighting fixture, and when necessary, the lighting performance is improved by increasing the gear of the lighting fixture. Then, through the threshold setting of the weight difference, the lighting fixture is divided into two parts, one that does not need to adjust the gear and the other that needs to be adjusted, and they are managed and controlled separately, thereby reducing or eliminating the problems of over-lighting and under-lighting of the lighting fixture, ensuring the lighting performance of the lighting fixture while also ensuring the service life of the lighting fixture.

[0183] Figure 3 Schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 3 As shown, the electronic device 9 includes a processor 91 and a memory 92 coupled to the processor 91 .

[0184] The memory 92 stores program instructions for implementing the automatic control method of the lighting fixture according to any of the above embodiments.

[0185] The processor 91 is used to execute the program instructions stored in the memory 92 to automatically control the lighting fixture.

[0186] The processor 91 may also be referred to as a CPU (Central Processing Unit). The processor 91 may be an integrated circuit chip having the ability to process signals. The processor 91 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0187] Further, Figure 4 This is a schematic diagram of the structure of a storage medium according to an embodiment of the present application. Figure 4 The storage medium 10 of the embodiment of the present application stores program instructions 101 that can implement all the above methods, wherein the program instructions 101 can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or terminal devices such as a computer, a server, a mobile phone, and a tablet.

[0188] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0189] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. The above is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of this application, or directly or indirectly used in other related technical fields, is also included in the patent protection scope of the present application.

Claims

1. A method for automatically controlling a lighting fixture, wherein the lighting fixture has a plurality of lighting environments to be illuminated in different scenes, and the lighting fixture includes at least two lighting intensities with increasing lighting brightness, characterized in that: The automatic control method comprises: Step S1, at the same timestamp and when all lighting fixtures are in an off state, first image data of each lighting environment are respectively obtained, and a first image brightness average value of each first image data is respectively obtained by a visual algorithm; Step S2, at the same timestamp and when all lighting fixtures are in the turned-on state, respectively obtain the second image data of each environment to be illuminated, and respectively obtain the second image brightness average value of each second image data by using the visual algorithm; Step S3, defining at least two continuous brightness intervals in order from low to high according to the value of the visible light brightness; Step S4, defining a weight coefficient based on each brightness interval, and the magnitudes of all weight coefficients decrease from large to small as the values ​​of all visible light brightness increase from low to high; Step S5, classifying all first image brightness averages and all second image brightness averages into all brightness intervals by a classification algorithm, obtaining a first weight coefficient based on each first image brightness average, and obtaining a second weight coefficient based on each second image brightness average; Step S6, obtaining a coefficient difference between a first weight coefficient and a second weight coefficient of the same lighting fixture, and determining whether the current coefficient difference exceeds a preset threshold; Step S7, connecting all lighting fixtures corresponding to the coefficient differences that do not exceed the preset threshold to the first control end, and connecting all lighting fixtures corresponding to the coefficient differences that exceed the preset threshold to the second control end; Step S8, in response to an external start signal, turn on all lighting fixtures that are communicatively connected to the first control end, turn on and gradually increase the lighting intensity of all lighting fixtures that are communicatively connected to the second control end, until the coefficient difference of all lighting fixtures that are communicatively connected to the second control end does not exceed the preset threshold.

2. The automatic control method according to claim 1, characterized in that: Step S8, in response to the external start signal, turning on all lighting fixtures in communication connection with the first control end, turning on and gradually increasing the lighting intensity of all lighting fixtures in communication connection with the second control end, until the coefficient difference of all lighting fixtures in communication connection with the second control end does not exceed the preset threshold, and then comprising: Step S10, if the coefficient difference of all lighting appliances in communication connection with the second control end after reaching the maximum lighting intensity still exceeds the preset threshold, then generating a lighting shortage signal; Step S20, sending the insufficient lighting signal to an external decision-making end.

3. The automatic control method according to claim 1, characterized in that: Step S1, at the same time stamp and when all lighting appliances are not turned on, respectively obtain the first image data of each lighting environment, and respectively obtain the first image brightness average value of each first image data through a visual algorithm, including: Step S11, at the same timestamp and when all lighting fixtures are in an off state, respectively obtain first image data of each environment to be illuminated; Step S12, importing the cv2 software package through the python import statement; Step S13, reading each first image data respectively through the cv2.imread function of the cv2 software package and storing them in the img variable; Step S14, converting all the first image data in the img variable into a first grayscale image through the cv2.cvtColor function of the cv2 software package and storing it in the gray variable; Step S15, obtaining the first average brightness of each first grayscale image in the gray variable by using the cv2.mean function of the cv2 software package and storing it in the average_brightness variable; Step S16, defining all first average brightnesses in the average_brightness variable as average brightnesses of all first images.

4. The automatic control method according to claim 3, characterized in that: Step S2, at the same timestamp and when all lighting fixtures are in the turned-on state, respectively obtain the second image data of each lighting environment, and respectively obtain the second image brightness average value of each second image data by the visual algorithm, including: Step S11, acquiring second image data of each environment to be illuminated respectively at the same timestamp and when all lighting fixtures are in an on state; Step S22, initializing the img variable, the gray variable, and the average_brightness variable; Step S23, reading each second image data respectively through the cv2.imread function and storing them in the img variable; Step S24, converting all the second image data in the img variable into a second grayscale image through the cv2.cvtColor function and storing it in the gray variable; Step S25, obtaining the second average brightness of each second grayscale image in the gray variable through the cv2.mean function and storing it in the average_brightness variable; Step S26, defining all second average brightnesses in the average_brightness variable as average brightnesses of all second images.

5. The automatic control method according to claim 1, characterized in that: Step S5, classifying all first image brightness averages and all second image brightness averages into all brightness intervals by a classification algorithm, obtaining a first weight coefficient based on each first image brightness average, and obtaining a second weight coefficient based on each second image brightness average, including: Step S51, defining a first set of data to be classified according to the average brightness of all first images and the average brightness of all second images and the second set of data to be classified Among them, X (1) is the first set of data to be classified, is the average brightness value of the jth first image in the first set of data to be classified, m is the number of average brightness values ​​of all first images, X (2) is the second data set to be classified, is the average brightness value of the i-th second image in the second to-be-classified data set, and n is the number of average brightness values ​​of all second images; Step S52: define a category set C = {y1, y2, ..., y k ,…,y o }, where y k is the kth brightness interval in the category set C, and o is the number of all brightness intervals; Step S53, calculating the conditional probability of the average brightness value of each first image in the first set of data to be classified in each brightness interval according to formula (1): Among them, P(X (1) |y k ) is the conditional probability of the first set of data to be classified in the kth brightness interval, P(y k ) is the edge probability of the kth brightness interval, P(x j y k ) is the conditional probability of the jth first image brightness average value in the kth brightness interval; Step S54, classifying the average brightness values ​​of each first image into the brightness intervals with the highest conditional probability; Step S55, defining the weight coefficient of the current brightness interval as a first weight coefficient of the average brightness of all first images within the current brightness interval; Step S56, clearing all first image brightness averages in all brightness intervals; Step S57, calculating the conditional probability of the average brightness value of each second image in the second to-be-classified data set in each brightness interval according to formula (2): Among them, P(X (2) |y k ) is the conditional probability of the second set of data to be classified in the kth brightness interval, P(x i |y k ) is the conditional probability of the average brightness of the i-th second image in the k-th brightness interval; Step S58, classifying each second image brightness average value into its respective brightness interval with the highest conditional probability, and defining the weight coefficient of the current brightness interval as the second weight coefficient of all second image brightness average values ​​within the current brightness interval.

6. The automatic control method according to claim 1, characterized in that: Step S8, in response to the external start signal, turning on all lighting fixtures in communication connection with the first control end, turning on and gradually increasing the lighting intensity of all lighting fixtures in communication connection with the second control end, until the coefficient difference of all lighting fixtures in communication connection with the second control end does not exceed the preset threshold, and then comprising: Step S100, respectively obtaining the sunrise time and sunset time of each lighting environment; Step S200, generating a closing signal based on the sunrise time of the current environment to be illuminated, and generating the opening signal based on the sunset time of the current environment to be illuminated; Step S300, turning off the lighting fixture of the current lighting environment according to the turning-off signal of the current lighting environment; Step S400: Turn on the lighting fixture of the current environment to be illuminated based on the turn-on signal of the current environment to be illuminated.

7. The automatic control method according to claim 1, characterized in that: Step S8, in response to the external start signal, turning on all lighting fixtures in communication connection with the first control end, turning on and gradually increasing the lighting intensity of all lighting fixtures in communication connection with the second control end, until the coefficient difference of all lighting fixtures in communication connection with the second control end does not exceed the preset threshold, and then comprising: Step S1000, monitoring the lighting intensity of all lighting fixtures in real time, and defining a lighting fixture with a lighting intensity of zero as a faulty lighting fixture; Step S2000, obtaining the geographic location of the faulty lighting fixture and sending it to an external decision-making end.

8. An automatic control device for a lighting fixture, the automatic control device being applied to the automatic control method for a lighting fixture as claimed in any one of claims 1 to 7, characterized in that: The automatic control device comprises: The module for acquiring the average brightness value in the non-on state is used to acquire the first image data of each environment to be illuminated at the same time stamp and when all lighting fixtures are in the non-on state, and to acquire the first image brightness average value of each first image data through a visual algorithm; An on-state brightness average value acquisition module is used to respectively acquire the second image data of each environment to be illuminated when all lighting fixtures are in the on state at the same timestamp, and respectively acquire the second image brightness average value of each second image data by using the visual algorithm; A brightness interval definition module, used to define at least two consecutive brightness intervals in order from low to high according to the value of visible light brightness; The weight coefficient definition module is used to define a weight coefficient based on each brightness interval, and the size of all weight coefficients decreases from large to small as the value of all visible light brightness increases from low to high; A brightness average classification module, used to classify all first image brightness averages and all second image brightness averages into all brightness intervals by a classification algorithm, and obtain a first weight coefficient based on each first image brightness average and a second weight coefficient based on each second image brightness average; A coefficient difference acquisition and judgment module, used to obtain the coefficient difference between the first weight coefficient and the second weight coefficient of the same lighting fixture, and to judge whether the current coefficient difference exceeds a preset threshold; A lighting fixture communication connection module, used to respectively connect the lighting fixtures corresponding to the coefficient differences that do not exceed the preset threshold value to the first control end for communication, and respectively connect the lighting fixtures corresponding to the coefficient differences that exceed the preset threshold value to the second control end for communication; A lighting fixture start-up module is used to respond to an external start-up signal to turn on all lighting fixtures that are communicatively connected to the first control end, and to turn on and gradually increase the lighting intensity of all lighting fixtures that are communicatively connected to the second control end until the coefficient difference of all lighting fixtures that are communicatively connected to the second control end does not exceed the preset threshold.

9. An electronic device, characterized in that: It comprises a processor and a memory coupled to the processor, wherein the memory stores program instructions executable by the processor; when the processor executes the program instructions stored in the memory, the automatic control method of the lighting fixture as described in any one of claims 1 to 7 is implemented.

10. A storage medium, characterized in that: The storage medium stores program instructions, and when the program instructions are executed by the processor, the automatic control method of the lighting fixture according to any one of claims 1 to 7 can be implemented.

Citation Information

Patent Citations

  • Intelligent light control system and method

    CN110169205A

  • Light supplement control method, light supplement control device, storage medium and electronic device

    CN112188112A

  • Intelligent lighting control method and system based on real-time environment information

    CN115767842A

  • Intelligent street lamp adjustment control system based on video analysis

    CN116017816A

  • Method for controlling lighting lamps in light-permeable public places

    CN117355005A

Cited By

  • Automatic control method, device and equipment of high-voltage circuit breaker and storage medium

    CN119602494A

  • An Automatic Control Method, Device, Equipment and Storage Medium for a High-Voltage Circuit Breaker

    CN119602494B