CN108924145A - Network transfer method, device and equipment - Google Patents

Network transfer method, device and equipment Download PDF

Info

Publication number
CN108924145A
CN108924145A CN201810778132.5A CN201810778132A CN108924145A CN 108924145 A CN108924145 A CN 108924145A CN 201810778132 A CN201810778132 A CN 201810778132A CN 108924145 A CN108924145 A CN 108924145A
Authority
CN
China
Prior art keywords
tcp connection
business datum
client
http request
sent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810778132.5A
Other languages
Chinese (zh)
Other versions
CN108924145B (en
Inventor
魏利开
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu Online Network Technology Beijing Co Ltd
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810778132.5A priority Critical patent/CN108924145B/en
Publication of CN108924145A publication Critical patent/CN108924145A/en
Application granted granted Critical
Publication of CN108924145B publication Critical patent/CN108924145B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present invention provides a kind of network transfer method, device and equipment.Method of the invention, by before obtaining business datum to be sent, the TCP connection of client creation and server end, and the head data of the corresponding HTTP request of the business datum are sent to the server end by the TCP connection, so that the TCP connection such as enters at the ready state of the business datum to be sent;The client is after getting the business datum to be sent, the business datum is directly sent to the server end by the TCP connection that the HTTP request occupies, the time that the head data of the time and HTTP request that eliminate TCP connection foundation are sent, network competition when business data transmission is reduced simultaneously, so that the transmission of the body data of HTTP request is more orderly and efficient, network transmission efficiency is improved.

Description

Network transfer method, device and equipment
Technical field
The present invention relates to field of communication technology more particularly to a kind of network transfer methods, device and equipment.
Background technique
The system that data actively are uploaded to server end for client at present, during user input data, visitor Family end uploads a data packet to server end at interval of preset duration, is uploaded in real time with the data that the user inputs between realization To server, client anticipated that the class for the data packet that the meeting in following a period of time is constantly uploaded to server end Type.Client is actively ordered into the body data that server end is sent, and the corresponding HTTP request of each body data is ordered into 's.
By taking speech recognition system as an example, user during one audio data of client typing, at interval of it is default when Long, client is raw using the audio section as the body data of HTTP request after getting the audio section in the time interval At the head data of the HTTP request, HTTP request is sent to server end.The tool of client transmission HTTP request Body process includes:The TCP connection with server end is established, sends the head number of HTTP request to server end by the TCP connection According to, by the TCP connection to server end send HTTP request body data.
But the data volume transmitted in network transmission process is big, network bandwidth resources are limited, the data of transmission need to compete net The network transmission efficiency of network bandwidth resources, client and server is low.
Summary of the invention
The present invention provides a kind of network transfer method, device and equipment, to solve the number transmitted in network transmission process It is big according to amount, network bandwidth resources are limited, the data of transmission need competition network bandwidth resources, and the network of client and server passes The problem of defeated low efficiency.
It is an aspect of the invention to provide a kind of network transfer methods, including:
Before obtaining business datum to be sent, the TCP connection of client creation and server end, and by described TCP connection sends the head data of the corresponding HTTP request of the business datum to the server end so that the TCP connection into The ready state of the business datum to be sent such as enter;
The client obtains the business datum to be sent;
The client sends the business datum to the server end by the TCP connection.
Another aspect of the present invention is to provide a kind of network transmission device, including:
Preprocessing module, for before obtaining business datum to be sent, client creation and the TCP of server end to connect It connects, and sends the head data of the corresponding HTTP request of the business datum to the server end by the TCP connection, so that The TCP connection such as enters at the ready state of the business datum to be sent;
Data acquisition module obtains the business datum to be sent for the client;
Transmission module sends the business datum to the server end by the TCP connection for the client.
Another aspect of the present invention is to provide a kind of client device, including:
Memory, processor, and it is stored in the computer journey that can be run on the memory and on the processor Sequence,
The processor realizes network transfer method described above when running the computer program.
Another aspect of the present invention is to provide a kind of computer readable storage medium, is stored with computer program,
The computer program realizes network transfer method described above when being executed by processor.
Network transfer method, device and equipment provided by the invention, by before obtaining business datum to be sent, visitor The TCP connection of family end creation and server end, and the business datum pair is sent to the server end by the TCP connection The head data for the HTTP request answered, so that the TCP connection such as enters at the ready state of the business datum to be sent;The visitor The TCP connection that family end is occupied after getting the business datum to be sent, directly by the HTTP request is to described Server end sends the business datum, the time that the head data of the time and HTTP request that eliminate TCP connection foundation are sent, Network competition when business data transmission is reduced simultaneously, so that the transmission of the body data of HTTP request is more orderly and high Effect, improves network transmission efficiency.
Detailed description of the invention
Fig. 1 is the network transfer method flow chart that the embodiment of the present invention one provides;
Fig. 2 is network transfer method flow chart provided by Embodiment 2 of the present invention;
Fig. 3 is the structural schematic diagram for the network transmission device that the embodiment of the present invention three provides;
Fig. 4 is the structural schematic diagram for the client device that the embodiment of the present invention five provides.
Through the above attached drawings, it has been shown that the specific embodiment of the present invention will be hereinafter described in more detail.These attached drawings It is not intended to limit the scope of the inventive concept in any manner with verbal description, but is by referring to specific embodiments Those skilled in the art illustrate idea of the invention.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended The example of device and method being described in detail in claims, some aspects of the invention are consistent.
Noun according to the present invention is explained first:
HTTP request:Refer to the request message from client to server end.HTTP request includes head data and main body number According to.In the present embodiment, the head data of HTTP request refer to the part before null and null in HTTP request, HTTP request Body data refers to the later part of the null in HTTP request, and the later part of the null in the present embodiment in HTTP request is taken The body data of band is the business datum that client is sent.
In addition, term " first ", " second " etc. are used for description purposes only, it is not understood to indicate or imply relatively important Property or implicitly indicate the quantity of indicated technical characteristic.In the description of following embodiment, the meaning of " plurality " is two More than a, unless otherwise specifically defined.
These specific embodiments can be combined with each other below, may be at certain for the same or similar concept or process It is repeated no more in a little embodiments.Below in conjunction with attached drawing, the embodiment of the present invention is described.
The embodiment of the present invention is applied to the transaction processing system that client actively uploads business datum to server end, such as Speech recognition system, image identification system etc..In this kind of transaction processing systems, for realize business processing in real time, During user input data, the business datum in this period is encapsulated as HTTP request at interval of preset period of time by client Body data, send server end for business datum by way of sending HTTP request.In this section of user's input In, when client uploads business datum to server end every time, the HTTP request corresponding with business datum of client generation Head data in other than different for the sequence identification of the sequence of identification service data, other data are all the same, that is, It says, client anticipated that the head data of the corresponding HTTP request of business datum to be sent in following a period of time.Client The business datum sent to server end is held to be ordered into, the corresponding HTTP request of each body data is ordered into.
Embodiment one
In the embodiment of the present invention, this method is applied to the business processing that client actively uploads business datum to server end System, such as speech recognition system, image identification system etc..The present embodiment is shown for being applied to speech recognition system Illustrate to meaning property, in other embodiments, this method applies also for other similar transaction processing system, and the present embodiment is to this It is not specifically limited.
Fig. 1 is the network transfer method flow chart that the embodiment of the present invention one provides.The embodiment of the present invention is directed to network transmission The data volume transmitted in the process is big, network bandwidth resources are limited, and the data of transmission need competition network bandwidth resources, client and clothes The low problem of the network transmission efficiency at business device end, provides network transfer method.Method in the present embodiment is applied to service The client of device end active upload data, which can be the terminal devices such as smart phone, plate, PC, at it In his embodiment, this method applies also for other equipment.As shown in Figure 1, specific step is as follows for this method:
Step S101, before obtaining business datum to be sent, the TCP connection of client creation and server end, and The head data of the corresponding HTTP request of business datum are sent to server end by TCP connection so that TCP connection enter etc. it is pending Send the ready state of business datum.
In the present embodiment, before obtaining business datum to be sent, client can pre-generate multiple HTTP requests Head data, create multiple TCP connections with server end, HTTP sent to server end by the TCP connection created and is asked The head data asked, at this point, the body data of the HTTP request to be sent such as TCP connection.It that is to say, passing through TCP connection to service After device end sends the head data of HTTP request, which is occupied by the HTTP request, and it is to be sent which enters etc. The ready state of the body data of the HTTP request that is to say that TCP connection such as enters at the corresponding business of the HTTP request to be sent The ready state of data, at this point, the TCP connection is occupied by the HTTP request, in the master for sending HTTP request by the TCP connection Before volume data, which, which is not used in, transmits other data.
For example, detecting that the input interface for incoming traffic data is opened or detects the defeated of business datum Enter operation or in transaction processing system initialization, client creates the TCP connection with server end, and passes through TCP connection The head data of the corresponding HTTP request of business datum are sent to server end, so that TCP connection such as enters at the business datum to be sent Ready state.
After receiving property data, client can be using business datum as the body data of HTTP request, HTTP The head data of request have passed through the TCP connection created and have been sent to server end, and client directlys adopt the HTTP request and accounts for The body data of the HTTP request is sent to server end by TCP connection, can be saved and got business to be sent TCP connection is created after data and sends the time of HTTP request head data, improves network transmission efficiency.
Step S102, client obtains business datum to be sent.
Step S103, client sends business datum to server end by TCP connection.
After getting business datum to be sent, business datum is encapsulated as the main body number of HTTP request by client According to the HTTP request that the TCP connection occupied by the HTTP request is directly packaged into server end transmission business datum Body data realizes the efficiently data transmission of client.
The embodiment of the present invention is by the way that before obtaining business datum to be sent, client creates the TCP with server end Connection, and the head data of the corresponding HTTP request of business datum are sent by TCP connection to server end so that TCP connection into The ready state of business datum to be sent such as enter;Client is after getting business datum to be sent, directly by being somebody's turn to do The TCP connection that HTTP request occupies sends business datum to server end, and the time and HTTP for eliminating TCP connection foundation ask The time that the head data asked are sent, while network competition when reducing business data transmission, so that the main body number of HTTP request According to transmission more orderly and efficiently, improve network transmission efficiency.
Embodiment two
In the embodiment of the present invention, this method is applied to the business processing that client actively uploads business datum to server end System, such as speech recognition system, image identification system etc..The present embodiment is shown for being applied to speech recognition system Illustrate to meaning property, in other embodiments, this method applies also for other similar transaction processing system, and the present embodiment is to this It is not specifically limited.
Fig. 2 is network transfer method flow chart provided by Embodiment 2 of the present invention.On the basis of the above embodiment 1, originally In embodiment, before obtaining business datum to be sent, the TCP connection of client creation and server end, and connected by TCP The head data that the corresponding HTTP request of business datum is sent to server end are connect, so that TCP connection such as enters at the business number to be sent According to ready state, including:Before obtaining business datum to be sent, client creates the TCP connection of the first preset quantity;It is right In each TCP connection, client generates the head data of HTTP request, and sends HTTP request to server end by TCP connection Head data, wherein the head data of HTTP request include the sequence mark for the genesis sequence for indicating the head data of HTTP request Know;Client establishes the corresponding relationship of the sequence identification of the head data of TCP connection and HTTP request, and TCP connection is labeled as Ready state.As shown in Fig. 2, specific step is as follows for this method:
Step S201, before obtaining business datum to be sent, client creates the TCP connection of the first preset quantity.
In the present embodiment, before obtaining business datum to be sent, client can pre-generate multiple HTTP requests Head data, create multiple TCP connections with server end, HTTP sent to server end by the TCP connection created and is asked The head data asked, so that these TCP connections such as enter at the ready state of the body data of HTTP request to be sent.At this point, TCP connects The body data of HTTP request to be sent such as connect.It that is to say, in the head number for sending HTTP request to server end by TCP connection The body datas of the HTTP request to be sent such as according to later, which is occupied by the HTTP request, which enters Ready state that is to say that TCP connection such as enters at the ready state of the corresponding business datum of the HTTP request to be sent, at this point, should TCP connection is occupied by the HTTP request, and before the body data for sending HTTP request by the TCP connection, the TCP connection is not It is used for transmission other data.
Before obtaining business datum to be sent, client creates the TCP connection of the first preset quantity, can specifically adopt It is realized with such as under type:
A kind of feasible embodiment can be:When detecting that the input interface for incoming traffic data is opened, Client creates the TCP connection with server end of the first preset quantity.For example, transaction processing system is speech recognition system, Client offer can be by the voice Interaction Interface of user's typing voice data, can be when voice Interaction Interface is opened, client The TCP connection of end creation and server end.
Another feasible embodiment can be:In the input operation for detecting business datum, client creation the The TCP connection with server end of one preset quantity.For example, transaction processing system is speech recognition system, user's point is detected When hitting speech voice input function button, alternatively, when detecting that user chooses the input function region of voice Interaction Interface, or detection When triggering the operation of output to other users, the TCP connection of client creation and server end.
Another feasible embodiment can be:In transaction processing system initialization, client creation first is default The TCP connection with server end of quantity.For example, transaction processing system is speech recognition system, start in speech recognition system, When opening the instant message applications for having speech identifying function such as user, the TCP connection of client creation and server end.
In addition, the first preset quantity is the quantity of the pre-set TCP connection being pre-created, for example, first is default Quantity can be 10,20,25,30,35 etc., and the first preset quantity can be by technical staff according to business number in practical application scene It is set according to the quantity and network transmission situation of corresponding HTTP request, the present embodiment is not specifically limited in this embodiment.
Step S202, for each TCP connection, client generates the head data of HTTP request, and passes through TCP connection to clothes The head data for device end transmission HTTP request of being engaged in, wherein the head data of HTTP request include the head data for indicating HTTP request Genesis sequence sequence identification.
Wherein, the sequence identification of the head data of HTTP request can be the sequence number of HTTP request.
Client needs when pre-generating transmission services data to server end before obtaining business datum to be sent The head data of the HTTP request of transmission, and the TCP connection by having built up is sent to server end.
Server end, can be according to the sequence identification in head data to receiving after receiving the head data of HTTP request The head data of HTTP request be ranked up, the subsequent body data by the HTTP request received by same TCP connection with The head data of the HTTP request are corresponding, and sorted business datum can be obtained, receiving industry so as to save server To the sequencer procedure of business datum after data of being engaged in, the efficiency of network transmission is further increased.
Step S203, client establishes the corresponding relationship of the sequence identification of the head data of TCP connection and HTTP request, and will TCP connection is labeled as ready state.
It, can be by the suitable of the head data of HTTP request after client sends the head data of HTTP request by TCP connection The storage corresponding with the mark of the TCP connection of sequence mark, thus establish the sequence identification of the head data of TCP connection and HTTP request Corresponding relationship, and TCP connection is labeled as ready state, in order to subsequent after receiving business datum, according to business number According to sequence identification search the TCP connection of corresponding ready state.
In practical applications, TCP connection will disconnect after the transmission of finishing service data, or after a time out.This implementation In example, in order to enable the corresponding HTTP request of all business datums can complete TCP company before getting the business datum The transmission of the head data of the foundation and HTTP request that connect, client can also the quantity of the TCP connection of ready state reduce when, The TCP connection for supplementing ready state in real time, specifically includes:
Client real-time monitoring is in the quantity of the TCP connection of ready state;If the number of the TCP connection in ready state Amount is less than the second preset quantity, then the TCP connection of client creation and server end, is sent new by newly created TCP connection HTTP request head data;Client establishes the sequence identification of the head data of newly created TCP connection and new HTTP request Corresponding relationship, and by newly created TCP connection be labeled as ready state.
Wherein, the second preset quantity is less than or equal to the first preset quantity, and the second preset quantity is pre-set The minimum number of the TCP connection of ready state.Second preset quantity can also be by technical staff according to industry in practical application scene The quantity and network transmission situation of the corresponding HTTP request of business data are set, and the present embodiment is not specifically limited in this embodiment.
Optionally, after client sends business datum to server end by TCP connection, client is by TCP connection mark It is denoted as occupied state.TCP connection is in occupied state, indicates the TCP connection just in transmission services data.
In addition, the TCP connection between client and server can be long connection in the present embodiment, that is to say in TCP After the transmission of a business datum is completed in connection, client and server end will not actively disconnect TCP connection.It that is to say, After the transmission that TCP connection completes a business datum, before the timeout, being still within can be used for transmits data to TCP connection Connection status.
Optionally, it after client sends business datum to server end by TCP connection, is sent completely in business datum Later, TCP connection can be re-set as ready state by client, specifically, client generates the head of new HTTP request Data, and send by TCP connection the head data of new HTTP request;Client establishes TCP connection and new HTTP request The corresponding relationship of the sequence identification of head data, and TCP connection is labeled as ready state.
Step S204, client obtains business datum to be sent.
Step S205, client determines the sequence identification of business datum.
The sequence identification of business datum refers to the sequence identification of the corresponding HTTP request of business datum, can be business datum The sequence number of corresponding HTTP request.
Step S206, client determines TCP connection corresponding with the sequence identification of business datum.
In the present embodiment, in above-mentioned steps S201-S203, client is corresponding by the sequence identification of business datum The head data of HTTP request have been sent to server end by established TCP connection.In the step, client is according to business number According to sequence identification, search the corresponding relationship of the sequence identification of the TCP connection of ready state and the head data of HTTP request, determine The sequence identification of the head data of the HTTP request sent and the consistent TCP connection of sequence identification of the business datum, can obtain To TCP connection corresponding with the sequence identification of business datum.
Step S207, client sends industry to server end by TCP connection corresponding with the sequence identification of business datum Business data.
After determining TCP connection corresponding with the sequence identification of business datum, client passes through suitable with business datum Sequence identifies corresponding TCP connection and sends business datum to server end, may thereby determine that the HTTP with same sequence identification The body data and head data of request are sent to server end by same TCP connection.Server end is receiving HTTP request Body data after, can be corresponding with ranked head data by body data, orderly body data can be obtained.
The embodiment of the present invention is by the way that before obtaining business datum to be sent, client creates the first preset quantity TCP connection, and the HTTP request head data including sequence identification are sent to server end by TCP connection, TCP connection enters The ready state of business datum to be sent so that server end can the head data in advance to the HTTP request received arrange Sequence;The TCP connection that client is occupied after getting business datum to be sent, directly by the HTTP request is to service Device end send business datum, server end after receiving the body data of HTTP request, can by body data with The head data of sequence are corresponding, and orderly body data can be obtained, and eliminate the time of TCP connection foundation, the head of HTTP request The time that data are sent and the time to body data sequence, while network competition when reducing business data transmission, make The transmission for obtaining the body data of HTTP request is more orderly and efficient, improves network transmission efficiency.
Embodiment three
Fig. 3 is the structural schematic diagram for the network transmission device that the embodiment of the present invention three provides.It is provided in an embodiment of the present invention Network transmission device can execute the process flow of network transfer method embodiment offer.As shown in figure 3, the device 30 includes: Preprocessing module 301, data acquisition module 302 and transmission module 303.
Specifically, preprocessing module 301, for before obtaining business datum to be sent, client creates and service The TCP connection at device end, and by TCP connection to the head data of the corresponding HTTP request of server end transmission business datum, so that TCP connection such as enters at the ready state of business datum to be sent.
Data acquisition module 302 obtains business datum to be sent for client.
Transmission module 303 sends business datum to server end by TCP connection for client.
Device provided in an embodiment of the present invention can be specifically used for executing embodiment of the method provided by above-described embodiment one, Details are not described herein again for concrete function.
The embodiment of the present invention is by the way that before obtaining business datum to be sent, client creates the TCP with server end Connection, and the head data of the corresponding HTTP request of business datum are sent by TCP connection to server end so that TCP connection into The ready state of business datum to be sent such as enter;Client is after getting business datum to be sent, directly by being somebody's turn to do The TCP connection that HTTP request occupies sends business datum to server end, and the time and HTTP for eliminating TCP connection foundation ask The time that the head data asked are sent, while network competition when reducing business data transmission, so that the main body number of HTTP request According to transmission more orderly and efficiently, improve network transmission efficiency.
Example IV
On the basis of above-described embodiment three, in the present embodiment, preprocessing module is also used to:Obtaining business to be sent Before data, client creates the TCP connection of the first preset quantity;For each TCP connection, client generates HTTP request Head data, and the head data of HTTP request are sent by TCP connection to server end, wherein the head data of HTTP request include For indicating the sequence identification of the genesis sequence of the head data of HTTP request;Client establishes the head of TCP connection and HTTP request The corresponding relationship of the sequence identification of data, and TCP connection is labeled as ready state.
Optionally, transmission module is also used to:
Client determines the sequence identification of business datum;Client determines TCP corresponding with the sequence identification of business datum Connection;Client sends business datum to server end by TCP connection corresponding with the sequence identification of business datum.
Optionally, the network in the present embodiment, which passes device, to include:First supplement process module.
First supplement process module is used for:
Client real-time monitoring is in the quantity of the TCP connection of ready state;If the number of the TCP connection in ready state Amount is less than the second preset quantity, then the TCP connection of client creation and server end, is sent new by newly created TCP connection HTTP request head data, wherein the second preset quantity be less than or equal to the first preset quantity;Client establishes new creation TCP connection and new HTTP request head data sequence identification corresponding relationship, and newly created TCP connection is labeled as Ready state.
Optionally, the network in the present embodiment, which passes device, to include:Second supplement process module.Second supplement process Module is used for:
TCP connection is labeled as occupied state by client.
Optionally, the second supplement process module is also used to:
After business datum is sent completely, client generates the head data of new HTTP request, and is sent out by TCP connection Send the head data of new HTTP request;Client establishes pair of the sequence identification of the head data of TCP connection and new HTTP request It should be related to, and TCP connection is labeled as ready state.
Optionally, preprocessing module is also used to:
When detecting that the input interface for incoming traffic data is opened, the TCP of client creation and server end Connection, and the head data of the corresponding HTTP request of business datum are sent by TCP connection to server end so that TCP connection into The ready state of business datum to be sent such as enter;And/or detect business datum input operation when, client creation with The TCP connection of server end, and pass through the head data that TCP connection sends the corresponding HTTP request of business datum to server end, So that TCP connection such as enters at the ready state of business datum to be sent.
Device provided in an embodiment of the present invention can be specifically used for executing embodiment of the method provided by above-described embodiment two, Details are not described herein again for concrete function.
The embodiment of the present invention is by the way that before obtaining business datum to be sent, client creates the first preset quantity TCP connection, and the HTTP request head data including sequence identification are sent to server end by TCP connection, TCP connection enters The ready state of business datum to be sent so that server end can the head data in advance to the HTTP request received arrange Sequence;The TCP connection that client is occupied after getting business datum to be sent, directly by the HTTP request is to service Device end send business datum, server end after receiving the body data of HTTP request, can by body data with The head data of sequence are corresponding, and orderly body data can be obtained, and eliminate the time of TCP connection foundation, the head of HTTP request The time that data are sent and the time to body data sequence, while network competition when reducing business data transmission, make The transmission for obtaining the body data of HTTP request is more orderly and efficient, improves network transmission efficiency.
Embodiment five
Fig. 4 is the structural schematic diagram for the client device that the embodiment of the present invention five provides.As shown in figure 4, the client is set Standby 40 include:Processor 401, memory 402, and it is stored in the computer that can be executed on memory 402 and by processor 401 Program.
Processor 401 realizes any of the above-described embodiment of the method when executing and storing in the computer program on memory 402 The network transfer method of offer.
The embodiment of the present invention is by the way that before obtaining business datum to be sent, client creates the TCP with server end Connection, and the head data of the corresponding HTTP request of business datum are sent by TCP connection to server end so that TCP connection into The ready state of business datum to be sent such as enter;Client is after getting business datum to be sent, directly by being somebody's turn to do The TCP connection that HTTP request occupies sends business datum to server end, and the time and HTTP for eliminating TCP connection foundation ask The time that the head data asked are sent, while network competition when reducing business data transmission, so that the main body number of HTTP request According to transmission more orderly and efficiently, improve network transmission efficiency.
In addition, the embodiment of the present invention also provides a kind of computer readable storage medium, it is stored with computer program, the meter Method that calculation machine program realizes what any of the above-described embodiment of the method provided when being executed by processor ....
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, only Only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can be tied Another system is closed or is desirably integrated into, or some features can be ignored or not executed.Another point, it is shown or discussed Mutual coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or logical of device or unit Letter connection can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can store and computer-readable deposit at one In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer It is each that equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the present invention The part steps of embodiment the method.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (Read- Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. it is various It can store the medium of program code.
Those skilled in the art can be understood that, for convenience and simplicity of description, only with above-mentioned each functional module Division progress for example, in practical application, can according to need and above-mentioned function distribution is complete by different functional modules At the internal structure of device being divided into different functional modules, to complete all or part of the functions described above.On The specific work process for stating the device of description, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its Its embodiment.The present invention is directed to cover any variations, uses, or adaptations of the invention, these modifications, purposes or Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following Claims are pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is only limited by appended claims System.

Claims (15)

1. a kind of network transfer method, which is characterized in that including:
Before obtaining business datum to be sent, the TCP connection of client creation and server end, and connected by the TCP The head data that the corresponding HTTP request of the business datum is sent to the server end are connect, so that the TCP connection enters The ready state of the business datum to be sent;
The client obtains the business datum to be sent;
The client sends the business datum to the server end by the TCP connection.
2. the method according to claim 1, wherein client is created before obtaining business datum to be sent The TCP connection with server end is built, and corresponding to the server end transmission business datum by the TCP connection The head data of HTTP request, so that the TCP connection such as enters at the ready state of the business datum to be sent, including:
Before obtaining business datum to be sent, the client creates the TCP connection of the first preset quantity;
For each TCP connection, the client generates the head data of HTTP request, and by the TCP connection to institute State the head data that server end sends the HTTP request, wherein the head data of the HTTP request include for indicating described The sequence identification of the genesis sequence of the head data of HTTP request;
The client establishes the corresponding relationship of the sequence identification of the head data of the TCP connection and the HTTP request, and will The TCP connection is labeled as ready state.
3. according to the method described in claim 2, it is characterized in that, the client is by the TCP connection to the service Device end sends the business datum, including:
The client determines the sequence identification of the business datum;
The client determines TCP connection corresponding with the sequence identification of the business datum;
The client passes through the TCP connection corresponding with the sequence identification of the business datum and sends to the server end The business datum.
4. according to the method in claim 2 or 3, which is characterized in that the method also includes:
The client real-time monitoring is in the quantity of the TCP connection of ready state;
If the quantity of the TCP connection in ready state less than the second preset quantity, the client creation with it is described The TCP connection of server end sends the head data of new HTTP request by newly created TCP connection, wherein described second is pre- If quantity is less than or equal to first preset quantity;
The client establishes pair of the sequence identification of the head data of the newly created TCP connection and the new HTTP request It should be related to, and the newly created TCP connection is labeled as ready state.
5. according to the method in claim 2 or 3, which is characterized in that the client is by the TCP connection to the clothes It is engaged in after the device end transmission business datum, further includes:
The TCP connection is labeled as occupied state by the client.
6. according to the method described in claim 5, it is characterized in that, the client is by the TCP connection to the service After device end sends the business datum, further include:
After the business datum is sent completely, the client generates the head data of new HTTP request, and by described TCP connection sends the head data of the new HTTP request;
The client establishes the corresponding relationship of the sequence identification of the head data of the TCP connection and the new HTTP request, And the TCP connection is labeled as ready state.
7. the method according to claim 1, wherein described before obtaining business datum to be sent, client The TCP connection of end creation and server end, and the business datum is sent to the server end by the TCP connection and is corresponded to HTTP request head data so that the TCP connection such as enters at the ready state of the business datum to be sent, including:
When detecting that the input interface for inputting the business datum is opened, the TCP of client creation and server end It connects, and sends the head data of the corresponding HTTP request of the business datum to the server end by the TCP connection, with The TCP connection is set the ready state of the business datum to be sent such as to enter;
And/or
In the input operation for detecting the business datum, the TCP connection of client creation and server end, and by described TCP connection sends the head data of the corresponding HTTP request of the business datum to the server end so that the TCP connection into The ready state of the business datum to be sent such as enter.
8. a kind of network transmission device, which is characterized in that including:
Preprocessing module, for before obtaining business datum to be sent, the TCP connection of client creation and server end, And the head data of the corresponding HTTP request of the business datum are sent to the server end by the TCP connection, so that institute State the ready state that TCP connection such as enters at the business datum to be sent;
Data acquisition module obtains the business datum to be sent for the client;
Transmission module sends the business datum to the server end by the TCP connection for the client.
9. device according to claim 8, which is characterized in that the preprocessing module is also used to:
Before obtaining business datum to be sent, the client creates the TCP connection of the first preset quantity;
For each TCP connection, the client generates the head data of HTTP request, and by the TCP connection to institute State the head data that server end sends the HTTP request, wherein the head data of the HTTP request include for indicating described The sequence identification of the genesis sequence of the head data of HTTP request;
The client establishes the corresponding relationship of the sequence identification of the head data of the TCP connection and the HTTP request, and will The TCP connection is labeled as ready state.
10. device according to claim 9, which is characterized in that the transmission module is also used to:
The client determines the sequence identification of the business datum;
The client determines TCP connection corresponding with the sequence identification of the business datum;
The client passes through the TCP connection corresponding with the sequence identification of the business datum and sends to the server end The business datum.
11. device according to claim 9 or 10, which is characterized in that described device further includes:First supplement process mould Block, the first supplement process module are used for:
The client real-time monitoring is in the quantity of the TCP connection of ready state;
If the quantity of the TCP connection in ready state less than the second preset quantity, the client creation with it is described The TCP connection of server end sends the head data of new HTTP request by newly created TCP connection, wherein described second is pre- If quantity is less than or equal to first preset quantity;
The client establishes pair of the sequence identification of the head data of the newly created TCP connection and the new HTTP request It should be related to, and the newly created TCP connection is labeled as ready state.
12. device according to claim 9 or 10, which is characterized in that described device further includes:Second supplement process mould Block, the second supplement process module are used for:
The TCP connection is labeled as occupied state by the client.
13. device according to claim 12, which is characterized in that the second supplement process module is also used to:
After the business datum is sent completely, the client generates the head data of new HTTP request, and by described TCP connection sends the head data of the new HTTP request;
The client establishes the corresponding relationship of the sequence identification of the head data of the TCP connection and the new HTTP request, And the TCP connection is labeled as ready state.
14. a kind of client device, which is characterized in that including:
Memory, processor, and it is stored in the computer program that can be run on the memory and on the processor,
The processor realizes such as method of any of claims 1-7 when running the computer program.
15. a kind of computer readable storage medium, which is characterized in that it is stored with computer program,
Such as method of any of claims 1-7 is realized when the computer program is executed by processor.
CN201810778132.5A 2018-07-16 2018-07-16 Network transmission method, device and equipment Active CN108924145B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810778132.5A CN108924145B (en) 2018-07-16 2018-07-16 Network transmission method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810778132.5A CN108924145B (en) 2018-07-16 2018-07-16 Network transmission method, device and equipment

Publications (2)

Publication Number Publication Date
CN108924145A true CN108924145A (en) 2018-11-30
CN108924145B CN108924145B (en) 2021-05-04

Family

ID=64411841

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810778132.5A Active CN108924145B (en) 2018-07-16 2018-07-16 Network transmission method, device and equipment

Country Status (1)

Country Link
CN (1) CN108924145B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111372099A (en) * 2020-03-20 2020-07-03 山东云缦智能科技有限公司 Low-delay HLS live broadcast implementation method
CN115132189A (en) * 2022-06-10 2022-09-30 中国第一汽车股份有限公司 Long connection communication connection pool management method based on self-adaptive control strategy

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011150644A1 (en) * 2010-12-17 2011-12-08 华为技术有限公司 Method and apparatus for acquiring and transmitting streaming media data in the process of initiation
US8443095B1 (en) * 2005-12-21 2013-05-14 Trend Micro Incorporated User space data stream parsing using TCP/IP information
CN104144186A (en) * 2013-05-10 2014-11-12 中国电信股份有限公司 Data uploading method and system based on Web browser in cloud computing environment
CN104349176A (en) * 2013-07-30 2015-02-11 中国电信股份有限公司 Self-adaptive stream media system, downloading method and stream media server, user terminal
US20150359016A1 (en) * 2014-06-09 2015-12-10 Qualcomm Incorporated Apparatus and method to estimate round trip time via transport control protocol signals
CN107659966A (en) * 2016-07-26 2018-02-02 普天信息技术有限公司 Data transmission method, the network equipment, user terminal, gateway device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8443095B1 (en) * 2005-12-21 2013-05-14 Trend Micro Incorporated User space data stream parsing using TCP/IP information
WO2011150644A1 (en) * 2010-12-17 2011-12-08 华为技术有限公司 Method and apparatus for acquiring and transmitting streaming media data in the process of initiation
CN104144186A (en) * 2013-05-10 2014-11-12 中国电信股份有限公司 Data uploading method and system based on Web browser in cloud computing environment
CN104349176A (en) * 2013-07-30 2015-02-11 中国电信股份有限公司 Self-adaptive stream media system, downloading method and stream media server, user terminal
US20150359016A1 (en) * 2014-06-09 2015-12-10 Qualcomm Incorporated Apparatus and method to estimate round trip time via transport control protocol signals
CN107659966A (en) * 2016-07-26 2018-02-02 普天信息技术有限公司 Data transmission method, the network equipment, user terminal, gateway device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111372099A (en) * 2020-03-20 2020-07-03 山东云缦智能科技有限公司 Low-delay HLS live broadcast implementation method
CN115132189A (en) * 2022-06-10 2022-09-30 中国第一汽车股份有限公司 Long connection communication connection pool management method based on self-adaptive control strategy

Also Published As

Publication number Publication date
CN108924145B (en) 2021-05-04

Similar Documents

Publication Publication Date Title
CN112784989B (en) Inference system, inference method, electronic device, and computer storage medium
CN107634915A (en) Data transmission method, device and storage medium
CN107146623B (en) Speech recognition method, device and system based on artificial intelligence
CN114281521B (en) Method, system, equipment and medium for optimizing deep learning heterogeneous resource communication efficiency
CN108985451A (en) Data processing method and equipment based on AI chip
CN109547541B (en) Node low-overhead cooperation method based on filtering and distribution mechanism in fog computing environment
CN116032663B (en) Privacy data processing system, method, equipment and medium based on edge equipment
CN103905482B (en) Method, push server and the system of pushed information
CN108924145A (en) Network transfer method, device and equipment
CN109495565B (en) High-concurrency service request processing method and device based on distributed ubiquitous computing
CN109561054A (en) A kind of data transmission method, controller and access device
CN110569127A (en) Virtual resource transferring, sending and acquiring method and device
CN109324815A (en) Monitoring method, device, equipment and the computer readable storage medium of system upgrade
CN108600564A (en) The method and apparatus of customer service
CN110955390A (en) Data processing method and device and electronic equipment
CN111813529B (en) Data processing method, device, electronic equipment and storage medium
CN105430028A (en) Service calling method, service providing method, and node
CN109213742A (en) Log collection method and device
CN109951532B (en) DPDK-based automatic flow model conversion device
CN103617796A (en) Voice recognition method based on cloud computing
Lu et al. Dynamic offloading on a hybrid edge–cloud architecture for multiobject tracking
CN114221964B (en) Access request processing method, device, computer equipment and storage medium
CN110047486A (en) Sound control method, device, server, system and storage medium
CN109246331A (en) A kind of method for processing video frequency and system
CN114222028A (en) Speech recognition method, speech recognition device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant