Đăng ký Đăng nhập
Trang chủ Developing an embedded module supporting service billing methods ...

Tài liệu Developing an embedded module supporting service billing methods

.PDF
150
1
92

Mô tả:

VITENAM NATIONAL UNIVERSITY HO CHI MINH CITY HCM UNIVERSITY OF TECHNOLOGY FACULTY OF COMPUTER SCIENCE AND ENGINEERING ——————– * ——————— GRADUATION THESIS DEVELOPING AN EMBEDDED MODULE SUPPORTING SERVICE BILLING METHODS MAJOR: COMPUTER ENGINEERING Council: COMPUTER ENGINEERING Supervisor: Dr. PHAM HOANG ANH Reviewer: Dr. NGUYEN TRAN HUU NGUYEN —o0o— Student 1: Cu Tan Phat (1752408) Student 2: Nguyen Ngoc Anh Tuan (1752592) HO CHI MINH, 10/2021 ĐẠI HỌC QUỐC GIA TP.HCM ---------TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA:KH & KT Máy tính ___ THUẬT MÁY TÍNH BỘ MÔN: KỸ _________________ CỘNG HÒA Xà HỘI CHỦ NGHĨA VIỆT NAM Độc lập - Tự do - Hạnh phúc NHIỆM VỤ LUẬN ÁN TỐT NGHIỆP Chú ý: Sinh viên phải dán tờ này vào trang nhất của bản thuyết trình HỌ VÀ TÊN: ______________________________________ MSSV: ______________ Cù Tấn Phát 1752048 Nguyễn Ngọc Anh Tuấn HỌ VÀ TÊN: ______________________________________ MSSV: ______________ 1752592 HỌ VÀ TÊN: ______________________________________ MSSV: ______________ Computer Engineering NGÀNH: ___________________________________ LỚP: ______________________ 1. Đầu đề luận án: Develop an Embedded Module Supporting Billing Methods ____________________________________________________________________________ ____________________________________________________________________________ 2. Nhiệm vụ (yêu cầu về nội dung và số liệu ban đầu): ____________________________________________________________________________ - Investigate existing modules and related hardware for design study. ____________________________________________________________________________ - Design the schematic diagram and PCB of the proposed module. ____________________________________________________________________________ - Develop APIs to integrate the proposed module with payment systems. ____________________________________________________________________________ - Prototype an application model, including a Web App for functional evaluation. ____________________________________________________________________________ ____________________________________________________________________________ 3. Ngày giao nhiệm vụ luận án: 4. Ngày hoàn thành nhiệm vụ: 5. Họ tên giảng viên hướng dẫn: Phần hướng dẫn: 100% TS. Phạm Hoàng Anh 1) __________________________________________________________________________ 2) __________________________________________________________________________ 3) __________________________________________________________________________ Nội dung và yêu cầu LVTN đã được thông qua Bộ môn. Ngày ........ tháng ......... năm .......... CHỦ NHIỆM BỘ MÔN GIẢNG VIÊN HƯỚNG DẪN CHÍNH (Ký và ghi rõ họ tên) (Ký và ghi rõ họ tên) PGS.TS. Phạm Quốc Cường PHẦN DÀNH CHO KHOA, BỘ MÔN: Người duyệt (chấm sơ bộ): ________________________ Đơn vị: _______________________________________ Ngày bảo vệ: ___________________________________ Điểm tổng kết: __________________________________ Nơi lưu trữ luận án: ______________________________ TS. Phạm Hoàng Anh TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA KH & KT MÁY TÍNH CỘNG HÒA Xà HỘI CHỦ NGHĨA VIỆT NAM Độc lập - Tự do - Hạnh phúc ---------------------------Ngày 06 tháng 08 năm 2021 PHIẾU CHẤM BẢO VỆ LVTN (Dành cho người hướng dẫn/phản biện) 1. Họ và tên SV: Cù Tấn Phát, Nguyễn Ngọc Anh Tuấn MSSV: 1752408, 1752592 Ngành (chuyên ngành): Kỹ thuật Máy tính 2. Đề tài: Develop An Embedded Module Supporting Billing Methods 3. Họ tên người hướng dẫn/phản biện: Phạm Hoàng Anh 4. Tổng quát về bản thuyết minh: Số trang: Số chương: Số bảng số liệu Số hình vẽ: Số tài liệu tham khảo: Phần mềm tính toán: Hiện vật (sản phẩm) 5. Tổng quát về các bản vẽ: - Số bản vẽ: Bản A1: Bản A2: Khổ khác: - Số bản vẽ vẽ tay Số bản vẽ trên máy tính: 6. Những ưu điểm chính của LVTN: - The students have demonstrated their capability in self-studying and then apply new knowledge and techniques to implement the proposed system. Basically, the students have successfully designed and implemented an embedded module that can communicate with various input types such as NFC, Barcode, and QR-Code, and a scalable IoT system by utilizing Azure IoT Platform. Therefore, the system is applicable to be deployed in practice, including hardware, embedded software, IoT server, and Web-based application. - The report has been well written and detailed though there are still typos. 7. Những thiếu sót chính của LVTN: - The students should perform experiments to evaluate the capability of the embedded module (i.e., IoT device). 8. Đề nghị: Được bảo vệ o Bổ sung thêm để bảo vệ o 9. Câu hỏi SV phải trả lời trước Hội đồng: 10. Đánh giá chung (bằng chữ: giỏi, khá, TB): Không được bảo vệ o Điểm : 8.8/10 Ký tên (ghi rõ họ tên) Phạm Hoàng Anh 75ѬӠ1* ĈҤ, +Ӑ& %È&+ .+2$ .+2$ .+ .7 0È< 7Ë1+ &Ӝ1* +Ñ$ ;­ +Ӝ, &+Ӫ 1*+Ƭ$ 9,ӊ7 1$0 ĈӝF OұS  7ӵ GR  +ҥQK SK~F  1Jj\  WKiQJ  QăP  3+,ӂ8 &+Ҩ0 %Ҧ2 9ӊ /971 'jQK FKR QJ˱ͥL K˱ͣQJ G̳QSK̫Q EL͏Q  +ӑ Yj WrQ 69 &Ô 7Ҩ1 3+È7 0669  1JjQK FKX\rQ QJjQK  .Ӻ 7+8Ұ7 0È< 7Ë1+ +ӑ Yj WrQ 69 1*8<ӈ1 1*Ӑ& $1+ 78Ҩ1 0669  1JjQK FKX\rQ QJjQK  .Ӻ 7+8Ұ7 0È< 7Ë1+  ĈӅ WjL3KiW WULӇQ P{ÿXQ QK~QJ Kӛ WUӧ QKLӅX ORҥL P{ KuQK WKDQK WRiQ GӏFK Yө 'HYHORSLQJ $Q (PEHGGHG 0RGXOH 6XSSRUWLQJ 6HUYLFH %LOOLQJ 0HWKRGV  +ӑ WrQ QJѭӡL KѭӟQJ GүQSKҧQ ELӋQ 76 1JX\ӉQ 7UҫQ +ӳX 1JX\rQ  7әQJ TXiW YӅ EҧQ WKX\ӃW PLQK 6ӕ WUDQJ  6ӕ FKѭѫQJ  6ӕ EҧQJ Vӕ OLӋX  6ӕ KuQK YӁ 6ӕ WjL OLӋX WKDP NKҧR 3KҫQ PӅP WtQK WRiQ +LӋQ YұW VҧQ SKҭP  7әQJ TXiW YӅ FiF EҧQ YӁ  6ӕ EҧQ YӁ %ҧQ $ %ҧQ $ .Kә NKiF  6ӕ EҧQ YӁ YӁ WD\ 6ӕ EҧQ YӁ WUrQ Pi\ WtQK  1KӳQJ ѭX ÿLӇP FKtQK FӫD /971 ,Q WKLV WKHVLV WKH VWXGHQWV KDYH SURSRVHG DQ LQWHJUDWHG PRGXOH DQG D PRGHO WKDW XVH VFDQQLQJ 45 FRGH DQG 5),' IRU VXSSRUWLQJ VHUYLFH ELOOLQJ PHWKRGV 7KH VWXGHQWV KDYH VXFFHVVIXOO\ LPSOHPHQWHG D PRGXOH WKDW LQWHJUDWHG WZR WHFKQRORJLHV ZKLFK DUH 5),'1)& WHFKQRORJ\ DQG EDUFRGH45 VFDQQLQJ WHFKQRORJ\ 7KLV PRGXOH LV DEOH WR UHDG GDWD IURP 5),' FDUG  EDU FRGH DQG WKH 45 FRGH ,W LV DOVR DEOH WR VHQG GDWD WR FHQWUDOL]HG VHUYHU IRU SURFHVVLQJ $ORQJ ZLWK D GHYLFH WKH VWXGHQWV KDYH DOVR EXLOW D EDFNHQ XVHG 0LFURVRIW $]XUH ,R7 +XE D ZHE SRUWDO IRU GHYLFH FRQILJXUDWLRQ DQG DQ $QGURLG $SS  1KӳQJ WKLӃX VyW FKtQK FӫD /971 ,Q P\ RSLQLRQ WKLV WKHVLV VKRXOG IRFXV PRUH RQ EXLOGLQJ DQ HPEHGGHG GHYLFH DV LW LV TXLWH VLPSOH 0RUH GHWDLOV RQ LPSOHPHQWDWLRQ VKRXOG EH LQFOXGHG LQ WKH WKHVLV VR WKDW RWKHUV FDQ UHSURGXFH WKH FXUUHQW ZRUN HDVLO\  ĈӅ QJKӏ ĈѭӧF EҧR YӋ ; %ә VXQJ WKrP ÿӇ EҧR YӋ † .K{QJ ÿѭӧF EҧR YӋ †   FkX KӓL 69 SKҧL WUҧ OӡL WUѭӟF +ӝL ÿӗQJ D &RXOG \RX SOHDVH WHOO XV ZKDW NLQG RI 5),' FDUGV WKDW \RXU V\VWHP VXSSRUWV" E &RXOG \RX SOHDVH WHOO XV KRZ WR NQRZ DQ 5),' FDUG LV YDOLG RU QRW"  ĈiQK JLi FKXQJ EҵQJ FKӳ JLӓL NKi 7%  ĈLӇP   .ê WrQ JKL U} Kӑ WrQ 1JX\ӉQ 7UҫQ +ӳX 1JX\rQ Commitment We commit that all knowledge, information mentioned in this proposal and all resources are made by our group - except for referenced knowledge had been quoted, absolutely not copy from other sources. If not, we completely take all responsibility from Dean Of Faculty and School Administrator. student group project Acknowledgements During the process of implementing and completing this thesis, our group has received a lot of supports. First and foremost, we would like to appreciate our supervisor - Ph.D Pham Hoang Anh. With the experience in developing embedded module, our supervisor has given many advice on designing and implementing the module. Besides, he also supported us in evaluating our proposed IoT system and clarifying the requirements for this topic. Our group also appreciate Mr. Huynh Hoang Kha due to his support on evaluating the suitability of the board for the box and giving many solutions on designing and making the box module. Thanks to his advice, we now have a simple box but meets all necessary requirements. Our group is extremely grateful for the dedication and support of the teachers in the Department of Computer Science & Engineering in particular as well as the Vietnam National University Ho Chi Minh City University of Technology in general. The knowledge, we have received from teachers, is very valuable and useful, which greatly supports us to complete this graduation thesis topic. Our group would like to appreciate our family, relatives, friends, those who have physically and mentally supported us in order to have enough energy and health to complete the thesis topic well. Tan Phat & Anh Tuan - Group’s members i Abstract Digital Transform Process has been one of the most prominent topics of this decade, especially from 2020 to this moment. Because of the global pandemic - COVID-19, digital transformation had made a remarkable development in many fields and aspects of life. Up to now, most of businesses had their owned digitalization strategy which makes them come closer to their customers but still prevent the infection of the pandemic. Based on that trend, many businesses start to apply modern methodology in activities related to authentication or authorization like payment transaction, access-control system,... These technologies could be divided into 3 groups: image processing technology (barcode, QR code,...), near communication protocols (RFID, NFC,...) or biometrics embedded with AI [Artificial Intelligent] system (fingerprint, facial/voice recognition,...). Differ from the third method, the applications using scanning technology and radio frequency transmission are easy to implement and have low cost in setting up and operation. As a result, there are many businesses that choose one of them or both to integrate with their existing system. However, there is a pain point existing in businesses using the applications mentioned above, it is the segregation of devices for each of method which prevents businesses from making use of application capabilities. In this report, we will talk about the the advantages of modern authentication technologies, specially in the situation of the world is suffering through the COVID19 pandemic. From those point, we will propose an integrated module and a model that make use of the scanning code and near communication protocol technologies in providing residence, entertainment and FB services. We also show our implementation in developing the module and building a simple system that could be applied by a business in case of using our module. ii Table of Contents Commitment Acknowledgements i Abstract ii List of Figures x Terms xii 1 Introduction 1 1.1 Why we choose this topic . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Our goal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.4 Our scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 Basic Knowledge 2.1 2.2 5 Internet of things - IoT . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.2 Components of IoT Ecosystem . . . . . . . . . . . . . . . . . 6 2.1.3 Application of IoT . . . . . . . . . . . . . . . . . . . . . . . 9 2.1.4 Challenges for IoT . . . . . . . . . . . . . . . . . . . . . . . 10 Communication protocols in IoT 2.2.1 . . . . . . . . . . . . . . . . . . . 13 Definition of communication protocols . . . . . . . . . . . . 13 iii Table of Contents 2.2.2 2.3 2.4 2.5 2.6 2.7 2.8 Communication protocols for IoT . . . . . . . . . . . . . . . 13 Message Queue Telemetry Transport (MQTT) . . . . . . . . . . . . 17 2.3.1 Definition: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.3.2 Component of MQTT: . . . . . . . . . . . . . . . . . . . . . 17 2.3.3 Publish, subscribe . . . . . . . . . . . . . . . . . . . . . . . . 18 2.3.4 MQTT Bridge . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Code scanning technologies . . . . . . . . . . . . . . . . . . . . . . . 19 2.4.1 Barcode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.4.2 QR Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.5.1 PCB Design . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.5.2 PCB Making . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Cloud Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.6.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.6.2 Service model . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.6.3 Deployment model . . . . . . . . . . . . . . . . . . . . . . . 27 Docker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.7.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.7.2 Docker architecture . . . . . . . . . . . . . . . . . . . . . . . 28 Kubernetes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2.8.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2.8.2 Kubernetes features . . . . . . . . . . . . . . . . . . . . . . . 30 3 Proposed solution and system design 3.1 3.2 31 Solution approaching . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.1.1 First system design . . . . . . . . . . . . . . . . . . . . . . . 31 3.1.2 Google Cloud Platform - Firebase . . . . . . . . . . . . . . . 32 3.1.3 Microsoft Azure - IoT hub . . . . . . . . . . . . . . . . . . . 33 Proposed solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 iv Table of Contents 3.3 Proposed module design and system design . . . . . . . . . . . . . . 37 3.3.1 System design . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.3.2 Module design . . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.3.3 Application design . . . . . . . . . . . . . . . . . . . . . . . 43 3.3.4 API reference . . . . . . . . . . . . . . . . . . . . . . . . . . 69 3.3.5 System Infrastructure . . . . . . . . . . . . . . . . . . . . . . 81 4 Implementation 4.1 4.2 4.3 Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 4.1.1 Components . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 4.1.2 Module design . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4.1.3 Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.1.4 Load stored data from config file . . . . . . . . . . . . . . . 90 4.1.5 Get data by GM65 and PN532 . . . . . . . . . . . . . . . . 91 4.1.6 Connect to Azure IoT Hub . . . . . . . . . . . . . . . . . . . 93 4.1.7 Send message . . . . . . . . . . . . . . . . . . . . . . . . . . 96 4.1.8 Update configuration from remote . . . . . . . . . . . . . . . 99 Tech Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 4.2.1 Back-end 4.2.2 Web application and mobile application: . . . . . . . . . . . 101 4.5 Zero-touch subscription flow . . . . . . . . . . . . . . . . . . 102 Remote configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 103 4.4.1 Device Twin State . . . . . . . . . . . . . . . . . . . . . . . 104 4.4.2 Implement remote configuration . . . . . . . . . . . . . . . . 105 Exchange data system . . . . . . . . . . . . . . . . . . . . . . . . . 110 4.5.1 4.5.2 4.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Zero touch subscription . . . . . . . . . . . . . . . . . . . . . . . . . 102 4.3.1 4.4 82 Overall description . . . . . . . . . . . . . . . . . . . . . . . 110 Sending data with Event Hub service . . . . . . . . . . . . 112 Back-end Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . 114 v Table of Contents 4.6.1 5 Conclusion 5.1 5.2 Cloud provider . . . . . . . . . . . . . . . . . . . . . . . . . 114 118 Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 5.1.1 Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 5.1.2 Portal website for module configuration . . . . . . . . . . . . 121 5.1.3 Web admin . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 5.1.4 Mobile app . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 5.1.5 Login and Register . . . . . . . . . . . . . . . . . . . . . . . 126 5.1.6 Booking and Service . . . . . . . . . . . . . . . . . . . . . . 127 System Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 5.2.1 Advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 5.2.2 Disadvantages . . . . . . . . . . . . . . . . . . . . . . . . . . 130 5.3 Feature Improvement . . . . . . . . . . . . . . . . . . . . . . . . . . 130 5.4 Source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 vi List of Figures 2.1 The application of the IoT . . . . . . . . . . . . . . . . . . . . . . 9 2.2 RFID printed circiut board . . . . . . . . . . . . . . . . . . . . . . 14 2.3 RFID applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.4 NFC modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.5 MQTT components . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.6 MQTT Bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.7 Version of QR code . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.8 QR code structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.9 Docker architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 28 3.1 Simple idead with MQTT broker . . . . . . . . . . . . . . . . . . . 32 3.2 System design using Firebase service . . . . . . . . . . . . . . . . . 33 3.3 Propose architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.4 Solution model design . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.5 ESP-WROOM-32 module . . . . . . . . . . . . . . . . . . . . . . . 39 3.6 PN532 reader module . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.7 GM65 scanner module . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.8 LM2596 step-down voltage regulator . . . . . . . . . . . . . . . . . 41 3.9 Propose Circuit diagram . . . . . . . . . . . . . . . . . . . . . . . . 42 3.10 Sign up use-case diagram . . . . . . . . . . . . . . . . . . . . . . . 47 3.11 Login use-case diagram . . . . . . . . . . . . . . . . . . . . . . . . 48 3.12 Booing ticket use-case diagram . . . . . . . . . . . . . . . . . . . . 49 vii List of Figures 3.13 Signup sequence diagram . . . . . . . . . . . . . . . . . . . . . . . 50 3.14 Login sequence diagram . . . . . . . . . . . . . . . . . . . . . . . . 51 3.15 Booking ticket sequence diagram . . . . . . . . . . . . . . . . . . . 52 3.16 Login use-case diagram . . . . . . . . . . . . . . . . . . . . . . . . 59 3.17 View list of devices use-case diagram . . . . . . . . . . . . . . . . . 60 3.18 Remote configuration use-case diagram . . . . . . . . . . . . . . . 61 3.19 View list of service use-case diagram . . . . . . . . . . . . . . . . . 62 3.20 Add service use-case diagram . . . . . . . . . . . . . . . . . . . . . 63 3.21 Login sequence diagram . . . . . . . . . . . . . . . . . . . . . . . . 64 3.22 View list of devices sequence diagram . . . . . . . . . . . . . . . . 65 3.23 Remote configuration sequence diagram . . . . . . . . . . . . . . . 66 3.24 View list of services sequence diagram . . . . . . . . . . . . . . . . 67 3.25 Add services sequence diagram . . . . . . . . . . . . . . . . . . . . 68 3.26 Sample login response . . . . . . . . . . . . . . . . . . . . . . . . . 71 3.27 Sample sign up response 3.28 Sample Booking response . . . . . . . . . . . . . . . . . . . . . . . 73 3.29 Sample Login response 3.30 Sample query list of devices response . . . . . . . . . . . . . . . . . 76 3.31 Sample query services response 3.32 Sample add new service response 4.1 PN532 setup connection protocol . . . . . . . . . . . . . . . . . . . 83 4.2 Schematic Design . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.3 Board Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.4 Wifi setup diagram 4.5 Sequence Diagram for Connecting Wifi Network . . . . . . . . . . 88 4.6 Flow diagram send request to . . . . . . . . . . . . . . . . . . . . . 94 4.7 HTTP GET request . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.8 Overview of send message from IoT deivce to Server . . . . . . . . 96 . . . . . . . . . . . . . . . . . . . . . . . 72 . . . . . . . . . . . . . . . . . . . . . . . . 74 . . . . . . . . . . . . . . . . . . . 78 . . . . . . . . . . . . . . . . . . 80 . . . . . . . . . . . . . . . . . . . . . . . . . . 87 viii List of Figures 4.9 Update configuration flow . . . . . . . . . . . . . . . . . . . . . . . 100 4.10 Zero touch subscription diagram . . . . . . . . . . . . . . . . . . . 103 4.11 Sample of Device Twin JSON document . . . . . . . . . . . . . . . 105 4.12 Device Twin Structure 4.13 Remote configuration flow 4.14 Devices data table . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 4.15 Sample configuration form 4.16 Remote configuration component diagram . . . . . . . . . . . . . . 110 4.17 Overall exchange data system diagram . . . . . . . . . . . . . . . . 111 4.18 Event Hub architecture . . . . . . . . . . . . . . . . . . . . . . . . 112 4.19 Custom Event Hub architecture . . . . . . . . . . . . . . . . . . . 113 4.20 Message Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 4.21 DigitalOcean instaces . . . . . . . . . . . . . . . . . . . . . . . . . 115 4.22 Built images at local . . . . . . . . . . . . . . . . . . . . . . . . . . 115 4.23 Built images on GitLab . . . . . . . . . . . . . . . . . . . . . . . . 116 4.24 Create deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 4.25 Deployment list . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 4.26 Exposing service . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 4.27 List of services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 4.28 Acccess web ađmin using external IP of service . . . . . . . . . . . 117 5.1 Inside the box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 5.2 The module board . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 5.3 The box lid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 5.4 Box side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 5.5 Box side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 5.6 Portal website - Homepage . . . . . . . . . . . . . . . . . . . . . . 122 5.7 Portal website - Configuration . . . . . . . . . . . . . . . . . . . . 122 5.8 Web admin login page . . . . . . . . . . . . . . . . . . . . . . . . . 123 . . . . . . . . . . . . . . . . . . . . . . . . 106 . . . . . . . . . . . . . . . . . . . . . . 107 . . . . . . . . . . . . . . . . . . . . . . 109 ix List of Figures 5.9 Manage devices page . . . . . . . . . . . . . . . . . . . . . . . . . . 124 5.10 Remote configuration form . . . . . . . . . . . . . . . . . . . . . . 124 5.11 Manage services page . . . . . . . . . . . . . . . . . . . . . . . . . 125 5.12 Create new cinema service form 5.13 Login and register screen . . . . . . . . . . . . . . . . . . . . . . . 127 5.14 Booking screen and QR tickets . . . . . . . . . . . . . . . . . . . . 128 5.15 Services screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 . . . . . . . . . . . . . . . . . . . 126 x List of Tables 3.1 Sign up use-case description . . . . . . . . . . . . . . . . . . . . . . 44 3.2 Log in use-case description . . . . . . . . . . . . . . . . . . . . . . . 45 3.3 Booking use-case description . . . . . . . . . . . . . . . . . . . . . . 46 3.4 Login use-case description . . . . . . . . . . . . . . . . . . . . . . . 54 3.5 View list devices use-case description . . . . . . . . . . . . . . . . . 55 3.6 Remote configuration use-case description . . . . . . . . . . . . . . 56 3.7 View list services use-case description . . . . . . . . . . . . . . . . . 57 3.8 Add service use-case description . . . . . . . . . . . . . . . . . . . . 58 3.9 API Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . 69 3.10 HTTP Status code table . . . . . . . . . . . . . . . . . . . . . . . . 70 3.11 Login request body . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 3.12 Sign up request body . . . . . . . . . . . . . . . . . . . . . . . . . . 71 3.13 Booking ticket request body . . . . . . . . . . . . . . . . . . . . . . 72 3.14 Booking tickets response body . . . . . . . . . . . . . . . . . . . . . 73 3.15 Login request body . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 3.16 Query list devices request parameter . . . . . . . . . . . . . . . . . 75 3.17 Query list device reponse body . . . . . . . . . . . . . . . . . . . . 75 3.18 Remote configuration request body . . . . . . . . . . . . . . . . . . 77 3.19 Query list services request parameters . . . . . . . . . . . . . . . . . 77 3.20 Query list services response body . . . . . . . . . . . . . . . . . . . 78 3.21 Add service request body . . . . . . . . . . . . . . . . . . . . . . . . 79 3.22 Add service response body . . . . . . . . . . . . . . . . . . . . . . . 79 xi Terms NFC . . . . . . . . . . Near Field Communication: near communication for exchanging data between two devices using radio frequency technology RFID . . . . . . . . . Radio Frequency Identification: a technology using radio frequency to write/read data on a IC tag QR code . . . . . Quick Response code: a type of encoded information storage in the format of combination of square modules EMV . . . . . . . . . Europay, MasterCard and Visa: a kind of payment method using chip pin technology OTP . . . . . . . . . . One Time Password SMS . . . . . . . . . . Short Message Service PCB . . . . . . . . . . Printed Circuit Board: a electronic board to set up a circuit on a conductive electricity material MQTT . . . . . . . Message Queuing Telemetry Transport: a simple message protocol for constrained devices like IoT devices API . . . . . . . . . . . Application Programming Interface: interface programming for application, a computer or application provides an interface for other objects could interact with it. IoT . . . . . . . . . . . A network that connects all of the things through Internet P2P . . . . . . . . . . peer-to-peer network, two devices in communication are the same, both of them can receive and send data to each other. UI . . . . . . . . . . . . User Interface 1 Introduction 1.1 Why we choose this topic With the growth of digitalization for business processes, there are certain changes in the field of payment transactions [11]. In recent years, people begin to use other payment methods such as banking card, mobile wallet,... instead of cash because of the inconvenience that this traditional method brings to customers. Besides, we have been facing with COVID-19 which is considered as a global pandemic with the spread comes from mostly air and direct contact through surface area of things. As a result, we need to prevent the exposure of COVID-19 by wearing mask and try not to touch anything, especially things that were circulated by hand like cash. In reality, many mobile wallet businesses had a remarkable development in the period that pandemic is still one of the most pressing issue around the world and most of FB businesses have supported many online payment methods. However, based on our experience, the existing online payment process is prolix and slightly inconvenient for both customer and cashier. Especially from the business side, although there is no doubt about the advantages of applying these methods into the business model, the fact that these technologies are only supported on single devices makes businesses invest lots of money to buy these devices. For example, bank card and NFC (smartphone) payment methods are integrated inside some models of payment terminal, while QR code, which usually appears in the mobile wallet application, requires a scanner to receive data as an image. On the other hand, the mentioned technologies above also support serviceproviding businesses in residence, entertainment and tourist field. They could be applied in managing access-control at the entry points or using some kinds of service that is provided by business based on customer levels and temporary tickets. 1 1.2. Our goal For instance, subway system in developed countries and Japan is the most typical for this kind of public transportation. Japanese uses subway system everyday and pay for each transport by a prepaid IC card or their mobile phone which integrated with NFC module, while travelers could buy traditional paper ticket at the station for short-distance transportation. IC card and NFC are extremely convenient for the passengers but paper ticket is different. Paper ticket requires another process inside the entrance gate where you put the ticket into insert hole to check whether valid ticket or not and get ticket back from the other side for checking later, that is not so convenient and has the risk for operation like ticket got stuck in the machine. We could improve that by applying QR code scanning for short-term providing service, selling tickets would come along with a barcode or QR code to be scanned at the entrance gate. Another use-case supports for the idea of this paragraph is apartment access method and relative’s visit. One of the ways to increase the security for apartments is managing get in/out at the main entry by RF card as a room key of apartment, so if people wanted to come inside the privacy area of apartment, they would need to have a valid RF card which shows that they owned their owned apartment. However, what would happen if there was a relative to visit the owner, whether the owner needs to go to the entrance to open the gate for relative. With QR code, that inconvenience would be eliminated due to the availability of sharing the code online through smartphone but still ensure the security based on the time limitation of a QR code, restricts freely accessing of the relative had a code. Owners can provide a temporary code which is only valid in a small period of time to the relatives and they can scan that code at the entrance gate to go inside the privacy area of apartment. As a result, based on two use-case we have mentioned above, we could clearly see the potential of combining code scanning and RFID/NFC technology together. In this report, our group would propose a module that integrates both technologies into only one device and a model using this module to make a real application to solve one or many mentioned use-cases. 1.2 Our goal Our goal is designing a module that integrates with a RFID/NFC reader to identified and receive information for authentication or payment process, a barcode/QR code scanner for short-term or third-party identification. Then, we would implement a model using designed device to get input data from end users. The model has a server - where end user’s data sent to, processes and performs desired features such as payment transaction, identification,... Last but not least, we 2 1.3. Related work would build up an application for business to manage the system and an application that generate temporary QR code that is only valid in specific interval. To wrap up our goal, we would design a new module that supports multiple technologies in identification on only one device and apply it in a practical model to solve one of mentioned use-cases above. 1.3 Related work With the blogs of Nick Revett about our present and future after the pandemic, it is obviously seen that the rise of QR code in applications, processes is so essential due to the COVID-19. He showed that QR code in 2020 could be embedded on the invitations for fast check-in and QR code is the what we need in this sensitive period because it provides a contactless workplace for business. Besides, developing an visitor entry procedure is also considered because it creates a safe and security workspace for business’s employees to feel comfortable. One of the most important key for an visitor entry procedure is clear authorization procedures and he recommended to use touchless processes with the use of smartphone due to the affects of COVID-19. COVID-19 had some impacts on the payment habit of people around the world. Cards are currently preferred over cash in paying and people tend to change to mobile device (wallet) in payment transactions with a mass statistic of peeking $1 trillion in 2020 [12]. In the near future, there will be more technologies that support for the cashless system payment such as voice activated payments, cryptocurrencies, biometric payments using facial recognition. However, we still needs more time to develop and apply these technologies into our real life, that does not prevent mobile payments and mobile wallets gaining attention and adoption from customers or businesses around the world. Up to now, NFC and QR codes are considered as remarkable payment solution because they bring up safety for customer’s asset and no-delay transactions for business. The increase in the non-cash payments in Europe, China is proving that changing payments method from cash to NFC or QR codes is inevitable. We have also researched on some existing modules which can be found on many online retail service website like AliExpress. There are many modules that have been already on the market but most of them are offline machines just have the ability to perform some functions through wire connections, some of them also does not support NFC technology. With that limitation, these modules can effectively integrated into in place systems like auto open door system, entry checking system. 3
- Xem thêm -

Tài liệu liên quan