Method and system for door lock and card cooperative processing
By using a hash algorithm to calculate multicast addresses and fake source IP addresses in the smart lock system, constructing a routing table, and sending IGMPv3 report messages, the problems of low efficiency in cross-device communication and cumbersome authorization verification are solved, enabling efficient and secure cross-lock collaborative operation and improving the system's response speed and reliability.
Patent Information
- Application Number
- CN202511348708.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2045-09-17
AI Technical Summary
Existing smart lock systems suffer from low cross-device communication efficiency, cumbersome permission verification processes, and imperfect temporary authorization mechanisms, resulting in high response latency and easy service interruption during network anomalies, making it difficult to achieve fast and secure cross-lock collaborative operation.
By detecting doorbell button operation and neighbor RFID card information through the first door lock, the robot summoning process is triggered. The multicast address and fake source IP address are calculated using a hash algorithm to generate a set of communication parameters, build a routing table, and send an IGMPv3 report message to realize cross-door lock request forwarding and confirmation, ensuring efficient and secure authorization verification and message transmission.
It enables efficient, secure, and low-latency cross-lock collaborative operation, ensuring the accuracy and rapid response of robot summoning authorization, and improving system reliability and user experience.
Smart Images

Figure CN120853293B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of intelligent door locks, and particularly relates to a method and system for door lock and card cooperative processing. BACKGROUND
[0002] In modern smart home and community management systems, the cooperative application of door locks and smart cards is increasingly widespread, but the existing technology has problems such as low cross-device communication efficiency, cumbersome permission verification process, and imperfect temporary authorization mechanism. Traditional door lock systems usually use a centralized server for permission verification and instruction forwarding, resulting in high response delay and easy service interruption in network anomalies. For scenarios such as neighbor delivery of express delivery and temporary visitor assistance, existing solutions mostly rely on fixed IP addresses or Bluetooth pairing, making it difficult to achieve fast and secure cross-door lock cooperative operation. SUMMARY
[0003] The purpose of the present application is to provide a method and system for door lock and card cooperative processing to solve the problems in the prior art and achieve efficient, secure, and low-latency cross-door lock cooperative operation.
[0004] One embodiment of the present application provides a method for door lock and card cooperative processing, the method comprising:
[0005] Triggering process and permission verification: based on the preset number of doorbell button operations detected by the first door lock and the neighbor RFID card information read, triggering the process of calling a robot on behalf of others, and verifying the matching result of the RFID card and the resident registration table to generate a permission verification pass signal;
[0006] Multicast address and false source IP generation: based on the ID number of the RFID card, calculating the target multicast address through a hash algorithm, and converting the ID number of the RFID card into a false source IP address using a segment mapping method to obtain a communication parameter set containing the multicast address and the false source IP;
[0007] Multicast message sending and routing table construction: according to the communication parameter set, sending an IGMPv3 report message carrying the false source IP and the multicast address to the router, triggering the router to generate a (S, G) multicast forwarding table entry and bind it to the receiving interface, where S is the false source IP and G is the target multicast address;
[0008] Cross-door lock request forwarding and confirmation: based on the triggering operation of the same RFID card detected by the second door lock to be assisted, generating a request assistance multicast message containing the multicast address and the false source IP, forwarding it to the first door lock through the router matching the (S, G) forwarding table entry, and sending an assistance confirmation message to the second door lock by the first door lock to complete the robot calling authorization.
[0009] Optionally, the triggering process and permission verification include:
[0010] Button operation detection: When the first door lock detects two consecutive doorbell button operations within a preset time, a 30-second countdown is started and the RFID card reading module is activated;
[0011] RFID matching verification: The RFID card ID number is read and compared with the resident registration table. If the matching is successful, a permission verification pass signal is generated, otherwise the process is terminated;
[0012] Cache proxy call event: Record proxy call event information, including RFID card ID number, multicast address, fake source IP and validity period, and start countdown monitoring. The validity period is updated synchronously with the routing table entry validity period.
[0013] Optionally, the multicast address and fake source IP generation includes:
[0014] Multicast address calculation: Convert the reference IP address 226.1.1.0 to a 32-bit binary constant U, concatenate it with the 32-bit binary representation V of the RFID card ID number to form a 64-bit data stream, calculate the hash value by CRC32 hash algorithm and take modulo 256, and get X in the multicast address 226.1.1.X;
[0015] Fake source IP generation: Perform CRC32 hash calculation on the RFID card ID number, split the result into four 8-bit segments and convert them to decimal numbers to generate a fake source IP address;
[0016] Parameter binding: Associate the multicast address with the fake source IP address to form a communication parameter set.
[0017] Optionally, the multicast message sending and routing table construction includes:
[0018] IGMPv3 message encapsulation: Encapsulate the fake source IP address, multicast address and validity period of 30 seconds into the IGMPv3 report message;
[0019] Routing table update: The router parses the IGMPv3 message, creates an (S, G) entry in the multicast forwarding table and binds it to the receiving interface, and sets the 30-second validity period;
[0020] Abnormal conflict processing: If the same (S, G) entry is detected to exist, refresh the validity period of 30 seconds.
[0021] Optionally, the cross-door lock request forwarding and confirmation includes:
[0022] Cross-door lock operation synchronization: After the assisted second door lock detects two doorbell operations of the same RFID card, a request assistance message containing the same multicast address and fake source IP is generated;
[0023] Router accurate forwarding: the router directs the request message to the interface corresponding to the first door lock according to the (S, G) forwarding table entry;
[0024] Assisted confirmation and task triggering: the first door lock sends a confirmation message to the second door lock after verifying the validity of the RFID card, and the second door lock initiates a robot dispatch request to the platform accordingly.
[0025] Another embodiment of the present application provides a door lock and card cooperative processing system, which comprises:
[0026] The verification module is configured to trigger process and permission verification: based on the preset number of doorbell button operations detected by the first door lock and the neighbor RFID card information read, a process of calling a robot on behalf is triggered, and the matching result of the RFID card and the resident registration table is verified to generate a permission verification pass signal;
[0027] The generation module is configured to generate multicast address and fake source IP: based on the ID number of the RFID card, a target multicast address is calculated through a hash algorithm, and the ID number of the RFID card is converted into a fake source IP address by using a segment mapping method to obtain a communication parameter set containing the multicast address and the fake source IP;
[0028] The sending module is configured to send multicast message and construct routing table: based on the communication parameter set, an IGMPv3 report message carrying the fake source IP and the multicast address is sent to the router to trigger the router to generate a (S, G) multicast forwarding table entry and bind to a receiving interface, wherein S is the fake source IP and G is the target multicast address;
[0029] The forwarding module is configured to forward cross-door lock request and confirmation: based on the trigger operation of the same RFID card detected by the assisted second door lock, a request assistance multicast message containing the multicast address and the fake source IP is generated, which is forwarded to the first door lock through the router matching the (S, G) forwarding table entry, and the first door lock sends an assistance confirmation message to the second door lock to complete the robot calling authorization.
[0030] Another embodiment of the present application provides a storage medium, which stores a computer program, wherein the computer program is configured to execute the method described in any one of the above embodiments when running.
[0031] Another embodiment of the present application provides an electronic device, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to execute the method described in any one of the above embodiments.
[0032] Compared with the prior art, the door lock and card cooperative processing method provided by the application can trigger a robot calling process according to the preset number of doorbell button operations detected by the first door lock and the neighbor RFID card information read, verify the matching result of the RFID card and the resident registration table, and generate an authority verification pass signal; based on the ID number of the RFID card, a target multicast address is calculated, and the ID number of the RFID card is converted into a fake source IP address to obtain a communication parameter set; according to the communication parameter set, an IGMPv3 report message is sent to the router; according to the trigger operation of the same RFID card detected by the assisted second door lock, an assistance request multicast message is generated, and the first door lock is forwarded to the second door lock through the router matching (S, G) forwarding table item and sending an assistance confirmation message to the second door lock, and the robot calling authorization is completed, so that efficient, safe and low-delay cross-door lock cooperative operation can be realized. BRIEF DESCRIPTION OF DRAWINGS
[0033] Figure 1 The hardware structure block diagram of the computer terminal of the door lock and card cooperative processing method provided by the embodiment of the application is shown in the figure.
[0034] Figure 2 The flowchart of the door lock and card cooperative processing method provided by the embodiment of the application is shown in the figure.
[0035] Figure 3 The structure diagram of the system of the door lock and card cooperative processing method provided by the embodiment of the application is shown in the figure. DETAILED DESCRIPTION
[0036] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the application, and cannot be explained as a limitation of the application.
[0037] The embodiment of the application first provides a door lock and card cooperative processing method, which can be applied to electronic equipment such as a computer terminal, specifically a general computer and the like.
[0038] The following will be described in detail taking the running on the computer terminal as an example. Figure 1 The hardware structure block diagram of the computer terminal of the door lock and card cooperative processing method provided by the embodiment of the application is shown in the figure. Figure 1 As shown in the figure, the computer equipment includes a processor, a memory and a network interface connected through a system bus, wherein the memory can include a non-volatile storage medium and an internal memory.
[0039] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, which, when executed, can make the processor execute any kind of door lock and card cooperative processing method.
[0040] The processor is configured to provide computing and control capabilities to support the operation of the entire computer device.
[0041] The internal memory provides an environment for the running of a computer program in a non-volatile storage medium, which, when executed by the processor, can cause the processor to execute any one of the methods for processing a door lock in cooperation with a card.
[0042] The network interface is configured to perform network communication, such as sending assigned tasks, etc. Figure 1 It should be understood that the structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0043] It should be understood that the processor can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0044] Referring to Figure 2 The embodiments of the present application provide a method for processing a door lock in cooperation with a card, which can include the following steps:
[0045] S201, triggering a process and verifying a right: according to the preset number of doorbell button operations detected by the first door lock and the read neighbor RFID card information, triggering a process for calling a robot, and verifying the matching result of the RFID card and the resident registration table to generate a right verification pass signal; specifically, the triggering process and the right verification include:
[0046] Button operation detection: when the first door lock detects two consecutive doorbell button operations within a preset time, a 30-second countdown is started and the RFID card reading module is activated;
[0047] RFID matching verification: read the RFID card ID number and compare it with the resident registration table, if the matching is successful, generate a right verification pass signal, otherwise terminate the process;
[0048] Cache call event: record the call event information, the call event information includes the RFID card ID number, the multicast address, the false source IP and the validity period, and start the countdown monitoring, the validity period is updated synchronously with the routing table entry validity period.
[0049] S202, multicast address and false source IP generation: based on the ID number of the RFID card, the target multicast address is calculated through the hash algorithm, and the ID number of the RFID card is converted into the false source IP address by using the segment mapping method, to obtain the communication parameter set containing the multicast address and the false source IP; specifically, the multicast address and the false source IP generation include:
[0050] Multicast address calculation: convert the reference IP address 226.1.1.0 into a 32-bit binary constant U, splice the 32-bit binary representation V of the RFID card ID number into a 64-bit data stream, calculate the hash value through the CRC32 hash algorithm and take the modulus of 256, to obtain X in the multicast address 226.1.1.X;
[0051] False source IP generation: perform CRC32 hash calculation on the RFID card ID number, split the result into four 8-bit segments and convert them into decimal numbers to generate a false source IP address;
[0052] Parameter binding: associate the multicast address with the false source IP address to form a communication parameter set.
[0053] S203, multicast message sending and routing table construction: according to the communication parameter set, send the IGMPv3 report message carrying the false source IP and the multicast address to the router, trigger the router to generate the (S, G) multicast forwarding table entry and bind it to the receiving interface, wherein S is the false source IP and G is the target multicast address; specifically, the multicast message sending and routing table construction include:
[0054] IGMPv3 message encapsulation: encapsulate the false source IP address, the multicast address and the validity period of 30 seconds into the IGMPv3 report message;
[0055] Routing table update: the router parses the IGMPv3 message, creates the (S, G) entry in the multicast forwarding table and binds it to the receiving interface, and sets the 30-second validity period;
[0056] Abnormal conflict processing: if it is detected that the same (S, G) entry already exists, refresh the validity period of 30 seconds.
[0057] S204, cross-door lock request forwarding and confirmation: according to the same RFID card triggering operation detected by the assisted second door lock, a request assistance multicast message containing a multicast address and a false source IP is generated, and is forwarded to the first door lock through the router matching (S, G) forwarding table item, and an assistance confirmation message is sent by the first door lock to the second door lock, and the robot calling authorization is completed. Specifically, the cross-door lock request forwarding and confirmation comprises:
[0058] Cross-door lock operation synchronization: the assisted second door lock detects two doorbell operations of the same RFID card, and generates a request assistance message containing the same multicast address and false source IP;
[0059] Router accurate forwarding: the router directs the request message to the interface corresponding to the first door lock according to the (S, G) forwarding table item;
[0060] Assistance confirmation and task triggering: the first door lock sends a confirmation message to the second door lock after verifying the validity of the RFID card, and the second door lock initiates a robot dispatch request to the platform accordingly.
[0061] In practical application, the owner of the intelligent door lock forgets to carry the door card when going out, and also does not carry a mobile phone, and goes to the management center to seek service, which is inconvenient to go and come. It is hoped that the robot can be called to perform face recognition and unlock the door for me. After negotiation, the neighbors can provide help. The present application proposes a kind of authorization of neighbor RFID card swiping to call a robot. A kind of technical scheme specifically comprises:
[0062] 1、Core idea: I don't have an RFID card and a mobile phone, so I can't swipe the card to enter the door or call the robot. Seeing the neighbor, ask the neighbor for help to call the robot. The neighbor presses the button on the door lock for 2 times to trigger, then swipes the RFID card, and then presses the button for 2 times to confirm, and then immediately comes to my door lock to swipe the RFID card and press the button for 2 times, realize calling the robot for me, and the robot performs face recognition and unlocks the door for me. Since the door lock of the neighbor and my door lock do not know each other's IP addresses, an additional design is added: when B helps A at the same time as D helps C, the multicast message sent by A is forwarded to B and D at the same time, which will cause confusion in the router forwarding message. Core point: the multicast group address of the IGMP message sent by lock B uses the hash result, the input of this hash function contains two data, one is the constant converted from 226.1.1.0, and the other is the ID number of the RFID, the output is between 0-255, and the final multicast group address is 226.1.1.X, this X is the hash result. The multicast address of the multicast message sent by A is also 226.1.1.X. Improvement point: in order to avoid conflict, take RFID as source IP. When B helps A, B sends igmpv3, which contains (fake source IP converted from RFID, and hash G). The router generates (S, G) table entry. When A sends multicast message, the source IP is fake source IP, and the destination address is hash G.
[0063] 2、The complete flow of technical implementation is as follows:
[0064] Preconditions:
[0065] The owner's entry door is installed with an intelligent door lock, which supports RFID card reading and unlocking to open the door, and the door lock stores a "resident registration owner information table" containing name, RFID-ID number, etc.
[0066] The robot supports autonomous walking to the specified destination room door; the robot is installed with a display screen supporting face recognition, which can perform face recognition comparison; the robot supports networking with the door lock and supports unlocking authorization for the specified door lock. The robot is connected with the platform to receive tasks published by the platform (such as delivering goods for the owner, providing face recognition and unlocking on site for the owner, etc.), and synchronizes and stores the resident registration table from the platform (the information of the resident registration table is collected and recorded by the administrator, and it is generally set to synchronize once a week), which contains room ID number, door lock ID number, door lock IP, owner's name, face image / feature vector, RFID-ID number, etc.
[0067] Other auxiliary situation explanation:
[0068] 1) Example scenario: the owner b of door lock B uses his own RFID-ID (b) to call the robot for the owner a of door lock A; during this period, the owner d of door lock D uses his own RFID-ID (d) to call the robot for the owner c of door lock C.
[0069] 2) A brief explanation of the manual operation process, taking B summoning the robot for A as an example:
[0070] First, the owner of door lock B, b, presses the "doorbell" button twice on door lock B (triggering B to start the robot summoning process), swipes their RFID-ID (b) on door lock B, and then presses the "doorbell" button twice again (triggering B to confirm the robot summoning process).
[0071] Then, the owner of door lock B, b, presses the "doorbell" button twice on door lock A (triggering A to start the robot summoning process), swipes his RFID-ID (b) on door lock A, and then presses the "doorbell" button twice again (triggering A to confirm the robot summoning process).
[0072] Finally, the robot came to door lock A, and the owner of door lock A actively cooperated with the robot to perform facial recognition. The robot then unlocked door lock A.
[0073] Door lock B determines that the current process involves another door lock summoning the robot by reading the doorbell button press information and the RFID-ID(b) swiped by the card, and caches the robot summoning record. Then, it calculates the multicast address using a hash method of 226.1.1.0 and the RFID-ID(b), and sends an IGMP multicast message carrying the RFID-ID(b). The router records this message on the interface connected to door lock B in the (*,G) forwarding table entry. The reason for sending the IGMP multicast message is that B does not know which door lock is summoning the robot at this time; and using a hash method to calculate the multicast address is to reduce the inability of the router to distinguish the door lock connected to the specified outgoing interface when multiple door locks simultaneously send 226.1.1.0 IGMP multicast messages. Then, door lock A determines that the current process involves another door lock summoning the robot by reading the doorbell button press information and the RFID-ID(b) swiped by the card, and caches the robot summoning record. First, the multicast address is calculated using the hash method of RFID-ID(b) and the read RFID ID number (226.1.1.0). Then, a multicast message is sent. The router forwards A's multicast message to the interface of the door lock B connected to the multicast forwarding table entry by querying the (*,G) forwarding table entry. After receiving the message, B unicasts it to A, enabling A to summon the robot with B's confirmation. A uses the same RFID-ID(b) as B, and the same multicast address can be calculated using the above hash method. Therefore, when A sends a multicast message, it can be directly forwarded to B.
[0074] Detailed explanation of the implementation process:
[0075] The door lock B detects 2 times of door lock doorbell button information (at this time, b is pressed 2 times on the door lock B "doorbell" button) to trigger the process of calling the robot to start and enter the 30-second countdown (waiting for the RFID card to be read, if the RFID card is not read within 30 seconds, the process of calling the robot triggered this time is ended, if you need to continue to call the robot, you need to press 2 times on the door lock B "doorbell" button again), if the RFID card is not read within 30 seconds (at this time, it may be that a stranger presses 2 times on the door lock B "doorbell" button, and the stranger does not have an RFID card), the process is ended. If B reads the RFID card, the RFID card is matched with the RFID-ID in the "resident registration master information table" one by one, and the matching is successful as RFID-ID (b) (at this time, b holds his own RFID-ID (b) in the door lock B card). At this time, the door lock B has completed the permission confirmation for calling the robot for other door locks.
[0076] The door lock B calculates the multicast address 226.1.1.X with the ID number RFID-ID (b) of the RFID in the method of 226.1.1.0 hash. For example, after hash calculation, X = 160. The door lock calculates the multicast address with its own RFID-ID number, which has difference, so that different multicast addresses can be used with other door locks.
[0077] Explanation: Hash method for calculating X in multicast address 226.1.1.X:
[0078] 1) First, convert the IP address 226.1.1.0 into a constant U, the conversion method: assume that each byte is converted into binary and spliced into a 32-bit binary number U in order. The binary of 226 is 11100010, the binary of 1 is 00000001, and the binary of 0 is 00000000. Spliced to get 11100010 00000001 0000000100000000;
[0079] 2) Extract RFID (b) into a binary number V, for example, RFID (b) number is 98765432 (decimal), then the binary is 101111000110000101001110000 (note: the actual length may not be 32 bits, and the front is filled with zeros to 32 bits), V after filling zeros: 00000000 01011110 00110000 10100111 0000 (at this time, it needs to be ensured that it is 32 bits);
[0080] 3) Concatenate U and V into a binary data stream, get a 64-bit binary data stream (such as direct connection), 11100010 00000001 00000001 00000000 00000000 01011110 00110000 10100111 0000;
[0081] 4) Hash the binary data stream after concatenating U and V (such as CRC32, MD5, SHA-1, etc. Hashing algorithm), and take the result modulo 256, get the output between 0 and 255. Suppose CRC32 is used to calculate the CRC32 hash value, get a 32-bit integer (such as 0x000000A0, which is 160). And after taking modulo 256, we can get 160 (160 % 256 = 160 (because 160 < 256)).
[0082] 5) Then the result is X = 160, and the hash calculated multicast address is: 226.1.1.160.
[0083] The door lock B sends an "assist call" IGMP assist message to the target IP address 226.1.1.160, containing the door lock ID (B), the validity period of 30 seconds, etc. The router receives and parses the "assist call" IGMP assist message sent by B, creates or updates a multicast forwarding entry (*, 226.1.1.160) in the routing table, and records a validity period of 30 seconds on the interface that receives the IGMP assist message (at this time, it is the interface connected to door lock B) in the forwarding table entry (when the router receives a multicast message with a destination address of 226.1.1.160, it will only be forwarded to the interface; the information about the above interface on the multicast forwarding table entry (*, 226.1.1.160) will be automatically deleted after the validity period of 30 seconds). Door lock B caches the robot event information for calling on behalf of, including the calling on behalf of event ID number (assisted door lock ID (B) + timestamp), RFID-ID (b), assisted door lock ID (B), validity period = 60 seconds, etc. while sending the "assist call" IGMP message, and then starts a 60-second countdown (the 60-second setting is for the processing delay of door lock A, router, etc.).
[0084] At this time, if there is a scenario that the owner d of the door lock D (carrying RFID (d)) calls the robot on behalf of the owner c of the door lock C, the door lock D sends an "assist call" IGMP assist message to the target IP address 226.1.1.108 (assuming that the calculation result X is 108 according to the above hash calculation method). The router receives and parses the above message sent by D, extracts the multicast group address 226.1.1.108 and other information, creates or updates a multicast forwarding table item (*, 226.1.1.108) in the routing table, and records the validity period of 30 seconds on the interface receiving the "assist call" IGMP assist message in the forwarding table item.
[0085] Explanation: Based on the above calculation method, B and D apply to join the multicast addresses 226.1.1.160 and 226.1.1.108 respectively, and they are obviously different and will not cause confusion.
[0086] The door lock A detects two doorbell button information (at this time, b presses the "doorbell" button on the door lock A for 2 times to trigger the robot calling process) and reads the RFID-ID (b) (at this time, b swipes the RFID (b) card on the door lock A), A extracts the RFID-ID (b) and the RFID-ID number in the resident registration information table of A, and matches them one by one, then it cannot be successfully matched (at this time, RFID-ID (b) is not the RFID-ID number in the resident registration information table of A). After detecting two doorbell button information (at this time, b presses the "doorbell" button on the door lock A for 2 times to confirm the robot calling), the door lock A calculates the multicast address 226.1.1.X according to the hash method in the above steps, forms the multicast address 226.1.1.160 (since X in 226.1.1.X calculated at this time is the same as X calculated by door lock B, that is, X=160), and sends a "request assistance" multicast message to the target IP address 226.1.1.160, containing door lock ID (A), door lock IP (A), RFID-ID (b), validity period 30 seconds, etc. At the same time, A caches the robot calling event, including calling event ID number (coding method can be: door lock ID (A) + timestamp), RFID-ID (b), assistance door lock ID / pending, validity period=60 seconds, etc., and then starts 60 seconds countdown and waits. The door lock A sends the "request assistance" multicast message to request the router to forward.
[0087] Router receives the multicast message of "request assistance" sent by A, extracts the target IP address 226.1.1.160, and finds the entry of (*, 226.1.1.160) in the multicast forwarding table and judges whether the validity period exceeds 30 seconds. The interface list of the entry contains the interface connected to the door lock B (the entry is the IGMP assistance message sent by the door lock B before), and the router transmits the multicast message of A from the interface of the multicast forwarding entry (*, 226.1.1.160) (at this time, the receiver is the door lock B).
[0088] At this time, if the door lock C detects 2 times of doorbell button information, generates and sends the multicast message of "request assistance" containing the RFID-ID (d) and the target address 226.1.1.108 (the door lock C calculates the multicast address according to the method described above with 226.1.1.0 and RFID (d) at this time, and since it is the same RFID (d), the calculated multicast address is the same as the multicast address calculated by D), containing the door lock ID (D), RFID-ID (d), etc. Router receives the multicast message, extracts the target IP address 226.1.1.108, and finds the entry of (*, 226.1.1.108) in the multicast forwarding table and judges whether the validity period exceeds 30 seconds. The interface list of the entry contains the interface connected to the door lock D (the entry is the IGMP assistance message sent by the door lock D before), and the router transmits the multicast message of A from the interface of the multicast forwarding entry (*, 226.1.1.108) (at this time, the receiver is the door lock D).
[0089] Note: The multicast IP addresses 226.1.1.X obtained by the door lock B and the door lock D according to the multicast IP addresses 226.1.1.0 and RFID (b) / RFID (d) calculated according to the method described above are not the same, which are 226.1.1.160 and 226.1.1.108 respectively. Then the multicast forwarding table entries created or updated by the router after receiving the IGMP messages of the door lock B and the door lock D are also different, which are the door lock B: (*, 226.1.1.160), the interface connected to the door lock B; the door lock D: (*, 226.1.1.108), the interface connected to the door lock D. When the door lock A sends the multicast message according to the multicast address 226.1.1.160 calculated by the detected RFID (b), the router will forward it to B, and when the door lock C sends the multicast message according to the multicast address 226.1.1.108 calculated by the detected RFID (d), the router will forward it to D, so as to realize more clear distinction.
[0090] The door lock B receives the "request assistance" message forwarded by the router, checks the cached robot calling event information according to the RFID-ID (b) in the message, confirms that the RFID-ID (b) is the cached calling RFID card, and then unicasts a "confirmation of assistance" message to the door lock A (the door lock IP (A) can be extracted from the message forwarded by the router, or the door lock IP (A) can also be extracted from the multicast message) in reply, containing the RFID-ID (b), the door lock ID (B), and whether the calling is confirmed / is.
[0091] The door lock A receives the "confirmation of assistance" message from B, checks that the "whether the calling is confirmed" result in the message is "yes", and then sends a "call robot" message to the platform, containing the door lock ID (A) and the like. At the same time, the door lock A stores a calling robot record for reference, containing the door lock ID (A), whether the calling is confirmed / is, the calling RFID / RFID (b), the calling door lock / door lock ID (B), and a timestamp (the clock of receiving the reply message from B), and the calling robot record is automatically deleted after being stored for 1 year.
[0092] Further improvement: When the door lock B sends the IGMPv3 report message, it also uses the destination multicast IP address 226.1.1.160 calculated by the hash method in the above steps, and the fake source IP address 38.29.174.229 obtained by mapping the RFID number in this scheme to an IP address by the calculation method. The router will generate a (38.29.174.229, 226.1.1.160) (S, G) multicast forwarding table entry in the routing table. When the door lock A sends a multicast message, it also uses the destination multicast IP address 226.1.1.160 calculated by the hash method in the above steps, and the fake source IP address 38.29.174.229 obtained by mapping the RFID number in this scheme to an IP address by the calculation method. Then, according to the (S, G) multicast forwarding table entry, the router can forward the multicast message from A to B. According to this method, when the owner d of the door lock D holds the RFID (d) to call the robot of the owner c of the door lock C at the same time, since the RFID (d) and the RFID (b) are different at this time, the destination multicast IP calculated by the hash method is different, and the fake source IP address is also different, which can eliminate the phenomenon of router forwarding confusion.
[0093] In the above steps, in the process of calculating the multicast address 226.1.1.X by the door lock with 226.1.1.0 and the ID number RFID of the RFID hash, and taking 226.1.1.X as its multicast address, since the value range of X is 0~255 (a total of 256 values), and the number of RFID is likely to be much greater than 256, according to the pigeonhole principle (if the possible values of the hash output (at this time, the possible values of X are 256) are less than the possible values of the input (at this time, the number of RFID is likely to be much greater than 256)), there must be a hash collision, that is, the calculated 226.1.1.X may be the same. At this time, assuming that the owner b of the door lock B is the owner a of the door lock A who calls the robot on behalf of the scene, the method of using hash calculation obtains and uses 226.1.1.160, and if there is another group of people or multiple groups of people using the multicast group 226.1.1.160 at the same time, for example, the owner d of the door lock D is the owner c of the door lock C who calls the robot on behalf of the scene, the method of using hash calculation obtains and uses 226.1.1.160, which will cause the multicast message sent by A to be forwarded to B and D at the same time, causing message confusion. In order to solve this problem, the optimization is as follows:
[0094] The door lock B detects 2 doorbell button information (at this time, b presses the "doorbell" button on the door lock B for 2 times), triggers the process of calling the robot and enters the 30-second countdown (waits for the RFID card to be read, if the RFID card is not read within 30 seconds, the process of calling the robot triggered this time is ended, if you need to continue to call the robot, you need to press the "doorbell" button on the door lock B for 2 times again), if the RFID card is not read within 30 seconds (at this time, it may be that a stranger presses the "doorbell" button on the door lock B for 2 times, and the stranger does not have an RFID card), the process is ended. If B reads the RFID card, it will match the RFID-ID in the "resident registration owner information table" one by one, and match the RFID-ID (b) successfully (at this time, b holds his own RFID-ID (b) and swipes the card at the door lock B).
[0095] The door lock B calculates the multicast destination IP address 226.1.1.X by hashing the ID number RFID-ID (b) of the RFID with 226.1.1.0 (for example, after hash calculation, X=160; the hash calculation method is as described in the above steps, which is not repeated here), and obtains the multicast destination IP address as 226.1.1.160. The door lock B converts the RFID tag ID number RFID-ID (b) into an IPv4 address by a hash algorithm combined with a segmented mapping method, and obtains a false source IP address as 38.29.174.229.
[0096] It is explained that the calculation method of mapping the RFID number to the IP address is as follows:
[0097] 1) Select a hash algorithm (such as MD5, SHA-1, CRC32, etc.) to calculate the hash value: This scheme takes the CRC32 algorithm (the CRC32 algorithm is relatively simple to calculate, and if a lower collision rate is required, MD5 or SHA-1 can be used) and RFID (b) number: 98765432 as an example:
[0098] 2) Calculate the CRC32 hash value of the RFID-ID: Convert the RFID (b) number: 98765432 to 32-bit binary: 000000101 11100011 00001010 01110000 (if insufficient, pad zeros in front to 32 bits), and calculate the hash value using the CRC32 algorithm: 0x261DAEE5.
[0099] 3) Map the hash value to an IPv4 address using the segmented mapping method: The hash value 0x261DAEE5 is split into four 8-bit parts and calculated as decimal values 0x26 (38), 0x1D (29), 0xAE (174), and 0xE5 (229), and directly mapped to the four parts of the IPv4 address, forming the IPv4 address: 38.29.174.229.
[0100] The door lock B sends an IGMPv3 report message to request to join the specified multicast group using the false source IP address and multicast group address calculated above, containing the source address as the false source IP address (38.29.174.229), the multicast group address as the hashed multicast group address (226.1.1.160), and the validity period of 30 seconds. The router receives the IGMPv3 report message sent by B, parses the false source IP address and hashed multicast group address, and generates a (38.29.174.229, 226.1.1.160) multicast forwarding table entry in the routing table, and the interface receiving the IGMPv3 report message (at this time, the interface connected to B) records a validity period of 30 seconds.
[0101] At this time, if there is a scenario where the owner d of the door lock D (carrying the RFID (d)) acts on behalf of the owner c of the door lock C to call the robot, the door lock D sends an IGMPv3 report message to request to join the specified multicast group, including the source address being the false source IP address (192.168.1.100), the multicast group address being the hashed multicast group address (226.1.1.08), and the validity period being 30 seconds. The router receives the IGMPv3 report message sent by D, parses the false source IP address and the hashed multicast group address, generates the (S, G) multicast forwarding table entry of (192.168.1.100, 226.1.1.108) in the routing table, and records the validity period of 30 seconds for the interface (at this time, the interface connected with D) receiving the IGMPv3 report message.
[0102] Description: Based on the above improved method, the multicast forwarding table entries corresponding to the interfaces of B and D in the router are (38.29.174.229, 226.1.1.160) and (192.168.1.100, 226.1.1.108) respectively, which have obvious differences in source IP address and target multicast IP address and will not cause confusion.
[0103] When the door lock A detects two door lock doorbell button information (at this time, b presses the "doorbell" button on the door lock A for 2 times in succession to trigger the robot calling process) and reads the RFID-ID (b) (at this time, b swipes the RFID (b) card on the door lock A), A extracts the RFID-ID (b) and compares it with the RFID-ID numbers in the resident registration information table of A one by one, and then matches it, but no successful matching is found (at this time, RFID-ID (b) is not an RFID-ID number in the resident registration information table of A). When detecting two door lock doorbell button information (at this time, b presses the "doorbell" button on the door lock A for 2 times in succession to confirm the robot calling), the door lock A calculates the X in the multicast address 226.1.1.X according to the hash method in the above steps, forms the multicast address 226.1.1.160 (since X in 226.1.1.X calculated at this time is the same as X calculated by the door lock B, that is, X = 160), and maps the RFID-ID (b) to the IP address 38.29.174.229 according to the hash mapping above (since A reads the same RFID-ID (b) as B at this time), the door lock A sends a "request for assistance" multicast message to the target IP address 226.1.1.160 with the fake source IP address 38.29.174.229, containing the door lock ID (A), the door lock IP (A), the RFID-ID (b), the validity period of 30 seconds, etc. At the same time, A caches the robot calling event, containing the calling event ID number (coding method can be: door lock ID (A) + timestamp), RFID-ID (b), assistance door lock ID / pending, validity period = 60 seconds, etc., and then starts a 60-second countdown to wait. The door lock A sends a "request for assistance" multicast message to request the router to forward.
[0104] The router receives the "request for assistance" multicast message sent by A, extracts the target IP address 226.1.1.160 and the source IP address 38.29.174.229, and finds the (38.29.174.229, 226.1.1.160) entry in the multicast forwarding table and judges whether the validity period exceeds 30 seconds. The interface list in this entry contains the interface connected to the door lock B (this entry is the IGMPv3 report message sent by the door lock B before), and the router sends the multicast message of A out from the interface of this multicast forwarding entry (38.29.174.229, 226.1.1.160) (at this time, the receiving party is the door lock B).
[0105] At this time, if the door lock C detects 2 door lock doorbell button information, generates and sends a multicast message containing the RFID-ID (d), the target address is 226.1.1.108 (the door lock C first calculates the multicast address according to the aforementioned method with 226.1.1.0, RFID (d) hash, at this time, since it is the same RFID (d), the calculated multicast address is the same as the multicast address calculated by D), the source IP address is 192.168.1.100 (according to the aforementioned RFID (d) hash mapping method), the "request assistance" multicast message contains the door lock ID (D), RFID-ID (d) and the like. The router receives the multicast message, extracts the target IP address 226.1.1.108 and the source IP address 192.168.1.100, and finds the (192.168.1.100, 226.1.1.108) entry in the multicast forwarding table and judges whether the validity period exceeds 30 seconds. The interface list of the entry contains the interface connected to the door lock D (the entry is the IGMP assistance message sent by the door lock D before), and the router sends the multicast message of A from the interface of the multicast forwarding entry (192.168.1.100, 226.1.1.108) (at this time, the receiver is the door lock D).
[0106] Description: The multicast IP addresses 226.1.1.X obtained by the door lock B and the door lock D according to the aforementioned 226.1.1.0, RFID (b) / RFID (d) hash calculation are not the same, which are 226.1.1.160 and 226.1.1.108 respectively. At the same time, the false source IP addresses obtained by mapping RFID (b) / RFID (d) to IP addresses are 38.29.174.229 and 192.168.1.100 respectively. Then, when the router receives the multicast messages of the door lock B and the door lock D, a multicast forwarding table entry is created or updated, which are different, respectively, the door lock B: (38.29.174.229, 226.1.1.160), the out interface connects the door lock B; the door lock D: (192.168.1.100, 226.1.1.108), the out interface connects the door lock D. When the door lock A sends a multicast message according to the multicast address 226.1.1.160 calculated by detecting RFID (b), the router will forward it to B, and when the door lock C sends a multicast message according to the multicast address 226.1.1.108 calculated by detecting RFID (d), the router will forward it to D, so as to realize more specific distinction than the method of the above steps.
[0107] The door lock B receives the "request assistance" message forwarded by the router A, checks the cached robot calling event information according to the RFID-ID (b) in the message, confirms that the RFID-ID (b) is the cached calling RFID card, and then unicasts (the door lock IP (A) of the door lock A can be extracted from the message sent by the router A) a "assistance confirmation" message to the door lock A, and the "assistance confirmation" message contains the RFID-ID (b), the door lock ID (B), and whether the calling is confirmed / is.
[0108] The door lock A receives the "assistance confirmation" message of B, checks the "whether the calling is confirmed" result in the message, and confirms that the result is "yes", and then sends a "call robot" message to the platform, and the "call robot" message contains the door lock ID (A) and the like. At the same time, the door lock A stores a calling robot record for checking, and the calling robot record contains the door lock ID (A), whether the calling is confirmed / is, the calling RFID / RFID (b), the calling door lock / door lock ID (B), and a timestamp (the clock of receiving the reply message of B), and the calling robot record is automatically deleted after being stored for one year.
[0109] The platform receives the "call robot" message sent by the door lock A, and assigns a robot to go to A to perform face recognition on the owner a and unlock the door.
[0110] The implementation process is refined as follows: the platform receives and caches the "call robot" message sent by the door lock A, schedules a robot (the scheduling of the robot is not the focus of the present application, and will not be described in detail), sends the door lock ID (A), the door lock IP (A), and the like in the "call robot" message to the robot, and at the same time, the platform sends a reply message to the door lock A that the robot has been dispatched, and the door lock receives the reply message of the platform and prompts "the robot has been successfully called, please wait" on the display screen of A. The robot receives the scheduling instruction of the platform, autonomously navigates to the door lock A according to the room ID (A) (autonomous navigation, autonomous walking, and the like of the robot are not the focus of the present application, and will not be described in detail), and establishes a connection with the door lock A, and then performs face recognition and comparison on a, and unlocks the door for a after the face comparison is successful.
[0111] The final implementation of calling the robot by the neighbor is determined by the neighbor RFID card authorization, the cooperation of the doorbell button of the door lock, and the countdown confirmation of the platform for calling the robot for the same RFID.
[0112] Another embodiment of the present application provides a door lock and card cooperative processing system, as shown in Figure 3 , which can include:
[0113] The verification module 301 is used for triggering process and permission verification: according to the preset number of doorbell button operations detected by the first door lock and the neighbor RFID card information read, triggering the process of calling a robot on behalf of, and verifying the matching result of the RFID card and the resident registration table, and generating a permission verification pass signal;
[0114] The generation module 302 is used for generating multicast address and false source IP: based on the ID number of the RFID card, calculating the target multicast address through a hash algorithm, and converting the ID number of the RFID card into a false source IP address by using a segment mapping method, to obtain a communication parameter set containing the multicast address and the false source IP;
[0115] The sending module 303 is used for multicast message sending and routing table construction: according to the communication parameter set, sending an IGMPv3 report message carrying the false source IP and the multicast address to a router, triggering the router to generate a (S, G) multicast forwarding table item and bind to a receiving interface, wherein S is the false source IP and G is the target multicast address;
[0116] The forwarding module 304 is used for cross-door lock request forwarding and confirmation: according to the trigger operation of the same RFID card detected by the second door lock assisted, generating a request assistance multicast message containing the multicast address and the false source IP, forwarding to the first door lock through the router matching the (S, G) forwarding table item, and sending an assistance confirmation message to the second door lock by the first door lock, to complete the robot calling authorization.
[0117] The embodiment of the application further provides a storage medium, and the storage medium stores a computer program, wherein the computer program is set to execute the steps in any one of the method embodiments.
[0118] The embodiment of the application further provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor is set to execute the computer program to execute the steps in any one of the method embodiments.
[0119] Specifically, the electronic device can further comprise a transmission device and an input and output device, wherein the transmission device is connected with the processor, and the input and output device is connected with the processor.
[0120] It can be seen that according to the preset number of doorbell button operations detected by the first door lock and the read neighbor RFID card information, the robot calling on behalf of is triggered, and the matching result of the RFID card and the resident registration table is verified to generate an authority verification pass signal; based on the ID number of the RFID card, the target multicast address is calculated, and the ID number of the RFID card is converted into a fake source IP address to obtain a communication parameter set; according to the communication parameter set, an IGMPv3 report message is sent to the router; according to the trigger operation of the same RFID card detected by the second door lock assisted, a request assistance multicast message is generated, and is forwarded to the first door lock through the router matching (S, G) forwarding table item, and the first door lock sends an assistance confirmation message to the second door lock, and completes the robot calling authorization, so that efficient, safe and low-delay cross-door lock cooperative operation can be realized.
[0121] The above describes the structure, features and effects of the present application in detail according to the embodiments shown in the drawings. The above description is only the preferred embodiments of the present application, but the present application is not limited to the embodiments shown in the drawings. Any changes or modifications made in accordance with the concept of the present application, or equivalent embodiments with equivalent changes, are still within the scope of the present application.
Claims
1. A method for door lock and card cooperative processing, characterized in that, The method comprises: Triggering process and permission verification: according to the preset number of doorbell button operations detected by the first door lock and the neighbor RFID card information read, triggering the proxy calling robot process, and verifying the matching result of the RFID card and the resident registration table to generate a permission verification pass signal; Multicast address and false source IP generation: based on the ID number of the RFID card, the target multicast address is calculated through the hash algorithm, and the ID number of the RFID card is converted into a false source IP address by using the segmented mapping method to obtain a communication parameter set containing the multicast address and the false source IP; Multicast message sending and routing table construction: according to the communication parameter set, an IGMPv3 report message carrying the false source IP and the multicast address is sent to the router, triggering the router to generate an (S, G) multicast forwarding table entry and bind it to the receiving interface, wherein S is the false source IP and G is the target multicast address; Cross-door lock request forwarding and confirmation: according to the trigger operation of the same RFID card detected by the second door lock assisted, a request assistance multicast message containing the multicast address and the false source IP is generated, which is forwarded to the first door lock through the (S, G) forwarding table entry matched by the router, and an assistance confirmation message is sent by the first door lock to the second door lock, completing the robot calling authorization.
2. The method of claim 1, wherein, The triggering process and permission verification comprise: Button operation detection: when the first door lock detects two consecutive doorbell button operations within a preset time, start a 30-second countdown and activate the RFID card reading module; RFID matching verification: read the RFID card ID number and compare it with the resident registration table, if the matching is successful, generate a permission verification pass signal, otherwise terminate the process; Cache proxy calling event: record the proxy calling event information, which includes the RFID card ID number, the multicast address, the false source IP and the validity period, and start the countdown monitoring, the validity period is updated synchronously with the routing table entry validity period.
3. The method of claim 2, wherein, The multicast address and false source IP generation comprise: Multicast address calculation: convert the reference IP address 226.1.1.0 into a 32-bit binary constant U, concatenate it with the 32-bit binary representation V of the RFID card ID number to form a 64-bit data stream, calculate the hash value by CRC32 hash algorithm and take modulo 256 to obtain X in the multicast address 226.1.1.X; False source IP generation: perform CRC32 hash calculation on the RFID card ID number, split the result into four 8-bit segments and convert them into decimal numbers to generate a false source IP address; Parameter binding: associate the multicast address with the false source IP address to form a communication parameter set.
4. The method of claim 3, wherein, The multicast message sending and routing table construction comprise: IGMPv3 message encapsulation: encapsulate the false source IP address, the multicast address and the validity period of 30 seconds into the IGMPv3 report message; Routing table update: the router parses the IGMPv3 message, creates an (S, G) entry in the multicast forwarding table and binds it to the receiving interface, and sets the 30-second validity period; Abnormal conflict processing: if the same (S, G) entry is detected to exist, refresh the validity period of 30 seconds.
5. The method of claim 4, wherein, The cross-door lock request forwarding and confirmation comprise: Cross-door lock operation synchronization: the second door lock assisted generates a request assistance message containing the same multicast address and fake source IP after detecting two doorbell operations of the same RFID card; Router accurate forwarding: the router directs the request message to the interface corresponding to the first door lock according to the (S, G) forwarding table entry; Assistance confirmation and task triggering: the first door lock sends a confirmation message to the second door lock after verifying the validity of the RFID card, and the second door lock initiates a robot dispatch request to the platform accordingly.
6. A system for door lock and card coordination processing, characterized by, The system comprises: A verification module for triggering a process and verifying permissions: based on the pre-set number of doorbell button operations detected by the first door lock and the neighbor RFID card information read, the process of calling a robot on behalf is triggered, and the matching result of the RFID card and the resident registration table is verified to generate a permission verification pass signal; A generation module for generating a multicast address and a fake source IP: based on the ID number of the RFID card, a target multicast address is calculated through a hash algorithm, and the ID number of the RFID card is converted into a fake source IP address by using a segment mapping method to obtain a communication parameter set containing the multicast address and the fake source IP; A sending module for sending a multicast message and constructing a routing table: based on the communication parameter set, an IGMPv3 report message carrying the fake source IP and the multicast address is sent to the router, triggering the router to generate an (S, G) multicast forwarding table entry and bind it to the receiving interface, wherein S is the fake source IP and G is the target multicast address; A forwarding module for cross-door lock request forwarding and confirmation: based on the trigger operation of the same RFID card detected by the second door lock assisted, a request assistance multicast message containing the multicast address and the fake source IP is generated, which is forwarded to the first door lock through the router matching the (S, G) forwarding table entry, and an assistance confirmation message is sent by the first door lock to the second door lock, completing the robot calling authorization.
7. The system of claim 6, wherein, The verification module is specifically configured to: Button operation detection: when the first door lock detects two consecutive doorbell button operations within a preset time, start a 30-second countdown and activate the RFID card reading module; RFID matching verification: read the RFID card ID number and compare it with the resident registration table, if the matching is successful, generate a permission verification pass signal, otherwise terminate the process; Cache proxy calling event: record the proxy calling event information, which includes the RFID card ID number, the multicast address, the fake source IP and the validity period, and start the countdown monitoring, the validity period is updated synchronously with the routing table entry validity period.
8. The system of claim 7, wherein, The generation module is specifically configured to: Multicast address calculation: convert the reference IP address 226.1.1.0 into a 32-bit binary constant U, concatenate it with the 32-bit binary representation V of the RFID card ID number to form a 64-bit data stream, calculate the hash value by using the CRC32 hash algorithm and take the modulus of 256 to obtain X in the multicast address 226.1.1.X; Fake source IP generation: perform CRC32 hash calculation on the RFID card ID number, split the result into four 8-bit segments and convert them into decimal numbers to generate a fake source IP address; Parameter binding: associate the multicast address with the fake source IP address to form a communication parameter set.
9. A storage medium, characterized by The storage medium has stored therein a computer program, wherein the computer program is configured to execute the method of any one of claims 1-5 when executed.
10. An electronic device comprising a memory and a processor, characterized in that, The memory has stored therein a computer program, and the processor is configured to execute the computer program to execute the method of any one of claims 1-5.
Citation Information
Patent Citations
Cross-lock door opening method and system of intelligent door lock
CN120071485A
Video recording method and system based on intelligent door lock
CN120091097A