CN104796395A - Processing method for instant large-scale network connection - Google Patents
Processing method for instant large-scale network connection Download PDFInfo
- Publication number
- CN104796395A CN104796395A CN201410257163.8A CN201410257163A CN104796395A CN 104796395 A CN104796395 A CN 104796395A CN 201410257163 A CN201410257163 A CN 201410257163A CN 104796395 A CN104796395 A CN 104796395A
- Authority
- CN
- China
- Prior art keywords
- buffer pool
- connection
- scale network
- network connection
- tcp
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/30—Network architectures or network communication protocols for network security for supporting lawful interception, monitoring or retaining of communications or communication related information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Technology Law (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention provides an optimization method for instant large-scale network connection. The method is characterized in that a buffer pool is dynamically built for each newly generated thread and is recycled dynamically, so that each connection can be guaranteed to communicate normally when large-scale network connection appears instantly. A buffer zone can be cleared timely when the connection fails. The method is not limited to a Microsoft operation system, and can be used in the Unix, Linux and iPhone operation system.
Description
Technical field
The invention belongs to a prioritization scheme of areas of information technology network technology, propose a kind of to adopt the design of individual buffer pond, the network problem of the data perturbation that solution moment of high efficient and reliable causes when large scale network connects.
Background technology
At present, when setting up TCP network and connecting, if there is the same server of multiple client's side link, so this server must can distinguish these clients, adopts fork mechanism, and when there being new operation, just fork goes out a new execution thread, then continues monitoring.When there being the data cube computation of surge formula, a large amount of TCP will being made to connect and cannot set up or loss of data.Main cause has:
1, because operating system limits the linking number that a port processes simultaneously, when exceeding this restriction, TCP will be made to connect cannot be set up.
2, the new thread produced is responsible for the data reading client from Buffer Pool, and read after terminating, other threads continue operation.Because Buffer Pool reads the restriction of time, when there being a large amount of connection requests, and when sending data, Buffer Pool is difficult to meet the demands, and also can cause the loss of connection data simultaneously.
Current solution is:
Amendment CONFIG.SYS: the linking number that retouching operation system processes a port simultaneously, can solve the problem of linking number deficiency;
Adopt completing port: completing port model is complexity-kind of I/O model the most up to now.Completing port model needs we create a Win32 completing port object, by the thread of specified quantity, overlapping I/O request is managed.So that for the overlapping I/O request completed provides service.When-individual application program needs to manage numerous socket simultaneously, so adopt this model, often can reach best systematic function, Unfortunately, this model is only applicable to the operating system of Microsoft.
Summary of the invention
One object of the present invention is as each newly-generated thread dynamic creation Buffer Pool, and dynamically reclaims, thus ensures when occurring instantaneously connecting on a large scale, and each connection can the method for normal communication.Can clear up in time when Joint failure.This method is not limited to microsoft operation system, can use at Unix, Linux and Apple Macintosh operating system.
Described method comprises the steps:
1, the dynamic array of Buffer Pool is set up and initialization in service end;
2, server is monitored the port of specifying, and receives the connection request that client sends, and by three-way handshake, sets up TCP and connects;
3, for each TCP connects appointment Buffer Pool, and the corresponding relation of connect handle and Buffer Pool;
4, DTD, or after accidental interruption, according to the corresponding relation connecting handle and Buffer Pool, reclaim corresponding Buffer Pool and connect for other.
Accompanying drawing explanation
Fig. 1 is the initialization flowchart of server
Fig. 2 is Buffer Pool scheduling logic and recovery process figure in server communication process.
Embodiment
The processing method connected based on moment large scale network of the present invention is mainly used in needing to manage hundreds and thousands of sockets when certain application program simultaneously, and situation when can read data from it.Be specially adapted to the server application simultaneously processing multi-client, for stable, the response in time of server provide a kind of processing method efficiently.
In order to realize this network optimized approach, first need initialization to connect buffering area array, the size of initialization array sets an initial value according to service needed.When server sets up new connection, from array, the buffering area that idle can be found in order, record this freebuf and the corresponding relation being connected socket.Be so just each connection establishment one independently buffering area, ensure that buffer data transmits accurate and removed in time.Substantially increase the efficiency of transfer of data.When connecting overtime countless certificate or losing efficacy, system the automatic recovery buffering area, and remove the mapping table of socket and buffering area.
Idiographic flow is as follows:
1, in a step 101, server carries out initial work, the coding obtaining host address and port and transmit and receive data.
2, in a step 102, initialize session Hash table, for depositing the session content of later connection.
3, in step 103, initialization buffering area array and and socket mapping table.
4, at step 104, server bound host address and port.
5, in step 105, server starts listening port.
6, in step 201, server receives the connection request of a client and connects.
7, in step 202., server is preserved and is connected session in Hash table.
8, in step 203, the buffering area of whois lookup free time, if do not found, will expand a new buffering area, and set up the corresponding relation of buffering area and socket in the array of buffering area.
9, in step 204, the buffering area that server by utilizing obtains is newly-built connection store data.Buffering area due to each connection is independently, although there is a lot of thread to transmit data simultaneously, can walk abreast between these transmission channels efficient deal with data, need not wait for, the situation of error of transmission also can not occur.
10, in step 205, if after the DTD connected, new message is not received again within the time of specifying, server will disconnect, buffer release district also removes the corresponding relation of buffering area and socket, buffering area array just creating an idle buffering position, when there being new connection, this buffering area will be used.
Claims (4)
1. one kind solves the optimization method of moment large scale network method of attachment, the speciality of the method is: be the thread dynamic creation Buffer Pool that each is newly-generated, and dynamically reclaim, thus ensure when occurring instantaneously connecting on a large scale, each connection can the method for normal communication.
2. can clear up in time when Joint failure.
3. this method is not limited to microsoft operation system, can use at Unix, Linux and Apple Macintosh operating system.
4. described in, method comprises the steps:
1), the dynamic array of Buffer Pool is set up and initialization in service end;
2), server monitors the port of specifying, and receives the connection request that client sends, and by three-way handshake, sets up TCP and connects;
3), be that each TCP connects appointment Buffer Pool, and the corresponding relation of connect handle and Buffer Pool;
4), DTD, or after accidental interruption, according to the corresponding relation connecting handle and Buffer Pool, reclaim corresponding Buffer Pool for other connections.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410257163.8A CN104796395A (en) | 2014-06-11 | 2014-06-11 | Processing method for instant large-scale network connection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410257163.8A CN104796395A (en) | 2014-06-11 | 2014-06-11 | Processing method for instant large-scale network connection |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104796395A true CN104796395A (en) | 2015-07-22 |
Family
ID=53560908
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410257163.8A Pending CN104796395A (en) | 2014-06-11 | 2014-06-11 | Processing method for instant large-scale network connection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104796395A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101282300A (en) * | 2008-03-03 | 2008-10-08 | 北京航空航天大学 | Method for processing HTTP packet based on non-blockage mechanism |
CN101488960A (en) * | 2009-03-04 | 2009-07-22 | 哈尔滨工程大学 | Apparatus and method for TCP protocol and data recovery based on parallel processing |
US20110196961A1 (en) * | 2010-02-08 | 2011-08-11 | University Of Electronic Science And Technology Of China | Method for network anomaly detection in a network architecture based on locator/identifier split |
CN103441999A (en) * | 2013-08-21 | 2013-12-11 | 好耶网络科技(上海)有限公司 | Control method for socket connection pool |
-
2014
- 2014-06-11 CN CN201410257163.8A patent/CN104796395A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101282300A (en) * | 2008-03-03 | 2008-10-08 | 北京航空航天大学 | Method for processing HTTP packet based on non-blockage mechanism |
CN101488960A (en) * | 2009-03-04 | 2009-07-22 | 哈尔滨工程大学 | Apparatus and method for TCP protocol and data recovery based on parallel processing |
US20110196961A1 (en) * | 2010-02-08 | 2011-08-11 | University Of Electronic Science And Technology Of China | Method for network anomaly detection in a network architecture based on locator/identifier split |
CN103441999A (en) * | 2013-08-21 | 2013-12-11 | 好耶网络科技(上海)有限公司 | Control method for socket connection pool |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9176786B2 (en) | Dynamic and automatic colocation and combining of service providers and service clients in a grid of resources for performing a data backup function | |
CN109309631A (en) | A kind of method and device based on universal network file system write-in data | |
CN103488546A (en) | Backup and recovery method capable of supporting online concurrency of multi-level data and database | |
WO2017167100A1 (en) | Data migration method and device | |
CN103986786A (en) | Remote cloud desktop operation system | |
US10609125B2 (en) | Method and system for transmitting communication data | |
CN101753597B (en) | Keeping alive method between peer node and client under peer node-client architecture | |
CN103279386A (en) | Method for achieving high availability of computer operation scheduling system | |
CN103873505A (en) | Method, system and device for offline uploading to cloud storage server | |
CN105786592A (en) | Method and device for processing distributed transactions | |
CN105119926A (en) | Multichannel duplex communication method based on Socket connection | |
CN102523118A (en) | Redundancy control system consisting of multiple control computers in local area network and method for redundancy control system | |
CN107682460A (en) | A kind of distributed storage trunked data communication method and system | |
CN107995043A (en) | Application disaster recovery and backup systems and calamity based on mixing cloud platform are for collocation method | |
CN102833092A (en) | Method and system for managing cloud nodes and central server | |
CN107979640B (en) | Data transmission method and device | |
CN101986659B (en) | Real-time data transmission method and system | |
CN102708063B (en) | disk space management method and device | |
CN103152420B (en) | A kind of method avoiding single-point-of-failofe ofe Ovirt virtual management platform | |
CN104243606A (en) | C/S-mode DDS communication system and method | |
CN103929455A (en) | Asynchronous file transmission system and method comprising network storage equipment | |
CN103607421A (en) | Data interaction method and intelligent terminal | |
CN105553766A (en) | Monitoring method of abnormal node dynamic tracking cluster node state | |
CN103259845B (en) | Improving one's methods of the data backup task of interruption Network Based | |
CN103312586A (en) | instant communication |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20150722 |
|
RJ01 | Rejection of invention patent application after publication |