Introduction
Compared with traditional video surveillance systems, embedded video surveillance systems have the advantages of small size, strong real-time performance, high cost performance, high reliability, convenient networking, and remote monitoring, so they are more suitable for industrial control, banking, and government security systems. The system provided in this article uses s3C2440, which has a higher cost performance, and builds a network based on B/S architecture for data transmission. Users can access it directly through a browser. Compared with C/S architecture, this system is more in line with customers' requirements for networking.
1 Embedded Video Surveillance System Solution
The modular design method is adopted to divide the system into three functional modules, namely: front-end video acquisition and alarm module, embedded Web server module, and back-end user monitoring module. The front-end video acquisition and alarm module is responsible for video acquisition, storage, processing and transmission, and real-time monitoring of the on-site ambient temperature to provide fire risk warning. The embedded Web server module is responsible for processing requests from the monitoring end and providing real-time monitoring data for users; the back-end user monitoring module realizes real-time remote monitoring and interacts with the web server. The entire system structure block diagram is shown in Figure 1.
2 Implementation of the front-end part of the system
2.1 Construction of front-end software platform
First, establish a cross-development environment on the PC. Then port the Boot-loader. This system uses U-Boot-1.16, which supports 10 processors and 214 development boards. However, it does not directly support the S3C2440 development board selected by this system. However, since it supports the S3C24lo development board, only a small amount of code modification is required to support this system. The main work includes modifying the SDRAM configuration; frequency division ratio (FCLK, HCLK, PCLK); system clock acquisition function (get'PCLK(), get_HCLK(), get-PLLCLK(), etc.); supporting NAND Flash and yaffs file system burning, etc. After completing the porting of the Boot-loader, the Linux kernel can be ported. Its main task is to add the drivers of the hardware related to this system, such as USB, network card, etc., and modify them accordingly to support the S3C2440 platform, and then statically compile them into the kernel. The camera driver of this system is dynamically loaded. When configuring the kernel, you need to select the "L0adable modulesupport" option. Finally, use Busybox to build the root file system.
To realize the on-site alarm function, the temperature sensor Dsl8820 is used to collect the on-site temperature in real time. The temperature warning value is set to 50℃. When the temperature exceeds the warning value, the buzzer on the front-end machine is immediately driven to remind on-site personnel that the environment is abnormal and there may be a fire.
2.2 Implementation of front-end video acquisition
Video04"nux (V4L for short) is the kernel driver for video devices in Ljnux. It provides a series of interface functions for application programming for video devices. This system uses a USB camera to collect video data. First, we need to develop the corresponding driver, that is, to design the program for video image acquisition for the USB camera device /dev/videoo. To complete the USB video data acquisition based on V4L, we must first obtain the device information of the video device, initialize the acquisition window, chroma mode, and frame status, and then we can collect the video image. The video acquisition process is shown in Figure 2.
After obtaining the device information and setting the camera parameters, data collection can be performed. This system uses mmap() to map the device file to the memory, thereby bypassing the kernel buffer and accelerating the I/O access speed. The specific operations are as follows:
First, use the ioctl(vide->fd, VIDIocGMBuF, &(vide->videombuf) function to obtain the frame information of the camera storage buffer (where , , id∞ is struct vdIn*), and then modify the settings in , ...
2.3 Implementation of video stream network transmission
The network transmission of the video in this system is based on the connection-oriented TCP protocol. TCP/IP protocol data transmission can be divided into three stages: establishing a connection, transmitting data, and disconnecting the connection [6]. First, the server creates a socket through the socket() function, uses the bind() function to bind the created socket to the port, and then calls the listen() function to put the server in a listening state, waiting for the connection request from the client application. The client application uses the TCP service by opening a socket. When the server receives the user's connection request, the server calls the accept() function to establish a connection between the two parties, responds to the client's request, and creates a new thread, which is responsible for sending data to the user.
3 Design of Embedded Web Server
At present, the B/S mode network structure has become the most popular application mode because of its advanced development technology, superior manageability and maintainability, and simple and convenient mode. This system adopts this structure, so users can remotely access embedded devices through the embedded Web server and use IE browser to realize remote monitoring of the site.
Boa is one of the web servers supported by Linux. It is a single-task http server with the advantages of simple code structure, support for dynamic CGI, "p service, and open source code. Therefore, it is particularly suitable for use as a web server in embedded systems [n]. Download its source code Boa-o.94.13.tar.gz from the Internet. Its transplantation on this system mainly includes two parts: file modification under src and config file modification.
Modification of boa-o.94.13/src file: First, set the compiler variables in boa-o.94/Makefile file: CC=/arm-1inux-gcc, CPP=/arnl_linux-gcc_E; and modify the compilation mode: LDFLAGS=-g-static. Then find the macro definition #defineTIMEZONE_OFFSET(foo)foo##->tm-gmtoff in the file compat.h and modify it to #define TIMEZONE_OFFSET(foo)f00->tm-gmtoff. Then, execute make under boa-o.94/src/ to compile, and the executable program obtained is boa, which can be downloaded to the target machine using the serial port to complete the transplantation.
boa-0.94/boa.conf file. Since boa must be started as root, change User nobody to User mot and Groupnogroup to Group r00t, that is, grant administrator privileges. Change the server name, that is, change ServerName www.your.org.here to serverName sm2440. Change DocumentRoot/var/www to
DocumentRoot/home/web, that is, set the main directory of HTML documents to /home/web. Finally, specify the location of nime.types files as Mime-Types/etc/milne.types. Other settings can be used by default. Finally, copy boa-0.94/boa.conf to the /etc/boa/directory. After configuring the Web server, you can access it remotely.
4 Implementing the client video data receiving application
The web client of this system uses Java Applet to provide users with a management and display interface. The Java Applet program is embedded in the HTML document and can be displayed and run in a standard browser. This method does not require special development software and network interfaces, and is an ideal choice for web-based network applications. This system needs to embed a player program in the display page to play the surveillance video obtained by the front end in real time. Among them, video data reception is the key to the client software design, and its implementation is as follows:
First, establish network communication, that is, create a socket, input and output streams. Then allocate a receive buffer, that is: byte[]buffer—new byte[5 12*1024];
Then read the header information of the image and confirm the correctness of the image data, that is: int n = in. r∞d(bu“er, O, HDRLEN);
HDRLEN is the length of the header, which is set to 50 B. By judging the agreed characters contained in the header information, it is determined whether to receive further image data or re-receive the header information. If the image header information can be read correctly, it proves that the video data stream received this time is correct. Then the image data after the header information can be written into the buffer for playback and display:
n=HDRLEN;
r—in. read(buffer, n, buffer.length-n); Since the static image data received in the video stream buffer contains the image header information, it is necessary to copy the image data to another buffer to obtain separate image data:
byte[]buffeLimage=new byte[n];.
for(int i一0;i
Then read the human data from the buffer buffer-image:
BufferedImage imagedata=
Imagel0.read(new ByteArrayInputStream(buffer—image)),
ImageIcon image—icon=new Image Icon(imageedate m-label.set Icon(image—icon),
The system continuously reads and displays image data through a loop. Users can then obtain real-time video surveillance data collected by the front end from the main page. The picture is smooth, without obvious delay or stagnation, thus achieving the monitoring purpose.
5 Conclusion
At present, embedded products are in the ascendant. The embedded video surveillance system design proposed in this paper combines the cost-effective ARM processor with the open source operating system Linux. It has many advantages such as high stability, low cost, and low power consumption. It is based on the B/S mode and directly connected to the Ethernet, which saves a lot of cable expenses. It is plug-and-play and realizes cross-platform monitoring, which provides great convenience for users. This system well embodies the advantages of intelligence, integration, networking, and cross-platform. It can be widely used in smart homes, smart transportation, factories and other manufacturing units and places that require real-time monitoring.
Previous article:Design of Touch Screen Based on S3C2410 Microprocessor
Next article:Design and implementation of Bragg fiber grating sensor signal processing system based on S3C44B0
Recommended ReadingLatest update time:2024-11-16 19:33
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Analysis of the phenomenon after nmos is broken down
- Optimizing DSP Power Budget
- I have a question about digital signal processing. I don't need to deal with hardware yet.
- Discussion: Internet of Vehicles: Who will dominate the world?
- [Tool Tutorial] CH340 USB to Serial Chip Driver Installation Instructions
- LPC1768 dynamically displays QR code
- Read the good book "Operational Amplifier Parameter Analysis and LTspice Application Simulation" 03 Bias Current Case Analysis
- 90% new, Xintang NuTiny-SDK-Nano130 development board 50 yuan, free shipping
- Keysight Technology Service Day Seminar|Wuhan Station——Invitation Letter
- GaN technology for wireless charging - high-power automotive scenarios first!