3G network: car anti-theft alarm video surveillance "new assistant"

Publisher:Huixin8888Latest update time:2011-07-27 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

With the mature development of the third generation mobile communication network, the application of video surveillance technology based on mobile communication network is becoming more and more widespread. Based on the advantages of high coverage, strong reliability and fast transmission rate of 3G network, this paper designs and implements visual monitoring of the car anti-theft alarm system. Based on the existing electronic car anti-theft alarm, this design expands the function of the original alarm system of the car body by expanding the universal interface. Its overall structure diagram is shown in Figure 1. This paper focuses on the design and implementation of the video surveillance part of the system.

The video surveillance part of this system is based on the hardware platform of InterPXA270 as the core, and the upper layer application is realized by building software development of embedded WindowsCE operating system. This design develops the camera driver in the form of stream interface, and uses the interface provided by the camera driver to realize the data acquisition of real-time images under embedded WindowsCE, and compresses the original images in MPEG-4 format. At the same time, SOCKET programming is used on the WindowsCE side to realize the transmission of monitoring data.

1 Hardware Platform

The structure of the existing car anti-theft alarm system is shown in the dotted box in Figure 1. This paper focuses on the design and implementation of the video surveillance part of this system. The hardware of the video surveillance part includes three parts: the camera for collecting monitoring data, the multimedia processor and the communication module. The hardware construction structure diagram is shown in Figure 2. The hardware platform of the video surveillance part is based on the InterPXA270 processing chip of the InterXScale microarchitecture, and the SIM5218 module is selected as the 3G communication module. The dual-port RAM technology is used to realize the communication between the dual CPUs of the video processing and the 3G communication module. Among them, the main frequency of the InterPXA270 chip is 520Hz, and the addition of WirelssMMX technology greatly improves the multimedia processing capability. In addition, the InterSpeedStep dynamic power management technology of PXA270 reduces the power consumption of the equipment while ensuring the CPU performance; Siemens' 3G communication module SIM5218 supports a data transmission rate of up to 7.2Mb/s, and provides a variety of peripheral interfaces such as UART, USB2.0, GPIO and I2C, which reduces the design difficulty; the camera in this design selected Mesh 2000, which uses OV511 chip as the core, has a COMS 350,000-pixel clarity, and communicates via USB, and can use a streaming interface to collect monitoring data in real time.

2 Software Features

The software architecture based on Windows CE operating system consists of two parts.

This article introduces the design of USB camera driver and the programming of data transmitter in detail. The software structure diagram of the system is shown in Figure 3.

WindowsCE stream interface driver is a driver with a customized interface, which is presented as a dynamic link library DLL at the user level and is a general type of device driver. The stream interface driver is used to implement a set of fixed functions called stream interface functions, which allow applications to access these drivers through the file system. The stream interface driver supports almost any type of external device that can be connected to a WindowsCE.net-based platform, including USB devices.

The main task of the stream interface driver is to pass the use of the peripheral to the application, which is achieved by representing the device as a special file in the file system. The application calls the stream interface function through the API function of the file system, and then the stream interface driver calls the native driver or interacts with the system kernel or peripherals through the device manager.

2.1 Implementation of the stream interface function of the camera driver

Developing a camera driver involves a set of standard stream interface driver functions, such as CAM_Init(), CAM_Deinit(), CAM_Open(), CAM_Read(), etc. These functions are the DLL interface of the interface driver, among which CAM_Init(), CAM_Open(), CAM_Read() and CAM_IOControl() are the most important. The following is a detailed introduction to these important functions.

(1) CAM_Init()

CAM_Init() function is called through ActiveDeviceEx() function provided by device manager. When the device is initialized, the device handle information is written to DriversActive through ActiveDeviceEx(). When the application is initialized, the address of the registry is passed to CAM_Init() in the form of Context parameter. RegOpenKeyEx(), RegQueryValueEx() and other functions are used to open and read and write the registry. After successful execution, the handle information of the USB device is returned. Part of the source code of the driver:

(2) CAM_Open()

Before reading from the device, you must first open the device by calling CAM_Open() by executing CeratFile(). The first parameter required by CAM_Open() is the device handle and other information returned by CAM_Init() when the application is initialized. Then set the device closing event to the no signal state.

Here is some source code:

The two functions EnterCriticalSection() and LeaveCriticalSection() involved in the program are used to ensure that all resources accessed in the critical section are not accessed by other threads until the current thread finishes executing the critical section code. EnterCriticalSection() and LeaveCriticalSection() represent entering the critical section and exiting the critical section respectively.

(3) CAM_IOControl()

In the program design, the camera device is opened by calling CAM_Open() through the CreateFile() function, and the return value is passed to the CAM_IOControl() stream interface function through ReadFile(), while CAM_IOControl() calls OV51xReadOneFrame() to read the USB device data. The following is part of the source code:

There are four types of data transmission on the USB bus, namely control transmission, interrupt transmission, bulk transmission and real-time transmission. These four types of transmission are applied to different USB devices. Among them, real-time transmission is suitable for transmission at a fixed rate or within a specific time, and can tolerate occasional erroneous streaming data. For devices with high real-time requirements such as USB cameras, real-time transmission is generally used. Therefore, in CAM_Read(), the real-time transmission function IssueIsochTransfer() is needed to read the data collected by the camera. If IssueIsochTransfer() returns a handle after execution, it means that the execution is successful. If there is no return value, it means that the execution failed.

Here is some source code:

The two functions EnterCriticalSection() and LeaveCriticalSection() involved in the program are used to ensure that all resources accessed in the critical section are not accessed by other threads until the current thread finishes executing the critical section code. EnterCriticalSection() and LeaveCriticalSection() represent entering the critical section and exiting the critical section respectively.

(3) CAM_IOControl()

In the program design, the camera device is opened by calling CAM_Open() through the CreateFile() function, and the return value is passed to the CAM_IOControl() stream interface function through ReadFile(), while CAM_IOControl() calls OV51xReadOneFrame() to read the USB device data. The following is part of the source code:

There are four types of data transmission on the USB bus, namely control transmission, interrupt transmission, bulk transmission and real-time transmission. These four types of transmission are applied to different USB devices. Among them, real-time transmission is suitable for transmission at a fixed rate or within a specific time, and can tolerate occasional erroneous streaming data. For devices with high real-time requirements such as USB cameras, real-time transmission is generally used. Therefore, in CAM_Read(), the real-time transmission function IssueIsochTransfer() is needed to read the data collected by the camera. If IssueIsochTransfer() returns a handle after execution, it means that the execution is successful. If there is no return value, it means that the execution failed.

Each time a packet of data is obtained, the frame start mark is searched. If found, all remaining data is copied to the application buffer. In the Ov51xReadOneFrame() function of the program, pDataBuff applies for 9610B space, and dwFrameLen is the length of each of the 10 transmissions, which is set to 961 here. Figure 4 is the Ov51ReadFrame() software flow chart.

2.2 Design and implementation of the communication transmitter

The communication sending end mainly completes RTP/RTCP protocol encapsulation and decapsulation, network transmission and data acquisition. This paper implements MPEG-4 real-time streaming media transmission based on RTP/UDP/IP protocol stack, which is a submodule of the network transmission part in the mobile video surveillance system. The JRTPLIB library function is used to implement the real-time transmission of RTP. The system architecture of the transmission part is shown in Figure 5.

The main function of the sender is to encapsulate the audio and video streams into RTP packets and transmit them to the receiver through the 3G network, while sending and receiving RTCP packets for feedback control in order to achieve the best effect. Based on the WindowsCE platform, real-time streaming media transmission is realized by programming by calling the JRTPLIB function library.

Since the RTP protocol is not implemented as an independent network layer, it adopts the concept of application layer framing as part of the application code. This article implements RTP encapsulation and grouping through the application for a specific media application, and then hands the RTP grouping to the UDP interface, using JTHREAD as the thread library to complete multi-threaded operations. Using RTP to do video transmission is completed in two sessions: one is responsible for sound transmission; the other is responsible for video transmission.

Part of the main program of the sender is as follows:

3 Conclusion

Based on the existing car anti-theft alarm system, this paper realizes the video monitoring function based on 3G network through the expansion of the interface, and elaborates on the design of the camera's stream interface function and the communication transmitter. In addition, through the expansion of the system's general interface, the system can also be combined with specific industries or home applications to realize the visual monitoring of a small environment by mobile phones. The design and implementation of this system is not only of great significance to the development of car anti-theft products, but also provides a good application prospect for the development of visual monitoring based on 3G network.

Reference address:3G network: car anti-theft alarm video surveillance "new assistant"

Previous article:Application of GPRS in Automobile Remote Monitoring System
Next article:A Distributed High Mobility Radar Servo System Based on CNA/CANopen Bus

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号