将数据从条形码阅读器导入到Web应用程序 [英] Import data from a barcode reader to a web app

查看:141
本文介绍了将数据从条形码阅读器导入到Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个基于PHP的Web应用程序,并增加了对创建和读取条形码的支持. 我想知道如何从通过USB连接到运行Web应用程序的PC的条形码阅读器导入数据?条形码扫描仪是否以任何标准格式传输数据?

I am developing a PHP based web app and adding support to create and read barcodes. I wanted to know how can I import data from a barcode reader connected via USB to the PC running the web app? Is there any standard format in which the barcode scanners transmit data?

推荐答案

显然取决于生产者和模型.更好的具有多个模式.但是共有三种策略:

Obviously depends on producer and model. The better ones have more than a single mode. But three strategies are common:

1.)它们充当键盘,因此可以键入"所扫描的内容.这仅适用于小批量工作,并迫使您连接到系统.因此,对于Web应用程序,您需要一个简单的文本输入字段.

1.) they act as a keyboard, thus "typing" whatever is scanned. This is fine for small volume duty only and forces you to have a connection to the system. So for a web app you need a simple text input field.

2.)它们包含某种类型的内存(通常是SD插槽/卡),用于存储扫描的代码.这使您能够以异步时间表上载"扫描的数据,例如,从商店或其他任何地方回来时. SD卡具有标准的文件系统,通常会将代码扫描到CSV文件中.因此,对于Web应用程序,您需要上传文件或必须批量运行处理代码.

2.) they contain some sort of memory (typically an SD-Slot/-Card) where they store scanned codes. This enables you to "upload" the scanned data in an asynchronus schedule, for example when coming back from a trip through the shop or whatever. The SD cards have a standard filesystem, the codes are typically scanned into CSV files. So for a web app you require a file upload or have to process the codes in a batch run.

3.)他们使用WLAN,并且可以使用诸如REST-API之类的东西来上传"他们的数据.由于反馈的问题,根据我的经验,通常无法真正使用它.对于网络应用程序,这意味着您必须添加这样的API.

3.) they use WLAN and can use things like a REST-API to "upload" their data. Usually not really usable in my experience due to problems with the feedback. For a web app this means you would have to add such an API.

哦,有趣的是:必须编写更好的代码.通常,这是通过扫描手册中无穷无尽的一系列代码来完成的.一个非常有趣"的过程:-)

Oh, and a funny thing: the better ones have to be programmed. This is usually done by scanning endless series of codes from a manual booklet. A very "interesting" process :-)

这篇关于将数据从条形码阅读器导入到Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆