This article takes BeagleBone Black as the core, attaches ZigBee wireless sensor node and GSM/GPRS module; establishes web server and SQLite database, receives, parses and stores physiological data collected by ZigBee node, controls GSM/GPRS for emergency call and text message; Make the hardware intelligent and provide automatic physiological monitoring to facilitate people's lives.
At present, the main defects of medical equipment are expensive, bulky and non-intelligent. With the development of technology, many optimized intelligent medical equipments have emerged in recent years, which has greatly facilitated people's lives. However, there are still defects such as single function and remote access.
The BB-Black development board is widely used in various scenarios due to its low price and powerful functions. How to use BB-Black to design a smarter and more complete real-time remote medical monitoring system will be a meaningful and promising market. Research topics.
1. Application system overall structure design description
1.1 Introduction to the hardware platform
The design involves three hardware modules: BB-black, ZigBee and GSM/GPRS. The BB-black development board is a core module, which is a development kit based on the AM3359 processor. The physical map is shown in Figure 1. The processor integrates an ARM Cortex-A8 core up to 1 GHz and provides a rich peripheral interface and two expansion interfaces to extend interfaces such as LCD, UART, eMMC, ADC, I2C, SPI and PWM. Its system block diagram is shown in Figure 2.
The AM3359 is an ARM Cortex-A8 core-based microprocessor that enhances graphics, graphics processing, peripherals, and industrial interface options such as etherCAT and PROFIBUS, and supports advanced operating systems such as Linux, WinCE, and Android. The processor contains multiple subsystems. The microprocessor unit (MPU) subsystem is based on the ARM Cortex-A8 microprocessor; the POWERVR SGX graphics acceleration subsystem is used for 3D graphics acceleration to support display and gaming effects; the programmable real-time unit subsystem (PRUSS) allows users to create each A digital resource that goes beyond local peripherals. In addition, PRUSS is independent of the ARM core, allowing the device to have independent operation and clocking for greater flexibility in complex system solutions.
1.2 System function module and information processing process
The function module of the system is shown in Figure 3, which is mainly composed of four parts: data acquisition module, GSM module, remote login module and BB-Black module. The physiological data module uses ZigBee wireless sensor node to collect user physiological data in real time; the GSM module uses quad-band GSM/GPRS to realize emergency alarm and positioning; the remote login module refers to mobile phone or other Internet access device for remote access and monitoring by users; BB- The Black module is the core module of the system, which can be divided into three parts: data processing, Boa server and SQLite database. The data processing module realizes receiving and parsing data, inserting data into the SQLite database, and issuing emergency alarm commands to the GSM module; the SQLite database is mainly used for storing physiological data; and the Boa server is realizing remote access of the user to query physiological data stored in the SQLite data. .
As shown in the figure above, the information processing process of the system is as follows:
1. The physiological data acquisition module collects physiological data in real time.
The user can carry the corresponding physiological data detection module (such as blood pressure, blood sugar, pulse and other detection modules) as needed, and move and real-time physiological data collection within the coverage of the wireless sensor network established by BB-black, according to IEEE 802.15.4 The communication standard transmits the physiological data packet through the wireless network; the ZigBee terminal node connected on the BB-black development board receives the data packet.
2. The BB-black module receives, analyzes and processes physiological data.
The AM335x processor periodically reads the data packet received by the terminal node, parses the physiological data in the data packet, and stores it in the SQLite database, and analyzes the data according to the health indicator. In case of emergency, the GSM/GPRS module is sent to the GSM/GPRS module. Send an AT control command to make an emergency call.
3. The guardian or doctor can access the server anytime, anywhere to view and manage the recent physiological data of the ward.
The user can log in to the Boa server through the Internet device and submit a query form to access the physiological data of the custodian stored on the SQLite, so as to realize the remote physical condition of the ward and realize remote monitoring.
The application scenario of this system can be as shown in Figure 4.
2. Remote monitoring function implementation
The system uses BB-black as a platform to provide users with remote login to access the embedded Web server Boa to view the recent physiological data functions of the custodian on the server. In order to realize the data storage function, the author uses small overhead and portability for embedded devices. A powerful, easy-to-use and efficient embedded SQLite database. The Common Gateway Interface (CGI) is a bridge between the Web server and the SQLite database. As a standard interface for the client to interact with the Web server, the application can be written according to the standard to achieve database access that cannot be implemented by static HTML pages. And search function to achieve client-server interaction. Its working principle is shown in Figure 5.
First, the client initiates a request to the server through the browser, and the embedded web server triggers the specified script program to parse the request after receiving the request, and executes the corresponding CGI application.
Secondly, the CGI application calls the corresponding SQLite database operation program according to the request information, and passes the execution result of the database operation program to the Web server in the form of an HTML document; the embedded Web server analyzes and processes the HTML document information, and transmits the final data content. Give the client a browser.
Finally, the data content is parsed by the client browser and displayed to the client as a web page.
2.1 Embedded Web Server Boa
2.1.1 Selection of Embedded Server Boa
The ARM Linux development environment supports three embedded web servers: httpd, thttpd, and Boa. The author chooses an embedded Web server Boa with small executable files and small resources required during the running process.
As a single-tasking HTTP server, Boa handles multiple HTTP connection requests by establishing an HTTP request list. At the same time, it only creates new processes for CGI programs during the processing of request requests, which saves system resources to the maximum extent. Said to be crucial. It also has the ability to automatically extract files, generate directories, and more.
2.1.2 Boa function implementation
In the design, the Boa server needs to implement tasks such as receiving client requests, analyzing requests, responding to requests, and returning request results to clients. The workflow is shown in Figure 6.
Boa server initialization work code implementation:
The above code first creates a non-blocking streaming socket descriptor socktfd that provides reliable connection-oriented transport. Then use the bind() function to associate the specified port with the socket descriptor, and finally use the listen() function to listen on the specified port and wait for the Request request.
When the connection request is heard, the server calls the get_request() function to obtain the request information, uses the accept() function to establish the connection, receives the request, analyzes the information, performs HTTP authentication confirmation, processes the request information, and sends and displays the result to the web browser. When there is a CGI request, a CGI processing process is created, and the processing result is sent and displayed to the web browser.
2.1.3 Boa porting on ARM
First, the following changes are made to the Boa server source code for BB-Black and the actual application scenario: (1) Specify the HTTP request list restriction parameter according to the number of guardians; set the server's input and output buffer space to the maximum value to speed up the physiological data transmission speed. (2) to simplify the Linux operating system library functions by writing some simple functions to save resources.
Second, use the arm-linux-gcc cross-compilation environment to configure a boa executable with a size of 175.8KB. Strip the included compilation information with the bin.arm-linux-strip boa command to get an ARM platform executable of only 59.4KB.
Finally, by modifying the web server configuration file boa.conf: the listening port is 80, comment out the binding IP address setting field, the KeepAliveMax value is 50, the KeepAliveTImeout value is 10, the server name is www.RemoteMedicalMonitoringSystem.com; and the CGI path, Run parameters such as the access log and error log storage path; put the configuration file and executable file boa in the /home/www directory of the BB-Block platform; execute the genromfs-f romfs.img-d romdisk command to generate a Boa The root file system of the server is programmed into the memory by the bootloader. Complete the porting of Boa to ARM platform.
2.2 CGI and SQLite database transplantation
Before running the CGI and SQLite programs, the BB-Black development board needs to port the corresponding libraries to the development board. After cross-compilation, copy CGI's libcgic.a and capture to the /home/ directory of the BB-black development board to complete the migration (you can access the directory through the webpage. If you display the word cgic test on the webpage, it means The cgi library was successfully ported; download SQLite's sqlite3 and libsqlite3.so.0.8.6 to the /usr/bin and /usr/lib directories of the BB-black development board respectively and pass ln –s /usr/lib/libsqlite3. So.0.8.6 /usr/lib/libsqlite3.so.0 command, establish a soft connection (because the executable program sqlite3 searches for libsqlite3.so.0 dynamic library at runtime), complete the migration.
2.3 Remote monitoring function implementation
2.3.1 HTML design
The telemedicine monitoring interface mainly has a guardian login interface and a physiological data monitoring interface of the ward. The first line of the pulse and heartbeat monitoring HTML page uses acTIon=“pluse_heart_monitor.cgi†to point the form to the pluse_heart_monitor.cgi handler, and method=“get†specifies the way to get the environment variable as get; the last few lines of the program use type=†Submit" or type="reset" specifies that the form is submitted when the two buttons are clicked; other physiological data monitoring pages are similar.
2.3.2 CGI and SQLite database interaction design
The interaction between CGI and SQLite data mainly includes CGI program to establish physiological data table on SQLite database, insert physiological data; CGI adds, deletes and changes query operation according to form submission content; its main control function code is as follows:
Among them getcgidata() implements GET and POST to get the string function from the webpage; if it is """", the getenv("QUERY_STRING") function gets the string function; if it is "POST", first use The atoi(getenv("CONTENT_LENGTH")) function takes the length of the string and then uses the (char)fgetc(stdin) function to get a single character in turn.
The data items in the string obtained from the web page by the getcgidata() function are separated by the '&' symbol. The getstringdata() function removes the '&' symbol, extracts the valid information, and performs a query operation on the SQLite database for the select_pluse_spo2() function. Provide parameters.
The select_pluse_spo2() function takes the valid information obtained by the getstringdata() function as a parameter, and executes the operation of opening the database, querying the data, and printing the data to the webpage. Part of the function implementation code:
3 Design of parameter sending and receiving functions
3.1 Data acquisition module function realization
The physiological data acquisition module is composed of a data monitoring module and a wireless sensor node ZigBee. The data monitoring module is responsible for collecting data, and the ZigBee node is responsible for receiving, parsing and transmitting data; the parsing process calls corresponding subroutines according to the monitoring item (eg, measuring blood oxygen, pulse, body temperature, etc.); when transmitting data, the terminal node and the non-terminal node respectively Call to send subroutine and transmit subroutine to serial port. The specific implementation procedure is shown in Figure 7.
3.2 Realization of physiological data receiving function on ARM board
First open the serial port on the ARM board, then configure the serial port parameters required for texting, and initialize the receiving buffer, start to cyclically read the serial port data packet; when the data is read, analyze the data packet to obtain the hidden in the packet. Blood oxygen saturation and pulse value; and health monitoring (monitoring according to healthy physiological indicators), if the acquired physiological data is abnormal, it will send a text message (including corresponding physiological data and health status description) to the guardian mobile phone; finally, the physiological data The package is converted to a hexadecimal number and stored in the document. The specific processing flow is shown in Figure 8.
4. System function test
Before the test, the physiological data receiving module and the GSM/GPRS module should be connected through the USB and UART interfaces on the development board; the development board is connected to the network through the RJ45 interface; and the user wears the data acquisition module as needed. After the hardware connection is completed, each module is powered on. After the system automatically starts each service, test it.
Taking the pulse and blood oxygen concentration as an example, the login interface of the test; the results of the query physiological data are displayed, and the mobile phone receives the short message as shown in the following figure.
Functional tests show that:
1. Within the coverage of the wireless sensor network, the tester can carry the monitoring device and walk around at random; the system automatically performs physiological monitoring, data transmission and storage.
2. The system can intelligently analyze physiological data and send the results to the tester's mobile phone as a short message, and can intelligently call the tester.
3. The tester can use a computer or other mobile device such as a mobile phone to access the Boa server through a browser to view the stored physiological data.
Passing performance tests shows that:
After the tester wears the power, the device works intelligently. The tester can receive the physiological data short message prompt in real time, and can also quickly access and modify the physiological data through the webpage. However, due to the coverage of the sensor signal (according to the test, the upper limit of the distance between the two sensor nodes can be transmitted is 1.5 meters), the tester's own degree is limited. At the same time, the embedded device has limited storage space, and the data stored in the SQLite data is sent to the tester via GSM in the form of a packet every hour.
In general, compared with traditional medical monitoring equipment, the system has the advantages of easy portability, low power consumption, low cost, etc., and has great market prospects in the future of remote monitoring of the elderly and improving people's quality of life. However, the system still has shortcomings. The future work is mainly to establish a research on the outdoor wireless sensor network environment to achieve a wider range and more practical telemedicine monitoring.
Body Bag,Storage Big Bag,Disposable Body Bags,Waterproof Body Bags
Ningbo Anbo United Electric Appliance Co.,ltd , https://www.airfryerfactory.com