An infrared human loitering detection method, system, terminal, and storage medium

By generating a reference value and calculating the signal difference in PIR human loitering detection, the high power consumption problem in the prior art is solved, achieving low power consumption and high accuracy detection, which is suitable for low power consumption devices.

CN117687108BActive Publication Date: 2026-06-30SHENZHEN KAADAS INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN KAADAS INTELLIGENT TECH CO LTD
Filing Date
2023-11-22
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing PIR human loitering detection solutions consume high power while ensuring accuracy, making them unsuitable for low-power devices.

Method used

By acquiring the reference value information of the sensor, the current reference value is generated, and when the signal value forms a waveform change, the difference between the signal values ​​of the previous and subsequent periods is calculated. Combined with the preset distance threshold, the human body wandering is confirmed, reducing unnecessary signal collection and lowering power consumption.

Benefits of technology

While ensuring the accuracy of human loitering detection, it reduces power consumption, making it suitable for low-power devices such as smart door locks and security systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117687108B_ABST
    Figure CN117687108B_ABST
Patent Text Reader

Abstract

This invention discloses an infrared human loitering detection method, system, terminal, and storage medium. The infrared human loitering detection method includes: acquiring reference value information of a sensor, and generating a current reference value of the sensor based on the reference value information; when it is determined that the signal value of the sensor forms a waveform change, acquiring a first signal value of the sensor above the current reference value and a second signal value below the current reference value; calculating the difference between the first signal value and the second signal value; when the difference is greater than a preset distance threshold, determining that a human loitering exists within a preset distance range of the sensor. This invention reduces the power consumption of human loitering detection while ensuring the accuracy of human loitering detection, and can be applied to low-power devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of human loitering detection technology, and in particular to an infrared human loitering detection method, system, terminal and storage medium. Background Technology

[0002] PIR sensors are commonly used to detect human activity by measuring infrared radiation to capture changes in body heat. Currently, there are various commercial solutions for PIR human loitering detection, where the accuracy and low power consumption of the detection algorithm are particularly important.

[0003] In existing design schemes, PIR human loitering detection solutions typically focus on detection accuracy, resulting in high power consumption and making them unsuitable for low-power devices.

[0004] Therefore, existing technologies still need to be improved and developed. Summary of the Invention

[0005] The main objective of this invention is to provide an infrared human loitering detection method, system, terminal, and storage medium, aiming to solve the problem of high power consumption in the prior art while ensuring the accuracy of human loitering detection.

[0006] The first aspect of this application provides an infrared human loitering detection method, the infrared human loitering detection method comprising:

[0007] Obtain the reference value information of the sensor, and generate the current reference value of the sensor based on the reference value information;

[0008] When it is determined that the signal value of the sensor forms a waveform change, a first signal value of the sensor above the current reference value and a second signal value below the current reference value are obtained;

[0009] Calculate the difference between the first signal value and the second signal value;

[0010] When the difference is greater than a preset distance threshold, it is determined that a human body is loitering within the preset distance range of the sensor.

[0011] In one implementation, acquiring the sensor's reference value information and generating the sensor's current reference value based on the reference value information specifically includes:

[0012] Acquire reference value information from the sensor, the reference value information including an initial reference value and a current signal value at a first preset time interval;

[0013] The initial reference value is supplemented based on the current signal value to generate the current reference value of the sensor.

[0014] In one implementation, acquiring the sensor's reference value information specifically includes:

[0015] Obtain the initial reference value of the sensor and the intermediate signal value at an interval of the first preset time.

[0016] If the current change between the intermediate signal value and the initial reference value is greater than a preset change value, then the sensor obtains an interval signal value at the first preset time interval, until the current change between the interval signal value and the initial reference value is lower than the preset change value, and the interval signal value is taken as the current signal value.

[0017] In one implementation, acquiring a first signal value of the sensor above the current reference value and a second signal value below the current reference value specifically includes:

[0018] The sensor acquires the signal values ​​of each first cycle at a second preset time interval in the first cycle, wherein each first cycle signal value is greater than the current reference value, and the first preset time is greater than the second preset time.

[0019] The first signal value of the sensor is obtained based on each of the first cycle signal values;

[0020] The sensor acquires the signal values ​​of each second cycle at intervals of the second preset time in the second cycle, and each second cycle signal value is less than the current reference value;

[0021] The second signal value of the sensor is obtained based on each of the second period signal values.

[0022] In one implementation, obtaining the first signal value of the sensor based on each of the first periodic signal values ​​specifically includes:

[0023] Acquire multiple valid first-cycle signal values;

[0024] The first signal value is obtained by calculating the average of multiple valid first period signal values;

[0025] The step of obtaining the second signal value of the sensor based on each of the second period signal values ​​specifically includes:

[0026] Acquire multiple valid second-cycle signal values;

[0027] The average of multiple valid second-period signal values ​​is calculated to obtain the second signal value.

[0028] In one implementation, determining that a human body is loitering within the preset distance range of the sensor when the difference is greater than a preset distance threshold specifically includes:

[0029] The hovering time of the hovering detection is obtained, and the hovering time is divided into multiple time granularities;

[0030] If the difference is greater than the preset distance threshold in each time granularity, then it is determined that a human body is wandering within the preset distance range of the sensor.

[0031] In one implementation, the infrared human loitering detection method further includes:

[0032] When it is determined that the signal value of the sensor does not show a waveform change, the sensor is controlled to enter a sleep state.

[0033] A second aspect of this application provides an infrared human loitering detection system, the infrared human loitering detection system comprising:

[0034] The data acquisition module is used to acquire the reference value information of the sensor and generate the current reference value of the sensor based on the reference value information;

[0035] The data selection module is used to acquire a first signal value of the sensor above the current reference value and a second signal value below the current reference value when it is determined that the signal value of the sensor forms a waveform change;

[0036] The data calculation module is used to calculate the difference between the first signal value and the second signal value;

[0037] The loitering confirmation module is used to determine that a human loitering is present within a preset distance range of the sensor when the difference is greater than a preset distance threshold.

[0038] A third aspect of this application provides a terminal, the terminal comprising: a memory, a processor, and an infrared human loitering detection program stored in the memory and executable on the processor, wherein when the infrared human loitering detection program is executed by the processor, it implements the steps of the infrared human loitering detection method as described in any one of the above embodiments.

[0039] A fourth aspect of this application provides a computer-readable storage medium storing an infrared human loitering detection program, which, when executed by a processor, implements the steps of the infrared human loitering detection method as described in any of the above embodiments.

[0040] Beneficial effects: This invention provides an infrared human loitering detection method, system, terminal, and storage medium. The method uses a reference value generated in the current environment as a reference within an interval. When the waveform of the sensor signal value changes, the first signal value of the first half cycle and the second signal value of the second half cycle are obtained. The difference between the signal values ​​of the two cycles is compared with a preset distance threshold to confirm whether there is human loitering during the loitering detection time. Thus, the signal value of the current environment is generated at each interval, and the signal values ​​of the two parts of a cycle are determined within the interval. There is no need to collect the signal value at all times, which reduces the power consumption of human loitering detection and ensures the accuracy of human loitering detection. It can be applied to low-power devices. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 This is a flowchart of a preferred embodiment of the infrared human loitering detection method of this application;

[0043] Figure 2 This is a flowchart illustrating the specific implementation steps of the entire execution process in a preferred embodiment of the infrared human loitering detection method of this application.

[0044] Figure 3 This is a schematic diagram of a preferred embodiment of the infrared human loitering detection system of the present invention;

[0045] Figure 4 This is a schematic diagram of a preferred embodiment of the terminal of the present invention.

[0046] Explanation of reference numerals in the attached figures:

[0047] 10. Vehicle lane change warning system; 100. Data acquisition module; 200. Data selection module; 300. Data calculation module; 400. Hesitation confirmation module. Detailed Implementation

[0048] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. The described embodiments are merely possible technical implementations of this invention and not all possible implementations. Based on the embodiments of this invention, those skilled in the art can obtain other embodiments without creative effort, and these embodiments are also within the protection scope of this invention.

[0049] Currently, there are many commercial solutions for PIR human loitering detection on the market. These solutions each have their own advantages, and they also have different focuses on accuracy and low power consumption. Whether it is too many false alarms or false negatives in detection, or excessive power consumption that causes the battery to be depleted faster, it will result in a poor customer experience. Existing PIR human loitering detection solutions that focus on detection accuracy are not suitable for low-power applications such as smart door locks, security systems and other low-power devices.

[0050] To facilitate understanding, the application scenario of the present invention will be introduced first: The infrared human loitering detection method of the present invention can be applied to low-power devices, which require high detection accuracy while the power consumption of the device is within a reasonable range.

[0051] The infrared human loitering detection method of this application combines accuracy and low power consumption, making it suitable for low-power applications such as smart door locks and security systems. In low-power device applications, the PIR-based intelligent human loitering detection technology of this application method achieves high accuracy while reducing detection power consumption.

[0052] The following describes the terms and relationships involved in the embodiments of this invention: "ADC value" refers to the analog signal value generated by the PIR sensor after analog-to-digital conversion, which is acquired by the microcontroller. It represents the magnitude of the physical quantity detected by the sensor. This value is usually a string of numbers, and the number of bits depends on the resolution of the microcontroller's ADC. For example, an 8-bit ADC has a maximum value of 255. In practical applications, the actual measured electrical quantity can be calculated and restored through this ADC value. At the same time, each ADC of the microcontroller has multiple multiplexed analog input channels, such as those used to receive signals from the PIR sensor. In the connection between the microcontroller and the PIR sensor, the PIR sensor is usually used as an input device. Its output signal is acquired and processed by the microcontroller. For example, the output of the PIR sensor can be connected to a specific pin of the Arduino, or a female / female jumper can be used to establish a connection between the PIR sensor and the Raspberry Pi GPIO header. In addition, the pyroelectric infrared sensor (PIR) can detect infrared rays emitted by humans or certain animals and convert them into electrical signals. When someone passes by, the PIR sensor will detect this change and output an electrical signal. This electrical signal can be used by the microcontroller to perform specific tasks.

[0053] The infrared human loitering detection method and related equipment of this application are described below with reference to the accompanying drawings. Addressing the problem in the aforementioned related technologies where high power consumption during human loitering detection prevents the application of low-power devices while maintaining accuracy, this application provides an infrared human loitering detection method. In this method, a reference value generated in the current environment is used as a reference within an interval. A first signal value for the first half of the cycle and a second signal value for the second half of the cycle are obtained as the waveform of the sensor signal value changes. The difference between the signal values ​​of the two cycles is compared with a preset distance threshold to confirm whether human loitering exists during the detection time. Thus, a signal value for the current environment is generated at each interval, and the signal values ​​of the two parts of a cycle are determined within the interval. This eliminates the need for constant signal value acquisition, reducing the power consumption of human loitering detection while ensuring accuracy. Therefore, this solves the technical problem in the related technologies where high power consumption during human loitering detection prevents the application of low-power devices while maintaining accuracy.

[0054] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0055] The infrared human loitering detection method described in the preferred embodiment of the present invention, such as... Figure 1 As shown, the infrared human loitering detection method includes the following steps:

[0056] In step S101, the reference value information of the sensor is obtained, and the current reference value of the sensor is generated based on the reference value information.

[0057] It is understood that this application embodiment uses a microcontroller to acquire the waveform ADC value when the PIR captures changes in human body heat. A human loitering detection algorithm is implemented on this microcontroller. The overall logic of the algorithm is to utilize the characteristics of the PIR, sample the ADC value generated by the PIR at the microcontroller, and determine the distance and duration of loitering by filtering and comparing the values. In this method, firstly, the reasonableness of the collected data is ensured; secondly, loitering values ​​are filtered out by comparing the data; and finally, the person is confirmed to have loitered for a set period of time.

[0058] In one implementation, reference value information of the sensor is obtained, the reference value information including an initial reference value and a current signal value at a first preset time interval; the initial reference value is supplemented according to the current signal value to generate the current reference value of the sensor.

[0059] It should be noted that, see Figure 2 First, when collecting ADC data, we must ensure the rationality of the data. When the system starts, we assign a reference value, which represents the ADC value (i.e. signal value) of the PIR in an unattended state. Using this value as the reference, we collect data at regular intervals t1 (i.e., the first preset time) to supplement the reference value. Each time the ADC value is acquired, it is averaged with the original reference value to form a new reference value.

[0060] Specifically, for example, if the initial reference value (i.e., factory default or set value) is a0, and the ADC value at the first interval t1 is a1, then the current reference value at the interval one t1 is a1' = (a0 + a1) / 2. If the ADC value at the second interval t1 is a2, then the current reference value at the interval two t1 is a2' = (a1' + a2) / 2. In other words, by continuously supplementing the reference value in this way, a new reference value specific to that environment (i.e., the current reference value) can be formed. The reason for supplementing the reference value is that we believe the reference value will change to some extent in different environments. It should not be limited to the reference value in the laboratory, but should be adapted to local conditions, which is more flexible and improves the accuracy of human loitering detection.

[0061] Furthermore, during the acquisition of reference value information, the validity of the acquired value (i.e., the ADC value) is determined. After confirming its validity, the previous reference value is supplemented to generate the current reference value. The specific steps for determining the validity of the acquired value include: acquiring the initial reference value of the sensor and the intermediate signal value at a time interval of the first preset time; if the current change value of the intermediate signal value and the initial reference value (i.e., the difference between the actual value and the current reference value) is less than or equal to a preset change value (i.e., the difference between the maximum value of the sine wave and the current reference value), it is indicated that the intermediate signal value (actual value) is valid, and the intermediate signal value is used as the current signal value; if the current change value of the intermediate signal value and the initial reference value is greater than the preset change value, the sensor is acquired again at a time interval of the first preset time until the current change value of the interval signal value and the initial reference value is lower than the preset change value, and the interval signal value is used as the current signal value.

[0062] In other words, when taking values, if the ADC value (i.e. the signal value) suddenly increases or decreases for a very short period of time, it is considered a bad value and is discarded, thereby ensuring the rationality of the signal value collected by the sensor and improving the accuracy of human loitering detection.

[0063] It should be noted that the signal values ​​detected by the PIR sensor can form waveform changes, producing a waveform similar to a sine wave, with both positive and negative values. That is, the current reference value serves as the baseline of the sine wave, and the ADC value is in the region above the current reference value (the first half of the cycle) and the region below the current reference value (the second half of the cycle). Specifically, when someone passes by, the PIR sensor detects the change in infrared light caused by the human body and converts this change into an electrical signal output. This electrical signal is a series of voltage value changes, reflecting the temperature change during movement. This voltage signal can then be used by a microcontroller to perform specific tasks. For example, an interrupt driver can be designed to respond to this voltage signal change. More specifically, the interrupt source can be set to motion detection, and the motion detection function can be turned off when motion is detected, thereby disabling the interrupt. In this way, the required operations can be performed based on the output signal of the PIR sensor. For example, a relay can be used to drive a floodlight, or a communication channel can be added to the host processor of a security system.

[0064] In step S102, when it is determined that the signal value of the sensor forms a waveform change, a first signal value of the sensor above the current reference value and a second signal value below the current reference value are obtained.

[0065] In one implementation, the sensor acquires first-cycle signal values ​​at intervals of a second preset time (t2) during a first cycle (first half-cycle), where each first-cycle signal value is greater than the current reference value and the first preset time is greater than the second preset time; a first signal value of the sensor is obtained based on each first-cycle signal value; the sensor acquires second-cycle signal values ​​at intervals of the second preset time during a second cycle (second half-cycle), where each second-cycle signal value is less than the current reference value; and a second signal value of the sensor is obtained based on each second-cycle signal value.

[0066] It should be noted that, see Figure 2 When filtering out lingering values, an interrupt pin is connected to the microcontroller via the PIR pin. When a waveform change occurs, the microcontroller is notified via an interrupt. The waveform will continuously change, and the interrupt pin remains high during this period. Therefore, during the high-level period of the interrupt pin, the ADC value is acquired every t2 (t2 must be less than t1). Bad values ​​acquired in this step also need to be discarded. That is, if the acquired values ​​differ too much, exceeding a tolerable value (i.e., a preset change value, the difference between the maximum / minimum value of the sine wave and the current reference value), then the acquired value should be discarded, and the next value should be acquired as soon as possible. Because the generated waveform resembles a sine wave, with both positive and negative values, we can acquire the two values ​​that differ most from the reference (note that during this time, i.e., within one interval t1, the reference value is not updated).

[0067] As we can understand, a microcontroller interrupt refers to an "emergency event" occurring during the execution of a microcontroller's program. In this case, the microcontroller immediately suspends the current program and automatically jumps to the corresponding handler (i.e., the interrupt service routine). After the emergency event is resolved, the microcontroller returns to the original program and continues execution. This process is called a program interrupt. Specifically, in the application of PIR sensors, we can connect the PIR sensor's output signal to a specific pin of the microcontroller, such as external interrupt 0 (INT0) or external interrupt 1 (INT1). When the PIR sensor detects a change in motion, it generates a waveform change, which the microcontroller interprets as an "emergency event." At this point, the microcontroller generates an interrupt request according to a preset program. Upon receiving this interrupt request, the microcontroller pauses the currently executing task and executes the interrupt service routine corresponding to the interrupt request. In this interrupt service routine, code can be written to handle the motion change event, such as turning a relay on or off. After processing, the microcontroller automatically returns to the previously paused task and continues execution.

[0068] Furthermore, multiple valid first-cycle signal values ​​are obtained, i.e., values ​​that momentarily increase or decrease in the first half of the cycle are removed. Then, the average of these multiple valid (i.e., legal, not discarded ADC values) first-cycle signal values ​​is calculated to obtain the first signal value. Similarly, multiple valid second-cycle signal values ​​are obtained, values ​​that momentarily increase or decrease in the second half of the cycle are removed, and the average of these multiple valid second-cycle signal values ​​is calculated to obtain the second signal value. See also... Figure 2 In other words, ADC data is collected in two ways. In the first half of the cycle, where the sine wave is greater than the reference value, an ADC value is taken at regular intervals. After a certain number of ADC values ​​are collected, they are averaged together to obtain the average value of the first half of the cycle (i.e., the first signal value). Similarly, in the part where the sine wave is lower than the reference value, a certain number of ADC values ​​are taken at regular intervals t2 and then averaged to obtain the average value of the second half of the cycle (i.e., the second signal value). Note that the first half-cycle value and the second half-cycle value are collected separately to ensure the accuracy of the detection.

[0069] In step S103, the difference between the first signal value and the second signal value is calculated.

[0070] In one implementation, the difference between the two average values ​​(i.e., the first signal value and the second signal value) that fully utilize all sampled values ​​is taken together. When this difference exceeds a specified distance threshold, it indicates that someone is loitering (for example, the threshold is 1300 for a preset distance of 1m, and 900 for a preset distance of 2m, etc.).

[0071] In step S104, when the difference is greater than a preset distance threshold, it is determined that a human body is wandering within the preset distance range of the sensor.

[0072] In one implementation, the loitering time of the loitering detection is obtained and the loitering time is divided into multiple time granularities; in each time granularity, if the difference is greater than the preset distance threshold, it is determined that there is a human loitering within the preset distance range of the sensor.

[0073] It should be noted that, see Figure 2When determining whether a person is loitering within a set time period, the time factor must be considered. Even if the waveform oscillation exceeds a threshold, it cannot be immediately confirmed as a loitering event, because loitering is a process, not an instantaneous result. Therefore, the time factor must be taken into account. For example, if the loitering time is set to 10 seconds, meaning a person is indeed constantly walking back and forth in front of the PIR during this 10-second period, then a loitering event can be reported. To fully consider the sample data over the entire time period, we need to divide the loitering time into smaller granularities and judge loitering at each granularity. If the waveform exceeds the threshold at all time granularities, it means that someone has been loitering throughout the entire time period, and a loitering event should be reported. For example, if the loitering time is set to 10 seconds, it can be divided into 5 parts, each with a granularity of 2 seconds. If a waveform exceeds the threshold within 2 seconds, it is recorded (using a uint32_t type). If the waveform exceeds the threshold for five consecutive granularities, it means that someone has been moving within 10 seconds, and a loitering event can be reported. Understandably, the time granularity can be set independently. Theoretically, the smaller the granularity, the more accurate the detection, but the energy consumption will be relatively higher.

[0074] It is worth noting that the infrared human loitering detection method of this application can improve the accuracy and power consumption of human loitering detection. By fully considering the sampling data of each part through the above-mentioned means, the accuracy of threshold detection can be greatly improved; when judging that a person is loitering within a certain period of time, by dividing the loitering time into multiple granularities, the threshold situation in each time granularity can be judged in a balanced way, and the loitering event can be reported more comprehensively and reasonably. At the same time, by setting the detection time interval, except for necessary detection operations, the microcontroller is in sleep mode, which can greatly reduce power consumption.

[0075] In one implementation, the infrared human loitering detection method further includes: when it is determined that the signal value of the sensor does not form a waveform change, controlling the sensor to enter a sleep state. After ensuring the accuracy of human loitering detection, it is necessary to guarantee its low power consumption attribute, so that the entire device should be in a sleep state at times other than when a human loitering occurs and a waveform is generated, thereby maximizing energy savings.

[0076] Next, the infrared human loitering detection system proposed according to the embodiments of this application is described with reference to the accompanying drawings.

[0077] Figure 3 This is a block diagram of an infrared human loitering detection system according to an embodiment of this application.

[0078] like Figure 3As shown, the vehicle lane change warning system 10 includes: a data acquisition module 100, a data selection module 200, a data calculation module 300, and a loitering confirmation module 400.

[0079] Specifically, the infrared human loitering detection system includes:

[0080] The data acquisition module 100 is used to acquire the reference value information of the sensor and generate the current reference value of the sensor based on the reference value information;

[0081] The data selection module 200 is used to acquire a first signal value of the sensor above the current reference value and a second signal value below the current reference value when it is determined that the signal value of the sensor forms a waveform change;

[0082] The data calculation module 300 is used to calculate the difference between the first signal value and the second signal value;

[0083] The loitering confirmation module 400 is used to determine that a human loitering exists within a preset distance range of the sensor when the difference is greater than a preset distance threshold.

[0084] It should be noted that the foregoing explanation of the infrared human loitering detection method embodiment also applies to the infrared human loitering detection system of this embodiment, and will not be repeated here.

[0085] This solves the technical problem in related technologies where the high power consumption required for detection, while ensuring the accuracy of human loitering detection, prevents its application to low-power devices.

[0086] Figure 4 A schematic diagram of the structure of a terminal provided in an embodiment of this application. The terminal may include:

[0087] The memory 501, the processor 502, and the computer program stored on the memory 501 and capable of running on the processor 502.

[0088] When the processor 502 executes the program, it implements the infrared human loitering detection method provided in the above embodiments.

[0089] Furthermore, the terminal also includes:

[0090] Communication interface 503 is used for communication between memory 501 and processor 502.

[0091] The memory 501 is used to store computer programs that can run on the processor 502.

[0092] The memory 501 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0093] If the memory 501, processor 502, and communication interface 503 are implemented independently, then the communication interface 503, memory 501, and processor 502 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EIS) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0094] Optionally, in a specific implementation, if the memory 501, processor 502, and communication interface 503 are integrated on a single chip, then the memory 501, processor 502, and communication interface 503 can communicate with each other through an internal interface.

[0095] Processor 502 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0096] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the infrared human loitering detection method described above.

[0097] One embodiment of this application provides a computer program product, including a computer program that, when executed by a processor, implements the features described in this application. Figure 1 The infrared human loitering detection method provided in any of the corresponding embodiments.

[0098] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions 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 one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0099] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0100] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0101] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable storage medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable storage medium could be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0102] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0103] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0104] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0105] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.

[0106] It should be understood that the application of this application is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. An infrared human loitering detection method, characterized in that, The infrared human loitering detection method includes: Obtain the reference value information of the sensor, and generate the current reference value of the sensor based on the reference value information; When it is determined that the signal value of the sensor forms a waveform change, a first signal value of the sensor above the current reference value and a second signal value below the current reference value are obtained; Calculate the difference between the first signal value and the second signal value; When the difference is greater than a preset distance threshold, it is determined that a human body is loitering within the preset distance range of the sensor.

2. The infrared human loitering detection method according to claim 1, characterized in that, The step of acquiring the sensor's reference value information and generating the sensor's current reference value based on the reference value information specifically includes: Acquire reference value information from the sensor, the reference value information including an initial reference value and a current signal value at a first preset time interval; The initial reference value is supplemented based on the current signal value to generate the current reference value of the sensor.

3. The infrared human loitering detection method according to claim 2, characterized in that, The acquisition of the sensor's reference value information specifically includes: Obtain the initial reference value of the sensor and the intermediate signal value at an interval of the first preset time. If the current change between the intermediate signal value and the initial reference value is greater than a preset change value, then the sensor obtains an interval signal value at the first preset time interval, until the current change between the interval signal value and the initial reference value is lower than the preset change value, and the interval signal value is taken as the current signal value.

4. The infrared human loitering detection method according to claim 2, characterized in that, The acquisition of a first signal value of the sensor above the current reference value and a second signal value below the current reference value specifically includes: The sensor acquires the signal values ​​of each first cycle at a second preset time interval in the first cycle, wherein each first cycle signal value is greater than the current reference value, and the first preset time is greater than the second preset time. The first signal value of the sensor is obtained based on each of the first cycle signal values; The sensor acquires the signal values ​​of each second cycle at intervals of the second preset time in the second cycle, and each second cycle signal value is less than the current reference value; The second signal value of the sensor is obtained based on each of the second period signal values.

5. The infrared human loitering detection method according to claim 4, characterized in that, The step of obtaining the first signal value of the sensor based on each of the first period signal values ​​specifically includes: Acquire multiple valid first-cycle signal values; The first signal value is obtained by calculating the average of multiple valid first period signal values; The step of obtaining the second signal value of the sensor based on each of the second periodic signal values ​​specifically includes: Acquire multiple valid second-cycle signal values; The average of multiple valid second periodic signal values ​​is calculated to obtain the second signal value.

6. The infrared human loitering detection method according to claim 1, characterized in that, The step of determining that a human body is loitering within the preset distance range of the sensor when the difference is greater than a preset distance threshold specifically includes: The hovering time of the hovering detection is obtained, and the hovering time is divided into multiple time granularities; If the difference is greater than the preset distance threshold in each time granularity, then it is determined that a human body is wandering within the preset distance range of the sensor.

7. The infrared human loitering detection method according to claim 1, characterized in that, The infrared human loitering detection method also includes: When it is determined that the signal value of the sensor does not show a waveform change, the sensor is controlled to enter a sleep state.

8. An infrared human loitering detection system, characterized in that, The infrared human loitering detection system includes: The data acquisition module is used to acquire the reference value information of the sensor and generate the current reference value of the sensor based on the reference value information; The data selection module is used to acquire a first signal value of the sensor above the current reference value and a second signal value below the current reference value when it is determined that the signal value of the sensor forms a waveform change; The data calculation module is used to calculate the difference between the first signal value and the second signal value; The loitering confirmation module is used to determine that a human loitering is present within a preset distance range of the sensor when the difference is greater than a preset distance threshold.

9. A terminal, characterized in that, The terminal includes: a memory, a processor, and an infrared human loitering detection program stored in the memory and executable on the processor. When the infrared human loitering detection program is executed by the processor, it implements the steps of the infrared human loitering detection method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an infrared human loitering detection program, which, when executed by a processor, implements the steps of the infrared human loitering detection method as described in any one of claims 1-7.