<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">OPJ</journal-id><journal-title-group><journal-title>Optics and Photonics Journal</journal-title></journal-title-group><issn pub-type="epub">2160-8881</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/opj.2020.106010</article-id><article-id pub-id-type="publisher-id">OPJ-101814</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Chemistry&amp;Materials Science</subject><subject> Engineering</subject><subject> Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Design and Implementation of Optical Fiber Test Equipment
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Shen</surname><given-names>Li</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Junyu</surname><given-names>Wei</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Shaojing</surname><given-names>Su</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Zhen</surname><given-names>Zuo</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>College of Intelligence Science and Technology, National University of Defense Technology, Changsha, China</addr-line></aff><pub-date pub-type="epub"><day>29</day><month>06</month><year>2020</year></pub-date><volume>10</volume><issue>06</issue><fpage>105</fpage><lpage>110</lpage><history><date date-type="received"><day>20,</day>	<month>March</month>	<year>2020</year></date><date date-type="rev-recd"><day>26,</day>	<month>June</month>	<year>2020</year>	</date><date date-type="accepted"><day>29,</day>	<month>June</month>	<year>2020</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  
    In order to meet the needs of the rapid development of optical fiber communication technology, combined with the thinking of the Internet of Things, a new idea of designing an optical fiber test equipment using Raspberry Pi is proposed. At the same time, the design of a multi-parameter measuring device for optical fiber signals based on Flask was completed. 
  
 
</p></abstract><kwd-group><kwd>Optoelectronics Device</kwd><kwd> Optical Fiber Communication</kwd><kwd> Raspberry Pi</kwd><kwd> Flask</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Optical fiber communication has become the main communication method in the current information age due to its high speed, large capacity, and anti-interference characteristics [<xref ref-type="bibr" rid="scirp.101814-ref1">1</xref>]. In order to adapt to the rapid development of optical fiber communication technology, optical communication test technology is also continuously progressing, and various new instruments are constantly launched with the needs of engineering practice. For example, in order to adapt to WDM technology, major test instrument manufacturers have launched innovative instruments for WDM testing [<xref ref-type="bibr" rid="scirp.101814-ref2">2</xref>]. In addition, the traditional test equipments such as optical power meter, optical time domain reflectometer, spectrum analyzer and so on are playing an important role in the daily operation, maintenance, engineering construction. At present, there are many kinds of optical communication test equipment on the market, including portable test equipment and multi-functional integrated test equipment. However, no matter what kind of equipment, they are all integrated and have poor scalability.</p><p>In order to meet the needs of the rapid development of optical fiber communication technology, this paper proposes a new design method of optical fiber communication test equipment in combination with WEB technology, the B/S architecture [<xref ref-type="bibr" rid="scirp.101814-ref3">3</xref>] and the concept of Internet of Everything. Based on the design idea, a flask-based multi-parameter measurement system was designed to measure several basic parameters of optical fiber signal, such as wavelength, dispersion and bit error rate.</p></sec><sec id="s2"><title>2. Design Idea of Optical Fiber Communication Test Equipment</title><p>Optical fiber communication test equipment generally consists of the following parts: hardware part, data transmission, upper interface display. The structure diagram is shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>.</p><p>The underlying hardware structure is mainly composed of three parts: the hardware layer, the hardware abstraction layer, and a Raspberry Pi.</p><p>・ Hardware layer: This layer mainly completes the specific functions of the optical fiber communication test equipment. According to the required functions, the ATCA hardware architecture [<xref ref-type="bibr" rid="scirp.101814-ref4">4</xref>] can be used, and the different test functions are divided into modules according to the idea of modularization.</p><p>・ Hardware abstraction layer: implements an abstract interface to the hardware layer to shield the specific technical details of the functions realized by different modules at the bottom layer, so as to facilitate the upgrading and transformation of subsequent technologies. Meanwhile, the data transmitted by the hardware layer is processed in a unified data format for output.</p><p>・ Raspberry Pi: Raspberry Pi [<xref ref-type="bibr" rid="scirp.101814-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.101814-ref6">6</xref>] is a card-type computer with ARM-based processor and Linux operating system. The appearance is only the size of a credit card. The purchase cost is only about 200 yuan, but it has powerful system functions and interface resources, and can achieve all the functions of common PC. With the hot development of raspberry PI, applications of</p><p>raspberry PI emerge in various series, such as smart home design based on raspberry PI [<xref ref-type="bibr" rid="scirp.101814-ref7">7</xref>], the implementation of target detection based on raspberry PI [<xref ref-type="bibr" rid="scirp.101814-ref8">8</xref>], etc.</p><p>Here, using raspberry PI to set up a small server, receive data from the hardware abstraction layer, then select a suitable web framework [<xref ref-type="bibr" rid="scirp.101814-ref9">9</xref>], such as Python-based Django, Flask, etc. to build web services.</p><p>・ Data transmission and display: you can use raspberry PI to build a small hot spot and access web pages with your mobile phone or other devices to obtain data from the test device [<xref ref-type="bibr" rid="scirp.101814-ref10">10</xref>].</p></sec><sec id="s3"><title>3. Multi-Parameter Measurement System for Optical Fiber Signals Based on Flask</title><p>This system mainly completes the measurement and display of optical fiber signals: light intensity, dispersion, bit error rate, jitter, etc. The overall design block diagram is shown in <xref ref-type="fig" rid="fig2">Figure 2</xref>.</p><p>The underlying hardware measures the wavelength and dispersion of the optical fiber signal. The measurement data is transmitted to the host computer through the serial port. The host computer uses Flask to build a web server to complete the page display.</p><sec id="s3_1"><title>3.1. The Hardware Design</title><p>According to the measurement principle of different parameters of the optical fiber signal, there are mainly two types of design. One requires a separate optical path and test circuit design; the other is to make measurements in the digital domain. The measurement of optical signal wavelength, dispersion, and optical power requires separate design of the optical path and measurement circuit. The measurement of bit error rate and jitter is performed in the digital domain. The</p><p>data from these modules will be input into an analysis module in the DSP to obtain the final measurement result. Then, the error analysis module will analyze the result to find the measurement error. The structure schematic diagram is shown in <xref ref-type="fig" rid="fig3">Figure 3</xref>.</p><p>To realize the measured parameters in the digital domain, the optical signal needs to be collected. However, due to the different signal rates of the optical signal load, the optical signal acquisition module needs to be designed as a multi-rate optical signal acquisition module. After passing the optical signal acquisition module, the data is sent to the FPGA. The measurement of bit error rate and jitter is mainly completed in FPGA. Due to the high optical signal rate, the amount of data generated by the acquisition module in a short time is huge, and a large amount of data collected needs to be stored in an external memory. The DSP mainly completes the calculation tasks in the measurement, and an embedded real-time operating system runs in the DSP. The main functions of the embedded operating system are the analysis of measurement results, the analysis of measurement errors, the output of measurement results and the communication with other instruments.</p></sec><sec id="s3_2"><title>3.2. Human-Computer Interaction Interface Design</title><p>Flask is a lightweight customizable framework developed based on the Python language. The core structure is relatively simple, and it has strong extensibility and compatibility.</p><p>・ Flask development environment</p><p>Use a virtual environment to build a development environment. The virtual environment is a private copy of the Python interpreter. The extension package installed in this environment will not affect the application environment of the global interpreter, and has environmental isolation and protection. Installation and configuration are as follows [<xref ref-type="bibr" rid="scirp.101814-ref11">11</xref>] [<xref ref-type="bibr" rid="scirp.101814-ref12">12</xref>]:</p><p>$ python -m venv venv</p><p>$ / venv / bin / activate</p><p>(venv) $ pip install flask</p><p>(venv) $ pip install flask-bootstarp flask-sqlalchemy flask-socketio</p><p>The first behavior creates a virtual environment, the second behavior activates the virtual environment, and the third behavior installs Flask in the virtual environment. The fourth line installs the necessary development environment libraries.</p><p>・ Optical fiber signal parameter measurement system platform</p><p>The serial port RS232 communication was adopted to receive the parameters of the measured optical fiber signal, and the flask back-end class OpbDealModel was established for receiving.</p><p>The front-end receives the request from the web browser, passes the configuration parameters to the flask back-end processing routine through the ajax asynchronous communication mode, and the back-end conducts the pre-measurement configuration, starts the measurement system, and sends the data to the front- end for real-time display through socketio.</p><p>・ Configuration page</p><p>The configuration page is shown in <xref ref-type="fig" rid="fig4">Figure 4</xref>.</p></sec></sec><sec id="s4"><title>4. Conclusion</title><p>Based on the concept of the Internet of everything and B/S architecture, this</p><p>paper presents a new idea for the design of optical fiber testing equipment. This design idea abstracts the differences in the underlying hardware technology of the test equipment. In combination with the Raspberry Pi, a small web can be used to obtain measurement data using wired or wireless devices such as mobile phones. This new idea has certain application reference value. In addition, a multi-parameter measurement system for optical fiber signals is designed, which can measure the wavelength, dispersion and light intensity. The disadvantage is that the serial port is used for data transmission. The next step is to use the Raspberry Pi to build a small web based on the system, so as to realize that just a mobile phone can get the data.</p></sec><sec id="s5"><title>Acknowledgements</title><p>This work was supported by Youth Science Foundation of Hunan Natural Science Foundation under Grant No.2019JJ50121.</p></sec><sec id="s6"><title>Conflicts of Interest</title><p>The authors declare no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s7"><title>Cite this paper</title><p>Li, S., Wei, J.Y., Su, S.J. and Zuo, Z. (2020) Design and Implementation of Optical Fiber Test Equipment. Optics and Photonics Journal, 10, 105-110. https://doi.org/10.4236/opj.2020.106010</p></sec></body><back><ref-list><title>References</title><ref id="scirp.101814-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Hu, W.S., Liu, X. and Chen, L.K. (2016) Editorial for Special Issue for the 50th Anniversary of the Invention of Optical Fiber Communications. Chinese Optics Letters, 14, 1.</mixed-citation></ref><ref id="scirp.101814-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Yang, Z.Y., Lei, Y. and Bo, F.D. (2012) Optical Communication Instruments Basics and Applications.</mixed-citation></ref><ref id="scirp.101814-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Lu, H., Gao, S.F. and Li, S.L. (2019) Design of Mobile Integrated Development Platform for Business System Based on B/S Architecture. Journal of Physics: Conference Series, 1237, Article ID: 042033. https://doi.org/10.1088/1742-6596/1237/4/042033</mixed-citation></ref><ref id="scirp.101814-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Yu, X. (2019) Hardware Design of Modulation Recognition System Based on ATCA Platform. Beijing University of Posts and Telecommunications.</mixed-citation></ref><ref id="scirp.101814-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Membrey, P. and Hows, D. (2013) Learn Raspberry Pi with Linux. 
https://doi.org/10.1007/978-1-4302-4822-4</mixed-citation></ref><ref id="scirp.101814-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Gay, W.W. (2014) Mastering the Raspberry Pi.</mixed-citation></ref><ref id="scirp.101814-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Ping, Z.M., Ping, W.D., Jie, W.C. and Ming, X.W. (2019) Design and Implementation of Smart Home Based on Raspberry Pie. Computer Systems &amp; Applications, 28, 109-114. http://www.c-s-a.org.cn/1003-3254/7020.html</mixed-citation></ref><ref id="scirp.101814-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Bin, L.X. (2019) Realtime Object Detection Based on Raspberry Pi. Huazhong University of Science &amp; Technology.</mixed-citation></ref><ref id="scirp.101814-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Dong, W.R. (2019) Jave Web Software Framework. China New Telecommunications, 21, 46.</mixed-citation></ref><ref id="scirp.101814-ref10"><label>10</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Yu</surname><given-names> W.S. </given-names></name>,<etal>et al</etal>. (<year>2015</year>)<article-title>Raspberry Pie and Web Make Internet of Things Easy</article-title><source>WXD Hands on Electronics</source><volume> 6</volume>,<fpage> 31</fpage>-<lpage>34</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.101814-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Du, F.X., Yang, J. and Shi, J.F. (2018) Intelligent Traffic Control Platform Based on Flask and Raspberry Pi. Modern Electronics Technique, 41, 88-91</mixed-citation></ref><ref id="scirp.101814-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Ren, D., Hou, Y.Z., Wang, F.X. and Jiang, L. (2019) The Design and Development of AIS Data Analysis System Based on Flask and Vue. Computer Engineering &amp; Software, 40, 111-114, 120.</mixed-citation></ref></ref-list></back></article>