CN104836798B - A kind of method and device for safeguarding client link information - Google Patents
A kind of method and device for safeguarding client link information Download PDFInfo
- Publication number
- CN104836798B CN104836798B CN201510177729.0A CN201510177729A CN104836798B CN 104836798 B CN104836798 B CN 104836798B CN 201510177729 A CN201510177729 A CN 201510177729A CN 104836798 B CN104836798 B CN 104836798B
- Authority
- CN
- China
- Prior art keywords
- client
- position section
- management table
- connection management
- connection
- 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.)
- Expired - Fee Related
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a kind of method and devices for safeguarding client link information, including:Establish connection management table;After receiving the connection request that client is sent, it is the position section that client distribution is fixed in the connection management table, the identification information and active time information of the client is stored by the position section.The present invention is by establishing connection management table, and after receiving the connection request that client is sent, it is the position section of client distribution fixation in the connection management table, the identification information and active time information of the client are stored by the position section, the structure of remote control switch of the invention is simple, can effectively solve the problem that the problem of the link information confusion of client connection table in the prior art.
Description
Technical field
The present invention relates to field of communication technology more particularly to a kind of method and devices for safeguarding client link information.
Background technique
In network communication field, most of application software systems take client-side/server-side architecture, how to close in server-side
The link information for managing management client is always a problem, if saved to client link information unreasonable, it is likely that lead
Client-side information managerial confusion is caused, to influence the connection experience of client.
The method of current existing client link information management:When the end common customer connects server, client is sent
Verification information after server passes through client validation information, is stored in local connection table and records (array by authentication information
Or chained list) in.When client needs to inquire, some configuration informations usually are issued to server by client, server is to this
A little configuration informations are inquired, and query result is returned to client, but if a certain index in connection table uses for a long time
Afterwards, may front and back distribute to two even more than client.In this way, when may cause the customer end B certain information of inquiry, as a result
It is shown as the configuration result of customer end A.It causes confusion in this way, will result in link information.
Summary of the invention
In view of above-mentioned analysis, the present invention is intended to provide a kind of method and device for safeguarding client link information, to
Solve the problems, such as that the link information of client connection table in the prior art is chaotic.
To solve the above problems, the present invention is mainly achieved through the following technical solutions:
One aspect of the present invention provides a kind of method for safeguarding client link information, and this method includes:
Establish connection management table;
After receiving the connection request that client is sent, fixed in the connection management table for client distribution
Position section, the identification information and active time information of the client are stored by the position section.
Preferably, this method further includes:
The not active duration that the client is determined according to the active time, when the client it is not active when
After length is greater than preset superseded time threshold, the client is carried out in the connection management table superseded.
Preferably, this method further includes:The position section of predistribution is set in the connection management table;
It is described after receiving the connection request that client is sent, in the connection management table for the client distribute
Before the step of fixed position section, further include:
The client is stored in the position section of the predistribution.
Preferably, of the invention, it is described described after the client is stored in the position section of the predistribution
It is specifically included in connection management table for the step of client distribution fixed position section:
Judge in the connection management table whether available free position section, if so, distributing the sky for the client
Not busy position section, otherwise, the duration sequence according to client active time apart from current time are not used to maximum duration
Client carry out it is superseded, and will eliminate after position section respectively give issue connection request client.
Preferably, this method further includes:
According to application scenarios, the permitted maximum number of connections of client is set.
Further aspect of the present invention provides a kind of device for safeguarding client link information, which is characterized in that including:
Table unit is built, for establishing connection management table;
Allocation unit, for being somebody's turn to do in the connection management table after receiving the connection request that client is sent
The fixed position section of client distribution, stores the identification information of the client by the position section and active time is believed
Breath.
Preferably, which further includes:
Unit is eliminated, for determining the not active duration of the client according to the active time, as the client
After the not active duration at end is greater than preset superseded time threshold, the client is washed in a pan in the connection management table
It eliminates.
Preferably, the allocation unit is also used to, and the position section of predistribution is arranged in the connection management table, when connecing
After receiving the connection request that client is sent, the client is stored in the position section of the predistribution, is then existed
It is the position section of client distribution fixation in the connection management table.
Preferably, the allocation unit is specifically used for, and the position section of predistribution is arranged in the connection management table, when
After receiving the connection request that client is sent, the client is stored in the position section of the predistribution, is judged
In the connection management table whether available free position section, if so, distribute the position section of the free time for the client,
Otherwise, the duration sequence according to client active time apart from current time washes in a pan the not used client of maximum duration
It eliminates, and the position section after eliminating is distributed to the client for issuing connection request.
Preferably, which further includes:
Setting unit, for the permitted maximum number of connections of client to be arranged according to application scenarios.
The present invention has the beneficial effect that:
A kind of method and device for safeguarding client link information provided by the invention, by establishing connection management table, and
It is the position area of client distribution fixation in the connection management table after receiving the connection request that client is sent
Between, the identification information and active time information of the client are stored by the position section, it is existing so as to effectively solve
There is the problem of the link information confusion of client connection table in technology.
Other features and advantages of the present invention will illustrate in the following description, and partial become from specification
It is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can by written specification,
Specifically noted structure is achieved and obtained in claims and attached drawing.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of the method for maintenance client link information of the embodiment of the present invention;
Fig. 2 is the flow diagram of the method for another maintenance client link information of the embodiment of the present invention;
Fig. 3 is the relational graph of the space distribution of the client of the embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of the device of maintenance client link information of the embodiment of the present invention.
Specific embodiment
Specifically describing the preferred embodiment of the present invention with reference to the accompanying drawing, wherein attached drawing constitutes the application a part, and
Together with embodiments of the present invention for illustrating the principle of the present invention.For purpose of clarity and simplification, when it may make the present invention
Theme it is smudgy when, illustrating in detail for known function and structure in device described herein will be omitted.
Link information in order to solve the problems, such as prior art client connection table is chaotic, and the present invention provides a kind of maintenances
The method and device of client link information carries out the present invention further detailed below in conjunction with attached drawing and several embodiments
Explanation.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, the present invention is not limited.
Embodiment of the method
A kind of method for safeguarding client link information provided in an embodiment of the present invention, referring to Fig. 1, this method includes:
S101, connection management table is established;
S102, after receiving the connection request that client is sent, be the client point in the connection management table
With fixed position section, the identification information and active time information of the client are stored by the position section.
The present invention is stored by being the fixed position section of client distribution in connection management table by the position section
The identification information and active time information of the client be not in so as to guarantee the relatively stable of user information
The situation of user information confusion.
The embodiment of the present invention is not limited to connection management table, those skilled in the art can also by other forms come
Save the relevant information of client, such as array form.
In order to solve in the prior art connection management table by the way of not covering, caused by connection fuse tube reason table compared with
Greatly and the problem of space waste, method described in the embodiment of the present invention is by determining the client according to the active time
The not active duration at end, after the not active duration of the client is greater than preset superseded time threshold, in the company
The client is carried out in adapter tube reason table superseded.
That is, the present invention eliminates time threshold by being arranged, after the not active time of some client being more than the threshold value,
The information of the client is deleted from connection management table, to release the free space in connection management table.
Method described in the embodiment of the present invention further includes:The position section of predistribution is set in the connection management table,
And after receiving the connection request that client is sent, the client is stored in the position section of the predistribution,
It i.e. after receiving connection request, is first temporarily stored in the position section of predistribution, is then in the connection management table
The fixed position section of client distribution.
When it is implemented, the client is stored in predistribution after receiving the connection request that client is sent
Position section in, then judge in the connection management table whether available free position section, if so, being the client
The position section of the free time is distributed, otherwise, the duration sequence according to client active time apart from current time is to maximum duration
Not used client carry out it is superseded, and will eliminate after position section respectively give issue connection request client.
Method i.e. of the present invention can be according to the state of table and other custom parameters (such as eliminating time threshold)
Cleaning appropriate is carried out to connection management table, to improve the utilization rate of connection management table.
Method described in the embodiment of the present invention further includes:According to application scenarios, the permitted most Dalian of client is set
Connect number.
By the way that the permitted maximum number of connections of client is arranged according to application scenarios, connection management table can be both reduced
Scale, to facilitate management, and can guarantee that server-side, will not be because of the appearance largely connected to the service quality of client
Causing server to occur, response speed is slack-off or other failures.
Fig. 2 is the flow diagram of the method for another maintenance client link information of the embodiment of the present invention, is tied below
Fig. 2 is closed method of the present invention is described in detail:
S201, application connection management table space;
S202, the connection request for receiving client;
S203, the client pre-dispense position section is given;
S204, judge in connection management table whether available free position section, if it is, otherwise, entering into S205
S206;
The client is given in the position section of S205, the respectively free time;
S206, using life cycle algorithm, eliminate the old position section in connection management table, and it is given to the new client respectively
End.
That is, the present invention, when client initiates the connection server-side, server-side exists for the user identifier in link information
Alternative position section is pre-allocated in locality connection management table.Then, server-side is traversed in this fragment position section
Operation searches clear position (i.e. temporarily unassigned position) if there is the free time and then directly distributes the location index to this client
End connection traverses all positions that have been assigned, and if clear position is not present in the section of position according to customized
Life cycle algorithm eliminates a certain connection, and the location index of the connection is distributed to new client and is connected.The processing stream of this method
Journey is as shown in Figure 2.
A certain size memory headroom of first to file of the present invention is as connection management table;It wherein include that can be used in structural body
Distinguish the information such as identification information and its active time of user.Assuming that the number of users that may be connected is N, each user's distribution
M link information;For each user, all there can be unique subscriber ID to be identified, and ID for each user, structural body
There is fixed position section to distribute to the User ID in array, for example, the user for being i for User ID, in memory headroom
In the position section that occupies be [i*M+1, (i+1) * M].The space distribution of each client is as shown in Figure 3.
The method through the invention, even if after system long-play, being initiated using same subscriber identification information
Connection is always recorded in fixed position, and it is not in user identifier that the identification information of the user in record is comparatively fixed
The situation of information confusion.In addition, the most Dalian that the present invention each user can be arranged according to the needs of application scenarios while allowing
Number is connect, the scale that can not only reduce management table facilitates management, but also server-side can be guaranteed to the service quality of client, Bu Huiyin
Appearance largely to connect causes server to occur, and response speed is slack-off or other failures.
Installation practice
The embodiment of the invention provides a kind of devices for safeguarding client link information, and referring to fig. 4, which includes mutual
Table unit and allocation unit are built in connection;
Table unit is built, for establishing connection management table;
Allocation unit, for being somebody's turn to do in the connection management table after receiving the connection request that client is sent
The fixed position section of client distribution, stores the identification information of the client by the position section and active time is believed
Breath.
The present invention is stored by being the fixed position section of client distribution in connection management table by the position section
The identification information and active time information of the client be not in so as to guarantee the relatively stable of user information
The situation of user information confusion.
Device described in the embodiment of the present invention further includes:Eliminate unit;
Unit is eliminated, for determining the not active duration of the client according to the active time, as the client
After the not active duration at end is greater than preset superseded time threshold, the client is washed in a pan in the connection management table
It eliminates.
The present invention eliminates time threshold by being arranged, will after the not active time of some client being more than the threshold value
The information of the client is deleted from connection management table, to release the free space in connection management table.
Preferably, the allocation unit in the embodiment of the present invention is also used to, and pre- point is arranged in the connection management table
The client is stored in the predistribution after receiving the connection request that client is sent by the position section matched
It is then the position section of client distribution fixation in the connection management table in the section of position.
Specifically, the allocation unit in the embodiment of the present invention is specifically used for, it is arranged in the connection management table pre-
The client is stored in the predistribution after receiving the connection request that client is sent by the position section of distribution
Position section in, judge in the connection management table whether available free position section, if so, being distributed for the client
The position section of the free time, otherwise, the duration sequence according to client active time apart from current time do not make maximum duration
Client carry out it is superseded, and will eliminate after position section distribute to issue connection request client.
Method i.e. of the present invention can be according to the state of table and other custom parameters (such as eliminating time threshold)
Cleaning appropriate is carried out to connection management table, to improve the utilization rate of connection management table.
Preferably, device described in the embodiment of the present invention further includes:Setting unit;
Setting unit, for the permitted maximum number of connections of client to be arranged according to application scenarios.
The present invention can both reduce connection by the way that the permitted maximum number of connections of client is arranged according to application scenarios
The scale of table is managed, to facilitate management, and can guarantee that server-side, will not be because of a large amount of connections to the service quality of client
Appearance cause server to occur response speed is slack-off or other failures.
The related content that content in the device of the embodiment of the present invention can refer to method part is understood, no longer superfluous herein
It states.
A kind of method and device for safeguarding client link information provided by the invention can at least be brought following beneficial to effect
Fruit:
1, of the invention by establishing connection management table, and after receiving the connection request that client is sent, described
It is the position section that client distribution is fixed in connection management table, the mark of the client is stored by the position section
Information and active time information, link information so as to effectively solve client connection table in the prior art is chaotic to ask
Topic.
2, the present invention can be according to the state of table and other custom parameters (such as eliminating time threshold) to connection management
Table carries out cleaning appropriate, to improve the utilization rate of connection management table.
The foregoing is only a preferred embodiment of the present invention, but scope of protection of the present invention is not limited thereto,
In the technical scope disclosed by the present invention, any changes or substitutions that can be easily thought of by anyone skilled in the art,
It should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with the protection model of claims
Subject to enclosing.
Claims (6)
1. a kind of method for safeguarding client link information, which is characterized in that including:
Establish connection management table;
It is the position of client distribution fixation in the connection management table after receiving the connection request that client is sent
Section is set, the identification information and active time information of the client are stored by the position section;
It is described after receiving the connection request that client is sent, in the connection management table for the client distribution fix
Position section the step of before, further include:The position section of predistribution is set in the connection management table, when receiving visitor
After the connection request that family end is sent, the client is stored in the position section of the predistribution;When by the client
After end is stored in the position section of the predistribution, described is the position of client distribution fixation in the connection management table
The step of setting section specifically includes:Judge in the connection management table whether available free position section, if so, being the visitor
The position section of the free time is distributed at family end, and otherwise, the duration sequence according to client active time apart from current time is to longest
Time not used client carry out it is superseded, and will eliminate after position section respectively give issue connection request client.
2. the method according to claim 1, wherein further including:
The not active duration that the client is determined according to the active time, when the client it is not active when grow up
After preset superseded time threshold, the client is carried out in the connection management table superseded.
3. method according to claim 1 or 2, which is characterized in that further include:
According to application scenarios, the permitted maximum number of connections of client is set.
4. a kind of device for safeguarding client link information, which is characterized in that including:
Table unit is built, for establishing connection management table;
Allocation unit, for after receiving the connection request that client is sent, being the client in the connection management table
The fixed position section of end distribution, the identification information and active time information of the client are stored by the position section;
Wherein, the allocation unit is specifically used for, and the position section of predistribution is arranged in the connection management table, when receiving
After the connection request that client is sent, the client is stored in the position section of the predistribution, judges the company
In adapter tube reason table whether available free position section, if so, distribute the position section of the free time for the client, otherwise,
According to client active time apart from current time duration sequence the not used client of maximum duration is carried out it is superseded, and will
Distribute to the client for issuing connection request in position section after eliminating.
5. device according to claim 4, which is characterized in that further include:
Unit is eliminated, for determining the not active duration of the client according to the active time, when the client
After not active duration is greater than preset superseded time threshold, the client is carried out in the connection management table superseded.
6. device according to claim 4 or 5, which is characterized in that further include:
Setting unit, for the permitted maximum number of connections of client to be arranged according to application scenarios.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510177729.0A CN104836798B (en) | 2015-04-15 | 2015-04-15 | A kind of method and device for safeguarding client link information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510177729.0A CN104836798B (en) | 2015-04-15 | 2015-04-15 | A kind of method and device for safeguarding client link information |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104836798A CN104836798A (en) | 2015-08-12 |
CN104836798B true CN104836798B (en) | 2018-11-20 |
Family
ID=53814434
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510177729.0A Expired - Fee Related CN104836798B (en) | 2015-04-15 | 2015-04-15 | A kind of method and device for safeguarding client link information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104836798B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101826055A (en) * | 2010-04-06 | 2010-09-08 | 山东高效能服务器和存储研究院 | Management method for data cache distribution in Linux system |
CN102572799A (en) * | 2011-12-29 | 2012-07-11 | 华为终端有限公司 | Method for acquiring network connection information of client terminal accessing Wi-Fi spot and terminal |
CN102902709A (en) * | 2012-08-02 | 2013-01-30 | 何建亿 | Space allocation fixing file memory system and implementation method |
CN103365929A (en) * | 2012-04-10 | 2013-10-23 | 阿里巴巴集团控股有限公司 | Management method and management system of database connection |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8694613B2 (en) * | 2010-11-22 | 2014-04-08 | Sony Corporation | Client device, information processing method, and information processing system |
CN103888492A (en) * | 2012-12-20 | 2014-06-25 | 鸿富锦精密工业(深圳)有限公司 | Memory management system and method |
CN103970807B (en) * | 2013-02-06 | 2017-04-19 | 阿里巴巴集团控股有限公司 | Method and system for managing database connection |
-
2015
- 2015-04-15 CN CN201510177729.0A patent/CN104836798B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101826055A (en) * | 2010-04-06 | 2010-09-08 | 山东高效能服务器和存储研究院 | Management method for data cache distribution in Linux system |
CN102572799A (en) * | 2011-12-29 | 2012-07-11 | 华为终端有限公司 | Method for acquiring network connection information of client terminal accessing Wi-Fi spot and terminal |
CN103365929A (en) * | 2012-04-10 | 2013-10-23 | 阿里巴巴集团控股有限公司 | Management method and management system of database connection |
CN102902709A (en) * | 2012-08-02 | 2013-01-30 | 何建亿 | Space allocation fixing file memory system and implementation method |
Also Published As
Publication number | Publication date |
---|---|
CN104836798A (en) | 2015-08-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106375404B (en) | Data storage control method, date storage method, data capture method and device | |
CN105282047A (en) | Access request processing method and device | |
CN103581279B (en) | Access system, method and device for third-party developer | |
US9582387B2 (en) | Server, backup system and backup method | |
CN104394366B (en) | The method and system of distributed video streaming media transcoding access control | |
CN102640455B (en) | Permit again distribution method, demodulator and admission control system thereof | |
CN109032837A (en) | The method and apparatus of data backup | |
CN107818013A (en) | A kind of application scheduling method thereof and device | |
CN106021370A (en) | Memory database instance management method and device | |
CN112016030B (en) | Message pushing method, device, server and computer storage medium | |
CN104980494B (en) | A kind of cloud storage download shared platform and method with local cache | |
CN105991692A (en) | Information pushing method, information display method, and related apparatus and system | |
CN104518981A (en) | Flow control method and device | |
CN102868770A (en) | Method, equipment and system for distributing interface | |
CN107430582A (en) | Thin client system, connection management device, virtual machine operations device, method and storage medium | |
CN106815342A (en) | A kind of distributed file system user quota system and method | |
EP1909433A4 (en) | A method and system for realizing the access management of the network devices | |
CN105224541B (en) | Uniqueness control method, information storage means and the device of data | |
CN103248631B (en) | Method, system and the browser of browser-cross identifying user identity | |
CN104836798B (en) | A kind of method and device for safeguarding client link information | |
CN109034963A (en) | A kind of shared bicycle monitoring and managing method based on big data | |
CN110750289B (en) | Gray switching state maintaining method for distributed system | |
CN107995062A (en) | Traffic control comprehensive platform cross regional business real-time processing method and system based on RPC | |
CN104869531B (en) | Group member updating method and device | |
CN106878990A (en) | A kind of information-pushing method and device |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20181120 |
|
CF01 | Termination of patent right due to non-payment of annual fee |