Specific implementation mode
It is with reference to the accompanying drawings and embodiments, right in order to make the object, technical solution and advantage of the application be more clearly understood
The application is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the application, and do not have to
In restriction the application.
It is appreciated that term " first " used in the present invention, " second " etc. can be used to describe herein various elements,
But these elements should not be limited by these terms.These terms are only used to distinguish first element and another element.Citing comes
It says, without departing from the scope of the invention, the first client can be known as the second client, and similarly, can incite somebody to action
Second client is known as the first client.First client and the second client both client, but it is not same visitor
Family end.
Data transmission method provided by the present application can be applied in application environment as shown in Figure 1.In the operation environment
Including first terminal 110, second terminal 120, cloud server terminal 130.First terminal 110, second terminal 120 and cloud server terminal 130
It is communicated by network.User is with starting the IP of the application client acquisition first terminal 110 in second terminal 120
Location sends Real time data acquisition request to first terminal 110 according to IP address, receives first terminal 110 and obtained according to real time data
The flow media data packet for taking request to return obtains real time data upload request, the flow media data packet that first terminal 110 is returned
It is uploaded to cloud server terminal 130.Wherein, first terminal 110 can be with camera, WIFI (Wireless Fidelity, wirelessly
Network communication technology) module etc. equipment such as law-enforcing recorder.Second terminal 120 can be, but not limited to be various smart mobile phones,
Tablet computer, portable wearable device etc., cloud server terminal 130 can be formed with the either multiple servers of independent server
Server cluster realize.
In addition, the application environment can also include third terminal 140, third terminal 140 by application client to
130 transmission data of cloud server terminal obtains request, receives the stream medium data that cloud server terminal 130 is returned according to data acquisition request
Packet, can be with real-time display stream medium data.Third terminal 140 can be, but not limited to be various personal computers, laptop,
Smart mobile phone, tablet computer and portable wearable device.
In one embodiment, as shown in Fig. 2, providing a kind of data transmission method, it is applied in Fig. 1 in this way
It illustrates, includes the following steps for second terminal:
Step 201, the IP address of first terminal is obtained.
IP address (Internet Protocol Address) is a kind of unified Internet protocol address.Specifically,
Two terminals can read the IP address that the network information distributes to first terminal.For example, first terminal is connected into second terminal establishment
When LAN, second terminal is that first terminal distributes an IP address automatically, and second terminal can by the reading terminals network information
To obtain the IP address for distributing to first terminal.First terminal can be that first terminal 100 can be with WIFI (Wireless
Fidelity, wireless network communication technique) module etc. equipment such as law-enforcing recorder, second terminal can be various smart mobile phones,
Tablet computer, portable wearable device etc., but not limited to this.
After first terminal connects network, second terminal is with obtaining the IP for distributing to first terminal by the reading network information
Location.
Step 202, Real time data acquisition request is sent to first terminal according to IP address.
Real time data refers to the data that first terminal obtains in real time.Specifically, real time data can be audio data, video
The one of which of data, image data etc. or its combination.Real time data acquisition request can be user by clicking display screen
On button generate, to can also be user generated by pressing the control on touch screen.For example, as shown in figure 3, being one
The Application Program Interface of second terminal in embodiment, interface element 301 are that a Real time data acquisition asks control, user to pass through
It clicks interface element 301 and generates Real time data acquisition request.
Specifically, the transport protocol that Real time data acquisition request can be supported according to first terminal generates the transport protocol
Real time data acquisition request.For example, first terminal uses RTSP (Real Time Streaming Protocol, real-time streams
Transport protocol) agreement transmitting real-time data, then generate the Real time data acquisition request of RTSP agreements.Real time data acquisition connection is asked
Include the IP address of first terminal, port numbers and data transfer path, data request patterns etc. in asking.
Second terminal is obtained by receiving real-time data and is asked, and generates the association according to the transport protocol that first terminal is supported
The request of view, and the Real time data acquisition request of corresponding agreement is sent to first terminal.
Step 203, the flow media data packet that first terminal is returned according to Real time data acquisition request is received.
Include the video flowing of coding in flow media data packet, second terminal obtains flow media data packet, can be with streaming media
Data packet is unpacked, and the video flowing of coding is obtained, and the video flowing of coding is decoded, can be with real-time display video information.
Second terminal such as can also be forwarded the flow media data packet of reception, record a video at the operations.
Second terminal receives the flow media data packet that first terminal is returned according to real time data request.
Step 204, real time data upload request is obtained.
Real time data upload request refers to that real time data is uploaded to the request of cloud server terminal from second terminal.Specifically,
Real time data upload request can be that user is generated by clicking the button on display screen, can also be that user is touched by pressing
Touch what the control on screen generated.For example, as shown in figure 3, being the Application Program Interface of second terminal in one embodiment, Interface Element
Element 302 asks control, user to generate real time data upload request by clicking interface element 302 for a Real time data acquisition.
Second terminal can obtain the real time data upload request of user's triggering.
Step 205, flow media data packet is uploaded to cloud server terminal.
Specifically, second terminal returns to first terminal according to the agreement that the type of server that cloud server terminal is disposed is supported
Flow media data packet unpack, the encoded video stream of acquisition is Resealed into the stream matchmaker for the agreement that cloud server terminal is supported
Volume data packet, then the flow media data packet Resealed is uploaded into Cloud Server.For example, cloud server terminal is flowed using LIBRTMP
Service framework disposes RTMP (Real Time Messaging Protocol, real-time messages transport protocol) streaming media server,
It then needs the encoded video stream that will be obtained envelope at the flow media data packet of RTMP data formats, and is uploaded to Cloud Server.In addition,
Cloud server terminal can also use the frames such as flash Streaming Medias frame, FMS streaming media servers to dispose cloud server terminal.
Second terminal by the way that flow media data packet to be re-packaged into the flow media data packet of cloud server terminal institute supported protocol,
Flow media data packet is uploaded to cloud server terminal.
In above-mentioned data transmission method, by obtaining the IP address of first terminal, sent to first terminal according to IP address
Real time data acquisition is asked, and the flow media data packet returned according to Real time data acquisition request is received, and is obtained real time data and is uploaded
Request, Cloud Server is uploaded to by flow media data packet.Due to that can realize law-enforcing recorder and cloud service by mobile terminal
The Real Data Exchangs at end can solve to need to realize real-time Data Transmission by 4G modules, increase law-enforcing recorder cost
The problem of.
As shown in figure 4, in one embodiment, according to IP address to first terminal in a kind of data transmission method provided
The step of sending Real time data acquisition request, specifically includes:
Step 401, token is sent to first terminal according to IP address and obtains request.
Token is a kind of network management technology, is equivalent to licensing, and the token that transmitting terminal obtains receiving terminal can just dock
Receiving end transmission data obtains request.Second terminal sends token to first terminal according to IP address and obtains request.
Step 402, it receives first terminal and the token that request is sent is obtained according to token.
The token mechanism of preemptive type may be used in first terminal.Specifically, if the token mechanism of preemptive type refers to first whole
The token at end is occupied by other-end, then second terminal receives the first terminal that first terminal returns and established with other-end
The information of connection;If the token of first terminal is in and is not occupied by other-end, first terminal sends token to second terminal,
Second terminal receives first terminal and obtains the token that request is sent according to token.
Step 403, Real time data acquisition request is sent to first terminal according to IP address and token.According to first terminal
IP address and token send Real time data acquisition request, and token is effective in data transmission procedure, if being disconnected in transmission process
With the connection of first terminal, initiate that when data transfer request token must be reacquired again.Specifically, second terminal and the first end
After end disconnects, second terminal reacquires the IP address of first terminal, according to the IP address of first terminal to first terminal
Send token obtain request, again receive first terminal send token after, second terminal according to new IP address and token to
First terminal sends Real time data acquisition request.
In one embodiment, number in real time is sent to first terminal according to IP address in a kind of data transmission method provided
It asks, specifically includes according to obtaining:
Real time data preview request is sent to first terminal or sends real time data video recording two kinds of moulds of request to first terminal
Formula.In one embodiment, the Application Program Interface of second terminal as shown in Figure 3, into directly raw when Application Program Interface
At real time data preview request, user can switch real time data request mode by clicking interface element 301, click for the first time
Real time data video recording request is generated when interface element 301, again taps on 301 switching request pattern of interface element, generates number in real time
According to preview request.
Real time data preview refers to the data information for directly acquiring first terminal camera and acquiring in real time.Real time data is recorded a video
Request refers to the data information for obtaining first terminal camera and acquiring and recorded in real time, the data information that first terminal is recorded
It can be saved in first terminal and the operations such as be checked, sent again.
In one embodiment, as shown in figure 5, being uploaded to flow media data packet in a kind of data transmission method provided
The step of cloud server terminal, including:
Step 501, video flowing is extracted from flow media data packet.
Video flowing refers to the video information using specific coding obtained after flow media data packet is unpacked.Specifically,
The h264 codings of high compression digital video coding decoder Standards may be used in two terminals, are encoded to video information.
Step 502, video flowing is encapsulated as specified format message, and will be in specified format packet buffer to upload queue.
Specified format message refers to the message that video flowing can be encapsulated as to specified protocol according to stream media protocol.Specifically
Ground, RTMP (Real Time Messaging Protocol, real-time messages transport protocol) agreement may be used in second terminal will
Video flowing is encapsulated as the message of RTMP formats, and will be in the packet buffer of encapsulation to upload queue.In addition, second terminal can be with
Streaming media server is supported using RTSP, HTTP (Hyper Text Transfer Protocol, hypertext transfer protocol) etc.
Carry out the procotol of audio and video and data communication.
Step 503, the Real time data acquisition request mode of video information is obtained.
The real time data request mode of video information includes real time data preview request and real time data video recording request.User
Real time data acquisition request mode, second terminal has been selected to obtain data upload requests when initiating Real time data acquisition request
When can read the Real time data acquisition request mode of video information.
Step 504, video frame rate is determined according to the Real time data acquisition request mode of video information.
Each second being capable of newer number when video frame rate refers to video processor processing video image.Different data obtain
The corresponding video frame rate of request mode is taken to differ.For example, the video frame rate of real time data preview can be 30 frame per second, 35 frames
Video frame rate Deng the video recording of, real time data can be that 10 frames, 15 frames etc. are without being limited thereto.
Second terminal can be asked by the Real time data acquisition request mode of acquisition video information according to Real time data acquisition
Modulus formula determines video frame rate.Specifically, the data preview sum number that second terminal is supported first terminal by predetermined manner
It is recorded in second terminal according to corresponding video frame rate of recording a video, after second terminal obtains Real time data acquisition request mode, is read real
When the corresponding video frame rate of data acquisition request pattern.
Step 505, specified format message is pushed to cloud server terminal according to video frame rate.
It refers to controlling the frame number for transmitting image each second according to video frame rate to push specified format message according to video frame rate.
By according to Real time data acquisition request mode, determining video frame rate, the message in queue control per second
The number of image frames of upload can prevent uploading speed from being shown with video pictures caused by actual video broadcasting speed difference and not flow
The problems such as smooth.
In one embodiment, as shown in fig. 6, providing a kind of data transmission method, it is applied in Fig. 1 in this way
It illustrates, includes the following steps for first terminal:
Step 601, the Real time data acquisition request that second terminal is sent is received.
The Real time data acquisition request that second terminal is sent can be real time data preview request, can also be real time data
Video recording request.
Step 602, the video information acquired in real time is obtained.
First terminal obtains the video information that camera acquires in real time.Camera can be divided into built-in camera and external take the photograph
As head.The video information that camera acquires in real time refers to the video letter of the variation about camera ambient enviroment of camera acquisition
It ceases, there may be have the objects such as building, highway, vehicle, pedestrian and flowers, plants and trees in video information.
After camera acquires the video information of ambient enviroment in real time, first terminal can get what camera acquired in real time
Video information.
Step 603, the video information of acquisition is encapsulated as flow media data packet.
The video information of first terminal acquisition first carries out the coding of specified value, and specifically, height may be used in first terminal
The h264 codings of degree compression digital video coding decoder Standards, generate the video flowing of coding, the video flowing of coding are sealed
The flow media data packet of specified format is dressed up, specifically, RTSP agreements may be used in specified format, i.e., seal the video flowing of coding
Dress up RTSP flow media data packets.
Step 604, it is asked flow media data packet being sent to second terminal according to Real time data acquisition, and eventually by second
End is uploaded to cloud server terminal.
It is asked the flow media data packet of encapsulation being sent to second terminal according to Real time data acquisition, and passes through second terminal
It is uploaded to cloud server terminal.
Above-mentioned data transmission method is asked by the Real time data acquisition sent according to second terminal, by what is acquired in real time
Video information is packaged into flow media data packet and is sent to second terminal, and uploads near cloud server terminal by second terminal.Due to
The real-time Data Transmission that law-enforcing recorder and cloud server terminal can be realized by mobile terminal, can solve law-enforcing recorder needs
The problem of carrying out real-time Data Transmission by 4G modules and cloud server terminal, increase law-enforcing recorder cost.
In one embodiment, in a kind of data transmission method provided receiving real-time data obtain request the step of it
Before, as shown in fig. 7, comprises:
Step 701, it establishes and connects with second terminal.
After first terminal starts, connected by starting WIFI (Wireless Fidelity, wireless network communication technique)
Into WLAN, and the IP address that wireless network distributes automatically is obtained, second terminal is divided by reading the network information and obtaining
The IP address of dispensing first terminal is established with first terminal and is connected.
Step 702, it receives the token that second terminal is sent and obtains request.
Token is a kind of network management technology, is equivalent to licensing, and the token that transmitting terminal obtains receiving terminal can just dock
Receiving end transmission data obtains request.Second terminal must first obtain the token of first terminal before sending Real time data acquisition request.
First terminal receives second terminal and is sent to the acquisition request of first terminal token according to IP address.
Step 703, request is obtained according to token and sends token to second terminal.
First terminal obtains after token obtains request, first determines whether token has been occupied by other-end, if so, to the
Two terminals return to the information that first terminal has established connection with other-end, are asked to second eventually if it is not, then being obtained according to token
End sends token.After second terminal obtains token, it can be obtained to first terminal transmission data by token in this connection
Request after second terminal is disconnected with first terminal, must retransmit token and obtain acquisition request token, just can be to first
Terminal transmission data obtains request,
In one embodiment, the video information of acquisition is encapsulated as Streaming Media number in a kind of data transmission method provided
The step of according to packet, including:Determine the pattern of Real time data acquisition request.The pattern of real time data request includes real time data preview
Two kinds of pattern and real time data RECORD mode.If Real time data acquisition request is real time data preview request, directly will camera shooting
The video information of head acquisition is encapsulated as flow media data packet;If Real time data acquisition request is real time data video recording request, to taking the photograph
As the video information that head acquires is recorded, and the video information of recording is encapsulated as flow media data packet.
In one embodiment, a kind of data transmission method is provided as shown in Figure 8, realizes the specific steps of this method such as
It is lower described:
First, second terminal can obtain the IP address of first terminal.First terminal is accessed after opening by WIFI module
WLAN obtains the IP address that WLAN distributes automatically, and second terminal is by reading the network information, by local
Auto-matching obtains the IP address of first terminal in net.For example, connecting second terminal by WIFI module after first terminal unlatching
The network hotspot of unlatching accesses in the WLAN of second terminal, and WLAN is that first terminal distributes an IP automatically
Address can be recorded in second terminal, and second terminal can obtain first terminal by reading the network information of WLAN
IP address.
Optionally, second terminal can send token to first terminal according to IP address and obtain request.Token is a kind of net
Network administrative skill, is equivalent to licensing, and the token that transmitting terminal obtains receiving terminal just can obtain request to receiving terminal transmission data.
Before second terminal initiates data acquisition request to first terminal, second terminal is whole to first according to the IP address of first terminal
End sends token and obtains request.After first terminal receives token acquisition request, first determine whether token is occupied by other-end,
If so, the information that first terminal has established connection with other-end is returned to second terminal, if it is not, then being asked according to token acquisition
It asks to second terminal and sends token.After second terminal receives token, it can be sent in fact to first terminal according to IP address and token
When data acquisition request.Token effectively, if after second terminal and first terminal disconnect, retransmits number in single connection
Token must be first reacquired before being asked according to acquisition.
Then, second terminal sends Real time data acquisition request according to IP address to first terminal.Real time data refers to
The data that one terminal obtains in real time.Specifically, real time data can be audio data, video data, image data etc. wherein
A kind of or its combination.Real time data acquisition request can be that user is generated by clicking the button on display screen, can also
It is that user is generated by the control pressed on touch screen.Specifically, Real time data acquisition request can be according to first terminal institute
The transport protocol of support generates the Real time data acquisition request of the transport protocol.For example, first terminal uses RTSP (Real
Time Streaming Protocol, real time streaming transport protocol) agreement transmitting real-time data, then generate the real-time of RTSP agreements
Data acquisition request.After second terminal receives the Real time data acquisition request of user's triggering, sent out to first terminal according to IP address
The Real time data acquisition of specified protocol is sent to ask.
Optionally, the Real time data acquisition request that second terminal is sent to first terminal can be that real time data preview is asked
It asks, can also be real time data video recording request both of which.Real time data preview refers to directly acquiring first terminal camera reality
When the data information that acquires.Real time data video recording request refers to the number for obtaining first terminal camera and acquiring and recorded in real time
It is believed that breath, the data information that first terminal is recorded can be saved in first terminal the operations such as is checked, is sent again.
Then, second terminal receives the flow media data packet that first terminal is returned according to Real time data acquisition request.
First, when first terminal receives Real time data acquisition request, the video information that camera acquires in real time is carried out
It obtains.The video information that camera acquires in real time refers to the video letter of the variation about camera ambient enviroment of camera acquisition
It ceases, there may be have the objects such as building, highway, vehicle, pedestrian and flowers, plants and trees in video information.
Then, the video information of acquisition is encapsulated as flow media data packet by first terminal.The video information of camera acquisition
The coding of specified value is first carried out, specifically, high compression digital video coding decoder Standards may be used in video information
H264 is encoded, and is generated the video flowing of coding, the video flowing of coding is packaged into the flow media data packet of specified format, specifically
Ground, specified format may be used RTSP agreements, i.e., the video flowing of coding be packaged into RTSP flow media data packets.
Optionally, the step of video information that camera acquires is encapsulated as stream medium data by first terminal further include:Really
The pattern of Real time data acquisition request is determined, if Real time data acquisition request is real time data preview request, directly by camera
The video information of acquisition is encapsulated as flow media data packet;If Real time data acquisition request is real time data video recording request, to camera shooting
The video information of head acquisition is recorded, and the video information of recording is encapsulated as flow media data packet.
Second terminal obtains the flow media data packet that first terminal returns.Include the video of coding in flow media data packet
Stream, second terminal can be unpacked with streaming media data packet, obtain the video flowing of coding, the video flowing of coding is solved
Code, can be with real-time display video information.Second terminal such as can also be forwarded the flow media data packet of reception, record a video at the behaviour
Make.
Optionally, second terminal, which can carry out unpacking with streaming media data, obtains the video of coding, to the video flowing of coding
Video information can be obtained by being decoded.The DST PLAYER integrated by second terminal, can play regarding for reception in real time
Frequency information.Specifically, video information can be real by VLC players (Video LAN Client, VideoLAN Client)
When play stream media data encapsulation video information.Can also use mplayer players, ijkplayer players,
The video information of the streaming medias data packet such as Exoplayer players is played in real time.
Then, second terminal obtains real time data upload request.Real time data upload request refers to obtaining second terminal
Real time data upload to the request of cloud server terminal.Real time data upload request can be user by click on display screen by
What button generated, can also be that user is generated by pressing the control on touch screen.
Then, flow media data packet is uploaded to cloud server terminal.Specifically, the clothes that second terminal is disposed according to cloud server terminal
The flow media data packet that the agreement that business device type is supported returns to first terminal is unpacked, by the encoded video stream weight of acquisition
It newly is packaged into the flow media data packet for the agreement that cloud server terminal is supported, then the flow media data packet Resealed is uploaded into cloud
Server.For example, in one embodiment, the server of cloud server terminal deployment uses RTMP (Real Time Messaging
Protocol, real-time messages transport protocol) streaming media server, data packet is uploaded to the process of cloud server terminal by second terminal,
Including:The flow media data packet obtained from first terminal is unpacked, the video flowing of coding is obtained, then, by regarding for coding
Frequency stream re-starts the flow media data packet for being encapsulated as RTMP data formats, and is uploaded to cloud server terminal.
Optionally, second terminal can also push the message of specified format to cloud server terminal according to video frame rate.Second eventually
The Real time data acquisition request mode that end passes through acquisition video information.The real time data request mode of video information includes counting in real time
According to preview request and real time data video recording request.Video frame is determined further according to the Real time data acquisition request mode of video information
Rate.Each second being capable of newer number when video frame rate refers to video processor processing video image.Different data acquisitions are asked
The corresponding video frame rate of modulus formula differs.Video flowing is encapsulated as the message of specified protocol by second terminal, and by the report of encapsulation
Text, which is cached to, to be uploaded in queue, carries out the number of image frames of control upload each second to the message in queue further according to video frame rate.
The uploading speed that message is controlled by video frame rate, caused by can preventing uploading speed and actual video broadcasting speed difference
Video pictures show the problems such as not smooth.
Then, third terminal can be obtained to cloud server terminal transmission data by application client and be asked.In data
It can be that user is generated by clicking the button on display screen to pass request, can also be that user passes through the control on pressing touch screen
What part generated.After cloud server terminal receives the data acquisition request sent by third terminal, the data sent according to third terminal obtain
Request is taken to return to flow media data packet, third terminal can carry out decoding of unpacking with streaming media data packet, after real-time display decoding
Video information.
Although should be understood that Fig. 2, each step in the flow chart of 4-7 is shown successively according to the instruction of arrow,
Be these steps it is not that the inevitable sequence indicated according to arrow executes successively.Unless expressly stating otherwise herein, these steps
There is no stringent sequences to limit for rapid execution, these steps can execute in other order.Moreover, in Fig. 2,4-7 extremely
Few a part of step may include that either these sub-steps of multiple stages or stage are not necessarily same to multiple sub-steps
Moment executes completion, but can execute at different times, and the execution sequence in these sub-steps or stage is also not necessarily
It carries out successively, but can either the sub-step of other steps or at least part in stage in turn or are handed over other steps
Alternately execute.
In one embodiment, as shown in figure 9, providing a kind of data transmission device, including:Request sending module 910,
Receiving module 920, acquisition request module 930 and transmission module 940, wherein:
Request sending module 910, the IP address for obtaining first terminal, and sent in fact to first terminal according to IP address
When data acquisition request.
Receiving module 920, the stream medium data returned according to Real time data acquisition request for receiving first terminal
Packet.
Acquisition request module 930, for obtaining real time data upload request;
Transmission module 940, for flow media data packet to be uploaded to cloud server terminal.
In one embodiment, request sending module 910 can be also used for sending token acquisition request to first terminal, and
According to the token of return and IP address Real time data acquisition request is sent to first terminal.
In one embodiment, request sending module 910 can be also used for asking to first terminal transmission real time data preview
It asks or sends real time data video recording request to first terminal.
In one embodiment, above-mentioned data transmission device further includes package module 950 and frame per second determining module 960,
In:
Video flowing for extracting video flowing from flow media data packet, and is encapsulated as specified format message by package module 950
It is cached to and uploads in queue.
Frame per second determining module 960, the Real time data acquisition request mode for obtaining video information, and according to video information
Real time data request mode determine video frame rate.
In one embodiment, as shown in Figure 10, a kind of data transmission device, including receiving module 1010, envelope are provided
Die-filling piece 1020 and sending module 1030, wherein:
Receiving module 1010, the Real time data acquisition request for receiving second terminal transmission.
Package module 1020 is encapsulated as stream medium data for obtaining the video information acquired in real time, and by video information
Packet.
Sending module 1030 flows matchmaker for asking to send flow media data packet to second terminal according to Real time data acquisition
Volume data packet uploads to cloud server terminal by second terminal.
In above-mentioned data transmission device, by obtaining the IP address of first terminal, sent to first terminal according to IP address
Real time data acquisition is asked, and the flow media data packet returned according to Real time data acquisition request is received, and is obtained real time data and is uploaded
Request, Cloud Server is uploaded to by flow media data packet.Due to that can realize law-enforcing recorder and cloud service by mobile terminal
The Real Data Exchangs at end need not be realized by integrated 4G modules, reduce the cost of law-enforcing recorder.
In one embodiment, the receiving module 1010 and sending module 1030 can be also used for:
Receiving module 1010 is established with second terminal and is connected, and is received the token that second terminal is sent and is obtained request.
Sending module 1030 obtains request according to token and sends token to second terminal.
In one embodiment, package module 1020 can be also used for obtaining the pattern of Real time data acquisition request, according to
The video information of acquisition is encapsulated as flow media data packet by the pattern of Real time data acquisition request.
Above-mentioned data transmission method is asked by the Real time data acquisition sent according to second terminal, by what is acquired in real time
Video information is packaged into flow media data packet and is sent to second terminal, and uploads near cloud server terminal by second terminal.Due to
The Real Data Exchangs that law-enforcing recorder and cloud server terminal can be realized by mobile terminal can solve law enforcement record and need to lead to
Cross the problem of 4G modules carry out real-time Data Transmission, increase law-enforcing recorder cost with cloud server terminal.
Specific about data transmission device limits the restriction that may refer to above for data transmission method, herein not
It repeats again.Modules in above-mentioned data transmission device can be realized fully or partially through software, hardware and combinations thereof.On
Stating each module can be embedded in or independently of in the processor in mobile terminal, can also be stored in a software form in the form of hardware
In memory in mobile terminal, the corresponding operation of the above modules is executed in order to which processor calls.
In one embodiment, a kind of mobile terminal is provided, internal structure chart can be as shown in figure 11.The movement is whole
End includes processor, memory, network interface, display screen and the input unit connected by system bus.Wherein, the movement is whole
The processor at end is for providing calculating and control ability.The memory of the mobile terminal includes non-volatile memory medium, memory
Reservoir.The non-volatile memory medium is stored with operating system and computer program.The built-in storage is situated between for non-volatile memories
The operation of operating system and computer program in matter provides environment.The network interface of the mobile terminal is used for and external terminal
It is communicated by network connection.To realize a kind of data transmission method when the computer program is executed by processor.The mobile terminal
Display screen can be liquid crystal display or electric ink display screen, the input unit of the mobile terminal can be on display screen
The touch layer of covering can also be the button being arranged on mobile terminal case, trace ball or Trackpad, can also be external key
Disk, Trackpad or mouse etc..It will be understood by those skilled in the art that structure shown in Figure 11, only and application scheme
The block diagram of relevant part-structure does not constitute the restriction for the mobile terminal being applied thereon to application scheme, specifically
Mobile terminal may include either combining certain components or with different portions than more or fewer components as shown in the figure
Part is arranged.
In one embodiment, a kind of mobile terminal, including memory and processor are provided, meter is stored in memory
Calculation machine program, the processor realize following steps when executing computer program:
Obtain the IP address of first terminal;
According to IP address Real time data acquisition request is sent to first terminal;
Receive the flow media data packet that first terminal is returned according to Real time data acquisition request;
Obtain real time data upload request;
Flow media data packet is uploaded to cloud server terminal.
In one embodiment, following steps are also realized when processor executes computer program:
Token is sent to first terminal obtain request according to IP address;
It receives first terminal and the token that request is sent is obtained according to token;
Real time data acquisition request is sent to first terminal according to IP address, including:
According to IP address and the token Real time data acquisition request is sent to first terminal.
In one embodiment, following steps are also realized when processor executes computer program:
Video flowing is extracted from flow media data packet;
Video flowing is encapsulated as specified format message, and will be in specified format packet buffer to upload queue;
Obtain the real time data request mode of video information;
Video frame rate is determined according to the real time data request mode of video information;
Specified format message is pushed to the cloud server terminal according to video frame rate.
In one embodiment, a kind of law-enforcing recorder is provided, internal structure chart is shown in Fig.12.The law enforcement
Record includes processor, memory, WIFI module, display screen and input unit, the camera connected by system bus.Its
In, the processor of law enforcement record is for providing calculating and control ability.The memory of law enforcement record includes non-volatile deposits
Storage media, built-in storage.The non-volatile memory medium is stored with operating system and computer program.The built-in storage is non-easy
The operation of operating system and computer program in the property lost storage medium provides environment.The WIFi modules of the law-enforcing recorder are used for
It is communicated by network connection with external terminal.The camera of the law-enforcing recorder be used for obtain external environment image information and
The video information of external environment variation.To realize a kind of data transmission method when the law-enforcing recorder is executed by processor.This is held
The display screen of method recorder can be liquid crystal display or electric ink display screen, and the input unit of the law-enforcing recorder can be with
It is the touch layer covered on display screen, can also be the button being arranged on law-enforcing recorder shell, trace ball or Trackpad, may be used also
To be external keyboard, Trackpad or mouse etc..It will be understood by those skilled in the art that structure shown in Figure 12, only
With the block diagram of the relevant part-structure of application scheme, the law-enforcing recorder being applied thereon to application scheme is not constituted
Restriction, specific law-enforcing recorder may include than more or fewer components as shown in the figure, or the certain components of combination, or
There is person different components to arrange.
In one embodiment, a kind of law-enforcing recorder, including WIFI module are provided;And memory and processor, it deposits
Computer program is stored in reservoir, which realizes following steps when executing computer program:
Receive the Real time data acquisition request that second terminal is sent;
Obtain the video information acquired in real time;
The video information of acquisition is encapsulated as flow media data packet;
Ask to send flow media data packet to second terminal according to Real time data acquisition, flow media data packet passes through described the
Two terminals upload to cloud server terminal.
In one embodiment, following steps are also realized when processor executes computer program:
It establishes and connects with second terminal;
It receives the token that second terminal is sent and obtains request;
Request, which is obtained, according to token sends token to the second terminal.
In one embodiment, following steps are also realized when processor executes computer program:
Determine the pattern of Real time data acquisition request;
If Real time data acquisition request is real time data preview request, the video information of acquisition is directly encapsulated as stream matchmaker
Volume data packet;
If Real time data acquisition request records the video information of acquisition, and will record to implement data recording request
The video information of system is encapsulated as flow media data packet.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated
Machine program realizes following steps when being executed by processor:
Obtain the IP address of first terminal;
According to IP address Real time data acquisition request is sent to first terminal;
Receive the flow media data packet that first terminal is returned according to Real time data acquisition request;
Obtain real time data upload request;
Flow media data packet is uploaded to cloud server terminal.
In one embodiment, following steps are also realized when computer program is executed by processor:
Token is sent to first terminal obtain request according to IP address;
It receives first terminal and the token that request is sent is obtained according to token;
According to IP address and the token Real time data acquisition request is sent to first terminal.
In one embodiment, following steps are also realized when computer program is executed by processor:
Video flowing is extracted from flow media data packet;
Video flowing is encapsulated as specified format message, and will be in specified format packet buffer to upload queue;
Obtain the real time data request mode of video information;
Video frame rate is determined according to the real time data request mode of video information;
Specified format message is pushed to the cloud server terminal according to video frame rate.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated
Machine program realizes following steps when being executed by processor:
Receive the Real time data acquisition request that second terminal is sent;
Obtain the video information acquired in real time;
The video information of acquisition is encapsulated as flow media data packet;
Ask to send flow media data packet to second terminal according to Real time data acquisition, flow media data packet passes through described the
Two terminals upload to cloud server terminal.
In one embodiment, following steps are also realized when processor executes computer program:
It establishes and connects with second terminal;
It receives the token that second terminal is sent and obtains request;
Request, which is obtained, according to token sends token to the second terminal.
In one embodiment, following steps are also realized when processor executes computer program:
Determine the pattern of Real time data acquisition request;
If Real time data acquisition request is real time data preview request, the video information of acquisition is directly encapsulated as stream matchmaker
Volume data packet;
If Real time data acquisition request records the video information of acquisition, and will record to implement data recording request
The video information of system is encapsulated as flow media data packet.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer
In read/write memory medium, the computer program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein,
Any reference to memory, storage, database or other media used in each embodiment provided herein,
Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM
(PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include
Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms,
Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing
Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM
(RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above example can be combined arbitrarily, to keep description succinct, not to above-described embodiment
In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance
Shield is all considered to be the range of this specification record.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art
It says, under the premise of not departing from the application design, various modifications and improvements can be made, these belong to the protection of the application
Range.Therefore, the protection domain of the application patent should be determined by the appended claims.