Day / night switching method, device, electronic device and medium for front-end equipment
By fitting the day and night switching time function of the front-end device, the day and night switching time is determined and controlled, which solves the problem of abnormal day and night switching, improves the stability and consistency of the equipment, and reduces hardware complexity.
Patent Information
- Application Number
- CN202111563246.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2041-12-20
AI Technical Summary
Existing front-end devices experience abnormal day/night switching due to inaccurate exposure information estimation or photoresistor installation position, which increases costs and hardware complexity.
By fitting the day and night switching time of multiple front-end devices in the management area where the target front-end device is located, the day and night switching time function information is determined, and the day and night switching time of the current date is estimated based on this information to control the device to switch day and night.
It solves the problem of abnormal day and night switching of a single front-end device in the same network, improves the accuracy and consistency of day and night switching, and reduces dependence on hardware and manual intervention.
Smart Images

Figure CN116320738B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of video surveillance technology, and in particular to a day / night switching method, device, electronic device, and medium for front-end equipment. Background Art
[0002] With the development of IP monitoring technology, front-end equipment such as IPC has been widely used, and video surveillance systems with parks, schools and cities as typical examples have been widely used.
[0003] To achieve all-weather monitoring in specific scenarios, users of monitoring products have increasingly high requirements for the compatibility, scalability, adaptability, and stability of day / night switching times. For example, the current ambient brightness can be estimated through exposure-related statistical information or mapped through the resistance value of a photoresistor, and then the day / night state can be determined through comparison. However, estimating the current ambient brightness through exposure information will produce inaccurate values for lighting environments with large variations. Furthermore, the use of an external photoresistor increases costs, and the location and lifespan of the photoresistor, as well as any obstruction of the photoresistor by debris, can affect the photosensitivity function to a certain extent, leading to deviations in the day / night switching. Summary of the Invention
[0004] Embodiments of the present invention provide a day / night switching method, apparatus, electronic device, and medium for a front-end device to solve the problem of abnormal day / night switching of the front-end device caused by hardware problems or obstructions.
[0005] In a first aspect, an embodiment of the present invention provides a day / night switching method for a front-end device, comprising:
[0006] Determine the day / night switching time function information used by the target front-end device; wherein the day / night switching time function information is obtained by fitting the historical day / night switching times reported by multiple front-end devices in the management area where the target front-end device is located when switching between day and night on different historical dates;
[0007] Determining, based on the day / night switching time function information, an estimated day / night switching time when the target front-end device performs day / night switching on the current date;
[0008] According to the estimated day / night switching time, the target front-end device is controlled to perform day / night switching; wherein the day / night switching includes switching from day mode to night mode and from night mode to day mode.
[0009] In a second aspect, an embodiment of the present invention further provides a day / night switching device for a front-end device, comprising:
[0010] A module for determining a day / night switching time function information is configured to determine the day / night switching time function information used by a target front-end device; wherein the day / night switching time function information is obtained by fitting the historical day / night switching times reported by multiple front-end devices in the management area where the target front-end device is located when switching between day and night on different historical dates;
[0011] An estimated day / night switching time determination module is used to determine the estimated day / night switching time when the target front-end device performs day / night switching on the current date based on the day / night switching time function information;
[0012] The day / night switching detection module is used to control the target front-end device to switch between day and night according to the estimated day / night switching time; wherein the day / night switching includes switching from day mode to night mode and from night mode to day mode.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, including:
[0014] one or more processors;
[0015] a storage device for storing one or more programs;
[0016] The one or more programs are executed by the one or more processors, so that the one or more processors implement the day and night switching method of the front-end device provided in the embodiment of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the day and night switching method of the front-end device provided in the embodiment of the present invention is implemented.
[0018] An embodiment of the present invention provides a method for day / night switching of a front-end device. The method determines the day / night switching time function information used by a target front-end device; determines the estimated day / night switching time when the target front-end device switches day / night on the current date based on the day / night switching time function information; and controls the target front-end device to switch day / night based on the estimated day / night switching time. A method for fitting and using a function based on the day / night switching time of all front-end devices in the current network solves the problem of abnormal day / night switching of a single front-end device in the same network. This eliminates the need for manual efforts to resolve abnormal day / night switching of a single front-end device due to defects in existing day / night detection algorithms, front-end device installation, and photoresistor lifespan.
[0019] The above content of the invention is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Other features, objects, and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are for the purpose of illustrating preferred embodiments only and are not to be considered as limiting the present invention. Like reference characters are used throughout the drawings to denote like parts. In the drawings:
[0021] Figure 1 This is a flow chart of a day / night switching method for a front-end device provided in the first embodiment of the present invention;
[0022] Figure 2A This is a flow chart of a method for day / night switching of a front-end device provided by the second embodiment of the present invention;
[0023] Figure 2B This is a flow chart of a method for fitting a color-cut-black function of a front-end device provided in the second embodiment of the present invention;
[0024] Figure 2C This is a flow chart of a method for fitting a black-cut color function of a front-end device provided in the second embodiment of the present invention;
[0025] Figure 3A This is a flow chart of a method for day / night switching of a front-end device provided in a third embodiment of the present invention;
[0026] Figure 3B This is a flow chart of a method for detecting and processing color-cut black by a front-end device provided in a third embodiment of the present invention;
[0027] Figure 3C This is a flow chart of a method for detecting and processing black-cut colors by a front-end device provided in the third embodiment of the present invention;
[0028] Figure 4 This is a structural block diagram of a day / night switching device of a front-end device provided by a fourth embodiment of the present invention;
[0029] Figure 5 This is a structural diagram of an electronic device provided in Example 5 of the present invention. DETAILED DESCRIPTION
[0030] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.
[0031] It should be noted that before discussing exemplary embodiments in more detail, some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the various operations (or steps) as sequential processes, many of the operations therein can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the various operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0032] At present, the day and night detection method of the front-end device is usually to estimate the current ambient brightness based on exposure-related statistical information, set the corresponding day and night switching threshold, and determine the current day and night state by comparing the current ambient brightness with the day and night switching threshold. However, estimating the current ambient brightness based on exposure information, as well as the value calculated for lighting environments with large differences, will result in inaccurate calculated current ambient brightness, which will lead to unreasonable actual day and night switching and even repeated day and night switching. Mapping the current ambient brightness through the resistance value of a photoresistor, setting the corresponding day and night switching threshold, and determining the day and night state by comparing the size relationship between the two, requires an external photoresistor in hardware, which increases the cost. In addition, the installation location and lifespan of the photoresistor, as well as the obstruction of the photoresistor by debris, will have a certain impact on the photosensitivity function. In severe cases, the calculated day and night switching point may be unreasonable. Therefore, an embodiment of the present invention provides an improved day and night switching method for a front-end device.
[0033] The following describes in detail the day and night switching method, device, electronic device and storage medium of the front-end device proposed in the present application through various embodiments and optional solutions of each embodiment.
[0034] Example 1
[0035] Figure 1 This is a flow chart of a method for day / night switching of a front-end device provided by the first embodiment of the present invention. This embodiment is applicable to the case where the front-end device performs day / night detection processing. The method of this embodiment can be executed by the day / night switching device of the front-end device, which can be implemented in hardware and / or software. Figure 1 As shown, the method specifically includes the following steps:
[0036] S110: Determine the day / night switching time function information adopted by the target front-end device.
[0037] The target front-end device may refer to a device installed on-site or at the front end, for example, an image acquisition device for monitoring video installed in a park, school or city, such as a camera, lens or pan / tilt head.
[0038] Optionally, the day / night switching time function information is obtained by fitting historical day / night switching times reported by multiple front-end devices within the management area where the target front-end device is located when switching day / night on different historical dates.
[0039] The day / night switching time function information may refer to the information used by the target front-end device when performing the day / night switching. For example, when the daytime brightness reaches a set threshold, the target front-end device is switched to daytime, the target front-end device system time is recorded, and the day / night switching time reported by multiple front-end devices in the area where the target front-end device is located is fitted. Front-end devices in the same network or in the same area with similar distances complete the fitting based on the day / night switching time, so that the front-end devices in the same network can maintain the time consistency of the day / night switching.
[0040] S120: Determine, based on the day / night switching time function information, an estimated day / night switching time for the target front-end device when performing day / night switching on the current date.
[0041] The estimated day / night switching time may refer to the time for the day / night switching on the current date estimated based on the day / night switching time function information. For example, based on the system time of the target front-end device when the target front-end device meets the day / night switching time reported daily by the network where the target front-end device is located, the system time of the target front-end device is sorted, and the average is calculated on the basis of removing the maximum and minimum values to obtain the average system time of the target front-end device at the day / night switching time. The average day / night switching time is fitted with the date to obtain the day / night switching time function information, and the day / night switching time is estimated based on the day / night switching time function information. The method of obtaining the average system time of the target front-end device includes but is not limited to calculating the average, mean square error, and median value after removing the maximum and minimum values.
[0042] S130: Control the target front-end device to perform day / night switching according to the estimated day / night switching time.
[0043] Day / night switching detection can be based on the current screen brightness value calculated based on the currently effective exposure information or by mapping the resistance of a photoresistor connected to the front-end device. The system then records the time. When the estimated day / night switching time is reached, the target front-end device is controlled to switch from night to day or vice versa.
[0044] Optionally, the day / night switching includes switching from day mode to night mode and from night mode to day mode. Based on the estimated day / night switching time, it is determined whether the system time of the target front-end device is less than the time when the day mode switches to night mode. If so, the target front-end device is controlled to switch from day mode to night mode. Based on the estimated day / night switching time, it is determined whether the system time of the target front-end device is less than the time when the night mode switches to day mode. If so, the target front-end device is controlled to switch from night mode to day mode.
[0045] An embodiment of the present invention provides a method for day / night switching of a front-end device. The method determines the day / night switching time function information used by a target front-end device; determines the estimated day / night switching time when the target front-end device switches day / night on the current date based on the day / night switching time function information; and controls the target front-end device to switch day / night based on the estimated day / night switching time. Based on the function fitting and use method of the day / night switching time of all front-end devices in the current network, the problem of abnormal day / night switching of a single front-end device in the same network is solved, eliminating the need for manual efforts to resolve the problem of abnormal day / night switching of a single front-end device caused by defects in the existing day / night detection algorithm, front-end device installation, and photoresistor life.
[0046] Example 2
[0047] Figure 2A This is a flow chart of a method for day and night switching of a front-end device provided by the second embodiment of the present invention. The embodiment of the present invention further optimizes the above embodiment on the basis of the above embodiment, and the embodiment of the present invention can be combined with various optional solutions in one or more of the above embodiments. Figure 2A As shown, the day and night switching method of the front-end device provided in the embodiment of the present invention may include the following steps:
[0048] S210: Determine the historical day / night switching time of multiple front-end devices in the management area where the target front-end device is located, when the day / night switching conditions are met and the day / night switching is performed on the same historical date.
[0049] Among them, two brightness thresholds L are pre-set for switching from day mode to night mode (such as color cut to black) and from night mode to day mode (such as black cut to color). s1 、L s2 In order to prevent the current screen brightness of the target front-end device from switching repeatedly at the critical point of day and night, it is recommended to determine the threshold value L s2 >L s1 The target front-end device is used during operation but is not limited to use, and the brightness value L of the current screen is obtained based on the currently effective exposure information calculation or based on the resistance mapping method of the photoresistor external to the target front-end device. s .
[0050] When the target front-end device continuously s1 frames, all satisfy L s <L s1 , then it is considered that the current environment is nighttime and needs to switch to night mode, and record the target front-end device system time T s1 , and T s1 and the current date are reported to the server; when the target front-end device is n consecutive s2 frames, all satisfy L s >L s2 , it is considered that the current environment is daytime, and it is necessary to switch to day mode and record the target front-end device system time T s1 , and T s2 Report to the server with the current date.
[0051] Among them, L s1 、L s2 、n s1 and n s2 It can be adjusted according to the usage scenario of the target front-end device, the day / night switching sensitivity, and the day / night switching speed.
[0052] S220 , pre-processing the historical day / night switching time of multiple front-end devices when they switched day / night on the same historical date to obtain a reference day / night switching time on the same historical date.
[0053] Optionally, the preprocessing of historical day / night switching times of multiple front-end devices when switching day / night on the same historical date to obtain a reference day / night switching time on the same historical date includes:
[0054] When multiple front-end devices detect that the day / night switching conditions are met on the same historical date, the historical day / night switching times when the day / night switching is performed are sorted by time size;
[0055] Eliminate a preset number of historical day / night switching times that are ranked first or last;
[0056] The historical day / night switching time on the same historical date after sorting and elimination is averaged to obtain the reference day / night switching time on the same historical date.
[0057] Among them, the backend server is based on the front-end device system time T reported by all front-end devices in the current network every day. s1 and T s1 Sort them and take the average value after removing the maximum and minimum values to get the average time for the target front-end device to switch between day and night in the current network. as well as
[0058] In one alternative, the average time for the target front-end device to switch between day and night in the current network is as well as The determination can be made by calculating the front-end device system time T reported daily by all front-end devices in the current network. s1 and T s1 The mean square error is calculated, and the system time of the front-end device with large error is removed, and then the average time of the day and night switching of the target front-end device in the current network is calculated. as well as
[0059] In one alternative, the average time for the target front-end device to switch between day and night in the current network is as well as The determination can be made by taking the system time T reported by all front-end devices in the current network every day. s1 and T s1 Sort and select the median value as the average time for the target front-end device to switch between day and night in the current network as well as
[0060] S230 , fitting the reference day / night switching times of different consecutive historical dates to obtain day / night switching time function information.
[0061] Optionally, the day / night switching time function information is used to characterize the changing pattern of the fitted day / night switching time with the date.
[0062] Among them, when the front-end device runs for a long time, as well as Fitting with the date, we get the function f with the date as the independent variable and the color-cut-black time as the dependent variable s1 (D); the independent variable is date, and the dependent variable is the function f of the black cutting time s2 (D).
[0063] In an optional solution of the embodiment of the present invention, Figure 2B This is a flow chart of a method for fitting a color-cut black function of a front-end device provided in the second embodiment of the present invention. Figure 2B As shown, the method includes:
[0064] Calculate the current screen brightness L s ; continuous n s1 All frames satisfy L s <L s1 ;Record the current system time T s1 , the front-end equipment is cut to black; s1 and the date of the day reported by the front-end device to the server; the server reports the T s1Sort; after removing the maximum and minimum values, sort to get the average value The system runs continuously for fitting and obtains the color-cut-black function f s1 (D).
[0065] In an optional solution of the embodiment of the present invention, Figure 2C This is a flow chart of a method for fitting a black-cut color function of a front-end device provided in the second embodiment of the present invention. Figure 2C As shown, the method includes:
[0066] Calculate the current screen brightness L s ; continuous n s1 All frames satisfy L s >L s2 ;Record the current system time T s2 , the front-end equipment black cut color; T s2 and the date of the day reported by the front-end device to the server; the server reports the T s2 Sort; after removing the maximum and minimum values, sort to get the average value The system runs continuously for fitting and obtains the color-cut-black function f s2 (D).
[0067] S240: Determine, based on the day / night switching time function information, an estimated day / night switching time for the target front-end device when performing day / night switching on the current date.
[0068] S250: Control the target front-end device to perform day / night switching according to the estimated day / night switching time.
[0069] An embodiment of the present invention provides a method for day / night switching of a front-end device. The method comprises determining the historical day / night switching times of multiple front-end devices within the management area where the target front-end device is located when the day / night switching conditions are met and the front-end devices perform day / night switching on the same historical date; pre-processing the historical day / night switching times of the multiple front-end devices when they perform day / night switching on the same historical date to obtain a reference day / night switching time on the same historical date; fitting the reference day / night switching times of consecutive different historical dates to obtain day / night switching time function information; determining the estimated day / night switching time of the target front-end device when it performs day / night switching on the current date based on the day / night switching time function information; and controlling the target front-end device to perform day / night switching based on the estimated day / night switching time. Through the technical solution of the embodiment of the present invention, the front-end devices in the same network are detected to maintain the time consistency of day / night switching; and when used in combination with other day / night detection algorithms, the accuracy of the other day / night detection algorithms is improved to a certain extent, thereby solving the problem of abnormal day / night switching of the front-end device due to hardware problems or occlusion.
[0070] Example 3
[0071] Figure 3A This is a flow chart of a method for day and night switching of a front-end device provided by the third embodiment of the present invention. The embodiment of the present invention further optimizes the above embodiment on the basis of the above embodiment, and the embodiment of the present invention can be combined with various optional solutions in one or more of the above embodiments. Figure 3A As shown, the day and night switching method of the front-end device provided in the embodiment of the present invention may include the following steps:
[0072] S310: Determine the day / night switching time function information adopted by the target front-end device.
[0073] S320: Determine, based on the day / night switching time function information, an estimated day / night switching time for the target front-end device when performing day / night switching on the current date.
[0074] S330: Determine the real-time day / night detection system time and the corresponding real-time day / night detection result when the target front-end device continuously performs inherent day / night detection on the current date.
[0075] The inherent day / night detection includes day / night detection using an inherent day / night detection method; and the day / night detection result is used to indicate whether a day / night switching condition is met.
[0076] S340 , controlling the target front-end device to perform day / night switching based on the estimated day / night switching time, the continuously updated real-time day / night detection system time, and the corresponding real-time day / night detection result.
[0077] During the target detection period, it is determined in real time whether the real-time day and night detection results of the target front-end device when continuously performing inherent day and night detection on the current date have changed; the target detection period includes the time range in which the real-time day and night detection system time that is continuously updated during continuous inherent day and night detection does not exceed the estimated day and night switching time.
[0078] Optionally, controlling the target front-end device to switch between day and night based on the estimated day / night switching time, the continuously updated real-time day / night detection system time, and the corresponding real-time day / night detection result includes:
[0079] If the real-time day / night detection system time continuously updated during the continuous inherent day / night detection is earlier than the estimated day / night switching time, the real-time day / night detection result is changed to satisfy the day / night switching condition, then the real-time day / night detection system time updated when the day / night switching condition is satisfied is used as the inherent day / night switching time for the day / night switching obtained by using the inherent day / night detection method;
[0080] If the difference between the estimated day / night switching time and the inherent day / night switching time is within the preset day / night switching tolerance time, triggering the target front-end device to perform day / night switching;
[0081] If the difference between the estimated day and night switching time and the inherent day and night switching time is not within the preset day and night switching tolerance time, the day and night switching conditions of the target front-end device when continuously performing inherent day and night detection on the current date are adjusted to increase the difficulty of switching, and return to perform the following operation: determine the real-time day and night detection system time and the corresponding real-time day and night detection results when the target front-end device continuously performs inherent day and night detection on the current date.
[0082] In an optional solution of the embodiment of the present invention, Figure 3B This is a flow chart of a method for detecting and processing color-cut black by a front-end device provided in the third embodiment of the present invention. Figure 3B As shown, the method includes:
[0083] Perform day and night detection of front-end equipment according to the algorithm and record the system time T, T <f s1 (D) satisfies the color cut black condition, calculate the color cut black time T s1 , then make judgment 1: f s1 (D)-T s1 <T t , where T t The default value is 20 minutes, which can be configured by the user. If judgment 1 is met, the day and night switching time calculated by the front-end device is considered reasonable, and the front-end device switches from day mode to night mode, and T s1 Report to the server and optimize the color-cut black function. The optimization method is (D) = (f before optimization s1 (D)+T s1 ) / 2; If judgment 1 is not satisfied, it is considered that the color-to-black time calculated by the current front-end device is unreasonable, and the day and night switching conditions when the front-end device continuously performs inherent day and night detection on the current date are adjusted, such as lowering the threshold L s1 =(1-L t )*L s1 Re-test the day and night to increase the difficulty of switching between day and night. t It is the ratio of the color-to-black and black-to-color threshold tolerance ranges. The default value is 0.2 and can be configured by the user.
[0084] In an optional solution of the embodiment of the present invention, Figure 3C This is a flow chart of a method for detecting and processing black-cut colors by a front-end device provided in the third embodiment of the present invention. Figure 3C As shown, the method includes:
[0085] According to the algorithm, the front-end equipment is tested day and night, and the system time T is recorded. When T <f s2 (D) satisfies the black-cutting condition, and calculates the black-cutting time T s2, then make judgment 3: f s2 (D)-T s2 <T t When judgment 3 is satisfied, the day-night switching time calculated by the front-end device is considered reasonable, and the front-end device switches from night mode to day mode, and sets T s2 Report to the server for optimization of the black-cut color function. The optimization method is the optimized f s2 (D)=(f before optimization s2 (D)+T s2 ) / 2. If judgment 3 is not satisfied, it is considered that the black-cutting time calculated by this front-end device is unreasonable, and the day and night switching conditions of the front-end device when continuously performing inherent day and night detection on the current date are adjusted, such as increasing the threshold L s2 =(1+L t )*L s2 Re-run the day and night test to increase the difficulty of switching between day and night.
[0086] Optionally, controlling the target front-end device to switch between day and night based on the estimated day / night switching time, the continuously updated real-time day / night detection system time, and the corresponding real-time day / night detection result includes:
[0087] If the real-time day / night detection system time updated by the continuous inherent day / night detection is equal to the estimated day / night switching time, the real-time day / night detection result has not changed to meet the day / night switching condition, then determining whether the real-time day / night detection result continuously updated when the target incremental time is not greater than the preset day / night switching tolerance time can be changed to meet the day / night switching condition; the target incremental time is the incremental value of the real-time day / night detection system time updated by the continuous inherent day / night detection relative to the estimated day / night switching time;
[0088] If the target increment time is not greater than the preset day / night switching tolerance time, the continuously updated real-time day / night detection result changes to meet the day / night switching conditions, and the target front-end device is triggered to perform day / night switching.
[0089] Optionally, in an optional solution of the embodiment of the present invention, the method further includes:
[0090] If the real-time day / night detection results that are continuously updated when the target increment time is not greater than the preset day / night switching tolerance time have not changed to meet the day / night switching conditions, then determine whether the real-time day / night detection results when the inherent day / night detection is continuously performed on the current date are within the preset threshold range that meets the day / night switching conditions;
[0091] If it is determined that the day / night switching condition is close to being met, the process returns to continue executing the following operations to wait for triggering the target front-end device to switch to day / night: determining the real-time day / night detection system time and the corresponding real-time day / night detection results of the target front-end device when it continuously performs inherent day / night detection on the current date;
[0092] If it is determined that the day / night switching conditions are not nearly met, the target front-end device is forced to perform day / night switching based on the estimated day / night switching time and the preset day / night switching tolerance time.
[0093] like Figure 3B As shown, when T = f s1 (D), the color cut black condition is still not met, and the time T continues to increase. When Tf is met s1 (D)≤T t When the color cut black condition is reached, the front-end device cuts the color black and turns T s1 Report to the server and optimize the color-cut black function. The optimization method is the optimized f s1 (D)=(f before optimization s1 (D)+T s1 ) / 2. If the black cut color condition is not met, then judgment 2 is performed: L s <(1+L t )*L s1 If judgment 2 is satisfied, it is considered that the current environment brightness is close to the color cut black judgment condition, and the day and night detection is continued according to the algorithm in the function fitting stage. If judgment 2 is not satisfied, it is considered that the color cut black calculation of this front-end device is abnormal. s1 (D)+T t ) when the color is forced to cut to black.
[0094] like Figure 3C As shown, when T = f s2 (D), the black-cutting condition is still not met, and the time T continues to increase. When T- s1 (D)≤T t , judge whether the black-to-color condition is met. If the color-to-black condition is met, the front-end device will cut the color to black and turn T s2 Report to the server for optimization of the black-cut color function. The optimization method is the optimized f s2 (D)=(f before optimization s2 (D)+T s2 ) / 2; When the color cut black condition is not met, judgment 4 is performed: L s >(1-L t )*L s2 If judgment 4 is satisfied, it is considered that the black-cut color judgment condition is close, and the day and night detection is continued according to the algorithm in the function fitting stage. If judgment 4 is not satisfied, it is considered that the front-end device black-cut color calculation is abnormal. s2 (D)+T t ) is forced to cut the color with black.
[0095] S350: Update the day / night switching time function information using the inherent day / night switching time for day / night switching obtained by adopting the inherent day / night detection method and the estimated day / night switching time.
[0096] An embodiment of the present invention provides a day / night switching method for a front-end device, which determines the day / night switching time function information adopted by a target front-end device; determines the estimated day / night switching time when the target front-end device performs day / night switching on the current date based on the day / night switching time function information; determines the real-time day / night detection system time and the corresponding real-time day / night detection result when the target front-end device continuously performs inherent day / night detection on the current date; and controls the target front-end device to perform day / night switching based on the estimated day / night switching time and the continuously updated real-time day / night detection system time and the corresponding real-time day / night detection result. Through the technical solution of the embodiment of the present invention, a method for fitting and using the color-to-black and black-to-color functions based on the day and night switching time of all front-end devices in the current network is provided; the present invention can be used as an enhanced algorithm for the current mainstream day and night detection algorithm and has strong applicability; based on the historical data of day and night switching of all front-end devices in the current network, the device with abnormal day and night detection of a single front-end device is corrected; at the same time, the color-to-black function and the black-to-color function can also be optimized through the normal day and night switching data of the front-end device; the problem of abnormal day and night switching of a single front-end device in the same network is solved, and there is no need for manual efforts to solve the problem of abnormal day and night switching of a single front-end device caused by defects in the existing day and night detection algorithm, front-end device installation, photoresistor life, etc.
[0097] Example 4
[0098] Figure 4 This is a structural block diagram of a day / night switching device for a front-end device provided by the fourth embodiment of the present invention. This embodiment is applicable to the case where the front-end device performs day / night detection processing. The device can be implemented in software and / or hardware and integrated into any electronic device with network communication function. Among them, the electronic device can be a cloud storage node device in a cloud storage system. Figure 4 As shown, the day / night switching device of the front-end device in the embodiment of the present application may include the following: a day / night switching time function information determination module 410, an estimated day / night switching time determination module 420, and a day / night switching detection module 430.
[0099] The day / night switching time function information determining module 410 is configured to determine the day / night switching time function information used by the target front-end device; the day / night switching time function information is obtained by fitting the historical day / night switching times reported by multiple front-end devices within the management area where the target front-end device resides, at different historical dates.
[0100] An estimated day / night switching time determination module 420 is configured to determine an estimated day / night switching time when the target front-end device performs day / night switching on the current date based on the day / night switching time function information;
[0101] The day / night switching detection module 430 is used to control the target front-end device to perform day / night switching according to the estimated day / night switching time; wherein the day / night switching includes switching from day mode to night mode and from night mode to day mode.
[0102] Based on the above embodiment, optionally, determining the day / night switching time function information adopted by the target front-end device includes:
[0103] Determine the historical day / night switching time when multiple front-end devices in the management area where the target front-end device is located detect that the day / night switching conditions are met and perform day / night switching on the same historical date;
[0104] Preprocess the historical day / night switching time of multiple front-end devices when they switched day / night on the same historical date to obtain the reference day / night switching time on the same historical date;
[0105] The reference day-night switching time of different consecutive historical dates is fitted to obtain day-night switching time function information; the day-night switching time function information is used to characterize the change pattern of the fitted day-night switching time with the date.
[0106] Based on the above embodiment, optionally, the pre-processing of the historical day / night switching time of multiple front-end devices when switching day / night on the same historical date to obtain the reference day / night switching time on the same historical date includes:
[0107] When multiple front-end devices detect that the day / night switching conditions are met on the same historical date, the historical day / night switching times when the day / night switching is performed are sorted by time size;
[0108] Eliminate a preset number of historical day / night switching times that are ranked first or last;
[0109] The historical day / night switching time on the same historical date after sorting and elimination is averaged to obtain the reference day / night switching time on the same historical date.
[0110] Based on the above embodiment, optionally, controlling the target front-end device to perform day / night switching according to the estimated day / night switching time includes:
[0111] Determining the real-time day / night detection system time and the corresponding real-time day / night detection result when the target front-end device continuously performs inherent day / night detection on the current date; the inherent day / night detection includes day / night detection using an inherent day / night detection method; the day / night detection result is used to indicate whether a day / night switching condition is met;
[0112] Based on the estimated day / night switching time, the continuously updated real-time day / night detection system time, and the corresponding real-time day / night detection results, the target front-end device is controlled to switch between day and night.
[0113] Based on the above embodiment, optionally, controlling the target front-end device to switch between day and night based on the estimated day / night switching time and the continuously updated real-time day / night detection system time and the corresponding real-time day / night detection result includes:
[0114] If the real-time day / night detection system time continuously updated during the continuous inherent day / night detection is earlier than the estimated day / night switching time, the real-time day / night detection result is changed to satisfy the day / night switching condition, then the real-time day / night detection system time updated when the day / night switching condition is satisfied is used as the inherent day / night switching time for the day / night switching obtained by using the inherent day / night detection method;
[0115] If the difference between the estimated day / night switching time and the inherent day / night switching time is within the preset day / night switching tolerance time, triggering the target front-end device to perform day / night switching;
[0116] If the difference between the estimated day and night switching time and the inherent day and night switching time is not within the preset day and night switching tolerance time, the day and night switching conditions of the target front-end device when continuously performing inherent day and night detection on the current date are adjusted to increase the difficulty of switching, and return to perform the following operation: determine the real-time day and night detection system time and the corresponding real-time day and night detection results when the target front-end device continuously performs inherent day and night detection on the current date.
[0117] Based on the above embodiment, optionally, controlling the target front-end device to switch between day and night based on the estimated day / night switching time and the continuously updated real-time day / night detection system time and the corresponding real-time day / night detection result includes:
[0118] If the real-time day / night detection system time updated by the continuous inherent day / night detection is equal to the estimated day / night switching time, the real-time day / night detection result has not changed to meet the day / night switching condition, then further determining whether the real-time day / night detection result continuously updated when the target incremental time is not greater than the preset day / night switching tolerance time can be changed to meet the day / night switching condition; the target incremental time is the incremental value of the real-time day / night detection system time updated by the continuous inherent day / night detection relative to the estimated day / night switching time;
[0119] If the target increment time is not greater than the preset day / night switching tolerance time, the continuously updated real-time day / night detection result changes to meet the day / night switching conditions, and the target front-end device is triggered to perform day / night switching.
[0120] Based on the above embodiment, optionally, after triggering the target front-end device to perform day / night switching, the method further includes:
[0121] The day / night switching time function information is updated using the inherent day / night switching time and the estimated day / night switching time obtained by adopting the inherent day / night detection method.
[0122] Based on the above embodiment, optionally, the method further includes:
[0123] If the real-time day / night detection results that are continuously updated when the target increment time is not greater than the preset day / night switching tolerance time have not changed to meet the day / night switching conditions, then determine whether the real-time day / night detection results when the inherent day / night detection is continuously performed on the current date are within the preset threshold range that meets the day / night switching conditions;
[0124] If it is determined that the day / night switching condition is close to being met, the process returns to continue executing the following operations to wait for triggering the target front-end device to switch to day / night: determining the real-time day / night detection system time and the corresponding real-time day / night detection results of the target front-end device when it continuously performs inherent day / night detection on the current date;
[0125] If it is determined that the day / night switching conditions are not nearly met, the target front-end device is forced to perform day / night switching based on the estimated day / night switching time and the preset day / night switching tolerance time.
[0126] The day and night switching device of the front-end device provided in the embodiment of the present invention can execute the day and night switching method of the front-end device provided in any embodiment of the present invention mentioned above, and has the corresponding functions and beneficial effects of executing the day and night switching method of the front-end device. For detailed process, please refer to the relevant operations of the day and night switching method of the front-end device in the above embodiment.
[0127] Example 5
[0128] Figure 5 This is a schematic diagram of the structure of an electronic device provided by the fifth embodiment of the present invention. Figure 5 The electronic device provided in the embodiment of the present invention includes: one or more processors 510 and a storage device 520; the processor 510 in the electronic device can be one or more, Figure 5 Take a processor 510 as an example; the storage device 520 is used to store one or more programs; the one or more programs are executed by the one or more processors 510, so that the one or more processors 510 implement the day and night switching method of the front-end device as described in any one of the embodiments of the present invention.
[0129] The electronic device may further include an input device 530 and an output device 540 .
[0130] The processor 510, storage device 520, input device 530 and output device 540 in the electronic device can be connected via a bus or other means. Figure 5 The bus connection is taken as an example.
[0131] The storage device 520 in the electronic device serves as a computer-readable storage medium and can be used to store one or more programs, which may be software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the day / night switching method for a front-end device provided in the embodiments of the present invention. The processor 510 executes the software programs, instructions, and modules stored in the storage device 520 to execute various functional applications and data processing of the electronic device, thereby implementing the day / night switching method for a front-end device in the above-described method embodiment.
[0132] The storage device 520 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the electronic device, etc. In addition, the storage device 520 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the storage device 520 may further include a memory remotely located relative to the processor 510, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0133] The input device 530 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device. The output device 540 may include a display device such as a display screen.
[0134] Furthermore, when one or more programs included in the electronic device are executed by the one or more processors 510, the programs perform the following operations:
[0135] Determine the day / night switching time function information used by the target front-end device; wherein the day / night switching time function information is obtained by fitting the historical day / night switching times reported by multiple front-end devices in the management area where the target front-end device is located when switching between day and night on different historical dates;
[0136] Determining, based on the day / night switching time function information, an estimated day / night switching time when the target front-end device performs day / night switching on the current date;
[0137] According to the estimated day / night switching time, the target front-end device is controlled to perform day / night switching; wherein the day / night switching includes switching from day mode to night mode and from night mode to day mode.
[0138] Of course, those skilled in the art will understand that when one or more programs included in the above-mentioned electronic device are executed by the one or more processors 510, the program can also perform relevant operations in the day and night switching method of the front-end device provided in any embodiment of the present invention.
[0139] Example 6
[0140] A sixth embodiment of the present invention provides a computer-readable medium having a computer program stored thereon. When the program is executed by a processor, the program is used to execute a day / night switching method for a front-end device. The method includes:
[0141] Determining the day / night switching time function information used by the target front-end device; wherein the day / night switching time function information is obtained by fitting the historical day / night switching times reported by multiple front-end devices in the management area where the target front-end device is located when switching between day and night on different historical dates;
[0142] Determining, based on the day / night switching time function information, an estimated day / night switching time when the target front-end device performs day / night switching on the current date;
[0143] According to the estimated day / night switching time, the target front-end device is controlled to perform day / night switching; wherein the day / night switching includes switching from day mode to night mode and from night mode to day mode.
[0144] Optionally, when the program is executed by the processor, it can also be used to execute the day and night switching method of the front-end device provided in any embodiment of the present invention.
[0145] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination thereof. The computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.
[0146] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0147] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
[0148] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0149] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0150] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for day and night switching of a front-end device, characterized in that: The method comprises: Determining the day / night switching time function information used by the target front-end device; wherein the day / night switching time function information is obtained by fitting the historical day / night switching times reported by multiple front-end devices in the management area where the target front-end device is located when switching between day and night on different historical dates; Determining, based on the day / night switching time function information, an estimated day / night switching time when the target front-end device performs day / night switching on the current date; Determining the real-time day / night detection system time and the corresponding real-time day / night detection result when the target front-end device continuously performs inherent day / night detection on the current date; the inherent day / night detection includes day / night detection using an inherent day / night detection method; the day / night detection result is used to indicate whether a day / night switching condition is met; Controlling the target front-end device to switch between day and night based on the estimated day / night switching time, the continuously updated real-time day / night detection system time, and the corresponding real-time day / night detection results; wherein the day / night switching includes switching from day mode to night mode and from night mode to day mode; The method of controlling the target front-end device to switch between day and night based on the estimated day and night switching time, the continuously updated real-time day and night detection system time, and the corresponding real-time day and night detection result includes: If the real-time day / night detection system time continuously updated during the continuous inherent day / night detection is earlier than the estimated day / night switching time, the real-time day / night detection result is changed to satisfy the day / night switching condition, then the real-time day / night detection system time updated when the day / night switching condition is satisfied is used as the inherent day / night switching time for the day / night switching obtained by using the inherent day / night detection method; If the difference between the estimated day / night switching time and the inherent day / night switching time is within the preset day / night switching tolerance time, triggering the target front-end device to perform day / night switching; If the difference between the estimated day and night switching time and the inherent day and night switching time is not within the preset day and night switching tolerance time, the day and night switching conditions of the target front-end device when continuously performing inherent day and night detection on the current date are adjusted to increase the difficulty of switching, and return to perform the following operation: determine the real-time day and night detection system time and the corresponding real-time day and night detection results when the target front-end device continuously performs inherent day and night detection on the current date.
2. The method according to claim 1, characterized in that Determine the day / night switching time function information used by the target front-end device, including: Determine the historical day / night switching time when multiple front-end devices in the management area where the target front-end device is located detect that the day / night switching conditions are met and perform day / night switching on the same historical date; Preprocess the historical day / night switching time of multiple front-end devices when they switched day / night on the same historical date to obtain the reference day / night switching time on the same historical date; The reference day-night switching time of different consecutive historical dates is fitted to obtain day-night switching time function information; the day-night switching time function information is used to characterize the change pattern of the fitted day-night switching time with the date.
3. The method according to claim 2, characterized in that Preprocess the historical day / night switching time of multiple front-end devices when they switched day / night on the same historical date to obtain the reference day / night switching time on the same historical date, including: When multiple front-end devices detect that the day / night switching conditions are met on the same historical date, the historical day / night switching times when the day / night switching is performed are sorted by time size; Eliminate a preset number of historical day / night switching times that are ranked first or last; The historical day / night switching time on the same historical date after sorting and elimination is averaged to obtain the reference day / night switching time on the same historical date.
4. The method according to claim 1, wherein Based on the estimated day / night switching time, the continuously updated real-time day / night detection system time, and the corresponding real-time day / night detection results, the target front-end device is controlled to switch between day and night, including: If the real-time day / night detection system time updated by the continuous inherent day / night detection is equal to the estimated day / night switching time, the real-time day / night detection result has not changed to meet the day / night switching condition, then determining whether the real-time day / night detection result continuously updated when the target incremental time is not greater than the preset day / night switching tolerance time can be changed to meet the day / night switching condition; the target incremental time is the incremental value of the real-time day / night detection system time updated by the continuous inherent day / night detection relative to the estimated day / night switching time; If the target increment time is not greater than the preset day / night switching tolerance time, the continuously updated real-time day / night detection result changes to meet the day / night switching conditions, and the target front-end device is triggered to perform day / night switching.
5. The method according to claim 1 or 4, characterized in that After triggering the target front-end device to switch between day and night, the following steps are also included: The day / night switching time function information is updated using the inherent day / night switching time and the estimated day / night switching time obtained by adopting the inherent day / night detection method.
6. The method according to claim 4, characterized in that The method further comprises: If the real-time day / night detection results that are continuously updated when the target increment time is not greater than the preset day / night switching tolerance time have not changed to meet the day / night switching conditions, then determine whether the real-time day / night detection results when the inherent day / night detection is continuously performed on the current date are within the preset threshold range that meets the day / night switching conditions; If it is determined that the day / night switching condition is close to being met, the process returns to continue executing the following operations to wait for triggering the target front-end device to switch to day / night: determining the real-time day / night detection system time and the corresponding real-time day / night detection results of the target front-end device when it continuously performs inherent day / night detection on the current date; If it is determined that the day / night switching conditions are not nearly met, the target front-end device is forced to perform day / night switching based on the estimated day / night switching time and the preset day / night switching tolerance time.
7. A day and night switching device for a front-end device, characterized in that: The device comprises: A module for determining a day / night switching time function information is configured to determine the day / night switching time function information used by a target front-end device; wherein the day / night switching time function information is obtained by fitting the historical day / night switching times reported by multiple front-end devices in the management area where the target front-end device is located when switching between day and night on different historical dates; An estimated day / night switching time determination module is used to determine the estimated day / night switching time when the target front-end device performs day / night switching on the current date based on the day / night switching time function information; A day / night switching detection module is configured to determine the real-time day / night detection system time and the corresponding real-time day / night detection results when the target front-end device continuously performs inherent day / night detection on the current date; the inherent day / night detection includes day / night detection using an inherent day / night detection method; the day / night detection results indicate whether the day / night switching conditions are met; and control the target front-end device to perform day / night switching based on the estimated day / night switching time, the continuously updated real-time day / night detection system time, and the corresponding real-time day / night detection results; wherein the day / night switching includes switching from day mode to night mode and from night mode to day mode. The day / night switching detection module is specifically used to: If the real-time day / night detection system time continuously updated during the continuous inherent day / night detection is earlier than the estimated day / night switching time, the real-time day / night detection result is changed to satisfy the day / night switching condition, then the real-time day / night detection system time updated when the day / night switching condition is satisfied is used as the inherent day / night switching time for the day / night switching obtained by using the inherent day / night detection method; If the difference between the estimated day / night switching time and the inherent day / night switching time is within the preset day / night switching tolerance time, triggering the target front-end device to perform day / night switching; If the difference between the estimated day and night switching time and the inherent day and night switching time is not within the preset day and night switching tolerance time, the day and night switching conditions of the target front-end device when continuously performing inherent day and night detection on the current date are adjusted to increase the difficulty of switching, and return to perform the following operation: determine the real-time day and night detection system time and the corresponding real-time day and night detection results when the target front-end device continuously performs inherent day and night detection on the current date.
8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the day and night switching method of the front-end device described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the day and night switching method of the front-end device described in any one of claims 1-6 is implemented.
Citation Information
Patent Citations
Lighting device
JP2001143876A
On-vehicle electronic device
JP2010129357A
Control apparatus for street light using globalpositioning system signal of wireless phone system
KR1020060025435A
Apparatus and method for controlling day photographmode and night photograph mode select in monitoringcamera
KR1020060039058A