Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to
Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can be using the exemplary system of the embodiment of the data transmission method or data transmission device of the application
System framework 100.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105.
Network 104 between terminal device 101,102,103 and server 105 to provide the medium of transmission link.Network 104 can be with
Including various connection types, such as wired, wireless transmission link or fiber optic cables etc..
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out
Send message etc..Various communication applications can be installed, such as network security class is applied, immediately on terminal device 101,102,103
Means of communication etc..
Terminal device 101,102,103 can be with display screen and support the various electronic equipments of network communication, packet
Include but be not limited to smart phone, tablet computer, E-book reader, MP3 player (Moving Picture Experts
Group Audio Layer III, dynamic image expert's compression standard audio level 3), MP4 (Moving Picture
Experts Group Audio Layer IV, dynamic image expert's compression standard audio level 4) it is player, on knee portable
Computer and desktop computer etc..
Server 105 can be to provide the server of various services, such as to the network on terminal device 101,102,103
Security classes application provides the background server supported.Background server can be to data such as the business data processing requests received
It carries out the processing such as analyzing, and processing result (such as business datum) is fed back into terminal device.
It should be noted that in the embodiment of the present application, client, server-side and the equipment for being not specific to a certain type.With more
For carrying out data transmission between a process, the process for issuing data processing request can be referred to as client, can will used
It is referred to as server-side in the process of processing data processing request.Above-mentioned client, server-side can run on identical terminal device
101,102,103 or server 105 on, can also run on different terminal device 101,102,103 or server 105 it
On.Correspondingly, the terminal device 101,102,103 or server 105 that can be operated in by client, server-side execute sending
Data processing request and the operation for handling data processing request.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need
It wants, can have any number of terminal device, network and server.
Referring to FIG. 2, it illustrates the processes 200 according to one embodiment of the data transmission method of the application.It needs
Illustrate, in the present embodiment, transmission interface can be the communication interface for multiple interprocess communications.When multiple processes
When running on local positioned at same equipment (such as server shown in FIG. 1 or terminal) i.e. multiple processes, then transmitting can with interface
Think local interface (such as application programming interface).When to be located at different equipment (such as shown in FIG. 1 for multiple processes
Server or terminal) when, then transmission interface can be network interface (such as socket).Data provided by the present embodiment pass
Transmission method can be executed by terminal device 101,102,103 or server 105.Method includes the following steps:
Step 201, the connection request sent in response to client is generated for the transmission with client transmissions business datum
Use interface.
In the present embodiment, connection request can be the connection request of the operation for triggering creation transmission interface.Example
Such as, when transmission is socket with interface, then the connection request can be socket connection request.Data transmission method is run on
Electronic equipment (such as server shown in FIG. 1 or terminal) thereon can pass through wired connection mode or radio connection
Connection request is received from client.It should be pointed out that above-mentioned radio connection can include but is not limited to 3G/4G connection,
WiFi connection, bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection and other now
The radio connection known or developed in the future.
Referring to FIG. 3, it illustrates the schematic diagrams for generating transmission interface.Fig. 3 is to be using transmission with interface as socket
Example illustrates to create transmission interface, that is, transmission socket principle in response to connection request.In fig. 3 it is shown that monitoring set
Connect word 301, transmission socket 302, client 303.Wherein, monitoring socket 301 can be in the company for receiving client transmission
It is created before connecing request.It can use and monitor the connection request that socket monitoring client 303 is sent.By monitoring socket
While being monitored to connection request, it can create further in response to the connection request of client for being passed with client
The transmission of defeated business datum socket 302.In the present embodiment, creation transmission when with interface can be socket based on transmission
With the principle of interface, creation for the communication between local process transmission with interface (such as application programming interface).
In the present embodiment, after creating transmission interface, it can use transmission interface and client carry out data
Transmission.For example, transmission interface can be written in data to be transmitted, it is then forwarded to client, in another example, it can be used from transmission
The data that reading client is sent in interface.In the present embodiment, when multiple client issues connection request, table can be generated
Sign client connect list with the client of interface corresponding relationship with transmission, every to increase a client connection, can create
One transmission interface is used for and newly increases client and carry out data transmission.
Step 202, the business data processing request for treating processing business data that client is sent is received.
In the present embodiment, business data processing request includes type of service belonging to business datum to be processed.In this reality
It applies in example, can will be referred to as business for the service that client provides.For example, can to the network security class service that client provides
A type of service can be corresponded to comprising searching solution, updating business, each business such as virus base, correspondingly, with
The associated data of type of service can be referred to as business datum.In the present embodiment, in the connection request in response to client,
After the transmission interface for creating transmission services data, the business data processing request of client transmission can be further received.
In the present embodiment, according to the difference of business data processing request type, business data processing request it is corresponding to
Processing business data are also different.For example, when to obtain newest virus base data mounted thereto to update for client expectation
When the virus base of network security class application, then what business data processing request can send for client is used to obtain newest disease
The request of malicious library data, correspondingly, business datum to be processed can it is expected the newest virus base data obtained for user.Example again
Such as, when client needs to upload wrong data it is expected to find out corresponding solution, then business data processing request can
Think the request for being used to handle the wrong data that client uploads (such as reception) that client is sent, accordingly
Ground, the wrong data that business datum to be processed can upload for client.
Step 203, it is based on type of service, determines the business data processing thread for being used for processing business data processing request.
In the present embodiment, the type of the business datum in being requested based on the business data processing of client transmission,
Determine the business data processing thread for being used for processing business data processing request.For example, when client expectation obtains newest disease
When malicious library data are to update the virus base in network security class application mounted thereto, business datum to be processed can be user
It is expected that the newest virus base data obtained.Type of service belonging to the business datum to be processed can update for virus base data
This type of service can be based on the type of service, determine the business data processing line for being used for processing business data processing request
Journey, i.e., for obtaining newest virus base data and sending the business data processing line of newest viral data to client
Journey.
In some optionally implementations of the present embodiment, further includes: the quantity based on type of service is pre-created more
A business data processing thread, wherein the corresponding type of service of each business data processing thread.In the present embodiment,
It can be directed to each type of service, create a business data processing thread corresponding with type of service.
In the present embodiment, the work for handling the requests such as connection request, business data processing request can be pre-created
Make thread.When a connection request is received, then transmission interface is created.It, then can be with when receiving business data processing request
According to the type of business datum to be processed, business data processing request is sent to its corresponding business data processing thread and is carried out
Processing.In the present embodiment, worker thread can also receive the request that is operated with interface to transmission (such as closing transmission is used
The request of interface).
Step 204, business data processing request is handled using business data processing thread, and is used by transmission
The business that interface and client transmissions obtain after being handled via business data processing thread business data processing request
Data.
In the present embodiment, it can use business data processing thread to handle business data processing request, then
Pass through transmission interface and client transmissions business datum.For example, when business data processing request is the newest viral number of acquisition
According to library data request when, then its correspond to business data processing thread can obtain newest virus database data, be then written
Into transmission interface, it is sent to client.When request of the business data processing request for the wrong data of upload client,
Then it corresponds to the wrong data that business data processing thread can be uploaded from transmission with client is read out in interface.
Referring to FIG. 4, it illustrates the schematic diagrams for requesting to be handled to business data processing.In fig. 4 it is shown that objective
Family end 401, business data processing thread 402, transmission interface 403.Below with client 1, the client 2 in client 401
And business data processing thread 1, the transmission interface of the transmission in interface 403 1 and biography in business data processing thread 402
It is defeated with for interface 2, illustrating business data processing thread and request business data processing the process handled: client 1 with
Client 2 corresponds to business data processing thread 1, i.e., handles client 1 using business data processing thread 1 and client 2 is sent out
The business data processing request sent.It is newest for obtaining with client 1 and the business data processing request that client 2 is sent
For the request of virus base data, transmission interface 1 and transmission interface 2 be in order to client 1 and 2 transmission services of client
Data and the transmission interface created.Then business data processing thread 1 passes through respectively for obtaining most current virus library data
Transmission interface 1 and transmission interface 2 send the data to client 1, client 2.Meanwhile can by transmission interface 1 with
Transmission is stored with interface 2 and the corresponding relationship of business data processing thread 1, thus, when client 1 and client 2 are sent
Business data processing request for request for being handled the wrong data that client uploads when, can be used according to transmission
Interface 1 and the transmission corresponding relationship of interface 2 and business data processing thread 1, the business that client 1 and client 2 are sent
Data processing request transfers to business data processing thread 1 to be handled, by business data processing thread 1 will based on wrong data and
The solution of lookup passes through transmission interface 1 respectively and transmission interface 2 sends the data to client 1, client 2.
In some optionally implementations of the present embodiment, business data processing is asked using business data processing thread
Asking and carrying out processing includes: the receiving time requested using business data processing thread based on business data processing, successively to business
Data processing request is handled.
In the present embodiment, the business data processing that business data processing thread can receive multiple client transmission is asked
It asks, business data processing request can be added in queue according to the time for receiving business data processing request, it can be with elder generation
Successively the business data processing request in queue is handled into the mode first gone out.
In some optionally implementations of the present embodiment, business data processing request further includes to be processed for characterizing
The weighted value of the corresponding urgency level of business datum;And business data processing is requested to carry out using business data processing thread
Processing includes: to be based on weighted value using business data processing thread, determines the processing sequence requested business data processing;And
Based on processing sequence, successively business data processing request is handled.
It in the present embodiment, may include that business datum to be processed is corresponding in the business data processing request that client is sent
Urgency level weighted value, then, to the higher business datum priority processing of weighted value.For example, for happening suddenly in network
The relevant business datum of network safety event, can assign higher weighted value, so that business data processing thread is to the industry
Business high priority data is handled.In the present embodiment, can based on the weighted value of the corresponding urgency level of business datum to be processed,
It determines the processing sequence requested business data processing, then according to processing sequence, successively business data processing is requested to carry out
Processing.
The data transmission method provided by the above embodiment of the application, by being requested for each business data processing,
The transmission interface that creation is used for transmission data transfers to different business datums then according to the type of business datum to be processed
Processing thread is handled, so as to avoid when being carried out data transmission by transmission interface, because transmission interface is corresponding
The problem of increasing overhead caused by simultaneously operating is needed between thread, reduces the overhead when transmitting data.
Referring to FIG. 5, it illustrates the processes 500 according to another embodiment of the data transmission method of the application.This
Data transmission method provided by embodiment can be executed by terminal device 101,102,103 or server 105.This method includes
Following steps:
Step 501, in response to the process instruction for treating processing business data of input, connection request is generated.
In the present embodiment, connection request can be the connection request of the operation for triggering creation transmission interface.Example
Such as, when coffret is socket, then the connection request can be socket connection request.The clothes that server-side can be provided
Business is referred to as business.It searches solution for example, the network security class service that server-side provides may include, update virus base etc.
Business, each business can correspond to a type of service, and correspondingly, data associated with type of service can be referred to as industry
Business data.In the present embodiment, according to the difference of the type of business datum to be processed, corresponding process instruction is also different.
For example, then process instruction can be when business datum to be processed is the newest virus base data for needing to obtain from server-side
For obtaining the instruction of newest virus base data from server-side.In the present embodiment, processing business data are treated receiving
Process instruction after, can in response to process instruction, generate connection request.
Step 502, connection request is sent to server-side, and receives giving birth in response to connection request for server-side return
At for mark with the transmission interface of server-side transmission services data.
In the present embodiment, after connection request is sent to server-side, it can receive the response of server-side return
In the mark being used for the transmission interface of server-side transmission services data that connection request generates.It can use transmission use
The corresponding transmission interface of the mark of interface and server-side transmission services data.
Step 503, business data processing request is generated.
In the present embodiment, business data processing request includes type of service and transmission belonging to business datum to be processed
With the mark of interface.
In some optionally implementations of the present embodiment, business data processing request further include: for characterizing wait locate
Manage the weighted value of the corresponding urgency level of business datum.It in the present embodiment, can be corresponding urgent previously according to business datum
Degree assigns the different weighted values for characterizing its urgency level to different types of business datum.For example, being answered with network security class
For, business datum associated with nonbursty network security incident can be assigned to higher weighted value.
Step 504, business data processing request is sent to server-side, passes through the corresponding transmission of the mark of transmission interface
With interface and server-side transmission services data.
In the present embodiment, business datum includes via the corresponding business number of type of service belonging to business datum to be processed
Business datum is obtained after being handled according to processing thread business data processing request.Business data processing is being requested to send
To server-side, business data processing corresponding with type of service belonging to business datum to be processed in server-side can be triggered
Thread handles business data processing request, obtains business datum after processing.It is then possible at via business datum
The corresponding transmission interface of the mark of transmission interface in reason request, with the business datum of server-side transmission after processing.
Referring to FIG. 6, it illustrates the structural schematic diagrams according to one embodiment of the data transmission device of the application.Dress
Setting 600 includes: response unit 601, receiving unit 602, determination unit 603, communication unit 604.Wherein, response unit 601 is matched
The connection request for sending in response to client is set, is generated for the transmission interface with client transmissions business datum;It connects
Unit 602 is received to be configured to receive the business data processing request for treating processing business data that client is sent, business datum
Processing request includes type of service belonging to business datum to be processed;Determination unit 603 is configured to determine based on type of service
Business data processing thread for processing business data processing request;Communication unit 604 is configured to using at business datum
Lineation journey handles business data processing request, and by transmission interface and client transmissions via business datum at
The business datum that lineation journey obtains after being handled business data processing request.
In some optionally implementations of the present embodiment, communication unit 604 includes: that the first processing subelement (does not show
Out), it is configured to the receiving time requested using business data processing thread based on business data processing, successively to business datum
Processing request is handled.
In some optionally implementations of the present embodiment, business data processing request further includes to be processed for characterizing
The weighted value of the corresponding urgency level of business datum, communication unit 604 include: second processing subelement (not shown), and configuration is used
In being based on weighted value using business data processing thread, the processing sequence requested business data processing is determined, and based on place
It makes sequence in order, successively business data processing request is handled.
In some optionally implementations of the present embodiment, device 600 further include: number of threads determination unit (is not shown
Out), it is configured to the quantity based on type of service, multiple business data processing threads are pre-created, wherein each business number
According to the corresponding type of service of processing thread.
Referring to FIG. 7, it illustrates the structural schematic diagrams according to another embodiment of the data transmission device of the application.
Device 700 includes: instruction response unit 701, transmission unit 702, generation unit 703, request transmitting unit 704.Wherein, it instructs
Response unit 701 is configured to the process instruction for treating processing business data in response to input, generates connection request;It sends single
Member 702 is configured to for connection request to be sent to server-side, and receives generating in response to connection request for server-side return
For mark with the transmission interface of server-side transmission services data;Generation unit 703 is configured to generate business datum
The mark of interface is used in processing request, business data processing request comprising type of service belonging to business datum to be processed and transmission
Know;Request transmitting unit 704 is configured to request business data processing to be sent to server-side, passes through the mark of transmission interface
Corresponding transmission interface and server-side transmission services data, business datum includes via at the corresponding business datum of type of service
Lineation journey obtains business datum after being handled business data processing request.
In some optionally implementations of the present embodiment, business data processing request further include: for characterizing wait locate
Manage the weighted value of the corresponding urgency level of business datum.
Below with reference to Fig. 8, it illustrates the terminal device for being suitable for being used to realize the embodiment of the present application or the computers of host
The structural schematic diagram of system 800.
As shown in figure 8, computer system 800 includes central processing unit (CPU) 801, it can be read-only according to being stored in
Program in memory (ROM) 802 or be loaded into the program in random access storage device (RAM) 803 from storage section 808 and
Execute various movements appropriate and processing.In RAM 803, also it is stored with system 800 and operates required various programs and data.
CPU 801, ROM 802 and RAM 803 are connected with each other by bus 804.Input/output (I/O) interface 805 is also connected to always
Line 804.
I/O interface 805 is connected to lower component: the importation 806 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 807 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 808 including hard disk etc.;
And the communications portion 809 of the network interface card including LAN card, modem etc..Communications portion 809 via such as because
The network of spy's net executes communication process.Driver 810 is also connected to I/O interface 805 as needed.Detachable media 811, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 810, in order to read from thereon
Computer program be mounted into storage section 808 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of Fig. 2-Fig. 7 description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be tangibly embodied in machine readable
Computer program on medium, the computer program include the program code for executing the method for Fig. 2-Fig. 7.Such
In embodiment, which can be downloaded and installed from network by communications portion 809, and/or is situated between from detachable
Matter 811 is mounted.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of the module, program segment or code include one or more
Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box
The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical
On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants
It is noted that the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, Ke Yiyong
The dedicated hardware based system of defined functions or operations is executed to realize, or can be referred to specialized hardware and computer
The combination of order is realized.
Involved unit or module can be realized by way of software in the embodiment of the present application, can also be by hard
The mode of part is realized.Described unit or module also can be set in the processor, for example, can be described as: a kind of place
Managing device includes response unit, receiving unit, determination unit, communication unit.Wherein, the title of these units is under certain conditions simultaneously
The restriction to the unit itself is not constituted, for example, response unit is also described as, " connection sent in response to client is asked
It asks, generates for the transmission interface with client transmissions business datum ".
As on the other hand, present invention also provides a kind of nonvolatile computer storage media, the non-volatile calculating
Machine storage medium can be nonvolatile computer storage media included in device described in above-described embodiment;It is also possible to
Individualism, without the nonvolatile computer storage media in supplying terminal.Above-mentioned nonvolatile computer storage media is deposited
One or more program is contained, when one or more of programs are executed by an equipment, so that the equipment: response
In the connection request that client is sent, generate for the transmission interface with the client transmissions business datum;Receive client
The business data processing for treating processing business data that end is sent is requested, and the business data processing request includes business to be processed
Type of service belonging to data;Based on the type of service, the business number for handling the business data processing request is determined
According to processing thread;Business data processing request is handled using the business data processing thread, and passes through institute
State transmission interface and the client transmissions via the business data processing thread to the business data processing request into
The business datum obtained after row processing.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art
Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic
Scheme, while should also cover in the case where not departing from the inventive concept, it is carried out by above-mentioned technical characteristic or its equivalent feature
Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein
Can technical characteristic replaced mutually and the technical solution that is formed.