Parcel event detection method and device, electronic equipment and computer storage medium
By reasonably controlling the timing and conditions of package event detection in the wake-up state of the monitoring device, combined with the package detection model, the contradiction between low power consumption and detection reliability is solved, and high-efficiency operation and reliable package event detection are achieved.
Patent Information
- Application Number
- CN202510264814.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, monitoring equipment cannot take into account the low power consumption requirements and the reliability of package event detection when realizing package care, resulting in difficulty in taking into account the high-efficiency operation and detection reliability of the equipment.
By determining whether the number of package event detection times is less than the preset number in the wake-up state, the package information is obtained and the detection is carried out only when specific conditions are met, the package event is determined in combination with the package detection model, and the detection timing is reasonably controlled to reduce unnecessary energy and computing resource consumption.
It improves the reliability of parcel event detection, while reducing unnecessary energy and computing resource consumption, ensuring high-efficiency operation of equipment, and timely detecting dynamic changes in parcels.
Smart Images

Figure CN120259937A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a method, device, electronic device, and computer storage medium for detecting package events. Background Art
[0002] With the continuous development of technology, more and more families begin to use monitoring devices such as smart door locks and smart cameras to protect family safety. By installing monitoring devices at the doorstep, not only can strangers appearing at the doorstep be identified, but also package care can be realized, facilitating users to control the safety and dynamics at the doorstep at any time.
[0003] In the related art, realizing package care through monitoring devices often cannot balance the low-power consumption requirements of the monitoring devices and the reliability of package event detection. There is a need to provide a method for detecting package events to improve the reliability of package event detection while ensuring the efficient operation of the device. Summary of the Invention
[0004] Embodiments of this application provide a method, device, electronic device, and computer storage medium for detecting package events, which can improve the reliability of package event detection while ensuring the efficient operation of the device.
[0005] In a first aspect, embodiments of this application provide a method for detecting package events, the method includes:
[0006] In response to a trigger event, enter the wake-up state;
[0007] If the trigger event is not detected continuously for a first duration in the wake-up state, or the duration of the wake-up state reaches a second duration, then determine whether the number of package event detections within a third duration from the current moment is less than a preset number;
[0008] If the number of package event detections within a third duration from the current moment is less than the preset number, then obtain the current package information based on multiple video frames within a fourth duration from the current moment;
[0009] Determine the package event detection result according to the current package information and the most recent package information.
[0010] In a possible implementation, the above method further includes:
[0011] If the trigger event is not detected continuously for a first duration in the wake-up state, and the number of package event detections within a third duration from the current moment is greater than or equal to the preset number, then continue to maintain the wake-up state for a fifth duration, and enter the sleep state if the trigger event is not detected within the fifth duration;
[0012] If the duration of the wake-up state reaches the second duration and the number of detected package events within the third duration from the current moment is greater than or equal to the preset number, the wake-up state is maintained for the sixth duration and then enters the sleep state.
[0013] In a possible implementation, if the number of detected package events within the third duration from the current moment is less than the preset number, the current package information is obtained based on multiple video frames within the fourth duration from the current moment, including:
[0014] If the number of detected package events within the third duration from the current moment is less than the preset number, multiple video frames within the fourth duration from the current moment are input into the package detection model;
[0015] Through the package detection model, the package detection information corresponding to each of the multiple video frames is obtained;
[0016] Based on the package detection information corresponding to each of the multiple video frames, the reliable video frames among the multiple video frames are determined;
[0017] Based on the package detection information corresponding to the reliable video frames, the current package information is determined.
[0018] In a possible implementation, the package detection information includes at least one package detection result, the package quality score corresponding to each package detection result, and the package size score corresponding to each package detection result;
[0019] Based on the package detection information corresponding to each of the multiple video frames, determining the reliable video frames among the multiple video frames includes:
[0020] Based on the package quality score corresponding to each package detection result and the package size score corresponding to each package detection result, the credibility score corresponding to each package detection result is calculated;
[0021] The video frame where the package detection result with the highest credibility score among the multiple video frames is located is used as the reliable video frame.
[0022] In a possible implementation, the package information includes the number of packages;
[0023] Based on the current package information and the most recent package information, the package event detection result is determined, including:
[0024] Determine whether the current number of packages is the same as the most recent number of packages;
[0025] If the current number of packages is not the same as the most recent number of packages, it is determined that a package event is triggered.
[0026] In a possible implementation, if the current number of packages is inconsistent with the number of packages in the most recent time, after determining that a package event is triggered, the method further includes:
[0027] Updating the package information of the most recent time to the current package information.
[0028] In a possible implementation, if the current number of packages is inconsistent with the number of packages in the most recent time, determining that a package event is triggered includes:
[0029] If the current number of packages is greater than the number of packages in the most recent time, determining that a package appearance event is triggered;
[0030] If the current number of packages is less than the number of packages in the most recent time, determining that a package pickup event is triggered.
[0031] In a possible implementation, the package information further includes the package size and the package location;
[0032] The above method further includes:
[0033] If the current number of packages is consistent with the number of packages in the most recent time, determining whether the current number of packages is greater than zero;
[0034] If the current number of packages is zero, determining that no package event is triggered;
[0035] If the current number of packages is greater than zero, determining whether the current package size is equal to the package size in the most recent time;
[0036] If the current package size is not equal to the package size in the most recent time, determining that a package appearance event is triggered;
[0037] If the current package size is equal to the package size in the most recent time, determining whether the distance between the current package location and the package location in the most recent time is greater than a preset distance;
[0038] If the distance between the current package location and the package location in the most recent time is greater than the preset distance, determining that a package appearance event is triggered;
[0039] If the distance between the current package location and the package location in the most recent time is less than or equal to the preset distance, determining that no package event is triggered.
[0040] In a possible implementation, after determining that a package appearance event is triggered, the method further includes:
[0041] Updating the package information of the most recent time to the current package information.
[0042] In a second aspect, an embodiment of the present application provides a package event detection device, and the device includes:
[0043] A response module, configured to enter a wake-up state in response to a trigger event;
[0044] A response module, configured to enter a wake-up state in response to a trigger event;
[0045] A judgment module, configured to judge whether the number of detected package events within a third time period from the current moment is less than a preset number if no trigger event is detected for a first time period continuously in the wake-up state or the duration of the wake-up state reaches a second time period;
[0046] An acquisition module, configured to obtain current package information based on a plurality of video frames within a fourth time period from the current moment if the number of detected package events within a third time period from the current moment is less than the preset number;
[0047] A determination module, configured to determine a package event detection result according to the current package information and the most recent package information.
[0048] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory; wherein, the memory stores a computer program, and when the processor executes the computer program, the method steps provided in the first aspect of the embodiment of the present application are implemented.
[0049] In a fourth aspect, an embodiment of the present application provides a computer storage medium, where the computer storage medium stores multiple instructions, and the instructions are suitable for being loaded and executed by a processor to implement the method steps provided in the first aspect of the embodiment of the present application.
[0050] The above-mentioned package event detection method, device, electronic device and computer storage medium enter a wake-up state in response to a trigger event, and further judge whether the number of detected package events within a third time period from the current moment is less than a preset number if no trigger event is detected for a first time period continuously after entering the wake-up state or the duration of the wake-up state reaches a second time period, which not only reduces unnecessary energy consumption and computing resource consumption, but also ensures timely detection of dynamic changes of the package; by obtaining current package information based on a plurality of video frames within a fourth time period from the current moment when the number of detected package events within a third time period from the current moment is less than the preset number, and determining a package event detection result according to the current package information and the most recent package information, it is possible to obtain current package information in a timely manner according to the recorded video frames, and accurately grasp the dynamic changes of the package by comparing the current package information with the most recent package information, making the package event detection result more reliable. The entire package event detection process can improve the reliability of package event detection while ensuring the high-efficiency operation of the device by reasonably controlling the timing of package event detection and effectively using video records to determine the package event detection result. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0052] Figure 1 Schematic diagram of the application environment of a package event detection method provided by an exemplary embodiment of the present application;
[0053] Figure 2 Schematic flowchart of a package event detection method provided by an exemplary embodiment of the present application;
[0054] Figure 3 Schematic flowchart of another package event detection method provided by an exemplary embodiment of the present application;
[0055] Figure 4 Schematic diagram of the time flow of a package event detection method provided by an exemplary embodiment of the present application;
[0056] Figure 5 Schematic diagram of the time flow of another package event detection method provided by an exemplary embodiment of the present application;
[0057] Figure 6 Schematic flowchart of another package event detection method provided by an exemplary embodiment of the present application;
[0058] Figure 7 Schematic flowchart of another package event detection method provided by an exemplary embodiment of the present application;
[0059] Figure 8 Schematic diagram of the structure of a package event detection device provided by an exemplary embodiment of the present application;
[0060] Figure 9 Schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0061] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0062] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be construed as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific circumstances. In addition, in the description of the present application, unless otherwise specified, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0063] First, an application scenario applicable to the embodiments of the present application is introduced: An intelligent door lock that integrates door lock, doorbell, and monitoring functions is equipped with a monitoring APP installed on a mobile phone. When the intelligent door lock detects a package event, it will report the corresponding package event to the monitoring APP so that the user can know the package dynamics in a timely manner and view the complete delivery process of the package based on the recorded video.
[0064] To meet the low-power requirement, the intelligent door lock is in a sleep state for most of the time to save power. Only when a trigger event (such as a doorbell pressing event) is detected, will it enter the wake state to enable functions such as video recording and package event detection. In the wake state, if no trigger event is detected for a continuous seventh duration (such as 3 seconds), or the continuous duration of the wake state reaches the eighth duration (such as 1 minute), the intelligent door lock will automatically enter the sleep state.
[0065] It is worth noting that in order to improve the reliability of package event detection while ensuring high-performance operation, the intelligent door lock provided by the embodiments of the present application does not continuously perform package event detection although it continuously performs video recording after entering the wake state. Package event detection will only be enabled when a preset condition is met. Among them, the preset conditions include: no trigger event is detected for a continuous first duration (such as 1.8 seconds) in the wake state, and the number of package event detections within a third duration (such as 24 hours) from the current moment is less than the preset number (such as 5 times); or, the continuous duration of the wake state reaches the second duration (such as 55 seconds), and the number of package event detections within a third duration from the current moment is less than the preset number.
[0066] After detecting the intelligent door lock opening package event, multiple video frames (such as 5 video frames) recorded within the fourth time period (such as 1 second) from the current moment are input into the package detection model. The package detection information corresponding to each of the multiple video frames is obtained through the package detection model. Based on at least one package detection result in the package detection information, the package quality score corresponding to each package detection result, and the package size score corresponding to each package detection result, the credible video frames among the multiple video frames are determined. Then, the package detection information corresponding to the credible video frames is used as the current package information. By comparing the current package information with the most recent package information, the package event detection result is determined. It can be understood that the package event detection result can be triggering a package event or not triggering a package event. Triggering a package event is an event related to the change in the package status in front of the door, which can be triggering a package appearance event or triggering a package pickup event. When the package event detection result is triggering a package event, the intelligent door lock reports the triggering package event to the monitoring APP to prompt the user that the package status in front of the door has changed.
[0067] The package event detection method provided by the embodiments of this application can be applied to an application environment such as Figure 1 shown. Among them, the monitoring terminal 10 communicates with the user terminal 20 through the network. Specifically, the monitoring terminal 10 enters the wake-up state in response to a trigger event; if no trigger event is detected during the first time period in the wake-up state, or the duration of the wake-up state reaches the second time period, it is determined whether the number of package event detections within the third time period from the current moment is less than the preset number; if the number of package event detections within the third time period from the current moment is less than the preset number, the current package information is obtained based on multiple video frames within the fourth time period from the current moment; according to the current package information and the most recent package information, the package event detection result is determined; in the case where the package event detection result is triggering a package event, the triggering package event is sent to the user terminal 20.
[0068] It should be noted that the monitoring terminal 10 can be but is not limited to an intelligent door lock, an intelligent camera, etc. The user terminal 20 is installed with a monitoring APP that matches the monitoring terminal 10. The user terminal 20 can be but is not limited to various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart in-vehicle devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc.
[0069] In one embodiment, as Figure 2 shown, a package event detection method is provided. Taking the application of this method to an intelligent door lock as an example, the method includes the following steps:
[0070] S201: Enter the wake-up state in response to a trigger event.
[0071] Among them, the trigger events can include, but are not limited to, doorbell pressing events, motion events, sound events, etc. The wake-up state is the normal working state of the smart door lock, corresponding to the sleep state. Optionally, the smart door lock turns on high-power modules such as cameras and processors in the wake-up state for video recording and package event detection; while in the sleep state, only low-power sensors are turned on to detect doorbell pressing events, motion events, and sound events, and functions such as video recording and package event detection are paused.
[0072] Optionally, the smart door lock enters the wake-up state in response to a doorbell pressing event. In the wake-up state, the smart door lock continuously performs video recording and enables package event detection when it detects that the current conditions meet the preset conditions. It should be noted that if no trigger event is detected within the seventh duration (e.g., 4 seconds) in the wake-up state, or the duration of the wake-up state reaches the eighth duration (e.g., 1 minute), the smart door lock will automatically enter the sleep state.
[0073] In this embodiment, when the smart door lock detects a doorbell pressing event, a motion event, or a sound event, it switches from the sleep state to the wake-up state capable of video recording and package event detection, which can not only reduce unnecessary power consumption but also ensure timely and accurate detection of the status change in front of the door, guaranteeing the high-efficiency operation of the device.
[0074] S202: If no trigger event is detected within the first duration in the wake-up state, or the duration of the wake-up state reaches the second duration, then determine whether the number of package event detections within the third duration from the current moment is less than the preset number.
[0075] Among them, the first duration is less than the above-mentioned seventh duration; the second duration is less than the above-mentioned eighth duration and greater than the above-mentioned seventh duration; the third duration is greater than the above-mentioned eighth duration. The preset number is a detection number threshold set to avoid frequent reporting of package events.
[0076] It can be understood that trigger events such as doorbell pressing events, motion events, and sound events often mean that someone is in front of the door. To ensure the accuracy and reliability of package event detection and reduce unnecessary consumption of computing resources, the smart door lock only determines whether to perform package event detection when it is about to switch from the wake-up state to the sleep state.
[0077] Optionally, after the intelligent door lock enters the wake-up state, if no trigger event is detected within the first duration (e.g., 1.8 seconds), or the duration of the wake-up state reaches the second duration (e.g., 55 seconds), it is determined whether the number of package event detections within the third duration (e.g., 24 hours) from the current moment is less than the preset number (e.g., 5 times). If the number of package event detections within the third duration from the current moment is less than the preset number, the package event detection is enabled; if the number of package event detections within the third duration from the current moment is greater than or equal to the preset number, the package event detection is not enabled.
[0078] In this embodiment, when the intelligent door lock does not detect a trigger event for the first duration after entering the wake-up state, or the duration of the wake-up state reaches the second duration, it is further determined whether the number of package event detections within the third duration from the current moment is less than the preset number. This not only reduces unnecessary consumption of computing resources but also ensures that the dynamic changes of the package can be detected in a timely and accurate manner, improving the reliability of package event detection.
[0079] S203: If the number of package event detections within the third duration from the current moment is less than the preset number, the current package information is obtained based on multiple video frames within the fourth duration from the current moment.
[0080] Among them, the fourth duration is less than the above-mentioned first duration and second duration.
[0081] Optionally, when the intelligent door lock does not detect a trigger event for the first duration in the wake-up state, or the duration of the wake-up state reaches the second duration, if it is further determined that the number of package detections within the third duration from the current moment is less than the preset number, the current package information is obtained based on multiple video frames (e.g., 5 video frames) recorded within the fourth duration (e.g., 1 second) from the current moment.
[0082] Specifically, the intelligent door lock inputs multiple video frames within the fourth duration from the current moment into the package detection model, obtains the package detection information corresponding to each of the multiple video frames through the package detection model, and determines the reliable video frames among the multiple video frames according to at least one package detection result in the package detection information, the package quality score corresponding to each package detection result, and the package size score corresponding to each package detection result. Then, the package detection information corresponding to the reliable video frames is used as the current package information.
[0083] In this embodiment, the intelligent door lock obtains the current package information based on the multiple recently recorded video frames only when the number of package event detections is less than the preset number. This can not only effectively control the number of package event detections, avoid frequently reporting package events to the user, but also accurately grasp the current package status information, reduce unnecessary consumption of computing resources, and improve the reliability of package event detection.
[0084] S204: Determine the detection result of the package event based on the current package information and the most recent package information.
[0085] Among them, the package information may but is not limited to include the number of packages, the size of the packages, the location of the packages, etc. The detection result of the package event may be that a package event is triggered or not triggered. Triggering a package event may be triggering a package appearance event or a package pickup event.
[0086] Optionally, after the intelligent door lock enters the wake-up state in response to a trigger event, it obtains the most recent package information from the flash memory, including the number of the most recent packages, the size of the most recent packages, and the location of the most recent packages. Then, it compares the current package information with the most recent package information to determine the detection result of the package event.
[0087] Specifically, the intelligent door lock first determines whether the number of current packages is the same as the number of the most recent packages. If the number of current packages is different from the number of the most recent packages and the number of current packages is greater than the number of the most recent packages, it is determined that a package appearance event is triggered. If the number of current packages is the same as the number of the most recent packages and the number of current packages is less than the number of the most recent packages, it is determined that a package pickup event is triggered.
[0088] If the number of current packages is the same as the number of the most recent packages and the number of current packages is zero, it is determined that no package event is triggered. If the number of current packages is the same as the number of the most recent packages and the number of current packages is greater than zero, it is further determined whether the size of the current packages is equal to the size of the most recent packages. If the size of the current packages is different from the size of the most recent packages, it is determined that a package appearance event is triggered. If the size of the current packages is equal to the size of the most recent packages, it is determined whether the distance between the location of the current packages and the location of the most recent packages is less than or equal to a preset distance. If the distance between the location of the current packages and the location of the most recent packages is greater than the preset distance, it is determined that a package appearance event is triggered. If the distance between the location of the current packages and the location of the most recent packages is less than or equal to the preset distance, it is determined that no package event is triggered.
[0089] In this embodiment, the intelligent door lock determines the detection result of the package event by comparing the current package information with the most recent package information, can more accurately grasp the dynamic changes of the packages, reduce the missed detection and false detection of the package events, and improve the reliability of the package event detection.
[0090] In the above package event detection method, the smart door lock enters the wake-up state in response to a trigger event. When the trigger event is not detected for the first duration after entering the wake-up state, or when the duration of the wake-up state reaches the second duration, it further determines whether the number of package event detections within the third duration from the current moment is less than a preset number. This not only reduces unnecessary energy consumption and computing resource consumption but also ensures timely detection of dynamic changes in the package. When the number of package event detections within the third duration from the current moment is less than the preset number, the current package information is obtained based on multiple video frames within the fourth duration from the current moment. According to the current package information and the most recent package information, the package event detection result is determined. It can timely obtain the current package information based on the recorded video frames, and accurately grasp the dynamic changes of the package by comparing the current package information with the most recent package information, making the package event detection result more reliable. The entire package event detection process can improve the reliability of package event detection while ensuring the high-efficiency operation of the device by reasonably controlling the timing of package event detection and effectively using the recorded video to determine the package event detection result.
[0091] In one embodiment, as Figure 3 shown, another package event detection method is provided. Taking the application environment shown in Figure 1 as an example for illustration, it includes the following steps:
[0092] S301: Enter the wake-up state in response to a trigger event.
[0093] Specifically, S301 is the same as S201 and will not be elaborated here.
[0094] S302: Determine whether the duration of the wake-up state reaches the second duration. If so, execute S303; if not, execute S307.
[0095] Optionally, after the smart door lock enters the wake-up state, it determines whether the duration of the wake-up state reaches the second duration (such as 55 seconds). If the duration of the wake-up state reaches the second duration, it means that the smart door lock is about to switch from the wake-up state to the sleep state. At this time, the smart door lock will execute S303 to further determine whether the number of package event detections within the third duration from the current moment is less than the preset number. If the duration of the wake-up state has not reached the second duration, the smart door lock will execute S307 to continue determining whether the trigger event has not been detected for the first duration.
[0096] S303: Determine whether the number of package event detections within the third duration from the current moment is less than the preset number. If so, execute S304; if not, execute S306.
[0097] Optionally, the intelligent door lock determines whether the number of package event detections within the third time period (e.g., 24 hours) from the current moment is less than a preset number (e.g., 5 times), so as to effectively control the number of package event detections and avoid frequently reporting package events to the user. If the number of package event detections within the third time period from the current moment is less than the preset number, it means that package event detection can continue. At this time, the intelligent door lock executes S304 to obtain the current package information based on multiple video frames captured in the recent period. If the number of package event detections within the third time period from the current moment is greater than or equal to the preset number, it means that there is no need to perform package event detection anymore. At this time, the intelligent door lock executes S306 and enters the sleep state after continuing to maintain the wake-up state for the sixth time period (e.g., 5 seconds).
[0098] S304: Obtain the current package information based on multiple video frames within the fourth time period from the current moment.
[0099] Optionally, the intelligent door lock obtains the current package information based on multiple video frames (e.g., 5 video frames) recorded within the fourth time period (e.g., 1 second) from the current moment. Specifically, the intelligent door lock inputs multiple video frames within the fourth time period from the current moment into the package detection model, obtains the package detection information corresponding to each of the multiple video frames through the package detection model, and determines the credible video frames among the multiple video frames according to at least one package detection result in the package detection information, the package quality score corresponding to each package detection result, and the package size score corresponding to each package detection result. Then, the package detection information corresponding to the credible video frames is used as the current package information.
[0100] S305: Determine the package event detection result based on the current package information and the most recent package information.
[0101] Specifically, S305 is the same as S204 and will not be elaborated here.
[0102] S306: Enter the sleep state after continuing to maintain the wake-up state for the sixth time period.
[0103] Optionally, if the duration of the wake-up state reaches the second time period (e.g., 55 seconds) and the number of package event detections within the third time period (e.g., 24 hours) from the current moment is greater than or equal to the preset number, the intelligent door lock will continue to maintain the wake-up state for the sixth time period (e.g., 5 seconds) until the duration of the wake-up state reaches the eighth time period (e.g., 1 minute) and then enters the sleep state.
[0104] Exemplarily, please refer to Figure 4, is a time flow diagram of a package event detection method provided by an exemplary embodiment of the present application. The maximum duration of the intelligent door lock in the wake-up state is the eighth duration (e.g., 1 minute), that is, it will automatically enter the sleep state after the eighth duration in the wake-up state. If the intelligent door lock detects that the duration of the wake-up state reaches the second duration (e.g., 55 seconds) at a certain time point T1 after entering the wake-up state in response to a trigger event, and the number of package event detections within the third duration (e.g., 24 hours) from the current moment is less than the preset number (e.g., 5 times), then the intelligent door lock continues to maintain the wake-up state for the sixth duration (e.g., 5 seconds) starting from time point T1, and performs package event detection based on multiple video frames (e.g., 5) recorded within the fourth duration (e.g., 1 second) from the current moment during the sixth duration, and reports the detection result, and then enters the sleep state at time point T2.
[0105] In this embodiment, when the duration of the intelligent door lock in the wake-up state reaches the second duration, it is judged whether the number of package event detections is less than the preset number. When the number of package event detections is less than the preset number, the package event detection is started. When the number of package event detections is greater than or equal to the preset number, it continues to maintain the wake-up state for the sixth duration and then enters the sleep state, which can reasonably control the timing of package event detection while taking into account the low power consumption requirements of the monitoring device and the reliability of package event detection.
[0106] S307: Judge whether the trigger event has not been detected for the first duration continuously. If so, execute S308; if not, execute S302 again.
[0107] Optionally, after the intelligent door lock enters the wake-up state, if it is determined that the duration of the wake-up state has not reached the second duration (e.g., 55 seconds), it continues to judge whether the trigger event has not been detected for the first duration (e.g., 1.8 seconds) continuously. If the trigger event has not been detected for the first duration continuously, it means that the picture monitored by the intelligent door lock is relatively stable and the intelligent door lock may be about to switch from the wake-up state to the sleep state. At this time, the intelligent door lock will execute S308 to further judge whether the number of package event detections within the third duration (e.g., 1 second) from the current moment is less than the preset number (e.g., 5 times). If the trigger event is detected within the first duration, the intelligent door lock will execute S302 again to judge whether the duration of the wake-up state reaches the second duration, that is, to start the process of judging the conditions for package event detection again.
[0108] S308: Judge whether the number of package event detections within the third duration from the current moment is less than the preset number. If so, execute S309; if not, execute S311.
[0109] Optionally, the intelligent door lock determines whether the number of package event detections within the third time period from the current moment is less than a preset number, so as to effectively control the number of package event detections and avoid frequently reporting package events to the user. If the number of package event detections within the third time period from the current moment is less than the preset number, it means that the package event detection can continue. At this time, the intelligent door lock executes S309 to obtain the current package information based on multiple video frames captured in the recent period. If the number of package event detections within the third time period from the current moment is greater than or equal to the preset number, it means that there is no need to perform package event detection anymore. At this time, the intelligent door lock executes S311, continues to maintain the wake-up state for the fifth time period, and enters the sleep state if no trigger event is detected within the fifth time period.
[0110] S309: Obtain the current package information based on multiple video frames within the fourth time period from the current moment.
[0111] Specifically, S309 is the same as S304 and will not be elaborated here.
[0112] S310: Determine the package event detection result based on the current package information and the most recent package information.
[0113] Specifically, S310 is the same as S204 and will not be elaborated here.
[0114] S311: Continue to maintain the wake-up state for the fifth time period, and enter the sleep state if no trigger event is detected within the fifth time period.
[0115] Optionally, if no trigger event is detected for the first time period continuously and the number of package event detections within the third time period from the current moment is greater than or equal to the preset number, the intelligent door lock will continue to maintain the wake-up state for the fifth time period and enter the sleep state if no trigger event is detected within the fifth time period.
[0116] Exemplarily, please refer to Figure 5, which is a schematic diagram of time flow for another package event detection method provided by an exemplary embodiment of the present application. If the intelligent door lock does not detect a trigger event for a seventh duration (e.g., 4 seconds) continuously, it will automatically enter the sleep state. If the intelligent door lock detects that the duration of the wake-up state reaches the first duration (e.g., 1.8 seconds) at a certain time point T1' after entering the wake-up state in response to a trigger event, and the number of package event detections within the third duration (e.g., 24 hours) from the current moment is less than the preset number (e.g., 5 times), then the intelligent door lock continues to maintain the wake-up state for a fifth duration (e.g., 2.2 seconds) starting from time point T1', and performs package event detection based on multiple video frames (e.g., 5) recorded within the fourth duration (e.g., 1 second) from the current moment during the fifth duration, and reports the detection result. In addition, if the intelligent door lock does not detect a trigger event within the fifth duration, it will enter the sleep state at time point T2'.
[0117] In this embodiment, when the intelligent door lock does not detect a trigger event for the first duration in the wake-up state, it determines whether the number of package event detections is less than the preset number. When the number of package event detections is less than the preset number, it starts the package event detection. When the number of package event detections is greater than or equal to the preset number, it continues to maintain the wake-up state for the fifth duration, and enters the sleep state when it does not detect a trigger event within the fifth duration. It can reasonably control the timing of package event detection, taking into account both the low-power requirement of the monitoring device and the reliability of package event detection.
[0118] In the above package event detection method, when the intelligent door lock does not detect a trigger event for the first duration or the duration of the wake-up state reaches the second duration, it further determines whether the number of package event detections is less than the preset number to determine whether to start the package event detection; when it does not detect a trigger event for the first duration and the number of package event detections is greater than or equal to the preset number, it continues to maintain the wake-up state for the fifth duration, and enters the sleep state when it does not detect a trigger event within the fifth duration; when the duration of the wake-up state reaches the second duration and the number of package event detections is greater than or equal to the preset number, it continues to maintain the wake-up state for the sixth duration and then enters the sleep state. Through the entire process of reasonably controlling the timing of package event detection and making a conditional judgment on starting package event detection when about to enter the sleep state, it can improve the reliability of package event detection while ensuring the efficient operation of the device.
[0119] In one embodiment, as Figure 6 shown, another package event detection method is provided. Taking the application of this method to an intelligent door lock as an example, it includes the following steps:
[0120] S601: In response to a trigger event, enter the wake-up state.
[0121] Specifically, S601 is the same as S201, which will not be elaborated here.
[0122] S602: Obtain the information of the most recent package.
[0123] Among them, the information of the most recent package may but is not limited to including the number of the most recent packages, the size of the most recent packages, the location of the most recent packages, etc. The location of the most recent package may but is not limited to including the position of the center point of the most recent package.
[0124] Optionally, the smart door lock reads the number of the most recent packages, the size of the most recent packages, and the location of the most recent packages from the flash memory, so as to subsequently determine the detection result of the package event by comparing the number of the most recent packages with the current number of packages, the size of the most recent packages with the current size of packages, and the location of the most recent packages with the current location of packages.
[0125] S603: When no trigger event is detected for the first duration in the wake state, or when the duration of the wake state reaches the second duration, determine whether the number of package event detections within the third duration from the current moment is less than the preset number. If so, execute S604; if not, execute S615.
[0126] Among them, the first duration is less than the above-mentioned seventh duration; the second duration is less than the above-mentioned eighth duration and greater than the above-mentioned seventh duration; the third duration is greater than the above-mentioned eighth duration. The preset number is the detection number threshold set to avoid frequent reporting of package events.
[0127] Optionally, after the smart door lock enters the wake state, if no trigger event is detected within the first duration (such as 1.8 seconds), or when the duration of the wake state reaches the second duration (such as 55 seconds), determine whether the number of package event detections within the third duration (such as 24 hours) from the current moment is less than the preset number (such as 5 times). If the number of package event detections within the third duration from the current moment is less than the preset number, execute S604 to input multiple video frames within the fourth duration from the current moment into the package detection model to start the package event detection. If the number of package event detections within the third duration from the current moment is greater than or equal to the preset number, execute S615 to temporarily not start the package event detection and enter the sleep state when the corresponding preset conditions are met.
[0128] S604: Input multiple video frames within the fourth duration from the current moment into the package detection model.
[0129] Among them, the package detection model is an object detection model that can locate packages in video frames and output the confidence of the detection results. The fourth duration is less than the above-mentioned first duration and second duration.
[0130] Optionally, the intelligent door lock inputs multiple video frames (such as 5 video frames) recorded within the fourth time period (such as 1 second) from the current moment into the package detection model, so as to obtain the current package information through the package detection model and the video frames recorded within the most recent period of time.
[0131] S605: Obtain the package detection information corresponding to each of the multiple video frames through the package detection model.
[0132] Among them, the package detection information includes at least one package detection result marked in the form of a bounding box, the package quality score corresponding to each package detection result, and the package size score corresponding to each package detection result.
[0133] Optionally, after the intelligent door lock inputs multiple video frames into the package detection model, the package detection model outputs at least one package detection result in each video frame, the package quality score corresponding to each package detection result, and the package size score corresponding to each package detection result.
[0134] S606: Determine the reliable video frames among the multiple video frames according to the package detection information corresponding to each of the multiple video frames.
[0135] Among them, the reliable video frame is the video frame with the highest credibility score among the above multiple video frames.
[0136] Optionally, the intelligent door lock calculates the credibility score corresponding to each package detection result according to the package quality score corresponding to each package detection result and the package size score corresponding to each package detection result, and then uses the video frame where the package detection result with the highest credibility score among the multiple video frames is located as the reliable video frame.
[0137] S607: Determine the current package information according to the package detection information corresponding to the reliable video frame.
[0138] Among them, the current package information may but is not limited to include the current number of packages, the current size of the packages, the current position of the packages, etc. The current position of the packages may but is not limited to include the position of the center point of the current packages.
[0139] Optionally, the intelligent door lock determines the current number of packages, the current size of the packages, and the current position of the packages according to at least one package detection result corresponding to the reliable video frame, so as to compare with the number of packages, the size of the packages, and the position of the packages in the most recent time and the current position of the packages respectively in the subsequent process, so as to determine the package event detection result.
[0140] Exemplarily, the intelligent door lock determines the current package size according to the number of bounding boxes annotated in the trusted video frame; determines the current package size according to the ranges of the bounding boxes annotated in the trusted video frame (such as the height and width of each bounding box); determines the current package position according to the coordinate positions of the bounding boxes annotated in the trusted video frame.
[0141] In this embodiment, the intelligent door lock combines multiple video frames recorded in the nearest period of time to the current moment and the package detection model to determine the current package information, which not only realizes on-demand detection and improves the detection efficiency, but also utilizes the result evaluation ability of the package detection model to improve the accuracy of the detection result.
[0142] S608: Determine whether the current number of packages is the same as the number of packages in the most recent time. If so, execute S609; if not, execute S612.
[0143] Optionally, the intelligent door lock determines whether the current number of packages is the same as the number of packages in the most recent time read from the flash memory. If the current number of packages is the same as the number of packages in the most recent time, S609 needs to be executed for further judgment; if the current number of packages is different from the number of packages in the most recent time, it means that there is an increase or decrease in packages, and S612 is executed to determine the trigger of a package event.
[0144] S609: Determine whether the current number of packages is greater than zero. If so, execute S610; if not, execute S614.
[0145] Optionally, when the intelligent door lock determines that the current number of packages is the same as the number of packages in the most recent time, it further determines whether the current number of packages is greater than zero. If the current number of packages is greater than zero, S610 needs to be executed for further judgment; if the current number of packages is equal to zero, it means that there is no increase or decrease in packages, and S614 is executed to determine that no package event is triggered.
[0146] S610: Determine whether the current package size is the same as the package size in the most recent time. If so, execute S611; if not, execute S612.
[0147] Optionally, the intelligent door lock determines whether the current package size is the same as the package size in the most recent time read from the flash memory. If the current package size is the same as the package size in the most recent time, S611 needs to be executed for further judgment; if the current package size is different from the package size in the most recent time, it means that a new package appears, and S612 is executed to determine the trigger of a package event.
[0148] S611: Determine whether the distance between the current package position and the package position in the most recent time is greater than the preset distance. If so, execute S612; if not, execute S614.
[0149] Among them, the preset distance is a pre-set distance threshold.
[0150] Optionally, the intelligent door lock determines whether there is a large deviation between the current package position and the most recent package position read from the flash memory. If there is a large deviation between the current package position and the most recent package position, then execute S612 to determine that a package event is triggered; if there is no large deviation between the current package position and the most recent package position, then execute S614 to determine that no package event is triggered.
[0151] S612: Determine that a package event is triggered.
[0152] Optionally, at most one package event detection is performed in one wake-up state. After the intelligent door lock determines that a package event is triggered, it ends the package event detection process in the current wake-up state.
[0153] S613: Update the most recent package information to the current package information.
[0154] It can be understood that determining that a package event is triggered means that the package status has changed. Therefore, in the case of determining that a package event is triggered, the intelligent door lock can update the most recent package information stored in the flash memory to the current package information, so that when the package event detection is started next time, the detection result of the package event can be quickly and effectively determined by comparing the next package information with the current package information.
[0155] In this embodiment, after the intelligent door lock determines that a package event is triggered, it updates the most recent package information in the flash memory to the current package information, which can not only discard outdated information in time and reduce unnecessary consumption of computing resources, but also ensure that the current package information is not lost after entering the sleep state, facilitating subsequent quick and effective determination of the package event detection result by comparing the package information at different times.
[0156] S614: Determine that no package event is triggered.
[0157] Optionally, at most one package event detection is performed in one wake-up state. After the intelligent door lock determines that no package event is triggered, it ends the package event detection process in the current wake-up state.
[0158] S615: Do not start the package event detection temporarily and enter the sleep state when the corresponding preset conditions are met.
[0159] Optionally, when the intelligent door lock detects that the number of package event detections within the third time period from the current moment is greater than or equal to the preset number, it determines not to start the package event detection in the current wake-up state and enters the sleep state when the corresponding preset conditions are met.
[0160] In the above package event detection method, the intelligent door lock determines the current package information by combining multiple video frames recorded in the most recent period of time from the current moment and the package detection model, which not only realizes on-demand detection and improves the detection efficiency, but also utilizes the result evaluation ability of the package detection model to improve the accuracy of the detection result. After determining that a package event is triggered, by updating the most recent package information in the flash memory to the current package information, it can not only discard outdated information in a timely manner and reduce unnecessary consumption of computing resources, but also ensure that the current package information is not lost after entering the sleep state, facilitating subsequent rapid and effective determination of the package event detection result by comparing the package information at different times. The entire process can improve the reliability of package event detection while ensuring the high-efficiency operation of the device.
[0161] In one embodiment, as Figure 7 shown, another package event detection method is provided. Taking the application of this method to an intelligent door lock as an example, it includes the following steps:
[0162] S701: In response to a trigger event, enter the wake state.
[0163] Specifically, S701 is the same as S201 and will not be elaborated here.
[0164] S702: Obtain the most recent package information.
[0165] Specifically, S702 is the same as S602 and will not be elaborated here.
[0166] S703: In the case that no trigger event is detected during the first duration in the wake state, or the duration of the wake state reaches the second duration, determine whether the number of package event detections within the third duration from the current moment is less than the preset number. If so, execute S704; if not, execute S721.
[0167] Specifically, S703 is the same as S603 and will not be elaborated here.
[0168] S704: Input multiple video frames within the fourth duration from the current moment into the package detection model.
[0169] Specifically, S704 is the same as S604 and will not be elaborated here.
[0170] S705: Obtain the package detection information corresponding to each of the multiple video frames through the package detection model.
[0171] Among them, the package detection information includes at least one package detection result, the package quality score corresponding to each package detection result, and the package size score corresponding to each package detection result.
[0172] Specifically, S705 is the same as S605, which will not be elaborated here.
[0173] S706: Calculate the confidence score corresponding to each package detection result based on the package quality score corresponding to each package detection result and the package size score corresponding to each package detection result.
[0174] Optionally, the intelligent door lock performs a weighted sum of the package quality score corresponding to each package detection result and the package size score corresponding to each package detection result to calculate the confidence score corresponding to each package detection result. Specifically, for each package detection result in the video frame, the confidence score can be calculated based on the package quality score and the first weight coefficient, and the package size score and the second weight coefficient. Exemplarily, assuming that the first weight coefficient corresponding to the package quality score is set to 0.6 and the second weight coefficient corresponding to the package size score is set to 0.4, then the confidence score corresponding to each package detection result = 0.6 * package quality score + 0.4 * package size score.
[0175] S707: Use the video frame where the package detection result with the highest confidence score among multiple video frames is located as the reliable video frame.
[0176] Optionally, after the intelligent door lock calculates the confidence score corresponding to each package detection result in each video frame, it uses the video frame where the detection result with the highest confidence score is located as the reliable video frame. For example, if each of the 5 video frames has two package detection results, then the video frame where the detection result with the highest confidence score among the total 10 package detection results is located is used as the reliable video frame.
[0177] In this embodiment, the intelligent door lock calculates the confidence score corresponding to each package detection result based on the package quality score corresponding to each package detection result and the package size score corresponding to each package detection result. It not only combines the actual application scenario, takes the package quality score and the package size score as important evaluation indicators to ensure the accuracy of package event detection, but also improves the efficiency of package event detection by only selecting multiple video frames taken in the recent period of time.
[0178] S708: Determine the current package information based on the package detection information corresponding to the reliable video frame.
[0179] Specifically, S708 is the same as S607, which will not be elaborated here.
[0180] S709: Determine whether the current number of packages is the same as the number of packages in the most recent time. If so, execute S711; if not, execute S710.
[0181] Optionally, the smart door lock determines whether the current number of packages is the same as the most recent number of packages read from the flash memory. If the current number of packages is the same as the most recent number of packages, S711 needs to be executed to further determine whether there are packages; if the current number of packages is different from the most recent number of packages, S710 is executed to further determine whether the current number of packages has increased or decreased compared to the most recent number of packages.
[0182] S710: Determine whether the current number of packages is greater than the most recent number of packages. If so, execute S714; if not, execute S717.
[0183] Optionally, the smart door lock determines whether the current number of packages is greater than the most recent number of packages. If the current number of packages is greater than the most recent number of packages, it means that the number of packages has increased, and S714 is executed to determine the triggering of the package appearance event; if the current number of packages is less than the most recent number of packages, it means that the number of packages has decreased, and S717 is executed to determine the triggering of the package pickup event.
[0184] S711: Determine whether the current number of packages is greater than zero. If so, execute S712; if not, execute S720.
[0185] Optionally, when the smart door lock determines that the current number of packages is the same as the most recent number of packages, it further determines whether the current number of packages is greater than zero. If the current number of packages is greater than zero, S712 needs to be executed to further compare the sizes of the packages; if the current number of packages is equal to zero, it means that there has been no new addition or reduction of packages, and S720 is executed to determine that the package event has not been triggered.
[0186] S712: Determine whether the current size of the package is equal to the most recent size of the package. If so, execute S713; if not, execute S714.
[0187] Optionally, the smart door lock determines whether the current size of the package is equal to the most recent size of the package read from the flash memory. If the current size of the package is equal to the most recent size of the package, S713 needs to be executed for further determination; if the current size of the package is different from the most recent size of the package, it means that a new package has appeared, and S714 is executed to determine the triggering of the package appearance event.
[0188] S713: Determine whether the distance between the current position of the package and the most recent position of the package is greater than the preset distance. If so, execute S714; if not, execute S720.
[0189] Among them, the preset distance is a pre-set distance threshold.
[0190] Optionally, the intelligent door lock determines whether there is a large deviation between the current package center point position and the most recent package center point position read from the flash memory. If there is a large deviation between the current package center point position and the most recent package center point position, it means that the package center point position has changed significantly, and S714 is executed to determine that a package appearance event is triggered; if there is no large deviation between the current package center point position and the most recent package center point position, then S720 is executed to determine that no package event is triggered.
[0191] S714: Determine that a package appearance event is triggered.
[0192] Optionally, at most one package event detection is performed in one wake-up state. Therefore, after the intelligent door lock determines that a package appearance event is triggered, it ends the package event detection process in the current wake-up state, and only performs package event reporting operations and package information update operations subsequently.
[0193] S715: Send the package appearance event to the user terminal.
[0194] Optionally, the intelligent door lock can send a package appearance event prompt message to the user terminal to prompt the user that there is a new package at the door of the house. Among them, the package appearance event prompt message can but is not limited to including a package appearance text prompt message and a package appearance video clip. The package pickup video clip can but is not limited to be a video clip taken within a preset time period from the current moment.
[0195] S716: Update the most recent package information to the current package information.
[0196] It can be understood that determining that a package event is triggered means that the package status has changed. Therefore, in the case of determining that a package event is triggered, the intelligent door lock can update the most recent package information stored in the flash memory to the current package information, so that when the package event detection is started next time, the package event detection result can be quickly and effectively determined by comparing the next package information with the current package information.
[0197] S717: Determine that a package pickup event is triggered.
[0198] Optionally, at most one package event detection is performed in one wake-up state. Therefore, after the intelligent door lock determines that a package pickup event is triggered, it ends the package event detection process in the current wake-up state, and only performs package event reporting operations and package information update operations subsequently.
[0199] S718: Send the package pickup event to the user terminal.
[0200] Optionally, the intelligent door lock may send a package pickup event prompt message to the user terminal to prompt the user that the package at the door has been picked up. The package pickup event prompt message may include, but is not limited to, a package pickup text prompt message and a package pickup video clip. The package pickup video clip may be, but is not limited to, a video clip taken within a preset time period from the current moment.
[0201] S719: Update the most recent package information to the current package information.
[0202] It can be understood that determining the triggering of a package event means that the package status has changed. Therefore, in the case of determining the triggering of a package event, the intelligent door lock can update the most recent package information stored in the flash memory to the current package information, so that when the package event detection is enabled next time, the detection result of the package event can be quickly and effectively determined by comparing the next package information with the current package information.
[0203] S720: Determine that the package event has not been triggered.
[0204] Optionally, at most one package event detection is performed in one wake-up state. Therefore, after the intelligent door lock determines that the package event has not been triggered, it ends the package event detection process in the current wake-up state.
[0205] In this embodiment, the intelligent door lock gradually determines whether a package event is triggered and what kind of package event is triggered based on the number of packages, the size of the packages, and the location of the packages in the package information, which not only ensures the accuracy and reliability of the package event detection, but also improves the efficiency of the package event detection.
[0206] S721: Do not enable the package event detection temporarily and enter the sleep state when the corresponding preset conditions are met.
[0207] Optionally, when the intelligent door lock detects that the number of package event detections within the third time period from the current moment is greater than or equal to the preset number, it determines not to enable the package event detection in the current wake-up state and enters the sleep state when the corresponding preset conditions are met.
[0208] In the above package event detection method, the intelligent door lock calculates the credibility score corresponding to each package detection result according to the package quality score corresponding to each package detection result and the package size score corresponding to each package detection result. It not only combines the actual application scenario, takes the package quality score and the package size score as important evaluation indicators, ensures the accuracy of package event detection, but also improves the efficiency of package event detection by only selecting multiple video frames taken in the most recent period of time; it gradually determines whether a package event is triggered and what kind of package event is triggered according to the number of packages, the size of the packages, and the positions of the packages in the package information, which not only ensures the accuracy and reliability of package event detection, but also improves the efficiency of package event detection. The whole process can improve the reliability of package event detection while ensuring the efficient operation of the device.
[0209] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps does not have a strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.
[0210] Based on the inventive concept of the above package event detection method, as Figure 8 shown, an embodiment of the present application further provides a package event detection device 800 for implementing the above package event detection method. The package event detection device 800 includes:
[0211] A response module 801, configured to enter a wake-up state in response to a trigger event;
[0212] A judgment module 802, configured to judge whether the number of package event detections within a third time period from the current moment is less than a preset number if no trigger event is detected for a first duration in the wake-up state or the duration of the wake-up state reaches a second duration;
[0213] An acquisition module 803, configured to obtain the current package information based on multiple video frames within a fourth time period from the current moment if the number of package event detections within a third time period from the current moment is less than the preset number;
[0214] A determination module 804, configured to determine the package event detection result according to the current package information and the most recent package information.
[0215] In a possible implementation, the determination module 802 is further configured to, if no trigger event is detected during the first duration in the wake-up state and the number of package event detections within the third duration from the current moment is greater than or equal to a preset number, continue to maintain the wake-up state for the fifth duration and enter the sleep state if no trigger event is detected within the fifth duration; if the continuous duration of the wake-up state reaches the second duration and the number of package event detections within the third duration from the current moment is greater than or equal to a preset number, continue to maintain the wake-up state for the sixth duration and then enter the sleep state.
[0216] In a possible implementation, the acquisition module 803 is specifically configured to, if the number of package event detections within the third duration from the current moment is less than the preset number, input multiple video frames within the fourth duration from the current moment into the package detection model; obtain the package detection information corresponding to each of the multiple video frames through the package detection model; determine the reliable video frames among the multiple video frames according to the package detection information corresponding to each of the multiple video frames; and determine the current package information according to the package detection information corresponding to the reliable video frames.
[0217] In a possible implementation, the package detection information includes at least one package detection result, the package quality score corresponding to each package detection result, and the package size score corresponding to each package detection result; the acquisition module 803 is specifically configured to calculate the credibility score corresponding to each package detection result according to the package quality score corresponding to each package detection result and the package size score corresponding to each package detection result; and use the video frame where the package detection result with the highest credibility score among the multiple video frames is located as the reliable video frame.
[0218] In a possible implementation, the package information includes the number of packages; the determination module 804 is specifically configured to determine whether the current number of packages is the same as the number of packages in the most recent time; if the current number of packages is not the same as the number of packages in the most recent time, determine that a package event is triggered.
[0219] In a possible implementation, the package event detection device 800 further includes an update module for updating the most recent package information to the current package information.
[0220] In a possible implementation, the determination module 804 is specifically configured to determine that a package appearance event is triggered if the current number of packages is greater than the number of packages in the most recent time; and determine that a package pickup event is triggered if the current number of packages is less than the number of packages in the most recent time.
[0221] In a possible implementation, the package information further includes the package size and the package position; specifically, the determination module 804 is configured to: if the current number of packages is the same as the number of packages in the most recent time, determine whether the current number of packages is greater than zero; if the current number of packages is zero, determine that no package event is triggered; if the current number of packages is greater than zero, determine whether the current package size is equal to the package size in the most recent time; if the current package size is not equal to the package size in the most recent time, determine that a package appearance event is triggered; if the current package size is equal to the package size in the most recent time, determine whether the distance between the current package position and the package position in the most recent time is greater than a preset distance; if the distance between the current package position and the package position in the most recent time is greater than the preset distance, determine that a package appearance event is triggered; if the distance between the current package position and the package position in the most recent time is less than or equal to the preset distance, determine that no package event is triggered.
[0222] In a possible implementation, the above update module is further configured to update the package information in the most recent time to the current package information.
[0223] Each module in the above package event detection device 800 can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in the form of hardware or be independent of it, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above respective modules.
[0224] The embodiment of the present application further provides an electronic device, which can be a terminal, and its internal structure diagram can be as Figure 5As shown in the figure. The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and external devices. The communication interface of the electronic device is used to communicate with an external user terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. The computer program, when executed by the processor, implements a package event detection method. The display unit of the electronic device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the electronic device, or an external keyboard, touchpad, or mouse, etc.
[0225] Those skilled in the art can understand that Figure 5 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the electronic device to which the solution of this application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0226] In one embodiment, an electronic device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0227] The embodiments of this application further provide a computer storage medium. Instructions are stored in the computer storage medium. When it runs on a computer or a processor, the computer or the processor is caused to execute one or more steps in the above embodiments. If each component module of the above electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in the above computer-readable storage medium.
[0228] In one embodiment, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0229] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer storage medium or transmitted through the computer storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a Digital Versatile Disc (DVD)), or a semiconductor medium (for example, a Solid State Disk (SSD)), etc.
[0230] Those of ordinary skill in the art can understand that all or part of the processes in the above embodiments of the method can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. The aforementioned storage medium includes: various media such as ROM, RAM, magnetic disks, or optical discs that can store program codes. Without conflict, the technical features in this embodiment and the implementation solutions can be combined arbitrarily.
[0231] The above-described embodiments are merely described in a preferred implementation manner of the present application and do not limit the scope of the present application. Without departing from the design spirit of the present application, various deformations and improvements made by those of ordinary skill in the art to the technical solutions of the present application shall fall within the protection scope determined by the claims.
[0232] The above description has been made of specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A method for detecting wrapping events, characterized in that, The method includes: Entering a wake-up state in response to a trigger event; If the trigger event is not detected during the first duration in the wake-up state, or the duration of the wake-up state reaches the second duration, then determine whether the number of package event detections within the third duration from the current moment is less than a preset number; If the number of package event detections within the third duration from the current moment is less than the preset number, then obtain the current package information based on multiple video frames within the fourth duration from the current moment; Determine the package event detection result according to the current package information and the most recent package information.
2. The method according to claim 1, characterized in that The method further includes: If the trigger event is not detected during the first duration in the wake-up state and the number of package event detections within the third duration from the current moment is greater than or equal to the preset number, then continue to maintain the wake-up state for the fifth duration, and enter the sleep state if the trigger event is not detected within the fifth duration; If the duration of the wake-up state reaches the second duration and the number of package event detections within the third duration from the current moment is greater than or equal to the preset number, then enter the sleep state after continuing to maintain the wake-up state for the sixth duration.
3. The method according to claim 1, characterized in that The step of, if the number of package event detections within the third duration from the current moment is less than the preset number, then obtain the current package information based on multiple video frames within the fourth duration from the current moment, includes: If the number of package event detections within the third duration from the current moment is less than the preset number, then input multiple video frames within the fourth duration from the current moment into a package detection model; Obtain the package detection information corresponding to each of the multiple video frames through the package detection model; Determine the reliable video frames among the multiple video frames according to the package detection information corresponding to each of the multiple video frames; Determine the current package information according to the package detection information corresponding to the reliable video frames.
4. The method according to claim 3, characterized in that The package detection information includes at least one package detection result, the package quality score corresponding to each package detection result, and the package size score corresponding to each package detection result; The step of, according to the package detection information corresponding to each of the multiple video frames, determine the reliable video frames among the multiple video frames, includes: Calculate the credibility score corresponding to each package detection result according to the package quality score corresponding to each package detection result and the package size score corresponding to each package detection result; Use the video frame where the package detection result with the highest credibility score among the multiple video frames is located as the reliable video frame.
5. The method according to claim 1, wherein The package information includes the number of packages; The step of, determine the package event detection result according to the current package information and the most recent package information, includes: Judge whether the current number of packages is the same as the most recent number of packages; If the current number of packages is not the same as the most recent number of packages, then determine that a package event is triggered.
6. The method according to claim 5, wherein The step of, if the current number of packages is not the same as the most recent number of packages, then determine that a package event is triggered, includes: If the current number of packages is greater than the most recent number of packages, then determine that a package appearance event is triggered; If the current number of packages is less than the number of packages in the most recent time, it is determined that a package pickup event is triggered.
7. The method according to claim 5, characterized in that The package information further includes the package size and the package location; The method further includes: If the current number of packages is the same as the number of packages in the most recent time, it is determined whether the current number of packages is greater than zero; If the current number of packages is zero, it is determined that no package event is triggered; If the current number of packages is greater than zero, it is determined whether the current package size is equal to the package size in the most recent time; If the current package size is not equal to the package size in the most recent time, it is determined that a package appearance event is triggered; If the current package size is equal to the package size in the most recent time, it is determined whether the distance between the current package location and the package location in the most recent time is greater than a preset distance; If the distance between the current package location and the package location in the most recent time is greater than the preset distance, it is determined that a package appearance event is triggered; If the distance between the current package location and the package location in the most recent time is less than or equal to the preset distance, it is determined that no package event is triggered.
8. An apparatus for detecting a wrapping event, characterized in that, The device includes: A response module, configured to enter a wake-up state in response to a trigger event; A judgment module, configured to judge whether the number of package event detections within a third time period from the current moment is less than a preset number if the trigger event is not detected continuously for a first time period in the wake-up state or the duration of the wake-up state reaches a second time period; An acquisition module, configured to acquire current package information based on a plurality of video frames within a fourth time period from the current moment if the number of package event detections within a third time period from the current moment is less than the preset number; A determination module, configured to determine a package event detection result according to the current package information and the package information in the most recent time.
9. An electronic device, characterized in that, Includes: A processor and a memory; the memory stores a computer program, and when the processor executes the computer program, the method steps of any one of claims 1-7 are implemented.
10. A computer storage medium, characterized in that, The computer storage medium stores multiple instructions, and the instructions are adapted to be loaded and executed by the processor to perform the method steps of any one of claims 1-7.