Gate control method and device and storage medium
The intelligent matching engine automatically handles gate malfunctions and generates gate opening commands, solving the problem of manual handling of abnormalities when gates malfunction, improving fault handling efficiency and user experience, and reducing operating costs.
Patent Information
- Application Number
- CN202511888703.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-02-24
AI Technical Summary
When existing turnstiles malfunction, users need to manually handle the entry and exit issues, resulting in a poor travel experience, high operating costs, and low fault handling efficiency.
The intelligent matching engine searches for records of abnormal door opening in the cache device, generates a gate opening command, and automatically controls the door to open, thus achieving automatic fault tolerance.
It improved the efficiency of gate fault handling, enhanced the user travel experience, reduced the workload of staff, and lowered operating costs.
Smart Images

Figure CN121564837A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of turnstiles, and in particular relates to a control method, device and storage medium for turnstiles. Background Technology
[0002] With the rapid development of Automated Fare Collection (AFC) systems, users entering and exiting stations by scanning codes or using tickets at turnstiles has become a part of daily travel.
[0003] In actual operation, turnstiles, as frequently used physical devices, may experience temporary malfunctions, such as gate jamming or infrared sensor failure.
[0004] When a user swipes their QR code or ticket at the turnstile, the backend system verifies the transaction and issues a permission instruction (the payment may have already been deducted or the account pre-authorized). However, if the turnstile malfunctions and fails to open the gate, and since the backend system can typically only process successful or failed transaction records, if a user tries to enter or exit through a different turnstile after a valid transaction has already been recorded, the system will consider it a duplicate entry and exit and refuse the user entry. In this case, the user must find a staff member, who will manually allow the user to pass after verifying the situation.
[0005] This manual method of handling entry and exit anomalies is cumbersome, reduces the user's travel experience, easily leads to user complaints, and increases the workload of staff and operating costs, resulting in low efficiency in handling gate malfunctions. Summary of the Invention
[0006] In view of this, the present invention provides a control method, device and storage medium for a turnstile, so as to improve the fault handling efficiency of the turnstile.
[0007] A first aspect of the present invention provides a control method for a turnstile, comprising:
[0008] The turnstile generates the first transaction record when a user enters or leaves the site;
[0009] The intelligent matching engine searches the cache device for records of abnormal door openings that occurred when the user first entered or left the site, based on the first transaction record.
[0010] When the intelligent matching engine finds a record of abnormal opening of the first gate, it generates a first gate opening command based on the record of abnormal opening of the first gate and the first transaction record.
[0011] The gate opens according to the first gate opening command.
[0012] A second aspect of the present invention provides a control device for a turnstile, comprising a turnstile and an intelligent matching engine;
[0013] A turnstile is used to generate the first transaction record when a user enters or leaves the site;
[0014] The intelligent matching engine is used to search the cache device for records of abnormal door openings generated when the user first entered or left the site, based on the first transaction record.
[0015] The intelligent matching engine is also used to generate a first gate opening instruction based on the first gate opening record and the first transaction record when the first gate abnormal opening record is found.
[0016] The turnstile is also used to control the opening of the gate according to the first gate opening command.
[0017] A third aspect of the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the gate control method as described in the first aspect above.
[0018] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the gate control method as described in the first aspect above.
[0019] The fifth aspect of the present invention provides a computer program product that, when run on a computer, causes the computer to perform the gate control method as described in the first aspect above.
[0020] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0021] In this embodiment, the turnstile generates a first transaction record when a user enters or leaves the station. The intelligent matching engine searches the cache device for a first gate opening error record generated when the user first entered or left the station, based on the first transaction record. Upon finding the first gate opening error record, the intelligent matching engine generates a first gate opening command based on the first transaction record and the first gate opening error record. The turnstile controls the gate to open according to the first gate opening command. This embodiment compensates for abnormal gate openings when a user enters or leaves the station, automatically opening the gate gate when a user continuously enters or leaves the station, allowing the user to enter or leave normally. It transforms fault handling from manual post-incident remediation to automatic fault tolerance during the incident, improving the system's intelligence and reliability, maintaining a good travel experience for users, reducing staff workload, lowering operating costs, and effectively improving the turnstile's fault handling efficiency. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic diagram of a gate control method provided in an embodiment of the present invention;
[0024] Figure 2 This is an architecture diagram of a control system provided in an embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of another gate control method provided in an embodiment of the present invention;
[0026] Figure 4 This is an entry timing diagram provided in an embodiment of the present invention;
[0027] Figure 5 This is an outbound timing diagram provided in an embodiment of the present invention;
[0028] Figure 6 This is a schematic diagram of a control device for a turnstile provided in an embodiment of the present invention;
[0029] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0030] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the present invention. However, those skilled in the art will understand that the present application may be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of the present application with unnecessary detail.
[0031] The technical solution of the present invention will be illustrated below through specific embodiments.
[0032] Reference Figure 1 The diagram illustrates a control method for a turnstile provided in an embodiment of the present invention, which may specifically include the following steps:
[0033] Step 101: The turnstile generates the first transaction record when a user enters or leaves the site.
[0034] This embodiment can be applied to automatic fare collection (AFC) systems that use QR codes, tickets, or other methods for transactions and support offline operation of terminal devices, such as urban rail transit (e.g., subways, light rails), railway passenger transport (e.g., high-speed rail, bullet trains) and other closed-loop fare collection systems (e.g., parks, stadiums).
[0035] Among them, the Automated Fare Collection (AFC) system is usually based on computer, communication, network, automatic control and other technologies to realize the automation of the entire process of ticketing, ticket checking, fare calculation, collection, clearing and management in urban rail transit and other systems.
[0036] Rail transit refers to a type of transportation vehicle or system that operates vehicles on specific tracks.
[0037] Sites that deploy Automated Fare Collection (AFC) systems are typically divided into paid and unpaid zones, with turnstiles used to separate the paid and unpaid zones.
[0038] The paid area refers to the area within the station where public transportation requires payment, while the unpaid area refers to the area outside the paid area within the station.
[0039] A turnstile is a terminal device used to process transactions for users entering and exiting a station. It has functions such as reading and writing boarding codes, calculating fares, and controlling the opening and closing of gates.
[0040] Therefore, a user entering the site (i.e., entering the site) refers to the user's action of passing through the non-paid area to the paid area, and a user leaving the site (i.e., leaving the site) refers to the user's action of passing through the paid area to the non-paid area.
[0041] like Figure 2 As shown, on the physical network perception layer, the controller embedded in the gate is not only responsible for controlling the gate, but also upgraded to an edge computing node. It has a self-diagnostic function (such as abnormal motor current of the gate, continuous blocking of the light curtain sensor, etc.) and can publish messages (including normal transaction messages and gate failure abnormal messages) to the background in a lightweight and asynchronous manner.
[0042] When a user performs an operation such as swiping a ride code or ticket on the gate, intending to enter or leave the station, the gate generates the first transaction record upon receiving the user's operation and sends the first transaction record to the intelligent matching engine.
[0043] In a communication method, such as Figure 2 As shown, the gate can use MQTT (Message Queuing Telemetry Transport) and other publish / message transmission protocols to publish the first transaction record to the first topic in the message middleware such as MQTT Broker in the real-time data acquisition layer.
[0044] Among them, the MQTT protocol is a lightweight publish / subscribe message transmission protocol suitable for Internet of Things (IoT) scenarios, featuring low bandwidth, low power consumption, and high real-time performance.
[0045] Message middleware such as MQTT Broker (MQTT middleware) is responsible for managing a large number of terminal devices (such as turnstiles) and sending and receiving high-concurrency messages.
[0046] Message middleware such as MQTT Broker (MQTT Middleware) supports dynamic routing based on message content, such as distributing messages to different partitions of message queues like Kafka based on device type.
[0047] Forwarding rules are configured on message middleware such as MQTT Broker (MQTT Middleware) to define the mapping relationship between the first topic in message middleware such as MQTT Broker (MQTT Middleware) and the second topic in message queues such as Kafka.
[0048] Kafka is a high-throughput distributed publish-subscribe messaging system used to build real-time streaming data pipelines and applications, capable of handling massive real-time transaction data streams.
[0049] Message queues such as Kafka serve as the data hub of the entire system, using their high throughput and persistence features to cache all incoming and outgoing transaction events and exception events.
[0050] Message middleware such as MQTT Broker (MQTT middleware) sends the first transaction record to the second topic of message queues such as Kafka in the stream processing and buffering layer according to the mapping relationship based on the first topic.
[0051] In the intelligent processing and decision-making layer, stream computing engines such as Flink and Spark Streaming consume the first transaction record in real time from the second topic subscribed to in message queues such as Kafka, and send the first transaction record to the intelligent matching engine.
[0052] Step 102: The intelligent matching engine searches the cache device for the first abnormal door opening record generated when the user first entered or left the site, based on the first transaction record.
[0053] In this embodiment, as Figure 2As shown, the intelligent matching engine can read the user's identifier (such as user ID), the site's identifier (such as site ID), and the transaction type (such as entering, leaving, etc.) from the first transaction record. Based on the first transaction record, it searches for the first door abnormal opening record generated when the user (represented by the user's identifier) first enters or leaves (represented by the transaction type) the site (represented by the site's identifier) in a high-speed caching device such as Redis (remote dictionary service).
[0054] Redis is an open-source in-memory data structure store used as a database, cache, and message broker. Its extremely high read and write speeds are suitable for scenarios requiring millisecond-level response times.
[0055] Step 103: When the intelligent matching engine finds the record of the first door being opened abnormally, it generates the first gate opening command based on the record of the first door being opened abnormally and the first transaction record.
[0056] When the intelligent matching engine finds the first abnormal gate opening record in high-speed caching devices such as Redis, it means that the user is not entering or leaving the site for the first time. The gate malfunctioned when the user entered or left the site and failed to open the gate normally. At this time, the first gate opening instruction is generated based on the first abnormal gate opening record and the first transaction record to compensate for the gate malfunction when the user entered or left the site. The first gate opening instruction is then sent to the gate.
[0057] In addition, in high-speed caching devices such as Redis, the status of the first door abnormal opening record can be set to compensated (i.e., the first door abnormal opening record is invalid).
[0058] Under normal circumstances, the intelligent matching engine will perform multiple checks on the first transaction record. One of these checks is the duplicate transaction check, which aims to verify whether the same user (represented by the user's identifier) has continuously executed multiple transactions of the same type (such as entering, leaving, etc.). When the intelligent matching engine finds an abnormal opening record of the first door, it can ignore the duplicate transaction check.
[0059] In a communication method, such as Figure 2 As shown, the intelligent matching engine can send the first gate opening command to stream computing engines such as Flink and Spark Streaming.
[0060] Streaming engines such as Flink and Spark Streaming publish the first gate opening command to the third topic of message queues such as Kafka.
[0061] Forwarding rules are configured on message middleware such as MQTT Broker (MQTT Middleware) to define the mapping relationship between the third topic in message queues such as Kafka and the fourth topic in message middleware such as MQTT Broker (MQTT Middleware).
[0062] Message middleware such as MQTT Broker consumes the first gate opening command from the third topic subscribed to in message queues such as Kafka according to the mapping relationship, and publishes the first gate opening command to the gate that has subscribed to the fourth topic according to the third topic.
[0063] Step 104: The gate opens according to the first gate opening command.
[0064] When the turnstile receives the first gate opening command, it can control the operation of the corresponding components (such as motors) to open the gate and allow users to pass through, enter or leave the station.
[0065] In this embodiment, the turnstile generates a first transaction record when a user enters or leaves the station. The intelligent matching engine searches the cache device for a first gate opening error record generated when the user first entered or left the station, based on the first transaction record. Upon finding the first gate opening error record, the intelligent matching engine generates a first gate opening command based on the first transaction record and the first gate opening error record. The turnstile controls the gate to open according to the first gate opening command. This embodiment compensates for abnormal gate openings when a user enters or leaves the station, automatically opening the gate gate when a user continuously enters or leaves the station, allowing the user to enter or leave normally. It transforms fault handling from manual post-incident remediation to automatic fault tolerance during the incident, improving the system's intelligence and reliability, maintaining a good travel experience for users, reducing staff workload, lowering operating costs, and effectively improving the turnstile's fault handling efficiency.
[0066] Reference Figure 3 The diagram illustrates another control method for a turnstile provided by an embodiment of the present invention, which may specifically include the following steps:
[0067] Step 301: The turnstile generates the first transaction record when a user enters or leaves the site.
[0068] Step 302: The intelligent matching engine searches the cache device for the first door abnormal opening record generated when the user first entered or left the site, based on the first transaction record.
[0069] Step 303: When the intelligent matching engine does not find a record of abnormal opening of the first gate, it generates a second gate opening command based on the first transaction record.
[0070] When the intelligent matching engine does not find a record of the first gate being opened abnormally in high-speed caching devices such as Redis, it indicates that the user is entering or leaving the site for the first time. At this time, a second gate opening instruction is generated based on the first transaction record, and the second gate opening instruction is notified to the gate.
[0071] In a communication method, such as Figure 2 As shown, the intelligent matching engine can send the second gate opening command to stream computing engines such as Flink and Spark Streaming.
[0072] Streaming engines such as Flink and Spark Streaming publish the second gate opening command to a third topic under a message queue such as Kafka.
[0073] Forwarding rules are configured on message middleware such as MQTT Broker (MQTT Middleware) to define the mapping relationship between the third topic in message queues such as Kafka and the fourth topic in message middleware such as MQTT Broker (MQTT Middleware).
[0074] Message middleware such as MQTT Broker consumes the second gate opening command from the third topic that has been subscribed to in message queues such as Kafka according to the mapping relationship, and publishes the second gate opening command to the gate that has subscribed to the fourth topic according to the third topic.
[0075] Step 304: The gate opens according to the second gate opening command.
[0076] When the turnstile receives the second gate opening command, it can control the operation of the corresponding components (such as motors) to open the gate and allow users to pass through, enter or leave the station.
[0077] Step 305: When the turnstile detects that no one has passed through a door, it generates a record of abnormal opening of the second door.
[0078] The turnstile is equipped with sensors such as light curtain sensors and infrared sensors for each gate. If no person is detected passing through a gate within a preset time, the sensor generates a record of abnormal opening of a second gate and sends the record to a high-speed cache device such as Redis.
[0079] In a communication method, such as Figure 2 As shown, the gate will publish the abnormal opening record of the second door to the fifth topic in message middleware such as MQTTBroker (MQTT middleware).
[0080] Forwarding rules are configured on message middleware such as MQTT Broker (MQTT Middleware) to define the mapping relationship between the fifth topic in message queues such as Kafka and the sixth topic in message middleware such as MQTT Broker (MQTT Middleware).
[0081] Message middleware such as MQTT Broker (MQTT middleware) sends the record of the abnormal opening of the second door to the sixth topic of message queues such as Kafka according to the mapping relationship and the fifth topic.
[0082] The stream computing engine consumes the abnormal opening records of the second door from the sixth topic subscribed to in message queues such as Kafka, and sends the abnormal opening records of the second door to high-speed caching devices such as Redis.
[0083] Step 306: The cache device stores records of abnormal opening of the second door for users when entering or leaving the site.
[0084] High-speed caching devices such as Redis store records of abnormal opening of the second door for users (represented by user identifiers) when entering or leaving (represented by transaction type) sites (represented by site identifiers).
[0085] For example, tables are distinguished according to transaction type. Under the table corresponding to the current transaction type, records of abnormal opening of the second door are stored using the user's identifier (such as user ID) and the site's identifier (such as site ID) as indexes.
[0086] Step 307: When the storage time for the abnormal opening record of the second door exceeds a preset threshold, the cache device deletes the abnormal opening record of the second door.
[0087] High-speed caching devices such as Redis configure an expiration time for the abnormal opening record of the second door. When the storage time of the abnormal opening record of the second door exceeds the preset threshold (i.e., the expiration time), it means that the abnormal opening record of the second door has expired and is deleted.
[0088] In this embodiment, as Figure 2 As shown, the clearing system in AFC performs logical processing such as deduction and settlement based on the user's OD (origin-destination) data, which includes the user's successful inbound and outbound transaction records.
[0089] The clearing system refers to the automatic ticketing and clearing center system, which is used to issue and manage tickets, settle and clear tickets and payments for different routes, and has the function of clearing with other payment cards.
[0090] Od / destination (OD) data describes pedestrian travel traffic between origin and destination.
[0091] This embodiment adopts an asynchronous, decoupled, high-concurrency architecture that combines IoT communication, real-time stream processing, and in-memory computing. The clusters such as Kafka, Redis, and MQTT are all distributed, with no single point of failure. They can be horizontally scaled to cope with future passenger flow growth, achieving high availability and scalability, and enabling real-time decision-making through stream processing.
[0092] In addition, such as Figure 2 As shown, in the persistence and monitoring layer, all transaction records (including records of abnormal opening of doors) can be persisted to the database (DB).
[0093] All logs and events flow into the ELK Stack (Elasticsearch-Logstash-Kibana) system simultaneously for real-time monitoring on the monitoring dashboard, business dashboard display (such as the occurrence rate of abnormal gates not being opened at each site), and post-event auditing and tracing. Operators can monitor the occurrence rate and distribution of abnormal gates not being opened across the entire network in real time, accurately locate gates with high failure rates, and achieve predictive maintenance.
[0094] Among them, ELK Stack is an open-source real-time log processing and data analysis platform used for system monitoring, troubleshooting, and business analysis.
[0095] To enable those skilled in the art to better understand this embodiment, the control method of the gate in this embodiment is illustrated below through specific examples.
[0096] Scenario 1: Station entry anomaly
[0097] like Figure 4 As shown, at time T1, the user swipes the code at gate O1 at station A to enter the station. Gate O1 generates a transaction record O1-Gate and sends the transaction record O1-Gate to the intelligent matching engine. The intelligent matching engine verifies that the transaction record O1-Gate passes and issues an opening command to gate O1.
[0098] At time T1, gate O1 malfunctions and fails to open the gate. At this time, the gate O1 self-diagnostic gate opening command has been issued but no personnel pass through. At this time, a gate abnormal opening record is generated, written to Redis, and set to expire in X minutes (X is configurable, such as 5 minutes).
[0099] At time T2, the user moves to gate O2 at station A within X minutes and swipes the code to enter the station again. Gate O2 generates a transaction record O2-Gate and sends the transaction record O2-Gate to the intelligent matching engine. The intelligent matching engine initiates a query in Redis using the user ID and the ID of station A as indexes. At this time, it finds the abnormal opening record of the gate at time T1, compensates for the abnormal opening record, and issues an opening command to gate O2.
[0100] At time T2, gate O2 successfully opened the gate, and the user entered the station normally.
[0101] At time T3, the user swipes their code at gate D1 at station B to exit, generating a transaction record D1-Gate. The transaction record D1-Gate is then sent to the intelligent matching engine. The intelligent matching engine verifies that the transaction record D1-Gate passes and issues an opening command to gate D1.
[0102] At time T3, gate D1 successfully opened the gate, and the user exited the station normally.
[0103] The clearing system matches the trip's origin (OD) with the O2-Gate and D1-Gate, and can then perform subsequent logical processing such as normal deduction of fares via the ride code.
[0104] Users can travel normally during Terminal 4 and Terminal 5.
[0105] Scenario 2: Departure Anomaly
[0106] like Figure 5 As shown, at time T1, the user swipes the code at gate O1 at station A to enter the station. Gate O1 generates a transaction record O1-Gate and sends the transaction record O1-Gate to the intelligent matching engine. The intelligent matching engine verifies that the transaction record O1-Gate passes and issues an opening command to gate O1.
[0107] At time T1, gate O1 successfully opened the gate, and the user entered the station normally.
[0108] At time T2, the user swipes their code at gate D1 at station B to exit, generating a transaction record D1-Gate. The transaction record D1-Gate is then sent to the intelligent matching engine. The intelligent matching engine verifies that the transaction record D1-Gate passes the verification and issues an opening command to gate D1.
[0109] At time T2, gate D1 malfunctions and fails to open the gate. At this time, gate O1 has issued a self-diagnostic gate opening command but no one passes through. At this time, a gate abnormal opening record is generated, written to Redis, and set to expire in X minutes (X is configurable, such as 5 minutes).
[0110] At time T3, the user moves to gate D2 at station B within X minutes and swipes their code to exit the station again. Gate O2 generates a transaction record D2-Gate and sends it to the intelligent matching engine. The intelligent matching engine initiates a query in Redis using the user ID and the ID of station B as indexes. At this time, it finds the abnormal opening record of the gate at time T2, compensates for the abnormal opening record, and issues an opening command to gate D2.
[0111] At time T3, gate D2 successfully opened the gate, and the user exited the station normally.
[0112] The clearing system matches the trip's origin (OD) with the O1-Gate and D2-Gate, and can then perform subsequent logical processing such as normal deduction of fares via the ride code.
[0113] Users can travel normally during Terminal 4 and Terminal 5.
[0114] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0115] Reference Figure 6 The diagram shows a control device for a gate provided in an embodiment of the present invention, which may specifically include a gate 601 and an intelligent matching engine 602;
[0116] Turnstile 601 is used to generate the first transaction record when a user enters or leaves the site;
[0117] The intelligent matching engine 602 is used to search the cache device for records of abnormal opening of the first door when the user first enters or leaves the site, based on the first transaction record;
[0118] The intelligent matching engine 602 is also used to generate a first gate opening instruction based on the first gate abnormal opening record and the first transaction record when the first gate abnormal opening record is found.
[0119] The gate 601 is also used to control the opening of the gate according to the first gate opening command.
[0120] In one embodiment of the present invention, a message middleware and a stream computing engine are also included;
[0121] The gate 601 is also used to publish the first transaction record to the first topic in the message middleware;
[0122] A message middleware is used to send the first transaction record to a second topic in the message queue based on the first topic.
[0123] The stream computing engine is used to consume the first transaction record from the second topic that has been subscribed to in the message queue and send the first transaction record to the intelligent matching engine.
[0124] In one embodiment of the present invention, a message middleware and a stream computing engine are also included;
[0125] The intelligent matching engine 602 is also used to send the first gate opening command to the stream computing engine;
[0126] A stream computing engine is used to publish the first gate opening instruction to the third topic of the message queue;
[0127] A message middleware is used to consume the first gate opening instruction from the third topic that has been subscribed to in the message queue, and to publish the first gate opening instruction to the gate that has subscribed to the fourth topic according to the third topic.
[0128] In one embodiment of the present invention, the intelligent matching engine 602 is further configured to generate a second gate opening instruction based on the first transaction record when no record of abnormal opening of the first gate is found.
[0129] The gate 601 is also used to control the opening of the gate according to the second gate opening command.
[0130] In one embodiment of the present invention, a message middleware and a stream computing engine are also included;
[0131] The intelligent matching engine 602 is also used to send the second gate opening command to the stream computing engine;
[0132] A stream computing engine is used to publish the second gate opening command to a third topic in the message queue;
[0133] The message middleware is used to consume the first gate opening instruction from the third topic that has been subscribed to in the message queue, and to publish the second gate opening instruction to the gate that has subscribed to the fourth topic according to the third topic.
[0134] In one embodiment of the present invention, the turnstile 601 is also configured to generate a record of abnormal opening of a second door when it is detected that no person has passed through the door.
[0135] A caching device is used to store records of abnormal opening of the second door for scenarios in which the user enters or leaves the site.
[0136] In one embodiment of the present invention, a message middleware and a stream computing engine are also included;
[0137] The turnstile 601 is also used to publish the abnormal opening record of the second door to the fifth topic in the message middleware;
[0138] The message middleware is used to send the record of the abnormal opening of the second door to the sixth topic of the message queue according to the fifth topic;
[0139] The stream computing engine is used to consume the second door abnormal opening record from the sixth topic that has been subscribed to in the message queue, and send the second door abnormal opening record to the cache device.
[0140] In one embodiment of the present invention, the caching device is further configured to delete the abnormal opening record of the second door when the storage time for the abnormal opening record of the second door exceeds a preset threshold.
[0141] The present invention provides a control device for a turnstile. By using the control device for the turnstile, the various steps in the aforementioned control method embodiments of turnstiles can be implemented.
[0142] It should be noted that the module division in the control devices of various turnstiles provided in the above embodiments is illustrative and only represents one logical functional division. In actual implementation, other division methods may also be used. Furthermore, the functional modules in the various embodiments of this invention can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0143] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of the embodiments of the present invention can be embodied in the form of a computer program product, which is stored in a computer storage medium and includes several instructions to cause an electronic device or processor to execute all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned computer storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0144] Furthermore, the control device and control method of the turnstile provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0145] Reference Figure 7 The diagram illustrates an electronic device according to an embodiment of the present invention. Figure 7As shown, the electronic device in this embodiment of the invention includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the control method embodiment of the gate described above. Alternatively, when the processor executes the computer program, it implements the functions of each module in the control device embodiment of the gate described above.
[0146] For example, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which can be used to describe the execution process of the computer program in the electronic device.
[0147] The electronic device may be a desktop computer, a cloud server, or other computing device. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 7 This is merely one example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.
[0148] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0149] The memory can be an internal storage unit of the electronic device, such as a hard drive or RAM. Alternatively, it can be an external storage device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory can include both internal and external storage units. The memory is used to store the computer program and other programs and data required by the electronic device. The memory can also be used to temporarily store data that has been output or will be output.
[0150] This invention also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the gate control method as described in the foregoing embodiments.
[0151] This invention also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the gate control method as described in the foregoing embodiments.
[0152] This invention also discloses a computer program product that, when run on a computer, causes the computer to execute the gate control method described in the foregoing embodiments.
[0153] The embodiments described above are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A control method for a turnstile, characterized in that, include: The turnstile generates the first transaction record when a user enters or leaves the site; The intelligent matching engine searches the cache device for records of abnormal door openings that occurred when the user first entered or left the site, based on the first transaction record. When the intelligent matching engine finds a record of abnormal opening of the first gate, it generates a first gate opening command based on the record of abnormal opening of the first gate and the first transaction record. The gate opens according to the first gate opening command.
2. The method according to claim 1, characterized in that, After the turnstile generates a first transaction record when a user enters or leaves the site, the method further includes: The gate will publish the first transaction record to the first topic in the message middleware; The message middleware sends the first transaction record to the second topic of the message queue based on the first topic. The stream computing engine consumes the first transaction record from the second topic that has been subscribed to in the message queue and sends the first transaction record to the smart matching engine.
3. The method according to claim 1, characterized in that, After the intelligent matching engine generates a first gate opening command based on the first transaction record when it finds an abnormal opening record of the first gate, the method further includes: The intelligent matching engine sends the first gate opening command to the stream computing engine; The stream computing engine publishes the first gate opening instruction to the third topic of the message queue; The message middleware consumes the first gate opening instruction from the third topic that has been subscribed to in the message queue, and publishes the first gate opening instruction to the gate that has subscribed to the fourth topic according to the third topic.
4. The method according to claim 1, characterized in that, Also includes: When the intelligent matching engine does not find a record of abnormal opening of the first gate, it generates a second gate opening command based on the first transaction record. The gate opens according to the second gate opening command.
5. The method according to claim 4, characterized in that, After the intelligent matching engine generates a second gate-opening command based on the first transaction record when it does not find a record of the first gate being abnormally opened, the method further includes: The intelligent matching engine sends the second gate opening command to the stream computing engine; The stream computing engine publishes the second gate opening instruction to the third topic of the message queue; The message middleware consumes the first gate opening instruction from the third topic that has been subscribed to in the message queue, and publishes the second gate opening instruction to the gate that has subscribed to the fourth topic according to the third topic.
6. The method according to any one of claims 1-5, characterized in that, Also includes: When the turnstile detects that no one has passed through a door, it generates a record of an abnormal opening of a second door. The caching device stores records of abnormal opening of the second door for scenarios where the user enters or leaves the site.
7. The method according to claim 6, characterized in that, After the turnstile generates a record of an abnormal opening of a second door when it detects that no one has passed through the first door, the method further includes: The turnstile will publish the record of the abnormal opening of the second door to the fifth topic in the message middleware; The message middleware sends the record of the second door being opened abnormally to the sixth topic of the message queue according to the fifth topic; The stream computing engine consumes the second door abnormal opening record from the sixth topic that has been subscribed to in the message queue, and sends the second door abnormal opening record to the cache device.
8. The method according to claim 6, characterized in that, Also includes: When the caching device stores the record of the abnormal opening of the second door for a period of time exceeding a preset threshold, it deletes the record of the abnormal opening of the second door.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the gate control method as described in any one of claims 1-8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the control method of the gate as described in any one of claims 1-8.