Implementation of an Intelligent Library System Based on WSN and RFID

To improve the intelligent management of the library, on the basis of manual and information management, new technologies were combined to design RFID wireless network with WSN consisting of nodes. Three modules of literature search positioning system, book whole frame system and automatic borrowing and returning door guard alarm system were mainly explored. The intelligent library system based on WSN and RFID used advanced RFID and ZigBee technology for the optimization and integration of literature resources, service process and management mode of the library. The library automation and intelligent interaction were realized and the concept of people-oriented was given full play to the maximum. The results showed that the intelligent library system based on WSN and RFID could basically realize the intelligent library management. To sum up, the system creates a random library service and management system at anytime and anywhere.


Introduction
Both WSN technology and RFID technology are the frontiers of the world. Library as a place for knowledge accumulation and dissemination is particularly important in the wave of information technology. The introduction of technology such as computer, Internet and barcode makes its development enter the digital age. However, management and service still need staff to check, find and borrow books by checking, searching and borrowing books, which is time-consuming and laborious, so readers often have to wait in line. With the increase of collections and number of readers, the demand is increasing, which has become the restricting factor of library development. The technology combining wireless sensor network of ZigBee andRFID is studied.In accordance with the present situation of library, intelligent system based on location is designed, so as to provide more convenient services for readers, which fully embodies the "humanization, information and automation" of intelligent management. cost, and reader dependence. Therefore, the combination of WSN technology and RFID technology has very broadprospect.
To sum up, for large and medium-sized libraries, due to the large number of readers, there are many problems such as long queuing for borrowing books, theft of books, inventory statistics low accuracy and so on. How to effectively improve the efficiency with the modern new technology is the bottleneck of the development of the library.To improve the intelligent management of the library, on the basis of manual and information management, new technologies were combined to de-sign RFID wireless network with WSN consisting of nodes. The intelligent library system based on WSN and RFID used advanced RFID and ZigBee technology for the optimization and integration of literature resources, service process and management mode of the library.The intelligent library system based on WSN and RFID could basically realize the intelligent library management.

3
Design and implementation of system function

Analysis and design of network communication
Because this system is to realize the combination of WSN and RFID, there is a communication between wireless sensor nodes in the network communication, communication between RFID node and wireless sensor nodes, communication between nodes and coordinator, and communication between the coordinate device and the control server. As a result,in the network design, it should reflect the differences and achieve their integration in the implementation.
Design of ZigBee network and protocol stack: firstly, the network scheme is selected. The ZigBee wireless network is divided into chain-based linear structure, treebased hierarchical network structure and grid-based planar stereo structure. This system uses a tree-based hierarchical network structure. The structure has the ability of distributed data processing. The cluster head receives data transmitted by cluster members, processes and removes redundancy, and then sends it directly to coordinator or multi-hop forwarding through other cluster heads. Tree network structure with cascade increases, the stability of the network would decrease, packets need greater delay and packet loss is more serious, affecting the quality of wireless network data transmission. In order to overcome the shortcomings, based on the practice of the library application, we take a fixed hierarchical tree type network structure, which simplifies the network structure and reduces the complexity and error probability of data transmission. Moreover, in the application in the positioning and monitoring, we can clearly see the topology between network nodes, facilitating the realization of the control center software.
Secondly, the network is established. ZigBee has formulated detailed network rules, and the normalization of wireless networks is a major feature of ZigBee. First of all, the coordinator sets the PANID and the application layer calls its unique NLME-NETWORK-FORMATION.requestto the network layer for establishing thenetwork request. The network layer receives the request and then carries out MAC layer channel scanning. Through the energy detection scanning and active scanning, the most suitable channel is selected to build the network. Through the registration of primitives in MAC layer, the unique PANID not conflict with what exists is randomly selected. Next, PANID and channel scanning results are returned back to the application layer by confirm primitives.
Design ofcommunication module of RFID and node: in order to ensure the integrity of data exchange between RFID reader and wireless network node, we need to set up a preamble coding before each packet for the formulation of communication protocol. When receiving the data, firstly, whether the data packets are integrated in verified. After determining the integrity of data packets, we must verify the correctness of data packets through CRC check, so as to avoid data damage in the package due to some external factors during transmission. Because RFID reader and network node have their own characteristics in information transmission, they are also different in frame format. In order to achieve interaction between them, we need to design a data frame format that can merge them.

Begin
The coordination controller receives and controls the command of the PC machine Module implementation: the wireless network makes information interaction between the coordinator node and the control PC machine. On the one hand, data is transferred to coordinator for processing, processed and uploaded to PC. On the other hand, PC command is sent to identify the correctness of the command by coordinator, and then it is sent to the lower level device execution. Figure 1 is a communication process between the coordinator and the control PC machine.

PC software core module design
Document lookup location module: literature search. The technology combined with RFID and WSN can lighten the workload of managers. Readers can input the location search key on handheld devices or fixed devices, and get the detailed location information of the literature in the library, so that readers can help themselves find it.
First, the server computer can monitor the status information of books and literature through the combination of RFID and WSN, and can be stored in the database and updated in real time. The fixed RFID reader receives the command of the upper wireless network nodes, scanning the electronic labels on the books in small areas, getting the location information of the books, and uploading them to the server computer through the wireless network for data processing. Readers can input the books search keywords on a handheld device or a fixed device. The computer can automatically call specific location information of library from the database, which can realize the intelligent location search completely. Figure 2 is a book lookup flow chart. Find books in the database based on the information received If(Books are in the library) Find book information and location and return information } Reader orientation: the main function is to locate the position by the handheld device and the library card on the user's body. The use of library card positioning is basically the same as library monitoring and positioning. What different is that the reader is more active, and the literature is less mobile. In the wireless sensor network library layout, handheld devices, as a mobile node of the network, pass messages with the surrounding nodes, and passed to the control server through the wireless network for processing and then returned.The message returned is used to determine the location of the mobile node.
Book setting and inventory module: shelf management. This module is similar tobooks management. Each shelf has an electronic tag, and in each of the shelves on the bookshelf box area, it also posted with electronic tags. In the meanwhile, according to the bookshelf and bookshelf box electronic tags as well as the book category, a collection of classified category area is formed. BycombiningRFID and WSN technology,regional location interaction management is conducted on books on the shelf.
Book arrangement: the book collation can manage the books and documents in all directions from three aspects, which are books follow-up, loading on the shelves and book management.
Book management: this module does not require RFID or WSN technology, but only the workers operate the database on the computer. The new book is scanned and classified by handheld RFID equipment, and its position is located on the area, frame, box and sequence. Put the library information on the books and then carry on the loading operation.
Statistical inventory: since this system realizes the monitoring function based on wireless sensor network composed of RFID and WSN, the document management can be refined to each book as the unit. The module should make clear the type of inventory. Secondly, select the inventory type and then choose some kind of operation of someone who wants to take inventory of specific position at a certain time. Finally, we need to analyze the results of the inventory and print out the data in the format.
Automatically borrowing and returning door guard alarm module: the intelligent door guard alarm system is an open door control system, replacing the old magnetic door control system. Magnetic door guard alarm system is mainly scanning the magnetism of books through access control and judging whether to alarmbased on whether there is magnetism or not. But we cannot know the information for books and readers. We can make up for this with RFID technology. Figure 3 is a kind of door guardalarm system device.
Automatically borrowing books: the automatic borrowing operation flow chart is shown in Figure 4. This module provides readers automatically borrowing and returning books service. First of all, readers need to take with the electronic tag library card for entering the library. Through the door guard alarm system, RFID reader installed on security door automatically induces the reading card of readers and notifies the control center that the reader enters the library. When readers selected target books, they can directly take the books out of libraries. Through the intelligent door guard alarm system, the install reader automatically scans the reading card on readers' body and electronic label inside books and transmits thereaders' and books' information to the control center. The system software on the computer callsreaders' borrowing information from the database based on the readers' information. If the number of readers' borrowed books is full, then return the prohibited borrowing command to the alarm prompt system. Inform readers of unable to borrow books and then the reader put the book back. If the number of readers' borrowed books meets the quantity requirements of borrowing books, the system marksthe borrowing relationship between readers and books in the database. And through the mail system, it sends email to the reader's email or mobile phone,prompt readers that the book has been borrowed with the borrowing time and time limit.
The main methods of this module are designed as follows: Reading card and label scanning process description: Else // It means that a book with a label is passed through the entrance guard system { Emit a door guard alarm } Else //If Num is 0, it indicates no card or tag passing through the door guard alarm system, thus unable to cause the reader response, so this is not possible. Num is greater than 1, which are a card and the label greater than 1 in number or labels more than two or more. Automatic return book: the reader enters the library with the returned books. When passing the intelligent door guard alarm system, the RFID reader scansthe reader's library card and the electronic tag with books, sends the information to the control center, and indicates that the reader and the book have entered the library. The reader can put the book in the designated book return area, the bookshelf and so on. When the reader leaves the library, the reader scans the reader's card signal and transmits to the control center. The system indicates that the reader leaves the library, and sets the relationship between the readers and the books left in the library as a return relationship. Then,it sends mail to the reader's mailbox or cell phone to notify the reader the information of returning the book. At the same time, it tells the frame manager that a new book needs the whole frame. The operating process is shown in Figure 5.
The When the Num cycle is completed, the readers and the books saved by the array aredetermined as the return relationship, sending messages to the mail system and prompting them to send the returned notification mail to the readers. Reminding the mail system: the warning system is divided into two parts: the entrance guard alarm system and the mail system. The former is that the identification system on the door automatically alerts the unnormalized reader and book relationship through the security doorwhen readers automatically borrow and return the book. The latter is, after automatically borrowing and returning back, the borrowing and returning information is automatically sent to reader's mailbox or cell phone in the form of sending mails. When the returning deadline approaches, the system will automatically prompt the reader to renew or return in this form. The system can also make new and good book recommendation. The reader can continue borrowing it via email or mobile phone text messages and put forward their comments and suggestions. Figure 6 is the operation flow chart of the door guard alarm system: http://www.i-joe.org Test and runningresults

Communication test of sensor nodes and RFID reader
Test purpose: this test mainly aims at communication between the wireless network nodes of the system and the RFID reader and writer.
Test scheme:due to test environment constraints, we test the communication between WSN node and the RFID reader and realize the simulation of middleware system using computer software program. The RFID reader is connected to the serial port to the computer and the computer is connected to the sensor node 1 in the network programming.Within the range ofthe distance, a sensor node 2 burn well is set. After the RFID reader recognizes, by computer, it sends the identification code to the sensor node 1 for launching. If node 2 received information, it indicates that the information transmission is successful.
Test results: as shown in Table 1.

Precondition
The compiled router1 and router2 are recorded to the two sensor nodes and 1 light flashes when the program runs. The RFID reader is serially connected with the computer and the sensor node 1 i connected with the computer serial port. The REID reader is used to identify the electronic tags, send information to the PC machine through the serial port and send the identification information on the PC machine to the sensor node 1 through the serial port. When the sensor node sends information, the 1 and 2 lights flash simultaneously. When the sensor node 2 receives the recognition information, the 1 and 2 lights are simultaneously flashing.

Test input Electronic tag information identified by RFID reader and writer
Test output The sensor 2 receives the RFID recognition information, and the 1 and 2 lights are simultaneously flashing.
Experimental result Consistent with the expected results

ZigBee network transmission test
Test purpose: to test the transmission distance and packet loss rate of ZigBee network.
Test scheme: distribution test transmission distance between the two areas of a building. Meanwhile, in order to test the node packet loss rate, we set the acquisition mode. Node 1 sends a data to the coordinator node every three seconds and places the monitoring information node in a position to capture the data packets sent by transmission nodes. After a period of time, the actual received packets are compared with the data packets should be sent by sending node theoretically and network packet loss rate is obtained.
Test results: according to the above plan, we choose two different districts separately for several times to test, record the results, and combine all the test results to objectively reflect the effect of transmission network. In theory, the transmission distance of cc2420 is 100m, but in actual test, the distance between the two walls is about 30m. After penetrating three walls, the performance is greatly reduced, and it is easy to be disturbed, resulting in sending packet loss. The test results determine the transmission distance of the Zigbee module in the actual working environment, which provides the basis for the network distribution in the building. The result of the packet loss rate test is shown in Table 2. The test time starts from the initiation network, and the packet loss rate is about 1% under normal circumstances. After being disturbed by other Zigbee networks, the packet loss rate is increased when the network is built up. If the network is built up, the packet loss rate should be similar to that without interference. It is concluded that only when the Zigbee network is launched, the node search network is easily disturbed, and the network is basically stable after the network is established.

Conclusion
The advanced RFID and ZigBee technologyis used in intelligent library system based on WSN and RFID. Specifically, the main contents and contributions of this paper are as follows: 1. Threemodules of literature searching system, book whole frame system and automatic borrowing and returning control systemare mainly studied. 2. The literature resources, service process and management mode of the libraryare optimized and integrated, and the library automation and intelligent interactionare realized. 3. The intelligent management of the library can be realized, and the random library service and management system at anytime and anywhere is established.