Detailed Description
The following description of the technical solutions in the embodiments of the present invention will be clear and complete, and it is obvious that the described embodiments are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The invention designs a method and a device for acquiring RFID data, which realize indirect control and data interaction between a service system and off-line RFID equipment through an HTTP local connection protocol. According to the method, the RFID hardware is directly docked without a service system, so that technical differences and potential safety risks are effectively isolated, the high efficiency and safety of data interaction are ensured, and a more stable technical support is provided for application of the RFID technology in various industries.
Referring to fig. 1 and 2, fig. 1 is a flowchart of the method of the present invention, and fig. 2 is a specific thread diagram of the method of the present invention, including:
s1, an RFID reading client is connected with RFID equipment through a local HTTP service, receives RFID tag information returned by the RFID equipment through a callback interface, and performs caching operation on the RFID tag information.
The specific operation of the corresponding steps is as follows:
Starting a client:
an off-line operator starts an RFID reading client;
after the RFID reading client is opened, a local HTTP service is started, and an SDK supported by the RFID device is used for connecting the RFID device in a serial port or network port mode;
And opening a webpage of an ERP/WM/MES service system needing to perform business operations such as RFID binding, warehouse-in and warehouse-out.
Acquiring a device connection state:
the service system uses an HTTP interface to connect HTTP service provided by the RFID reading client through an HTTP:// localhost local access address to acquire the connection state and the reading state of the RFID device;
If the equipment is disconnected, the equipment can be actively connected, and the equipment can be connected/disconnected manually through an HTTP interface;
returning to the connection and opening state of the equipment, and judging and controlling by the service system to perform service operation.
The opening device reads the tag:
when the RFID reading client is connected with normal conditions through the interface return device, an HTTP interface is used for calling an opening device interface of the RFID reading client, so that the device can be controlled to open/close to read the RFID tag;
After the RFID device reads the tag, the RFID reading client receives RFID information (device number, TID, EPC, power and antenna number) read by the RFID device through a callback interface, removes the RFID tag information, judges whether the current RFID has a client cache or not, if so, stores the RFID into a cache queue inside the RFID reading client;
And (3) reprocessing the data of the cache queue through an asynchronous thread, storing the data in a packet mode according to equipment codes, removing internal redundant information, only reserving the EPC/TID array mode for storage, reducing the storage volume and facilitating transmission. The business system can acquire tag information according to the designated equipment.
S2, the service system acquires RFID tag information through a local access address by using an HTTP interface, invokes SSE service, controls message pushing of starting or closing the SSE service through the HTTP interface, filters and packages the cached RFID tag information through equipment codes, and polls the SSE service through an asynchronous pushing thread to select a pushing mode of the message pushing.
The specific operation of the corresponding steps is as follows:
Establishing SSE connection:
The service system actively uses the SSE client to connect with the SSE server provided by the RFID reading client through the local address in the service processing page, and the SSE client can transmit the equipment code appointed read-write data;
The service system controls the RFID reading client to start/stop message pushing through the HTTP interface, the SSE client can continuously receive the RFID information pushed by the SSE server, and the pushing is canceled and the RFID reading record of the current device is emptied when the SSE client is closed;
filtering data according to equipment codes of the SSE client to obtain a tag array cached by the RFID reading client, packaging the data according to character strings, separating each tag by commas, minimizing the reduction of transmission volume, and improving transmission and analysis efficiency;
and the asynchronous push thread polls the RFID reading client connected with the current SSE server according to the configured time, if the push is started, the message push is carried out on the online client, if the push is not started, the next poll is carried out, whether the client has a device code is judged, and if the client has the device code, the current client acquires the cache data according to the device code and carries out the push.
S3, the service system reads the RFID tag array of the RFID reading client, performs data inspection, and performs data verification according to different service requirements.
The specific operation of the corresponding steps is as follows:
receiving tag data:
if the RFID device reads the tag and establishes SSE connection, the SSE client can continuously receive the RFID tag data pushed by the SSE server;
The service system separates the data of the SSE client according to commas to obtain all tag arrays read by the current RFID equipment;
and the service system performs data inspection on the read tag array.
The data inspection includes:
checking the length of label content;
tag count checking (binding operation can only be performed on a single tag);
the manufacturer to which the tag belongs (TID distinguishes between manufacturers);
tag type (encrypted/non-encrypted) (TID distinguishes tag types);
tag (EPC) data length (different types of tag EPC length;
tag coding rules (EPC confirm tag rules);
After the inspection is finished, the data are displayed according to different business requirements, and the on-site operators are handed to check the data and the actual articles:
The SSE client only acquires one label, and judges that serial reading and misreading occur and needs to be read again under the condition that the number of the labels exceeds.
Batch operations, such as warehouse entry/warehouse exit/inventory, etc., require judging whether the read label belongs to the purchasing RFID label of the service system, and whether the label accords with the current article label coding rule, because a plurality of products widely applied to RFID already begin to be managed by adopting RFID, and the labels not belonging to the service are required to be filtered.
Stopping reading:
clearing the RFID reading client tag cache data;
And stopping the RFID device from reading the tag and performing next business processing.
Compared with the related art, the invention has the advantages that the indirect control and data interaction between the service system and the RFID reader-writer are realized by using the HTTP local connection protocol, the system integration flow is simplified, and the technical threshold and the cost are reduced.
Aiming at the security and privacy protection problems possibly encountered in the application process of the RFID technology, the direct interaction between the service system and the RFID equipment is effectively isolated through a design solution, such as an HTTP local connection protocol, so that the risks of data leakage and illegal access are reduced, and the security of data transmission and storage is ensured.
Most of the current business systems (WMS, ERP, MES) adopt web technology, the RFID devices are docked by using the method, the system does not need to access the SDK and the API of the RFID devices, the HTTP web technology is directly used for controlling the reader-writer, and the development cost is greatly reduced.
The RFID data acquisition comprises an RFID reading client, an HTTP module and an SSE server, wherein the RFID reading client is used for reading RFID tag information of RFID equipment through an HTTP interface and connecting and communicating with a service system;
the service system is used for deploying the SSE client, connecting with the RFID reading client and used for calling the data of the RFID tag information read by the RFID reading client and checking the data;
and the RFID device is connected with the RFID reading client and used for reading the RFID tag information.
Compared with the related art, the integrated mode of the convenience of the invention ensures that enterprises can quickly complete the butt joint of RFID equipment, complete the interaction between data acquisition and a system, promote the enterprises to upgrade and optimize the existing system by using the RFID technology, realize fine management, optimize operation flow and improve production efficiency and customer satisfaction.
In another aspect, the present invention also provides a computer readable storage medium storing a computer program, which when executed by a processor, implements the steps of the RFID data acquisition method described above.
An extension of another aspect of the present invention also provides a computer terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the RFID data acquisition method described above when the processor executes the computer program.
The processor, when executing the computer program, performs the functions of the modules/units in the above-described device embodiments. The computer program may be divided into one or more modules/units, which are stored in the memory and executed by the processor to accomplish the present invention, for example. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments are used for describing the execution of the computer program in the terminal device.
The computer terminal can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing devices. May include, but is not limited to, a processor, memory. More or fewer components may be included or certain components may be combined, or different components may be included, for example, in input and output devices, network access devices, buses, etc.
The Processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may be an internal storage unit, such as a hard disk or a memory. The memory may also be an external storage device such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), or the like. Further, the memory may also include both internal storage units and external storage devices. The memory is used for storing the computer program and other programs and data. The memory may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent structures or equivalent processes or direct or indirect application in other related technical fields are included in the scope of the present invention.