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 extensive. Based on the advantages of high coverage, strong reliability and fast transmission rate of 3G network, this paper designs and implements the visual monitoring of the car anti-theft alarm system. Based on the existing electronic car anti-theft alarm, this design realizes the functional expansion of the original alarm system of the car body by expanding the general interface. Its overall structure block 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 with InterPXA270 as the core, and the upper-level 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 as the core, 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 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 device while ensuring the CPU performance; Siemens' 3G communication module SIM5218 supports a data transmission rate of up to 7.2Mb/s, and provides a wealth of peripheral interfaces such as UART, USB 2.0, GPIO and I2C, which reduces the design difficulty; the camera in this design chooses the Mesh 2000, which uses the OV511 chip as the core, has a COMS 350,000-pixel clarity, and uses USB communication. It can use the stream interface to collect monitoring data in real time.
2 Software Functions
The software architecture based on WindowsCE operating system includes two parts.
Using PlatformBuilder to customize WindowsCE system and develop USB camera driver and data transmitter, this article introduces the design of USB camera driver and programming of transmitter in detail. The software structure diagram of the system is shown in Figure 3.
WindowsCE stream interface driver is a driver with customized interface, which is 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 enable 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 the 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
The development of the 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()
The CAM_Init() function is called by the ActiveDeviceEx() function provided by the device manager. When the device is initialized, the device handle information is written to Drivers\Active through ActiveDeviceEx(). When the application is initialized, the address of the registry will be passed to CAM_Init() in the form of the Context parameter. Functions such as RegOpenKeyEx() and RegQueryValueEx() are used to perform the operations of opening and reading and writing 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 the device, you must first call CAM_Open() by executing CeratFile() to open the device. The first parameter required by CAM_Open() is the device handle and other information returned by CAM_Init() when the application is initialized, and then set the device shutdown event to a no-signal state.
The following is part of the 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 completes the execution of 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 CreatFile() function is used to call CAM_Open() to open the camera device, and the return value is passed to the CAM_IOControl() stream interface function through ReadFile(), and 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 it is found, all the 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 sender
The communication sender 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 the RTP/UDP/IP protocol stack, which is a submodule of the network transmission part of the mobile video surveillance system. The JRTPLIB library function is used to realize 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 stream into the RTP packet and transmit it to the receiver through the 3G network, and send and receive RTCP packets for feedback control at the same time, in order to achieve the best effect. Based on the WindowsCE platform, the real-time streaming media transmission is realized 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 paper 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 the multi-threaded operation. The use of RTP for 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 implements the video monitoring function based on the 3G network through the expansion of the interface, and elaborates on the design of the camera's stream interface function and the communication sender. 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 range of environments 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 networks.
Previous article:Design of a fast charging system for electric vehicles
Next article:Design of vehicle acceleration test system based on single chip microcomputer
- Popular Resources
- Popular amplifiers
- ICCV2023 Paper Summary: Video Analysis and Understanding
- A Simple Introduction to GAN Generative Adversarial Networks: Principle Analysis and TensorFlow Practice
- RBF neural network control design, analysis and Matlab simulation (Liu Jinkun)
- TI-DSP multi-core technology and real-time software development
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
- New breakthrough! Ultra-fast memory accelerates Intel Xeon 6-core processors
- New breakthrough! Ultra-fast memory accelerates Intel Xeon 6-core processors
- Consolidating vRAN sites onto a single server helps operators reduce total cost of ownership
- Consolidating vRAN sites onto a single server helps operators reduce total cost of ownership
- 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!
- RPM Remote Power Management Server
- What does nationality have to do with a good entrepreneur?
- How to send two-way PWM with dead zone complementation in micropython
- Display QR code-Intelligent TFT module
- EEWORLD University ---- Open Source PWM Robotic Arm (STM32 Version) Video Tutorial
- 【DM642】Porting of H.264 source code on DM642
- Prize-giving live broadcast: Book a session on "Meeting the test challenges in 5G signal generation" and win Keysight gifts
- A power backup solution for NVR/DVR systems
- Composition of PIC series 8-bit microcontroller source program
- SPDT switches for wireless LANs