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.
Previous article:Application of GPRS in Automobile Remote Monitoring System
Next article:A Distributed High Mobility Radar Servo System Based on CNA/CANopen Bus
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- Questions about multi-channel schematic connection
- TMS320DM8127 Camera Starter Kit (CSK)
- The city was frozen...
- Microcontrollers only have so many resources, why do so many people want to use RTOS?
- 4 hours of practice + analysis (live broadcast): TI engineers teach you how to quickly get started with various wireless product development
- Microwave RF filter classification and performance indicators
- Should the voltage regulator diode of the flyback power supply control chip be connected in parallel?
- Best RP2040 Development Boards of 2021
- Do you know why UCC27211 needs an external Boot diode?
- Review summary: Zhongke Yihaiwei EQ6HL45 1V0 development board