Access Control & Time-Attendance Systems

What is scarce in this field is not someone who can call an SDK. It is someone who knows what the hardware actually does at 03:00 on a Sunday when the link has been down for six hours, and who knows why your night-shift overtime calculation disagrees with the payroll department twice a month. That knowledge took a decade of production systems to acquire, and it does not depend on the language your product is written in.

Your stack is not the issue

Most companies building on ZKTeco and comparable terminals work in C# or Java. That is the sensible choice — it is what the manufacturer's SDKs, sample code and documentation target, and it is what you can hire for. Nothing on this page asks you to change it.

I work with teams in three modes, and the language only matters in the third:

  • Domain consulting. Your engineers are competent and are building the thing; they are losing weeks to behaviour nobody documented. I answer the specific questions, review the design, and tell you which of your assumptions about the hardware are wrong before you build on them.
  • Specification. I write the protocol handling, sync model and rule logic as a document precise enough for your team to implement in your language, with the edge cases enumerated rather than discovered. This is usually the best value for money, because the knowledge stays in your company.
  • Implementation. I build the component. If it has to live inside a .NET or Java system, it is delivered behind a boundary that system already speaks — an HTTP service, or a shared library behind a C ABI. See Native & Low-Level Engineering for how that integration is done.

The PUSH protocol as it behaves, not as it is documented

ZKTeco's PUSH Communication Protocol v3.1.2 inverts the classic SDK model: instead of your server opening a session to the terminal, the terminal makes outbound HTTP requests to you. That is what makes cloud-hosted access control possible without a public IP at every site — and it moves all the difficulty into your server.

The mechanics are learnable from the specification:

  • Registration and the option handshake at /iclock/cdata, and the option block that configures the terminal for the rest of its life on your system — Stamp, OpStamp, TransFlag, TransTimes, TransInterval, Delay, ErrorDelay, TimeZone, Realtime.
  • Record ingestion: table=ATTLOG for punches, OPERLOG for operations on the device itself, attendance photos where the model supports them.
  • The command queue at /iclock/getrequest: DATA UPDATE USERINFO, DATA UPDATE FINGERTMP, DATA UPDATE BIOPHOTO, DATA DELETE, DATA QUERY ATTLOG, CLEAR LOG, CHECK, INFO, REBOOT.
  • Acknowledgement at /iclock/devicecmd with ID=..&Return=..&CMD=...

What is not learnable from the specification is the behaviour that costs you the project:

  • Firmware generations disagree about what the option block means. A transfer flag combination that reports a category of events on one generation silently omits it on another. There is no error. The device simply never mentions those events, and you find out from a payroll dispute six weeks later.
  • Stamps move backwards. Incremental sync depends entirely on stamp counters staying consistent between server and device. A factory reset, a firmware upgrade, or a warranty replacement carrying the same serial number resets them — and a server that trusts the stamp either re-imports a month of punches or loses a day of them.
  • Acknowledgement is not delivery. A command can be taken from the queue and never applied. If your server treats dequeue as success, your database and your terminal diverge permanently and quietly.
  • One poisoned command blocks everything behind it. A queue without per-command failure isolation stops the entire device, and the symptom presented to support is "this terminal stopped updating", which points nowhere near the cause.
  • Retry settings are a fleet-wide decision. Set ErrorDelay wrong and a transient server error turns three hundred terminals into a retry storm that keeps the server down.

Biometric template management across device generations

Templates are where mixed fleets stop being a theoretical problem. A finger enrolled on one sensor generation does not necessarily verify on another, and the encodings do not line up by themselves.

  • ZK proprietary template versions (v9 and v10) alongside ISO 19794-2 and ANSI-378: which conversions are lossless, which are not, and which devices reject a template they consider foreign.
  • Correct transport of templates: the Size and Valid fields, base64 payloads, per-finger index handling, and the multi-part behaviour some firmware requires for large biometric records.
  • Per-device capacity limits — user slots, template slots, face and palm records — and what to do when a site outgrows a terminal, which is a data-partitioning decision rather than a hardware purchase.
  • PIN collisions when previously separate installations are merged: PINs are device-scoped, your user identities are not, and the mapping layer between them is where most systems quietly break.
  • Re-enrolment strategy when a template will not verify on a replacement device, designed so that re-enrolment is a per-user event rather than a site-wide outage.
  • Where biometric data lives, how long it is kept, and what leaves the device. Under GDPR this is special category data, and the architecture decision — templates centralised, or held only on the terminal — is one your legal counsel will eventually ask about. Better to make it deliberately.

Attendance rule logic — where these products actually fail

Reading a punch off a terminal is the easy half. Turning a stream of punches into a number that a payroll department will accept is the half that generates every support ticket, and it is the least transferable knowledge in the domain, because it is learned from disputes rather than from documentation.

  • Shifts that cross midnight. A punch at 23:47 and a punch at 07:12 are one shift or two depending on rules that must be explicit. Any system that assigns attendance to a calendar day by the timestamp alone will be wrong for every night worker it has, and the error is systematic rather than random.
  • Overtime. Thresholds that are daily, weekly or per-period; bands with different multipliers; overtime that requires prior approval versus overtime that accrues automatically; the interaction between a late arrival and an extended departure on the same day. The rules are usually a mixture of labour law, a collective agreement and local custom, and they are rarely written down anywhere in one place before someone asks me to encode them.
  • Multiple overlapping calendars. A company calendar, a site calendar, a departmental roster, a national holiday list and a shift pattern that repeats on a cycle that does not divide evenly into a week. When they disagree — and they always disagree — precedence must be defined rather than emergent, or the answer changes depending on the order rows came out of the database.
  • Leave, and its interaction with everything above. Leave types that consume different balances, half-days against a shift that is not eight hours, sick leave applied retroactively over days that have already been calculated and approved, leave that falls on a public holiday, and leave that overlaps a night shift and therefore two calendar days.
  • Recalculation and immutability. A retroactive change — a corrected punch, a late leave request, a roster fixed after the fact — must recompute a closed period without silently altering figures a manager has already signed off. Systems that recalculate in place lose the audit trail, and the first serious dispute is the moment you discover that.
  • Manual correction as a first-class path. People forget to clock in. A system that has no auditable way to insert a corrected punch, with an approver and a reason, will have one anyway — implemented by somebody with database access, unlogged.

I design this as an explicit rule model with defined precedence, deterministic recalculation and a preserved audit trail — separated from device handling, because the two change for entirely different reasons and on entirely different schedules.

Devices on real networks

Terminals sit on private LANs behind NAT, on links that drop for hours, in cabinets that lose power. The domain question is not how to open a socket; it is what the system should believe when a device has been silent for a day.

  • Buffer-and-replay. A terminal that has been offline will deliver a backlog when it returns, out of order relative to other devices and overlapping records you already have. Ingestion has to be idempotent — deduplicated on the natural key of serial number, PIN, timestamp and verify mode — so that a replayed batch is harmless by construction.
  • Clock drift and timezones. Devices report in local time, sites cross DST boundaries on different dates, and a terminal whose RTC drifted by four minutes produces punches that fail your shift rules for reasons nobody can explain from the UI.
  • State reconciliation. The question that matters is not whether a command succeeded, but whether the terminal currently holds what your database thinks it holds. Periodic comparison of the device user table, template set, timezones and access groups, with a repair path that pushes only the differences, and automatic full resync when a device shows the signatures of a reset.
  • Per-device health. Last contact, last successful command, queue depth, unacknowledged commands. An operations view that tells your support desk which of three hundred terminals actually needs attention, so that a sync failure is noticed by the system rather than by payroll at month end.
  • Reaching devices that have no route in. Where the classic SDK path is required, the terminal has to be reachable from your side — which is exactly what a customer's firewall prevents. That is an engineering problem rather than a domain one, and it is covered on Native & Low-Level Engineering.

Recovery from the failures that only happen in production

Every system in this field eventually meets the same short list, and the difference between products is whether the list was designed for or discovered: a device replaced under warranty with a cloned serial number; two sites merged into one database with overlapping PINs; a firmware upgrade that changes the option-block semantics mid-fleet; a database restored from backup to a point behind what the terminals have already delivered; an operator who cleared the device log to "fix" a problem. Each has a correct recovery path, and each has a naive one that makes the data permanently wrong.

Hardware

ZKTeco is where my depth is. I also work with Hikvision and Suprema terminals in mixed installations, at the level of ISAPI-style HTTP interfaces, event push and vendor SDKs. If your product has to present one coherent model across several vendors' hardware, that abstraction layer is a large part of what I would be designing for you — and the place where vendor differences must be absorbed rather than leaked into your business logic.

I am not a ZKTeco, Hikvision or Suprema partner and I hold no vendor certification. What I have is a decade of implementing against these systems in production. Product and vendor names are used here only to describe the hardware I work with.

Typical starting points

  • Our C# team can talk to the devices, but the attendance numbers are wrong and nobody can say why.
  • Punches arrive twice, or arrive a day late, and we cannot reproduce it.
  • We are writing the overtime and night-shift rules for the third time and they are still wrong.
  • We built our own PUSH server and it works until a device reboots.
  • Fingerprints enrolled on the old devices do not work on the new ones.
  • We are entering this market and want someone who has already made the expensive mistakes.

Book a free 30-minute technical call

Useful things to bring: device models and firmware versions, whether you are on PUSH or the SDK, how many terminals across how many sites, and one concrete symptom with a timestamp — or one attendance calculation that is wrong and the rule it was supposed to follow. Thirty minutes on those specifics usually locates the fault well enough to say what fixing it involves.

Book a free 30-minute technical call

Tell me what is broken.

No sales call. You describe the problem, I tell you whether it is something I can solve and roughly what it takes. If it sits outside what I do, I will say so on that call.

Book a free 30-minute technical call