Method, device, lock and storage medium for detecting device status
By performing light attenuation detection of the incident light received by the smart door lock and determining its opening and closing state, the problem of poor stability of the smart door lock opening and closing door detection is solved, accurate detection is achieved under external interference, and the robustness and adaptability of the detection are improved.
Patent Information
- Application Number
- CN202210367632.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2042-04-08
AI Technical Summary
The door detection stability of smart door locks is poor, especially in scenarios where external interference is present, the reflectivity will fluctuate greatly due to interference in light intensity, affecting the stability of the detection.
By receiving incident light and converting it into incident light signals, at least one set of incident light intensity is sampled, and the light attenuation detection process is performed to obtain the light attenuation detection result, which is used to determine the opening and closing state of the target device. This method takes into account the ratio of light intensity of the inner and outer optical paths, and avoids reflectivity detection based on a single light intensity.
It effectively improves the stability of smart door lock opening and closing detection, and can accurately detect the door opening and closing state under external interference, enhancing the robustness and adaptability of detection.
Smart Images

Figure CN114813073B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of smart door locks. Specifically, the present application relates to a method, device, lock and storage medium for detecting device status. Background Art
[0002] At present, smart door locks are increasingly used in the smart home industry. Smart door locks not only provide face unlocking functions, but also provide voice broadcasting and other functions based on the user's door opening and closing behaviors.
[0003] In order to reduce the noise caused by the collision and friction between the smart door lock and the door strike plate when opening and closing the door, the mechanical method is gradually replaced by the optical method in the door opening and closing detection scheme. Specifically, the optical door opening and closing detection scheme is based on reflectivity to determine whether the door is open. However, in the case of external interference, the reflectivity will fluctuate greatly due to the interference of light intensity, which will affect the stability of door opening and closing detection.
[0004] From the above, it can be seen that how to improve the stability of door opening and closing detection applied to smart door locks needs to be solved. Summary of the invention
[0005] The embodiments of the present application provide a method, device, lock and storage medium for detecting device status, which can solve the problem of poor stability of door opening and closing detection applied to smart door locks in related technologies. The technical solution is as follows:
[0006] According to one aspect of an embodiment of the present application, a method for detecting a device state includes: receiving incident light and converting the incident light into an incident light signal; sampling the incident light signal to obtain at least one group of incident light intensities, each group of incident light intensities including the light intensities of incident light incident via at least two optical paths; performing light attenuation detection processing on at least one group of incident light intensities to obtain a light attenuation detection result, the light attenuation detection result being used to indicate the light intensity ratio between the outgoing light and the incident light incident via any one of the optical paths; and determining the open or closed state of the target device based on the light attenuation detection result.
[0007] According to one aspect of the embodiments of the present application, a device for detecting the state of a device includes: a signal transceiver module, configured to receive incident light and convert the incident light into an incident light signal; a signal sampling module, configured to sample the incident light signal to obtain at least one set of incident light intensities, and each set of incident light intensities includes the light intensities of the incident light incident via at least two optical paths; a light attenuation detection module, configured to perform light attenuation detection processing on at least one set of incident light intensities to obtain a light attenuation detection result, and the light attenuation detection result is used to indicate the light intensity ratio between the outgoing light and the incident light incident via any one of the optical paths; a state detection module, configured to determine the open / closed state of the target device according to the light attenuation detection result.
[0008] In an exemplary embodiment, each set of incident light intensities includes a first incident light intensity and a second incident light intensity. The first incident light intensity refers to the light intensity of the incident light incident via the inner optical path or the outer optical path, and the second incident light intensity refers to the light intensity of the incident light incident via the ambient optical path.
[0009] In an exemplary embodiment, the device further includes: an abnormal state detection module, configured to perform abnormal state detection on the target device based on at least one set of incident light intensities, and the abnormal state includes at least one of the following: a first abnormal state, a second abnormal state, and a saturation state; wherein, the first abnormal state is used to indicate an abnormality of the first component of the target device, the second abnormal state is used to indicate an abnormality of the second component of the target device, and the saturation state is used to indicate that the light intensity of the environment where the target device is located is saturated.
[0010] In an exemplary embodiment, the abnormal state detection module includes: a first abnormal unit, configured to determine that the target device is in the first abnormal state if, in each set of incident light intensities, the first incident light intensity is equal to the second incident light intensity and the first incident light intensity is not equal to a first set value; or a second abnormal unit, configured to determine that the target device is in the second abnormal state if the first incident light intensity is equal to the second incident light intensity and the first incident light intensity is equal to a second set value; or a third abnormal unit, configured to determine that the target device is in the saturation state if the first incident light intensity is equal to the second incident light intensity and the first incident light intensity is equal to a third set value.
[0011] In an exemplary embodiment, the signal sampling module includes: a sampling unit configured to perform multiple samplings on the incident optical signal to obtain the light intensities corresponding to multiple incident lights; a traversing unit configured to perform a traversing step on the multiple light intensities, the traversing step including: taking the first light intensity and the second light intensity as a first set of incident light intensities, and taking the larger light intensity value in the first set of incident light intensities as the first incident light intensity in the first set of incident light intensities; taking the third light intensity and the fourth light intensity as a second set of incident light intensities, and taking the larger light intensity value in the second set of incident light intensities as the first incident light intensity in the second set of incident light intensities; until the traversing step is completed to obtain at least one set of incident light intensities.
[0012] In an exemplary embodiment, the device further includes: a signal sending unit configured to output an outgoing optical signal and convert the outgoing optical signal into an outgoing light, the outgoing optical signal including: a low-level signal sent in a first time period, a high-impedance signal sent in a second time period, and a high-level signal sent in a third time period.
[0013] In an exemplary embodiment, the device further includes: a verification module configured to verify the incident light intensity sampled in the third time period according to the voltage value of the high-impedance signal and the voltage value of the high-level signal to obtain a verification result, the verification result being used to indicate whether there is light intensity saturation in the environment where the target device is located in the third time period.
[0014] In an exemplary embodiment, the device further includes: a deletion module configured to, if the verification result indicates that there is light intensity saturation in the environment where the target device is located in the third time period, delete the incident light intensity sampled in the third time period; correspondingly, the light attenuation detection module is configured to calculate the light attenuation detection result according to at least one set of incident light intensities sampled in the first time period, and / or according to at least one set of incident light intensities sampled in the second time period.
[0015] In an exemplary embodiment, the light attenuation detection module includes: an attenuation rate calculation unit configured to input each set of incident light intensities into a light flux model for attenuation rate calculation processing to obtain multiple grouped attenuation rates, each grouped attenuation rate corresponding to a set of incident light intensities, the light flux model being used to indicate the light intensity ratio between the outgoing light and the incident light incident via different optical paths in the open / closed state of the target device; a fusion unit configured to perform a fusion process on the multiple grouped attenuation rates to obtain an external optical path attenuation rate as the light attenuation detection result, the external optical path attenuation rate being used to indicate the light intensity ratio between the outgoing light and the incident light incident via the external optical path.
[0016] According to one aspect of an embodiment of the present application, a lock comprises a lock body flap, a processor and an optical element, wherein the processor is used to output an outgoing light signal to the optical element upon receiving a switch signal of the lock body flap popping out; the optical element is used to convert the outgoing light signal into an outgoing light, and convert the received incident light into an incident light signal, so as to return the incident light signal to the processor, so that the processor samples and performs light attenuation detection processing on the incident light signal to determine the opening and closing state of the lock.
[0017] According to one aspect of an embodiment of the present application, a lock includes: at least one processor, at least one memory, and at least one communication bus, wherein a computer program is stored in the memory, and the processor reads the computer program in the memory through the communication bus; when the computer program is executed by the processor, the method for detecting the device status as described above is implemented.
[0018] According to one aspect of an embodiment of the present application, a storage medium stores a computer program thereon, and when the computer program is executed by a processor, the method for detecting a device status as described above is implemented.
[0019] According to one aspect of an embodiment of the present application, a computer program product includes a computer program, the computer program is stored in a storage medium, a processor of a computer device reads the computer program from the storage medium, and the processor executes the computer program, so that the computer device implements the method for detecting the device status as described above when executing the computer program.
[0020] The beneficial effects of the technical solution provided by this application are:
[0021] In the above technical solution, the received incident light is converted into an incident light signal, and at least one group of incident light intensities is obtained by sampling the incident light signal, so that according to the light intensity of the incident light incident through at least two optical paths in the at least one group of incident light intensities, light attenuation detection processing is performed to obtain a light attenuation detection result, and then the opening and closing state of the target device can be determined according to the light attenuation detection result, wherein the light path refers to any one of the internal light path, the external light path, and the ambient light path. Since the internal light path refers to the light path formed between the internal components of the smart door lock, the external light path refers to the light path formed between the smart door lock and the door strike plate, and the ambient light path refers to the light path formed in the environment where the smart door lock is located, that is, the light attenuation detection result not only takes into account external factors, such as sunlight, oil, water mist, etc. in contact with the smart door lock, but also takes into account internal factors, such as the structure of the smart door lock itself, the characteristics of the door strike plate, etc., to avoid detecting the opening and closing state of the smart door lock based on the reflectivity represented by a single light intensity, thereby effectively solving the problem of poor stability of door opening and closing detection applied to smart door locks in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for the description of the embodiments of the present application.
[0023] Figure 1 It is a schematic diagram of the characteristic curve between the light intensity and the reflectivity involved in each embodiment of the present application;
[0024] Figure 2 It is a schematic diagram of the structure of the intelligent door lock involved in each embodiment of the present application;
[0025] Figure 3 It is a schematic diagram of the structure of the door state detection circuit involved in each embodiment of the present application;
[0026] Figure 4 It is a schematic diagram of the optical structure involved in each embodiment of the present application;
[0027] Figure 5 It is a flowchart of a method for detecting the state of a device shown according to an exemplary embodiment;
[0028] Figure 6 is Figure 5 A schematic diagram of the waveform of the relevant signals involved in the detection of opening and closing the door shown in the embodiment;
[0029] Figure 7 It is a specific implementation schematic diagram of a method for detecting the state of a device in an application scenario;
[0030] Figure 8 It is a structural block diagram of a device for detecting the state of a device shown according to an exemplary embodiment. Detailed implementation manners
[0031] The following details the embodiments of the present application. The examples of the embodiments are shown in the drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions throughout. The embodiments described by referring to the drawings below are exemplary and are only used to explain the present application, and cannot be construed as a limitation to the present application.
[0032] Those skilled in the art can understand that, unless specifically stated, the singular forms "a", "an", "the" and "said" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of this application means the presence of the stated features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their groups. It should be understood that when we say an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0033] As mentioned above, for the detection of door opening and closing of smart door locks, the traditional technology usually uses reflectivity for detection. The reflectivity refers to the light intensity ratio between the outgoing light emitted by an optical element and the incident light received after reflection of the outgoing light. In scenarios with external interference, the reflectivity will fluctuate greatly due to the interference of light intensity, thus affecting the stability of door opening and closing detection.
[0034] Figure 1 The characteristic curve between light intensity and reflectivity is shown. Generally, the reflectivity increases with the increase of light intensity, and the opening and closing of the door can be detected by a fixed reflectivity threshold, that is, the detection interval is fixed, as Figure 1 shown in 101 in
[0035] However, in scenarios with interference from light sources such as sunlight, the light intensity of the optical signal received by the smart door lock is often very strong, thus making the characteristic curve between light intensity and reflectivity higher than the detection interval, as Figure 1 shown in 102 in
[0036] In scenarios where there is oil stain, water mist, etc. attached to the smart door lock, the light intensity of the optical signal received by the smart door lock will be very weak, thus making the characteristic curve between light intensity and reflectivity lower than the detection interval, as Figure 1 shown in 103 in
[0037] Another scenario is that there is rust, spraying, mirroring, etc. on the surface of the door strike plate. At this time, the light signal received by the smart door lock will fluctuate greatly with the changes in the roughness and color of the door strike plate surface, which may cause the characteristic curve between light intensity and reflectivity to deviate significantly from the detection range. In this case, if the above-mentioned traditional technology is used for detection, it will be judged that the light intensity deviates from the detection area, resulting in abnormal detection.
[0038] From the above, it can be seen that once the light intensity is disturbed by external factors, the characteristic curve between light intensity and reflectivity may deviate from the detection range, thereby causing abnormal door opening and closing detection, and ultimately affecting the stability of door opening and closing detection.
[0039] To this end, the method for detecting the device status provided in the present application is applied to smart door locks, which can effectively improve the stability of door opening and closing detection. Accordingly, the method for detecting the device status is suitable for a device for detecting the device status, and this device for detecting the device status is deployed in the smart door lock.
[0040] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0041] Figure 2 FIG. 1 is a schematic diagram of the structure of a smart door lock shown in an exemplary embodiment. Figure 2 As shown, the smart door lock includes a lock body flap 1, a flap trigger switch 2, an optical element 3, a support 4 and a lock body guide plate 5. The lock body guide plate 5 has a slotted hole for the support 4 to pass through so that the optical element 3 is mounted on the support 4.
[0042] Figure 3 FIG. 1 is a schematic diagram of a device status detection circuit shown in an exemplary embodiment. Figure 3 As shown, in the smart door lock, the device status detection circuit 100 is electrically connected to the optical element 200, and the device status detection circuit 100 includes a processor 110, which is used to implement a method for detecting the device status.
[0043] Specifically, when the user opens or closes the door, the lock body tongue of the smart door lock pops out, thereby triggering the tongue trigger switch of the smart door lock, thereby forming a switch signal.
[0044] For the processor 110, when receiving the switch signal, it outputs the outgoing light signal to the optical element 200, and converts the outgoing light signal into outgoing light through the photoelectric conversion function of the optical element 200, and the outgoing light returns to the optical element 200 through different optical paths. Among them, the different optical paths include at least an internal optical path and an external optical path. The internal optical path refers to the optical path formed between the internal components of the smart door lock, and the external optical path refers to the optical path formed between the smart door lock and the door strike plate. Figure 4In the optical element, a part of the outgoing light is reflected from the outer wall of the support to the receiving tube in the optical element, and the other part of the outgoing light is reflected from the inner wall of the door strike plate to the receiving tube. Based on this, the inner light path refers to the light path formed between the receiving tube and the outer wall of the support, and the outer light path refers to the light path formed between the receiving tube and the inner wall of the door strike plate.
[0045] At the same time, the optical element 200 also receives incident light, part of which is the outgoing light returning to the optical element 200 through different optical paths (such as internal optical paths or external optical paths), and the other part of the incident light is external light (such as sunlight) returning to the optical element 200 through the ambient optical path (that is, the optical path formed by the environment where the smart door lock is located). The optical element 200 converts the received incident light into an incident light signal and returns it to the processor 110, so that the processor 110 can sample and perform light attenuation detection processing on the incident light signal to determine the opening and closing state of the smart door lock (that is, the open state, the closed state), thereby realizing the door opening and closing detection applied to the smart door lock.
[0046] Now, in combination with the above-mentioned smart door lock and its device status detection circuit, the method for detecting the device status is described in detail.
[0047] See also Figure 5 The present application embodiment provides a method for detecting the state of a device, which is applicable to a target device, which may be Figure 2 The smart door lock shown can also be other devices with opening and closing states, which is not limited here.
[0048] In the following method embodiments, for the convenience of description, the execution subject of each step is described as a target device, but this does not constitute a specific limitation.
[0049] like Figure 5 As shown, the method for detecting the device status may include the following steps:
[0050] Step 310: receiving incident light and converting the incident light into an incident light signal.
[0051] When the target device meets the specified conditions, for example, the specified conditions are that the lock body flap of the smart door lock pops out and triggers the flap trigger switch of the smart door lock, an outgoing light signal can be emitted and converted into outgoing light through photoelectric conversion, and the target device can also receive incident light and convert it into incident light signal through photoelectric conversion. The incident light may be the incident light received by the target device after the outgoing light is reflected, or it may be the incident light received by the target device after the ambient light is incident.
[0052] Take smart door lock as an example, please refer to Figure 3, when the locking tongue of the smart door lock pops out, the processor 110 will receive a switch signal and output an outgoing light signal to the optical element 200. For the optical element 200, on the one hand, it emits outgoing light obtained by photoelectric conversion of the outgoing light signal, and at the same time, it also receives and performs photoelectric conversion on the incident light to return the incident light signal obtained by photoelectric conversion to the processor 110. It should be noted that photoelectric conversion is to convert between optical signals and electrical signals. Here, the incident light and the outgoing light are optical signals, while the incident light signal and the outgoing light signal are electrical signals. That is to say, the incident light signal is an electrical signal obtained by photoelectric conversion of the incident light, and the outgoing light signal is an electrical signal obtained by photoelectric conversion of the outgoing light.
[0053] In one embodiment, the outgoing light signal at least includes: a low-level signal sent in a first time period, a high-impedance signal sent in a second time period, and a high-level signal sent in a third time period. Specifically, the low-level signal, the high-impedance signal, and the high-level signal can be periodic signals or square-wave signals.
[0054] For example, as Figure 6 shown, the low-level signal is a square-wave signal including m1 periods, and the voltage value of the low-level signal is V L ; the high-impedance signal is a square-wave signal including m2 periods, and the voltage value of the high-impedance signal is V Z ; the high-level signal is a square-wave signal including m3 periods, and the voltage value of the high-level signal is V H . Among them, the voltage values and the number of periods of the above signals can be flexibly set according to the actual needs of the application scenario, and are not limited here. For example, V L = 0V, m1 = m2 = m3.
[0055] Step 330, sample the incident light signal to obtain at least one set of incident light intensities.
[0056] Among them, each set of incident light intensities includes the light intensities of the incident light incident through at least two optical paths. For example, each set of incident light intensities includes: the light intensity of the incident light incident through the inner optical path and the light intensity of the incident light incident through the outer optical path; or, each set of incident light intensities includes: the light intensity of the incident light incident through the outer optical path and the light intensity of the incident light incident through the ambient optical path; or, the light intensity of the incident light incident through the inner optical path and the light intensity of the incident light incident through the ambient optical path. It should be noted here that what is sampled is the voltage value of the incident light signal. That is to say, the incident light intensity here is actually represented by the voltage value of the incident light signal. That is, the larger the voltage value of the incident light signal, the greater the incident light intensity. It can also be considered that the greater the light intensity of the incident light.
[0057] In one embodiment, each group of incident light intensity includes a first incident light intensity and a second incident light intensity, wherein the first incident light intensity refers to the light intensity of the incident light incident via an internal light path or an external light path, and the second incident light intensity refers to the light intensity of the incident light incident via an ambient light path.
[0058] That is to say, the first incident light intensity corresponds to the incident light coming from the outgoing light returning to the optical element through different optical paths. The different optical paths include an inner optical path and an outer optical path. Specifically, the inner optical path refers to the optical path formed between the receiving tube of the optical element and the outer wall of the support of the smart door lock, and the outer optical path refers to the optical path formed between the receiving tube of the optical element and the inner wall of the door strike plate. Figure 4 shown.
[0059] The second incident light intensity corresponds to the incident light coming from the external light (such as sunlight) returning to the optical element through the ambient light path. The ambient light path refers to the light path formed by the environment where the smart door lock is located.
[0060] In one embodiment, step 330 may include the following steps: sampling the incident light signal 2N times to obtain 2N light intensities; taking two adjacent light intensities among the 2N light intensities as a group of incident light intensities, and taking the light intensity with a larger value in the group of incident light intensities as the first incident light intensity in the group of incident light intensities, to obtain N groups of incident light intensities.
[0061] For example, suppose 2N light intensities are sampled and recorded as L1, L2, L3, L4, ..., L 2N-1 , L 2N .
[0062] Then, assuming L1>L2, the first incident light intensity L r1 = L1, the second incident light intensity L e1 = L2, L1, L2 as the first group of incident light intensity {L r1 , L e1}.
[0063] Similarly, assuming L3>L4, the first incident light intensity L r2 = L3, the second incident light intensity L e2 = L4, L3, L4 as the second group of incident light intensity {L r2 , L e2}.
[0064] By analogy, assuming L 2N-1 >L 2N , then the first incident light intensity L rN =L 2N-1 , the second incident light intensity L eN =L 2N , L2N-1 , L 2N As the intensity of the Nth group of incident light {L rN , L eN}.
[0065] When the above process is completed for all 2N light intensities, N groups of incident light intensities are obtained.
[0066] Step 350: Perform optical attenuation detection processing on at least one group of incident light intensities to obtain an optical attenuation detection result.
[0067] Among them, the optical attenuation detection result is used to indicate the light intensity ratio between the outgoing light and the incident light incident through any one optical path. In one embodiment, the optical attenuation detection result is the external optical path attenuation rate, and the external optical path attenuation rate is used to indicate the light intensity ratio between the outgoing light and the incident light incident through the external optical path.
[0068] In one embodiment, the arithmetic processing process of the optical attenuation detection result is implemented through a luminous flux model. The luminous flux model is used to indicate the light intensity ratio between the outgoing light signal and the incident light incident through different optical paths in the open / closed state of the target device, so as to describe the attenuation of the outgoing light to the incident light during transmission through different optical paths.
[0069] The construction process of the luminous flux model is described as follows:
[0070] First, for the sake of convenience of description, the following symbols are defined:
[0071] The light intensity of the outgoing light is denoted as L t , and the light intensity of the incident light is denoted as L r .
[0072] For the incident light, the light intensity of the incident light incident through the internal optical path is denoted as L i , the light intensity of the incident light incident through the external optical path is denoted as L o , and the light intensity of the incident light incident through the environmental optical path is denoted as L e .
[0073] For different optical paths, the light intensity ratio between the incident light and the outgoing light of each optical path is defined as the "attenuation rate". Specifically, the internal optical path attenuation rate is denoted as A i , and the external optical path attenuation rate is denoted as A o . It should be noted that since the incident light incident through the environmental optical path comes from external light rather than from the reflection of the outgoing light, there is no corresponding attenuation rate for the environmental optical path.
[0074] As described above, on the one hand, regarding the outgoing light, the outgoing light will return to the optical element through different optical paths. A part of the outgoing light returns to the optical element via the inner optical path, and another part of the outgoing light returns to the optical element via the outer optical path. On the other hand, regarding the incident light, a part of the incident light is the outgoing light that returns to the optical element through the inner optical path or the outer optical path, and another part of the incident light is the external light that returns to the optical element through the environmental optical path. Based on this, the light intensities of the outgoing light and incident light related to the inner optical path, outer optical path, and environmental optical path are summarized to obtain the following light flux model:
[0075] L t = L i + L o ;
[0076] L r = L i (1 - A i ) + L o (1 - A o ) + L e .
[0077] It should be understood that taking an intelligent door lock as an example, when the intelligent door lock is closed, such as when closing the door, the outgoing light will be reflected back to the optical element through different optical paths; when opening the door, the outgoing light is not reflected. At this time, the incident light basically comes from the external light. Therefore, determining whether the door is opened or closed is related to the attenuation rate A o of the outer optical path. That is, when the intelligent door lock is in the open state, since there are almost no reflecting surfaces, A o approaches 1; while when the intelligent door lock is in the closed state, the calculated A o is significantly smaller. Thus, the light flux model is converted into the following calculation formula (1):
[0078]
[0079] where L r is the first incident light intensity, and L e is the second incident light intensity.
[0080] A i is the attenuation rate of the inner optical path, which is related to the inherent characteristics of the support. When the structure of the support is fixed, A i is a calibratable constant.
[0081] L o is the light intensity of the incident light entering via the outer optical path, which is a calibratable variable. At the same time, when the optical structure is fixed, the splitting ratio between the inner optical path and the outer optical path is also fixed, that is, the ratio of L i to L o is a constant, denoted as Then L t can also be converted into a calibratable variable, that is, L t= L i + L o = (1 + k)L o 。
[0082] Based on this, the calculation formula (1) can be further transformed into the following calculation formula (2):
[0083]
[0084] After determining the luminous flux model represented by the calculation formula (2), the attenuation rate of the external optical path can be calculated and used as the optical attenuation detection result. In one embodiment, step 350 may include the following steps: input each group of incident light intensities into the luminous flux model for attenuation rate calculation processing to obtain multiple grouped attenuation rates, each grouped attenuation rate corresponding to a group of incident light intensities; perform fusion processing on the multiple grouped attenuation rates to obtain the attenuation rate of the external optical path. Among them, the fusion processing refers to average calculation processing.
[0085] Still taking the aforementioned example for illustration, assume that N groups of incident light intensities are obtained, denoted as {L r1 , L e1}, {L r2 , L e2}, ……, {L rN , L eN}.
[0086] For the first group of incident light intensities {L r1 , L e1}, the corresponding first grouped attenuation rate
[0087] Similarly, for the second group of incident light intensities {L r2 , L e2}, the corresponding second grouped attenuation rate
[0088] ……, for the Nth group of incident light intensities {L rN , L eN}, the corresponding Nth grouped attenuation rate
[0089] After obtaining the N grouped attenuation rates corresponding to the N groups of incident light intensities, the attenuation rate of the external optical path A0 = (A 01 + A 02 + …… + A 0N ) / N, as the optical attenuation detection result.
[0090] Step 370, determine the opening and closing state of the target device according to the optical attenuation detection result.
[0091] First, the light attenuation detection result is used to indicate the light intensity ratio between the outgoing light and the incident light incident via any optical path. In one embodiment, the light attenuation detection result is the external optical path attenuation rate, which is used to indicate the light intensity ratio between the outgoing light and the incident light incident via the external optical path.
[0092] Secondly, the device state includes a normal state. In one embodiment, the normal state includes an open state and a closed state.
[0093] After determining the light attenuation detection result, the open and closed state of the target device can be detected. In one embodiment, the light attenuation detection result is the external light path attenuation rate. If the external light path attenuation rate is greater than the set attenuation rate, the target device is determined to be in the open state; conversely, if the external light path attenuation rate is less than or equal to the set attenuation rate, the target device is determined to be in the closed state. The set attenuation rate can be flexibly adjusted according to the actual needs of the application scenario and is not limited here.
[0094] Through the above process, the light attenuation detection result not only takes into account external factors, such as sunlight, oil stains, water mist, etc. that come into contact with the smart door lock, but also takes into account internal factors, such as the smart door lock's own structure, door strike plate characteristics, etc., to avoid detecting the door state based on reflectivity represented by a single light intensity, so that the door opening and closing detection scheme also covers the impact of related abnormal conditions such as external light sources and obstacle reflections on the detection, effectively enhancing the robustness and adaptability of the door opening and closing detection scheme, thereby effectively solving the problem of poor stability of door opening and closing detection applied to smart door locks in related technologies.
[0095] In an exemplary embodiment, after step 330, the method for detecting the device status may further include the following steps:
[0096] Based on at least one set of incident light intensities, abnormal state detection is performed on the target device.
[0097] The device status also includes an abnormal status.
[0098] In one embodiment, the abnormal state includes a first abnormal state, a second abnormal state, and a saturated state. The first abnormal state is used to indicate that the first component of the target device is damaged, the second abnormal state is used to indicate that the second component of the target device is damaged, and the saturated state is used to indicate that the light intensity of the environment where the target device is located is saturated. Taking the target device as a smart door lock as an example, the first abnormal state is used to indicate that the light emitting circuit of the optical element in the smart door lock is damaged, the second abnormal state is used to indicate that the receiving circuit of the optical element in the smart door lock is damaged, and the saturated state is used to indicate that the light intensity of the environment where the smart door lock is located is saturated.
[0099] Specifically, in each group of incident light intensities, if the first incident light intensity is equal to the second incident light intensity and the first incident light intensity is not equal to the first set value, it is determined that the target device is in the first abnormal state; or if the first incident light intensity is equal to the second incident light intensity and the first incident light intensity is equal to the second set value, it is determined that the target device is in the second abnormal state; or if the first incident light intensity is equal to the second incident light intensity and the first incident light intensity is equal to the third set value, it is determined that the target device is in the saturation state.
[0100] In one embodiment, the first set value is zero. In one embodiment, the second set value is zero. In one embodiment, the third set value is the power supply voltage value, where the power supply voltage value refers to the voltage value of the power supply that powers the target device.
[0101] Still taking the previous example for illustration, assume that N groups of incident light intensities are obtained, denoted as {L r1 , L e1}, {L r2 , L e2}, ……, {L rN , L eN}.
[0102] The first case:
[0103] Let the first set value = 0. If in the first group of incident light intensities, L r1 = L e1 ≠ 0;
[0104] In the second group of incident light intensities, L r2 = L e2 ≠ 0;
[0105] ……, in the Nth group of incident light intensities, L rN = L eN ≠ 0, then it is determined that the target device is in the first abnormal state.
[0106] The second case:
[0107] Let the second set value = 0. If in the first group of incident light intensities, L r1 = L e1 = 0;
[0108] In the second group of incident light intensities, L r2 = L e2 = 0;
[0109] ……, in the Nth group of incident light intensities, L rN = L eN = 0, then it is determined that the target device is in the second abnormal state.
[0110] The third case:
[0111] Let the third set value = VCC. If among the first group of incident light intensities, L r1 = L e1 = VCC;
[0112] Among the second group of incident light intensities, L r2 = L e2 = VCC;
[0113] ……, among the Nth group of incident light intensities, L rN = L eN = VCC, then it is determined that the target device is in a saturated state.
[0114] Under the action of the above embodiments, the detection of the abnormal state of the target device is realized, so that extreme working conditions such as damage and inoperability of optical elements can be discovered in time, and the "either 0 or 1" judgment method for door opening and closing detection in the related art is solved, that is, the detection of the device state only has the judgment methods of "open state" and "closed state", which further effectively improves the stability of door opening and closing detection.
[0115] Furthermore, after detecting the device state, in an application scenario, the intelligent door lock can generate a state message according to the detected device state and feedback the state message to the client associated with the intelligent door lock, which can also be considered as the user's terminal, so that the user can timely learn the specific situation of the intelligent door lock. Through active operations, for example, when the door state is the first abnormal state / second abnormal state, actively submit a maintenance request, thereby reducing the error probability of the intelligent door lock.
[0116] Please refer back to Figure 6 , the emitted optical signal includes: a low-level signal sent in the first time period, that is, a square wave signal including m1 cycles, and the voltage value is V L ; a high-impedance signal sent in the second time period, that is, a square wave signal including m2 cycles, and the voltage value is V Z ; a high-level signal sent in the third time period, that is, a square wave signal including m3 cycles, and the voltage value is V H. Correspondingly, the signal waveform presented by the incident optical signal is basically the same as the signal waveform presented by the output optical signal. Here, the inventor realizes that during abnormal state detection, only when the first incident light intensity and the second incident light intensity in each group of incident light intensities are equal, and the first incident light intensity is equal to the third set value, it is determined that the target device is in a saturated state, that is, the light intensity in the environment where the target device is located is saturated. However, since the voltage value of the square wave signal in the output optical signal gradually increases with the change of the time period, it can be understood that the light intensity will also gradually increase with the change of the time period. There may be a situation where the light intensity in the environment where the target device is located reaches saturation only in a certain time period. Then, the incident optical signal with saturated light intensity may cause an abnormality in the device state detection.
[0117] Based on this, in an exemplary embodiment, before step 350, the method for detecting the state of the device may further include the following steps:
[0118] Check the incident light intensity sampled in the third time period according to the voltage value of the high-impedance signal and the voltage value of the high-level signal, and obtain a check result.
[0119] Among them, the check result is used to indicate whether there is saturated light intensity in the environment where the target device is located in the third time period.
[0120] If the check result indicates that there is saturated light intensity in the environment where the target device is located in the third time period, delete the incident light intensity sampled in the third time period. At this time, the light attenuation detection result can be calculated according to at least one group of incident light intensities sampled in the first time period, and / or according to at least one group of incident light intensities sampled in the second time period.
[0121] On the contrary, if the check result indicates that there is no saturated light intensity in the environment where the target device is located in the third time period, the light attenuation detection result can be calculated according to at least one group of incident light intensities sampled in any one or more time periods, for example, at least one group of incident light intensities sampled in the third time period.
[0122] For example, assume that 3N groups of incident light intensities are obtained. In the first time period, N groups of incident light intensities sampled by the low-level signal are denoted as {L r11 , L e11}, {L r12 , L e12}, ……, {L r1N , L e1N}; in the second time period, N groups of incident light intensities sampled by the high-impedance signal are denoted as {L r21 , L e21}, {L r22 , L e22}, ……, {L r2N, L e2N}; In the third time period, N groups of incident light intensities obtained by sampling the high-level signal are denoted as {L r31 , L e31}, {L r32 , L e32}, ……, {L r3N , L e3N}.
[0123] Let the voltage value of the high-impedance signal be V Z , and the voltage value of the high-level signal be V H , then:
[0124] When (L r2i - L e2i ):(L r3i - L e3i ) > V Z :V H , i ∈ {1, 2,..., N}, the verification result indicates that there is light intensity saturation in the environment where the target device is located in the third time period.
[0125] Conversely, when (L r2i - L e2i ):(L r3i - L e3i ) = V Z :V H , i ∈ {1, 2,..., N}, the verification result indicates that there is no light intensity saturation in the environment where the target device is located in the third time period.
[0126] Through the cooperation of the above embodiments, the verification of the incident light signals received in different time periods is realized, and the incident light signals with light intensity saturation are excluded from participating in the door opening and closing detection, which can effectively avoid abnormal device state detection, thereby contributing to the further improvement of the stability of device state detection.
[0127] Figure 7 Shows a specific implementation diagram of a method for detecting the state of a device in an application scenario. Taking an intelligent door lock as the target device, now in combination with Figure 7 , the process of door opening and closing detection applied to the intelligent door lock in this application scenario is described as follows:
[0128] As Figure 7 shown, when the locking tongue of the intelligent door lock pops out, after waiting for 100 ms to stabilize the door state, an outgoing light signal can be sent to the optical element of the intelligent door lock, and 6N samplings are performed based on the incident light signal received by the optical element to obtain 6N light intensities, that is, step 501 is executed. As Figure 6 shown, the outgoing light signal includes: a low-level signal sent in the first time period, that is, a square wave signal including m1 cycles, with a voltage value of VL ; The high-impedance signal sent in the second time period, i.e., a square wave signal containing m2 cycles, with a voltage value of V Z ; The high-level signal sent in the third time period, i.e., a square wave signal containing m3 cycles, with a voltage value of V H . Among them, m1 = m2 = m3 = N, V L = 0.
[0129] Through step 502, the abnormal state of the door state is detected according to 6N light intensities. Specifically, let the third set value = VCC. If all 6N light intensities are VCC, it is determined that the intelligent door lock is in a saturated state, i.e., 511.
[0130] Otherwise, through step 503, continue to detect the abnormal state of the door state according to 6N light intensities. Specifically, take 2 adjacent light intensities among the 6N light intensities as a group of incident light intensities, and take the larger light intensity value in this group of incident light intensities as the first incident light intensity in this group of incident light intensities, obtaining 3N groups of incident light intensities.
[0131] Furthermore, through step 504 and step 505, let the second set value = 0. If in the 3N groups of incident light intensities, the first incident light intensity = the second incident light intensity = 0, it is determined that the intelligent door lock is in a second abnormal state, i.e., 512, indicating that the receiving circuit is damaged; let the first set value = 0. If in the 3N groups of incident light intensities, the first incident light intensity = the second incident light intensity ≠ 0, it is determined that the intelligent door lock is in a first abnormal state, i.e., 513, indicating that the light-emitting circuit is damaged.
[0132] Through steps 506 to 507, the 3N groups of incident light intensities are verified to determine whether there is light intensity saturation in the environment where the intelligent door lock is located in the third time period. It can also be considered to determine whether the ratio of the incident light intensities sampled in different time periods is consistent with the ratio of the voltage values of the outgoing light signals.
[0133] If they are inconsistent, that is, in (L r2i -L e2i ):(L r3i -L e3i ) > V Z :V H , when i ∈ {1, 2,..., N}, the verification result indicates that there is light intensity saturation in the environment where the intelligent door lock is located in the third time period, then delete the incident light intensities sampled in the third time period, and calculate the external optical path attenuation rate according to at least one group of incident light intensities sampled in the second time period.
[0134] If they are consistent, that is, in (L r2i -L e2i ):(L r3i -Le3i ) = V Z : V H When \(i\in\{1, 2, \ldots, N\}\), if the verification result indicates that there is no light intensity saturation in the third time period in the environment where the intelligent door lock is located, then according to at least one set of incident light intensities sampled in the third time period, the external optical path attenuation rate is calculated.
[0135] Through step 508, after obtaining N sets of incident light intensities, the specific process of calculating the external optical path attenuation rate includes: inputting each set of incident light intensities (denoted as \(\{L r1 , L e1}\), \(\{L r2 , L e2}\), \(\ldots\), \(\{L rN , L eN \}\)) into the light flux model for attenuation rate operation processing, to obtain N grouped attenuation rates (denoted as \(A 01 , A 02 , \(\ldots\), A 0N \)), and each grouped attenuation rate corresponds to a set of incident light intensities; perform an averaging operation on the N grouped attenuation rates to obtain the external optical path attenuation rate \(A_0\). Among them, the expression of the light flux model can be:
[0136] Through step 509, based on the external optical path attenuation rate, door opening and closing detection is performed. Specifically, when the external optical path attenuation rate is greater than the set attenuation rate, it is determined that the intelligent door lock is in the open state, that is, 515; conversely, when the external optical path attenuation rate is less than or equal to the set attenuation rate, it is determined that the intelligent door lock is in the closed state, that is, 514.
[0137] In this application scenario, the door opening and closing detection scheme simultaneously covers the impacts of relevant abnormal situations such as external light source types and obstacle reflections on the detection, effectively enhancing the robustness and adaptability of the door opening and closing detection scheme. At the same time, it solves the "either 0 or 1" judgment method in the related technology for door opening and closing detection, that is, it solves the judgment method where the door state has only "open state" and "closed state", thereby effectively improving the stability of the door opening and closing detection applied to intelligent door locks.
[0138] The following is an apparatus embodiment of the present application, which can be used to execute the method for detecting the state of the device involved in the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the method embodiment of the method for detecting the state of the device involved in the present application.
[0139] Please refer to Figure 8 , in the embodiment of the present application, a device 600 for detecting the state of a device is provided, including but not limited to: a signal transceiver module 610, a signal sampling module 630, an optical attenuation detection module 650, and a state detection module 670.
[0140] Among them, the signal transceiver module 610 is configured to receive incident light and convert the incident light into an incident light signal.
[0141] The signal sampling module 630 is configured to sample the incident light signal to obtain at least one set of incident light intensities, and each set of incident light intensities includes the light intensities of the incident light incident through at least two optical paths.
[0142] The optical attenuation detection module 650 is configured to perform optical attenuation detection processing on at least one set of incident light intensities to obtain an optical attenuation detection result, and the optical attenuation detection result is used to indicate the light intensity ratio between the outgoing light and the incident light incident through any one of the optical paths.
[0143] The state detection module 670 is configured to determine the opening and closing state of the target device according to the optical attenuation detection result.
[0144] In an exemplary embodiment, each set of incident light intensities includes a first incident light intensity and a second incident light intensity. The first incident light intensity refers to the light intensity of the incident light incident through the inner optical path or the outer optical path, and the second incident light intensity refers to the light intensity of the incident light incident through the environmental optical path.
[0145] In an exemplary embodiment, the device further includes: an abnormal state detection module, configured to perform abnormal state detection on the target device based on at least one set of incident light intensities, and the abnormal state includes at least one of the following: a first abnormal state, a second abnormal state, and a saturation state; wherein, the first abnormal state is used to indicate an abnormality of a first component of the target device, the second abnormal state is used to indicate an abnormality of a second component of the target device, and the saturation state is used to indicate that the light intensity of the environment where the target device is located is saturated.
[0146] In an exemplary embodiment, the abnormal state detection module includes: a first abnormal unit, configured to determine that the target device is in the first abnormal state if, in each set of incident light intensities, the first incident light intensity is equal to the second incident light intensity and the first incident light intensity is not equal to a first set value; or a second abnormal unit, configured to determine that the target device is in the second abnormal state if the first incident light intensity is equal to the second incident light intensity and the first incident light intensity is equal to a second set value; or a third abnormal unit, configured to determine that the target device is in the saturation state if the first incident light intensity is equal to the second incident light intensity and the first incident light intensity is equal to a third set value.
[0147] In an exemplary embodiment, the signal sampling module includes: a sampling unit configured to perform multiple samplings on the incident optical signal to obtain multiple light intensities; a traversing unit configured to perform a traversing step on the multiple light intensities, the traversing step including: taking the first light intensity and the second light intensity as a first set of incident light intensities, and taking the light intensity with a larger value in the first set of incident light intensities as the first incident light intensity in the first set of incident light intensities; taking the third light intensity and the fourth light intensity as a second set of incident light intensities, and taking the light intensity with a larger value in the second set of incident light intensities as the first incident light intensity in the second set of incident light intensities; until the traversing step is completed to obtain at least one set of incident light intensities.
[0148] In an exemplary embodiment, the device further includes: a signal sending unit configured to output an outgoing optical signal and convert the outgoing optical signal into outgoing light, the outgoing optical signal including: a low-level signal sent in a first time period, a high-impedance signal sent in a second time period, and a high-level signal sent in a third time period.
[0149] In an exemplary embodiment, the device further includes: a verification module configured to verify the incident light intensity sampled in the third time period according to the voltage value of the high-impedance signal and the voltage value of the high-level signal to obtain a verification result, the verification result being used to indicate whether there is light intensity saturation in the environment where the target device is located in the third time period.
[0150] In an exemplary embodiment, the device further includes: a deletion module configured to delete the incident light intensity sampled in the third time period if the verification result indicates that there is light intensity saturation in the environment where the target device is located in the third time period; correspondingly, the light attenuation detection module is configured to calculate the light attenuation detection result according to at least one set of incident light intensities sampled in the first time period, and / or according to at least one set of incident light intensities sampled in the second time period.
[0151] In an exemplary embodiment, the light attenuation detection module includes: an attenuation rate calculation unit configured to input each set of incident light intensities into a light flux model for attenuation rate calculation processing to obtain multiple grouped attenuation rates, each grouped attenuation rate corresponding to a set of incident light intensities, the light flux model being used to indicate the light intensity ratio between the outgoing light and the incident light incident through different optical paths in the open / closed state of the target device; a fusion unit configured to perform a fusion process on the multiple grouped attenuation rates to obtain an external optical path attenuation rate as the light attenuation detection result, the external optical path attenuation rate being used to indicate the light intensity ratio between the outgoing light and the incident light incident through the external optical path.
[0152] It should be noted that the device for detecting the device status provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when performing device status detection. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device for detecting the device status will be divided into different functional modules to complete all or part of the functions described above.
[0153] In addition, the apparatus for detecting device status and the method for detecting device status provided in the above embodiments belong to the same concept, wherein the specific manner in which each module performs operations has been described in detail in the method embodiments and will not be repeated here.
[0154] In addition, a lock is provided in an embodiment of the present application. The lock includes a processor, and the processor is used to implement the method for detecting the device status in the above embodiments.
[0155] In an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for detecting the status of a device in the above-mentioned embodiments is implemented.
[0156] In an embodiment of the present application, a computer program product is provided, the computer program product includes a computer program, the computer program is stored in a storage medium. A processor of a computer device reads the computer program from the storage medium, and the processor executes the computer program, so that the computer device executes the method for detecting the device status in the above embodiments.
[0157] Compared with related technologies, on the one hand, the light attenuation detection results not only take into account external factors, such as sunlight, oil stains, water mist, etc. that come into contact with the smart door lock, but also internal factors, such as the smart door lock's own structure, door strike plate characteristics, etc., to avoid detecting the door state based on the reflectivity represented by a single light intensity, thereby effectively improving the stability of door opening and closing detection; on the other hand, each group of incident light intensity includes a first incident light intensity and a second incident light intensity, so as to detect abnormal conditions of the smart door lock, thereby being able to promptly detect extreme conditions such as damage to optical components in the smart door lock and inability to work, further effectively improving the stability of door opening and closing detection.
[0158] It should be understood that although the steps in the flowchart of the accompanying drawings are shown sequentially in the direction of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise clearly stated in this document, there is no strict order restriction for the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0159] The above are only some embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A method for detecting the status of a device, characterized in that, The method comprises: Receiving incident light and converting the incident light into an incident light signal; The incident light signal is sampled to obtain at least one group of incident light intensities, each group of incident light intensities includes a first incident light intensity and a second incident light intensity, the first incident light intensity refers to the light intensity of the incident light incident via an internal light path or an external light path, and the second incident light intensity refers to the light intensity of the incident light incident via an ambient light path; the internal light path refers to a light path formed between internal components of the lock, and the external light path refers to a light path formed between the lock and a door strike plate; Calculating an external light path attenuation rate according to a first incident light intensity and a second incident light intensity in at least one group of incident light intensities, and using the calculated external light path attenuation rate as a light attenuation detection result; the external light path attenuation rate is used to indicate a light intensity ratio between an outgoing light and an incident light incident via the external light path; The open / closed state of the lock is determined according to the light attenuation detection result.
2. The method according to claim 1, characterized in that, After sampling the incident light signal to obtain at least one set of incident light intensities, the method further includes: In each group of incident light intensities, abnormal state detection is performed on the lock by comparing the first incident light intensity, the second incident light intensity, the first set value, the second set value, and the third set value, wherein the abnormal state includes at least one of the following: a first abnormal state, a second abnormal state, and a saturation state; The first abnormal state is used to indicate that the first component of the lock is abnormal, the second abnormal state is used to indicate that the second component of the lock is abnormal, and the saturated state is used to indicate that the light intensity of the environment where the lock is located is saturated; The first component is a light emitting circuit of an optical element in the lock, and the second component is a receiving circuit of the optical element in the lock.
3. The method according to claim 2, characterized in that, The abnormal state detection of the lock is performed by comparing the first incident light intensity, the second incident light intensity, the first set value, the second set value, and the third set value in each group of incident light intensities, including: In each group of incident light intensities, if the first incident light intensity is equal to the second incident light intensity and the first incident light intensity is not equal to the first set value, it is determined that the lock is in the first abnormal state; or If the first incident light intensity is equal to the second incident light intensity, and the first incident light intensity is equal to the second set value, determining that the lock is in the second abnormal state; or If the first incident light intensity is equal to the second incident light intensity, and the first incident light intensity is equal to the third set value, it is determined that the lock is in the saturation state.
4. The method according to claim 1, characterized in that, The sampling of the incident light signal to obtain at least one set of incident light intensities includes: Sampling the incident light signal multiple times to obtain light intensities corresponding to multiple incident lights; A traversal step is performed on a plurality of light intensities, the traversal step comprising: Taking the first light intensity and the second light intensity as a first group of incident light intensities, and taking the light intensity with a larger value in the first group of incident light intensities as a first incident light intensity in the first group of incident light intensities; Using the third light intensity and the fourth light intensity as a second group of incident light intensities, and using the light intensity with a larger value in the second group of incident light intensities as the first incident light intensity in the second group of incident light intensities; Until the traversal step is completed, at least one set of incident light intensities is obtained.
5. The method according to claim 1, characterized in that, The method further comprises: An outgoing light signal is output and converted into outgoing light, wherein the outgoing light signal includes: a low level signal sent in a first time period, a high impedance signal sent in a second time period, and a high level signal sent in a third time period.
6. The method according to claim 5, characterized in that, Before calculating the external light path attenuation rate according to the first incident light intensity and the second incident light intensity in at least one group of incident light intensities and using the calculated external light path attenuation rate as the light attenuation detection result, the method further includes: The incident light intensity sampled in the third time period is verified according to the voltage value of the high impedance signal and the voltage value of the high level signal to obtain a verification result, and the verification result is used to indicate whether there is light intensity saturation in the environment where the lock is located in the third time period.
7. The method according to claim 6, characterized in that, The method further comprises: If the verification result indicates that the environment where the lock is located has light intensity saturation in the third time period, deleting the incident light intensity sampled in the third time period; The step of calculating the external light path attenuation rate according to the first incident light intensity and the second incident light intensity in at least one group of incident light intensities, and taking the calculated external light path attenuation rate as the light attenuation detection result, comprises: The light attenuation detection result is calculated based on at least one group of incident light intensities sampled during the first time period, and / or based on at least one group of incident light intensities sampled during the second time period.
8. The method according to any one of claims 1 to 7, characterized in that, The step of calculating the external light path attenuation rate according to the first incident light intensity and the second incident light intensity in at least one group of incident light intensities, and taking the calculated external light path attenuation rate as the light attenuation detection result, comprises: Input the incident light intensity of each group into the luminous flux model for attenuation rate calculation to obtain multiple grouped attenuation rates, where each grouped attenuation rate corresponds to a group of incident light intensities. The luminous flux model is used to indicate the light intensity ratio between the outgoing light and the incident light incident through different optical paths in the open / closed state of the lock; the luminous flux model is expressed as , where A oi represents the grouped attenuation rate, A i represents the inner optical path attenuation rate, L r represents the first incident light intensity, L e represents the second incident light intensity, L i represents the light intensity of the incident light incident through the inner optical path, L o represents the light intensity of the incident light incident through the outer optical path, k represents the ratio of L i to L o ; A plurality of grouped attenuation rates are fused to obtain an external optical path attenuation rate as the optical attenuation detection result.
9. A device for detecting the status of a device, characterized in that, The device comprises: A signal receiving module, used for receiving incident light and converting the incident light into an incident light signal; a signal sampling module, used for sampling the incident light signal to obtain at least one group of incident light intensities, each group of incident light intensities including a first incident light intensity and a second incident light intensity, wherein the first incident light intensity refers to the light intensity of the incident light incident via an internal light path or an external light path, and the second incident light intensity refers to the light intensity of the incident light incident via an ambient light path; the internal light path refers to the light path formed between internal components of the lock, and the external light path refers to the light path formed between the lock and the door strike plate; A light attenuation detection module, used to calculate an external light path attenuation rate according to a first incident light intensity and a second incident light intensity in at least one group of incident light intensities, and to use the calculated external light path attenuation rate as a light attenuation detection result; the external light path attenuation rate is used to indicate a light intensity ratio between an outgoing light and an incident light incident via the external light path; A state detection module is used to determine the open or closed state of the lock according to the light attenuation detection result.
10. A lock, characterized in that, The lock comprises a lock body flap, a processor and an optical element, wherein: The processor is configured to output an emitted light signal to the optical element if a switch signal indicating that the locking tongue of the lock body pops out is received. The optical element is configured to convert the emitted light signal into emitted light, and convert the received incident light into an incident light signal, so as to return the incident light signal to the processor, enabling the processor to perform sampling and optical attenuation detection processing on the incident light signal according to the method for detecting the state of the detection device according to any one of claims 1 to 8, and determining the opening and closing state of the lock.
11. A lock, characterized in that, The lock includes a processor, and the processor is configured to implement the method for detecting the state of the detection device according to any one of claims 1 to 8.
12. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method for detecting the state of the detection device according to any one of claims 1 to 8.
Citation Information
Patent Citations
Switch door detection device based on laser
CN204680082U
Lock
CN217712125U