CN105681321A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN105681321A
CN105681321A CN201610101597.8A CN201610101597A CN105681321A CN 105681321 A CN105681321 A CN 105681321A CN 201610101597 A CN201610101597 A CN 201610101597A CN 105681321 A CN105681321 A CN 105681321A
Authority
CN
China
Prior art keywords
data
client
type
queue
ready state
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.)
Pending
Application number
CN201610101597.8A
Other languages
Chinese (zh)
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.)
Vimicro Corp
First Research Institute of Ministry of Public Security
Original Assignee
Vimicro Corp
First Research Institute of Ministry of Public Security
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 Vimicro Corp, First Research Institute of Ministry of Public Security filed Critical Vimicro Corp
Priority to CN201610101597.8A priority Critical patent/CN105681321A/en
Publication of CN105681321A publication Critical patent/CN105681321A/en
Pending legal-status Critical Current

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/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/01Protocols

Abstract

The invention discloses a data processing method and device, which are used for improving the communication capability of a server with a client. The data processing method comprises the steps: establishing a first communication channel through a socket interface and a preset client, and establishing a second communication channel through a network service interface and a preset server; when detecting that data in a ready state exists in the first communication channel, reading the data in the ready state in the first communication channel; writing the read data in the first communication channel into the tail of a first data queue for storing data transmitted from the client to the server in a local buffer pool; when detecting that data in the ready state exists in the second communication channel, reading the data in the ready state in the second communication channel; writing the read data in the second communication channel into the tail of a second data queue for storing data transmitted from the server to the client in the local buffer pool.

Description

A kind of data processing method and device
Technical field
The present invention relates to Internet technical field, particularly to a kind of data processing method and device.
Background technology
Adopt network interconnection device can realize exchanging visit and the communication of two distinct types of network, and the speed of heterogeneous networks and the difference of bandwidth can be coordinated. Common network interconnection device has repeater, bridge, router, access device, gateway etc. Commonly used due to network, network type gets more and more, and in order to realize intercommunication and resource-sharing mutually in a wider context, the interconnection between network just becomes the best way that a kind of information is quickly passed on, and when the network interconnection, then needs to use network interconnection device. Such as, generally network interconnection device is all adopted to realize the interconnection between server and client between all kinds of servers and all kinds of clients accessing this server.
But, when server and client side interconnects, network interconnection device is after receiving the connection request of client, can be that each client one new thread of establishment carries out link processing, after client-access amount increases, number of threads and the client of service end are proportional, after Thread Count expands, the Thread Count that system processes simultaneously is excessive, thus, the performance of system will sharply decline, along with the continuation of concurrent visit capacity increases, system can occur thread stacks to overflow, new thread creates the problem such as unsuccessfully, and the process that ultimately results in delays machine or ossified, service can not be externally provided, thus, how to solve that concurrent visit capacity is excessive and the problem that causes, improve the communication capacity between server and client, become a technical problem urgently to be resolved hurrily.
Summary of the invention
The present invention provides a kind of data processing method and device, in order to improve the communication capacity of server and client.
The present invention provides a kind of data processing method, including:
Set up the first communications conduit by sockets interface and default client and set up the second communication channel by network service interface and preset service device;
Detect in described first communications conduit and described second communication channel and whether there are the data being in ready state;
When detecting that in described first communications conduit, existence is in the data of ready state, read the data being in ready state in described first communications conduit;
The data read from described first communications conduit are write in local buffer pool and is used for storing the tail of the queue of the first data queue of the data being sent to server from client;
When detecting that in described second communication channel, existence is in the data of ready state, read the data being in ready state in described second communication channel;
The data read from described second communication channel are write in local buffer pool and is used for storing the tail of the queue of the second data queue of the data being sent to client from server.
The beneficial effects of the present invention is: owing to adding local buffer pool, make system after reading data, need not immediately treat, but the data read are write the tail of the queue of corresponding data queue in local buffer pool, thus, reduce the data number simultaneously processed, reduce the number of concurrent of thread, it is ensured that when concurrent visit capacity is excessive, the stability of systematic function, improve the communication capacity between server and client, improve the communication efficiency between server and client.
In one embodiment, described method also includes:
The head of the queue of the first data queue in Buffer Pool described in poll;
When the head of the queue of described first data queue has the data being in ready state, described in reading, it is in the data of ready state;
Whether the type of the data read described in judgement belongs to the data type that described preset service device is supported;
When the type of described data belongs to the data type that described preset service device is supported, the described data read are sent to preset service device;
When the type of described data is not belonging to the data type that described preset service device is supported, the type of described data is converted to the data type that described preset service device is supported;
When converting, the data after translation type are sent to preset service device.
Having the beneficial effects that of the present embodiment: the head of the queue of the first data queue in poll Buffer Pool, when the head of the queue of the first data queue has the data being in ready state, read the data being in ready state, thus, owing to there is the first data queue, make network interconnection device when receiving client data without immediately treating, reduce the number of concurrent of thread, secondly, whether the type prejudging these data belongs to the data type that server is supported, when being not belonging to the data type that server is supported, it is the data type that server is supported by this data type conversion, thus ensure that the effectiveness that server and client are mutual, further increase the communication capacity between server and client, improve the communication efficiency between server and client.
In one embodiment, carrying the client identification of the destination client receiving described data in the data of described second data queue, described method also includes:
The head of the queue of the second data queue in Buffer Pool described in poll;
When the head of the queue of described second data queue has the data being in ready state, described in reading, it is in the data of ready state;
The data type that the client that described client identification is corresponding is supported is determined according to the client identification carried in the described data read;
Whether the type of the data read described in judgement belongs to the data type that client corresponding to described client identification is supported;
When the type of the described data read belongs to the data type that client corresponding to described client identification is supported, the described data read are sent in described data the client that the client identification carried is corresponding;
When the type of described data is not belonging to client corresponding to described client identification, the type of described data is converted to the data type that client corresponding to described client identification is supported;
When converting, the data after translation type are sent in described data the client that the client identification carried is corresponding.
Having the beneficial effects that of the present embodiment: the head of the queue of the second data queue in poll Buffer Pool, when the head of the queue of the second data queue has the data being in ready state, read the data being in ready state, thus, owing to there is the second data queue, make network interconnection device when receiving the data of server without immediately treating, reduce the number of concurrent of thread, secondly, whether the type prejudging these data belongs to the data type that client is supported, when being not belonging to the data type that client is supported, it is the data type that client is supported by this data type conversion, thus ensure that the effectiveness that server and client are mutual, further increase the communication capacity between server and client, improve the communication efficiency between server and client.
In one embodiment, when described default client is multiple, described set up the first communications conduit by sockets interface and described client, including:
Multiple first communications conduit is set up, the corresponding communications conduit of each client by sockets interface and multiple clients;
Described method also includes:
Foundation processes thread;
By described process thread while listening for the plurality of first communications conduit.
Having the beneficial effects that of the present embodiment: when there is multiple client, the corresponding communications conduit of each client, thus, secondly client and communications conduit one_to_one corresponding are made, it is to avoid the disorder of data, one can be passed through and process thread while listening for multiple first communications conduits, thus, reduce the number of concurrent of thread, it is ensured that the stability of systematic function.
In one embodiment, the plurality of first communications conduit has different priority, described when detect there are the data being in ready state in described first communications conduit time, read the data being in ready state in described first communications conduit, including:
When detecting that in multiple first communications conduit, existence is in the data of ready state, obtain the priority of described first communications conduit;
The data of described first communications conduit are successively read by the order from high to low of the priority according to described first communications conduit.
Having the beneficial effects that of the present embodiment, the data in the first communications conduit can be successively read according to the priority of communications conduit order from high to low, thus, when setting up communications conduit, the client that can be important gives higher priority, it is to avoid the reading of emergency data is incured loss through delay.
The present invention also provides for a kind of data processing equipment, including:
First sets up module, for setting up the first communications conduit by sockets interface and default client and setting up the second communication channel by network service interface and preset service device;
Detection module, for detecting in described first communications conduit and described second communication channel whether there are the data being in ready state;
First read module, for when detecting that in described first communications conduit, existence is in the data of ready state, reading the data being in ready state in described first communications conduit;
First writing module, is used for storing the tail of the queue of the first data queue of the data being sent to server from client for the data read from described first communications conduit being write in local buffer pool;
Second read module, for when detecting that in described second communication channel, existence is in the data of ready state, reading the data being in ready state in described second communication channel;
Second writing module, is used for storing the tail of the queue of the second data queue of the data being sent to client from server for the data read from described second communication channel being write in local buffer pool.
In one embodiment, described device also includes:
First poller module, the head of the queue of the first data queue in Buffer Pool described in poll;
Third reading delivery block, for when the head of the queue of described first data queue has the data being in ready state, being in the data of ready state described in reading;
First judge module, whether the type of the data for reading described in judging belongs to the data type that described preset service device is supported;
First sending module, for when the type of described data belongs to the data type that described preset service device is supported, being sent to preset service device by the described data read;
First modular converter, for when the type of described data is not belonging to the data type that described preset service device is supported, being converted to the data type that described preset service device is supported by the type of described data;
Second sending module, for when converting, being sent to preset service device by the data after translation type.
In one embodiment, carrying the client identification of the destination client receiving described data in the data of described second data queue, described device also includes:
Second poller module, the head of the queue of the second data queue in Buffer Pool described in poll;
4th read module, for when the head of the queue of described second data queue has the data being in ready state, being in the data of ready state described in reading;
Determining module, the client identification carried in the data read described in basis determines the data type that the client that described client identification is corresponding is supported;
Second judge module, whether the type of the data for reading described in judging belongs to the data type that client corresponding to described client identification is supported;
3rd sending module, for when the type of the described data read belongs to the data type that client corresponding to described client identification is supported, being sent in described data, by the described data read, the client that the client identification carried is corresponding;
Second modular converter, for when the type of described data is not belonging to client corresponding to described client identification, being converted to the data type that client corresponding to described client identification is supported by the type of described data;
4th sending module, for when converting, being sent in described data, by the data after translation type, the client that the client identification carried is corresponding.
In one embodiment, described first sets up module, including:
Set up submodule, for when described default client is multiple, setting up multiple first communications conduit by sockets interface and multiple clients, the corresponding communications conduit of each client;
Described device also includes:
Second sets up module, is used for setting up process thread;
Monitor module, be used for by described process thread while listening for the plurality of first communications conduit.
In one embodiment, the plurality of first communications conduit has different priority, described first read module, including:
Obtain submodule, for when detecting that in multiple first communications conduit, existence is in the data of ready state, obtaining the priority of described first communications conduit;
Reading submodule, is used for the order from high to low of the priority according to described first communications conduit and the data of described first communications conduit is successively read.
Other features and advantages of the present invention will be set forth in the following description, and, partly become apparent from description, or understand by implementing the present invention. The purpose of the present invention and other advantages can be realized by structure specifically noted in the description write, claims and accompanying drawing and be obtained.
Below by drawings and Examples, technical scheme is described in further detail.
Accompanying drawing explanation
Accompanying drawing is for providing a further understanding of the present invention, and constitutes a part for description, is used for together with embodiments of the present invention explaining the present invention, is not intended that limitation of the present invention. In the accompanying drawings:
Fig. 1 is the flow chart of method for processing video frequency in one embodiment of the invention;
Fig. 2 is the flow chart of method for processing video frequency in one embodiment of the invention;
Fig. 3 is the block diagram of video process apparatus in one embodiment of the invention;
Fig. 4 is the block diagram of video process apparatus in one embodiment of the invention.
Detailed description of the invention
Below in conjunction with accompanying drawing, the preferred embodiments of the present invention are illustrated, it will be appreciated that preferred embodiment described herein is merely to illustrate and explains the present invention, is not intended to limit the present invention.
Fig. 1 is the flow chart of method for processing video frequency in one embodiment of the invention, as shown in Figure 1, in the present invention, data processing method can be used for the network interconnection device of Connection Service device and the client accessing this server, such as: repeater, router, bridge, gateway etc., the method can be implemented as following steps S11-S15:
In step s 11, set up the first communications conduit by sockets interface and default client and set up the second communication channel by network service interface and preset service device;
In step s 12, detect in the first communications conduit and second communication channel and whether there are the data being in ready state;
In step s 13, when detecting that in the first communications conduit, existence is in the data of ready state, the data being in ready state in the first communications conduit are read;
In step S14, the data read are write in local buffer pool be used for storing the tail of the queue of the first data queue of the data being sent to server from client from the first communications conduit;
In step S15, when detecting that in second communication channel, existence is in the data of ready state, read the data being in ready state in second communication channel;
In step s 16, the data read from second communication channel write local buffer pool will be used for storing the tail of the queue of the second data queue of the data being sent to client from server.
In the present embodiment, for police information system, the background server of police information system and the outside platform being connected with this server or equipment (such as Image-capturing platform or monitoring device) is connected by network interconnection device, sockets interface is adopted to be connected with monitoring device, and set up the first communications conduit with monitoring device, network service interface is adopted to be connected with the background server of police information system, and set up with it second communication channel, by local detection module or the detection thread that pre-builds detect in the first communications conduit and second communication channel whether there is the equipment being in ready state, when detecting that the first communications conduit exists the data being in ready state, read this data, and write the data into the tail of the queue of the first data queue in local buffer pool, this first data queue is for storing the monitoring data sent from monitoring device to police information system, when detecting that second communication channel exists the data being in ready state, read this data, and write the data into the tail of the queue of the second data queue in local buffer pool, this second data queue is for storing the data (such as monitoring instruction or request data accordingly) sent from police information system to monitoring device.
In the present embodiment, using Buffer Pool team data to process, carried out asynchronous reading and write by corresponding communications conduit, this communications conduit is full duplex, it is possible to map the application programming interface of underlying operating system better.
The beneficial effects of the present invention is: owing to adding local buffer pool, make system after reading data, need not immediately treat, but the data read are write the tail of the queue of corresponding data queue in local buffer pool, thus, reduce the data number simultaneously processed, reduce the number of concurrent of thread, it is ensured that when concurrent visit capacity is excessive, the stability of systematic function, improve the communication capacity between server and client, improve the communication efficiency between server and client.
In one embodiment, as in figure 2 it is shown, after above-mentioned steps S14, the method also can be implemented as following steps S21-S26:
In the step s 21, the head of the queue of the first data queue in poll Buffer Pool;
In step S22, when the head of the queue of the first data queue has the data being in ready state, read the data being in ready state;
In step S23, it is judged that whether the type of the data read belongs to the data type that preset service device is supported;
In step s 24, when the type of data belongs to the data type that preset service device is supported, the data read are sent to preset service device;
In step s 25, when the type of data is not belonging to the data type that preset service device is supported, the type of data is converted to the data type that preset service device is supported;
In step S26, when converting, the data after translation type are sent to preset service device.
In the present embodiment, adopt the head of the queue of polling mechanism poll Buffer Pool the first data queue, when the head of the queue of this first data queue has the data being in ready state, read this data being in ready state, owing to being written in tail of the queue when data write this first data queue, data are read, it then follows the principle of FIFO from head of the queue; And owing to the monitoring device of different manufacturers production supports different agreements, and the data gathered are likely to support different data types, thus, before transmitting data to server, it is necessary to judge whether these data belong to the data type that police information system background server is supported, if belonged to, then it is transmitted directly to this background server, if be not belonging to, then need first to convert this data to the data type that this background server is supported, be then then forwarded to this background server. Thus, network interconnection device serves the effect of data conversion.
Having the beneficial effects that of the present embodiment: the head of the queue of the first data queue in poll Buffer Pool, when the head of the queue of the first data queue has the data being in ready state, read the data being in ready state, thus, owing to there is the first data queue, make network interconnection device when receiving client data without immediately treating, reduce the number of concurrent of thread, secondly, whether the type prejudging these data belongs to the data type that server is supported, when being not belonging to the data type that server is supported, it is the data type that server is supported by this data type conversion, thus ensure that the effectiveness that server and client are mutual, further increase the communication capacity between server and client, improve the communication efficiency between server and client.
In one embodiment, carrying the client identification of the destination client receiving data in the data of the second data queue, after above-mentioned steps S16, the method also can be implemented as following steps A1-A7:
In step A1, the head of the queue of the second data queue in poll Buffer Pool;
In step A2, when the head of the queue of the second data queue has the data being in ready state, read the data being in ready state;
In step A3, determine, according to the client identification carried in the data read, the data type that the client that client identification is corresponding is supported;
In step A4, it is judged that whether the type of the data read belongs to the data type that client corresponding to client identification is supported;
In step A5, when the type of the data read belongs to the data type that client corresponding to client identification is supported, the data read are sent to the client that the client identification carried in data is corresponding;
In step A6, when the type of data is not belonging to client corresponding to client identification, the type of data is converted to the data type that client corresponding to client identification is supported;
In step A7, when converting, the data after translation type are sent to the client that the client identification carried in data is corresponding.
In the present embodiment, adopt the head of the queue of polling mechanism poll Buffer Pool the second data queue, this second data queue sends the data to client for depositing from server, these data carry the client identification that the client receiving these data is corresponding, instructs network interconnection device to send the data to corresponding client according to this client identification, when the head of the queue of this second data queue has the data being in ready state, read this data being in ready state, the monitoring device produced due to different manufacturers supports different agreements, thus, different monitoring devices is likely to support different data types, before transmitting data to client, need to determine, according to the client identification carried in these data, the data type that the client that this client identification is corresponding is supported, after determining the data type that the client that this client identification is corresponding is supported, whether the type judging these data is the data type that this client is supported, when the type of these data is the data type that this client is supported, send the data to the client that this client identification is corresponding, when the type of these data is not the data type that this client is supported, the type of these data is converted to the data type that client corresponding to this client identification is supported, then sends the data to the client that this client identification is corresponding again.
Having the beneficial effects that of the present embodiment: the head of the queue of the second data queue in poll Buffer Pool, when the head of the queue of the second data queue has the data being in ready state, read the data being in ready state, thus, owing to there is the second data queue, make network interconnection device when receiving the data of server without immediately treating, reduce the number of concurrent of thread, secondly, whether the type prejudging these data belongs to the data type that client is supported, when being not belonging to the data type that client is supported, it is the data type that client is supported by this data type conversion, thus ensure that the effectiveness that server and client are mutual, further increase the communication capacity between server and client, improve the communication efficiency between server and client.
In one embodiment, when default client is multiple, setting up the first communications conduit by sockets interface and client and can be implemented as following steps B1 in above-mentioned steps S11:
In step bl is determined., set up multiple first communications conduit by sockets interface and multiple clients, the corresponding communications conduit of each client;
Said method also can be implemented as following steps B2-B3:
In step B2, foundation processes thread;
In step B3, by processing thread while listening for multiple first communications conduits.
In the present embodiment, when there is multiple client, the first communications conduit is set up respectively by sockets interface and these clients, the corresponding communications conduit of each client, now, setting up one and process thread, this process thread is responsible for while listening for multiple first communications conduits corresponding respectively with above-mentioned multiple clients.
Having the beneficial effects that of the present embodiment: when there is multiple client, the corresponding communications conduit of each client, thus, secondly client and communications conduit one_to_one corresponding are made, it is to avoid the disorder of data, one can be passed through and process thread while listening for multiple first communications conduits, thus, reduce the number of concurrent of thread, it is ensured that the stability of systematic function.
In one embodiment, multiple first communications conduits have different priority, and above-mentioned steps S13 can be implemented as following steps C1-C2:
In step C1, when detecting that in multiple first communications conduit, existence is in the data of ready state, obtain the priority of the first communications conduit;
In step C2, according to the priority of the first communications conduit order from high to low, the data of the first communications conduit are successively read.
In the present embodiment, owing to there is multiple first communications conduit, when there being the data that there is ready state in multiple first channel, need a kind of strategy that can determine reading order, in the present embodiment, different priority is given to multiple first communications conduits, for the background server of police information system and the monitoring device that is connected with this background server, monitoring position according to the monitoring device being connected with this background server, determine the importance of this monitoring device, such as, the monitoring position of monitoring device A is Frequent Accidents area, then think that the importance of monitoring device A is high, give the priority that communications conduit corresponding for this monitoring device A is the highest, again such as, the monitoring position of monitoring device B is that artificial abortion compact district is (such as market, shopping center), then think that the importance of monitoring device B is higher, the priority of then corresponding for this monitoring device B communications conduit is only second to monitoring device A, by that analogy. such mode, it is possible to avoid the delay of important information to a certain extent.
Having the beneficial effects that of the present embodiment, the data in the first communications conduit can be successively read according to the priority of communications conduit order from high to low, thus, when setting up communications conduit, the client that can be important gives higher priority, it is to avoid the reading of emergency data is incured loss through delay.
Fig. 3 is the block diagram of video process apparatus in one embodiment of the invention, as shown in Figure 3, in the present invention, data processing equipment can be used for the network interconnection device of Connection Service device and the client accessing this server, for instance: repeater, router, bridge, gateway etc., device includes with lower module:
First sets up module 31, for setting up the first communications conduit by sockets interface and default client and setting up the second communication channel by network service interface and preset service device;
Detection module 32, for detecting in the first communications conduit and second communication channel whether there are the data being in ready state;
First read module 33, for when detecting that in the first communications conduit, existence is in the data of ready state, reading the data being in ready state in the first communications conduit;
First writing module 34, is used for storing the tail of the queue of the first data queue of the data being sent to server from client for the data read from the first communications conduit being write in local buffer pool;
Second read module 35, for when detecting that in second communication channel, existence is in the data of ready state, reading the data being in ready state in second communication channel;
Second writing module 36, is used for storing the tail of the queue of the second data queue of the data being sent to client from server for the data read from second communication channel being write in local buffer pool.
In one embodiment, as shown in Figure 4, device also includes such as lower module:
First poller module 41, for the head of the queue of the first data queue in poll Buffer Pool;
Third reading delivery block 42, for when the head of the queue of the first data queue has the data being in ready state, reading the data being in ready state;
First judge module 43, for judging whether the type of the data read belongs to the data type that preset service device is supported;
First sending module 44, for when the type of data belongs to the data type that preset service device is supported, being sent to preset service device by the data read;
First modular converter 45, for when the type of data is not belonging to the data type that preset service device is supported, being converted to the data type that preset service device is supported by the type of data;
Second sending module 46, for when converting, being sent to preset service device by the data after translation type.
In one embodiment, carrying the client identification of the destination client receiving data in the data of the second data queue, device also includes:
Second poller module, for the head of the queue of the second data queue in poll Buffer Pool;
4th read module, for when the head of the queue of the second data queue has the data being in ready state, reading the data being in ready state;
Determine module, for determining the data type that the client that client identification is corresponding is supported according to the client identification carried in the data read;
Second judge module, for judging whether the type of the data read belongs to the data type that client corresponding to client identification is supported;
3rd sending module, for when the type of the data read belongs to the data type that client corresponding to client identification is supported, being sent to, by the data read, the client that the client identification carried in data is corresponding;
Second modular converter, for when the type of data is not belonging to client corresponding to client identification, being converted to the data type that client corresponding to client identification is supported by the type of data;
4th sending module, for when converting, being sent to, by the data after translation type, the client that the client identification carried in data is corresponding.
In one embodiment, first sets up module, including:
Set up submodule, for when default client is multiple, setting up multiple first communications conduit by sockets interface and multiple clients, the corresponding communications conduit of each client;
Device also includes:
Second sets up module, is used for setting up process thread;
Monitor module, for by processing thread while listening for multiple first communications conduits.
In one embodiment, multiple first communications conduits have different priority, the first read module, including:
Obtain submodule, for when detecting that in multiple first communications conduit, existence is in the data of ready state, obtaining the priority of the first communications conduit;
Reading submodule, is used for the order from high to low of the priority according to the first communications conduit and the data of the first communications conduit is successively read.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or computer program. Therefore, the present invention can adopt the form of complete hardware embodiment, complete software implementation or the embodiment in conjunction with software and hardware aspect. And, the present invention can adopt the form at one or more upper computer programs implemented of computer-usable storage medium (including but not limited to disk memory and optical memory etc.) wherein including computer usable program code.
The present invention is that flow chart and/or block diagram with reference to method according to embodiments of the present invention, equipment (system) and computer program describe. It should be understood that can by the combination of the flow process in each flow process in computer program instructions flowchart and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame. These computer program instructions can be provided to produce a machine to the processor of general purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device so that the instruction performed by the processor of computer or other programmable data processing device is produced for realizing the device of function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and can guide in the computer-readable memory that computer or other programmable data processing device work in a specific way, the instruction making to be stored in this computer-readable memory produces to include the manufacture of command device, and this command device realizes the function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices provides for realizing the step of function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
Obviously, the present invention can be carried out various change and modification without deviating from the spirit and scope of the present invention by those skilled in the art. So, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (10)

1. a data processing method, it is characterised in that described method is applied to gateway, including:
Set up the first communications conduit by sockets interface and default client and set up the second communication channel by network service interface and preset service device;
Detect in described first communications conduit and described second communication channel and whether there are the data being in ready state;
When detecting that in described first communications conduit, existence is in the data of ready state, read the data being in ready state in described first communications conduit;
The data read from described first communications conduit are write in local buffer pool and is used for storing the tail of the queue of the first data queue of the data being sent to server from client;
When detecting that in described second communication channel, existence is in the data of ready state, read the data being in ready state in described second communication channel;
The data read from described second communication channel are write in local buffer pool and is used for storing the tail of the queue of the second data queue of the data being sent to client from server.
2. the method for claim 1, it is characterised in that described method also includes:
The head of the queue of the first data queue in Buffer Pool described in poll;
When the head of the queue of described first data queue has the data being in ready state, described in reading, it is in the data of ready state;
Whether the type of the data read described in judgement belongs to the data type that described preset service device is supported;
When the type of described data belongs to the data type that described preset service device is supported, the described data read are sent to preset service device;
When the type of described data is not belonging to the data type that described preset service device is supported, the type of described data is converted to the data type that described preset service device is supported;
When converting, the data after translation type are sent to preset service device.
3. the method for claim 1, it is characterised in that carrying the client identification of the destination client receiving described data in the data of described second data queue, described method also includes:
The head of the queue of the second data queue in Buffer Pool described in poll;
When the head of the queue of described second data queue has the data being in ready state, described in reading, it is in the data of ready state;
The data type that the client that described client identification is corresponding is supported is determined according to the client identification carried in the described data read;
Whether the type of the data read described in judgement belongs to the data type that client corresponding to described client identification is supported;
When the type of the described data read belongs to the data type that client corresponding to described client identification is supported, the described data read are sent in described data the client that the client identification carried is corresponding;
When the type of described data is not belonging to client corresponding to described client identification, the type of described data is converted to the data type that client corresponding to described client identification is supported;
When converting, the data after translation type are sent in described data the client that the client identification carried is corresponding.
4. the method for claim 1, it is characterised in that when described default client is multiple, described sets up the first communications conduit by sockets interface and described client, including:
Multiple first communications conduit is set up, the corresponding communications conduit of each client by sockets interface and multiple clients;
Described method also includes:
Foundation processes thread;
By described process thread while listening for the plurality of first communications conduit.
5. method as claimed in claim 4, it is characterized in that, the plurality of first communications conduit has different priority, described when detecting that in described first communications conduit, existence is in the data of ready state, read the data being in ready state in described first communications conduit, including:
When detecting that in multiple first communications conduit, existence is in the data of ready state, obtain the priority of described first communications conduit;
The data of described first communications conduit are successively read by the order from high to low of the priority according to described first communications conduit.
6. a data processing equipment, it is characterised in that including:
First sets up module, for setting up the first communications conduit by sockets interface and default client and setting up the second communication channel by network service interface and preset service device;
Detection module, for detecting in described first communications conduit and described second communication channel whether there are the data being in ready state;
First read module, for when detecting that in described first communications conduit, existence is in the data of ready state, reading the data being in ready state in described first communications conduit;
First writing module, is used for storing the tail of the queue of the first data queue of the data being sent to server from client for the data read from described first communications conduit being write in local buffer pool;
Second read module, for when detecting that in described second communication channel, existence is in the data of ready state, reading the data being in ready state in described second communication channel;
Second writing module, is used for storing the tail of the queue of the second data queue of the data being sent to client from server for the data read from described second communication channel being write in local buffer pool.
7. device as claimed in claim 6, it is characterised in that described device also includes:
First poller module, the head of the queue of the first data queue in Buffer Pool described in poll;
Third reading delivery block, for when the head of the queue of described first data queue has the data being in ready state, being in the data of ready state described in reading;
First judge module, whether the type of the data for reading described in judging belongs to the data type that described preset service device is supported;
First sending module, for when the type of described data belongs to the data type that described preset service device is supported, being sent to preset service device by the described data read;
First modular converter, for when the type of described data is not belonging to the data type that described preset service device is supported, being converted to the data type that described preset service device is supported by the type of described data;
Second sending module, for when converting, being sent to preset service device by the data after translation type.
8. device as claimed in claim 6, it is characterised in that carrying the client identification of the destination client receiving described data in the data of described second data queue, described device also includes:
Second poller module, the head of the queue of the second data queue in Buffer Pool described in poll;
4th read module, for when the head of the queue of described second data queue has the data being in ready state, being in the data of ready state described in reading;
Determining module, the client identification carried in the data read described in basis determines the data type that the client that described client identification is corresponding is supported;
Second judge module, whether the type of the data for reading described in judging belongs to the data type that client corresponding to described client identification is supported;
3rd sending module, for when the type of the described data read belongs to the data type that client corresponding to described client identification is supported, being sent in described data, by the described data read, the client that the client identification carried is corresponding;
Second modular converter, for when the type of described data is not belonging to client corresponding to described client identification, being converted to the data type that client corresponding to described client identification is supported by the type of described data;
4th sending module, for when converting, being sent in described data, by the data after translation type, the client that the client identification carried is corresponding.
9. device as claimed in claim 6, it is characterised in that described first sets up module, including:
Set up submodule, for when described default client is multiple, setting up multiple first communications conduit by sockets interface and multiple clients, the corresponding communications conduit of each client;
Described device also includes:
Second sets up module, is used for setting up process thread;
Monitor module, be used for by described process thread while listening for the plurality of first communications conduit.
10. device as claimed in claim 9, it is characterised in that the plurality of first communications conduit has different priority, described first read module, including:
Obtain submodule, for when detecting that in multiple first communications conduit, existence is in the data of ready state, obtaining the priority of described first communications conduit;
Reading submodule, is used for the order from high to low of the priority according to described first communications conduit and the data of described first communications conduit is successively read.
CN201610101597.8A 2016-02-24 2016-02-24 Data processing method and device Pending CN105681321A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610101597.8A CN105681321A (en) 2016-02-24 2016-02-24 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610101597.8A CN105681321A (en) 2016-02-24 2016-02-24 Data processing method and device

Publications (1)

Publication Number Publication Date
CN105681321A true CN105681321A (en) 2016-06-15

Family

ID=56305028

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610101597.8A Pending CN105681321A (en) 2016-02-24 2016-02-24 Data processing method and device

Country Status (1)

Country Link
CN (1) CN105681321A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107122237A (en) * 2017-04-27 2017-09-01 珠海格力电器股份有限公司 Data communications method and device
CN107729139A (en) * 2017-09-18 2018-02-23 北京京东尚科信息技术有限公司 A kind of method and apparatus for concurrently obtaining resource
CN109922159A (en) * 2019-03-27 2019-06-21 宁波大学 A kind of method of the two-way virtual link in cloud between internet of things equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103078909A (en) * 2012-12-27 2013-05-01 福建天晴数码有限公司 Communication method of total-event-driven efficient distributed game server
CN103164256A (en) * 2011-12-08 2013-06-19 深圳市快播科技有限公司 Processing method and system capable of achieving one machine supporting high concurrency
CN103618667A (en) * 2013-12-16 2014-03-05 苏州工业园区服务外包职业学院 Information transfer method, access gateway and system
CN104412565A (en) * 2012-06-27 2015-03-11 高通股份有限公司 Method for socket management involving a bearer independent protocol
CN104769553A (en) * 2013-01-31 2015-07-08 甲骨文国际公司 System and method for supporting work sharing muxing in a cluster

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164256A (en) * 2011-12-08 2013-06-19 深圳市快播科技有限公司 Processing method and system capable of achieving one machine supporting high concurrency
CN104412565A (en) * 2012-06-27 2015-03-11 高通股份有限公司 Method for socket management involving a bearer independent protocol
CN103078909A (en) * 2012-12-27 2013-05-01 福建天晴数码有限公司 Communication method of total-event-driven efficient distributed game server
CN104769553A (en) * 2013-01-31 2015-07-08 甲骨文国际公司 System and method for supporting work sharing muxing in a cluster
CN103618667A (en) * 2013-12-16 2014-03-05 苏州工业园区服务外包职业学院 Information transfer method, access gateway and system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107122237A (en) * 2017-04-27 2017-09-01 珠海格力电器股份有限公司 Data communications method and device
CN107122237B (en) * 2017-04-27 2020-08-04 珠海格力电器股份有限公司 Data communication method and device
CN107729139A (en) * 2017-09-18 2018-02-23 北京京东尚科信息技术有限公司 A kind of method and apparatus for concurrently obtaining resource
CN107729139B (en) * 2017-09-18 2021-02-26 北京京东尚科信息技术有限公司 Method and device for concurrently acquiring resources
CN109922159A (en) * 2019-03-27 2019-06-21 宁波大学 A kind of method of the two-way virtual link in cloud between internet of things equipment
CN109922159B (en) * 2019-03-27 2021-10-08 宁波大学 Cloud bidirectional virtual connection method between Internet of things devices

Similar Documents

Publication Publication Date Title
US10484472B2 (en) Methods and systems for efficiently moving data between nodes in a cluster
CN110691370B (en) Data transmission method, device and system
CN111247777B (en) Data transmitting/receiving apparatus and method of operating data transmitting/receiving apparatus
US8806030B2 (en) Multichannel connections in file system sessions
US6185607B1 (en) Method for managing network data transfers with minimal host processor involvement
JP3782352B2 (en) Channel setup in wideband code division multiple access system
CN106664290A (en) Data transmission method and device for photoelectric hybrid network
US20100306387A1 (en) Network interface device
US8539089B2 (en) System and method for vertical perimeter protection
CN105681321A (en) Data processing method and device
CN110958265A (en) Real-time forwarding method and device based on market data
CN103501282B (en) Network message sending control method, virtual switch and physical machine
CN110532202A (en) A kind of storage cluster system, data transmission method and device
CN109600278A (en) A kind of data communications method, device, equipment and medium
US20150281001A1 (en) System and method for managing storage transactions in a network interface
CN112653716B (en) Service binding method and device
TWI571077B (en) Integration network device and service integration method thereof
CN103036815B (en) A kind of information technology and communication technology ICT emerging system
US11121956B1 (en) Methods and systems for optimizing bidirectional forwarding detection in hardware
KR102526770B1 (en) Electronic device providing fast packet forwarding with reference to additional network address translation table
CN113133056B (en) Data transmission method and device
KR20200143881A (en) Controller commnication device and method thereof
CN101741706B (en) Method for controlling quality of service of internet small computer system interface iSCSI
CN112653627B (en) Data transmission method, device and system, computer equipment and computer readable storage medium
KR101512619B1 (en) Apparatus and method for transmitting mass data using platform

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160615

RJ01 Rejection of invention patent application after publication