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 . 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 . 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.
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  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.
2. Design Idea of Optical Fiber Communication Test Equipment
Optical fiber communication test equipment generally consists of the following parts: hardware part, data transmission, upper interface display. The structure diagram is shown in Figure 1.
The underlying hardware structure is mainly composed of three parts: the hardware layer, the hardware abstraction layer, and a Raspberry Pi.
・ 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  can be used, and the different test functions are divided into modules according to the idea of modularization.
・ 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.
・ Raspberry Pi: Raspberry Pi   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
Figure 1. Design architecture.
raspberry PI emerge in various series, such as smart home design based on raspberry PI , the implementation of target detection based on raspberry PI , etc.
Here, using raspberry PI to set up a small server, receive data from the hardware abstraction layer, then select a suitable web framework , such as Python-based Django, Flask, etc. to build web services.
・ 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 .
3. Multi-Parameter Measurement System for Optical Fiber Signals Based on Flask
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 Figure 2.
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.
3.1. The Hardware Design
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
Figure 2. System architecture.
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 Figure 3.
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.
3.2. Human-Computer Interaction Interface Design
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.
Figure 3. Hardware structure.
・ Flask development environment
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  :
$ python -m venv venv
$ / venv / bin / activate
(venv) $ pip install flask
(venv) $ pip install flask-bootstarp flask-sqlalchemy flask-socketio
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.
・ Optical fiber signal parameter measurement system platform
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.
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.
・ Configuration page
The configuration page is shown in Figure 4.
Based on the concept of the Internet of everything and B/S architecture, this
Figure 4. Configuration Page.
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.
This work was supported by Youth Science Foundation of Hunan Natural Science Foundation under Grant No.2019JJ50121.
 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
 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 & Applications, 28, 109-114. http://www.c-s-a.org.cn/1003-3254/7020.html