The content of the invention
In view of the above the shortcomings that prior art, it is an object of the invention to provide a kind of peace of long connection application access
Full management-control method and system, asking for substantial amounts of time and internal memory is taken for solving long connection application access management and control in the prior art
Topic.
In order to achieve the above objects and other related objects, the present invention provides a kind of bursting tube prosecutor of long connection application access
Method, applied to applications client and long connection server during long connecting communication is carried out based on Transmission Control Protocol, the length is even
Scoop out is included with the security control method of access:Applications client adds pre-defined answer in the TCP connection requests of initiation
Use ID;What the TCP protocol stack of long connection server extracted in the TCP connection requests described applies ID;The long Connection Service
Device judge it is described using ID whether in the relation table to be prestored in the long connection server, if so, then handling the TCP connections
Request, long connection is established with the applications client, if it is not, then refusing the TCP connection requests.
Alternatively, the applications client described applies ID in the Options fields addition of Transmission Control Protocol.
Alternatively, pre-define described using 64 unsigned int numbers that ID is 8 bytes.
Alternatively, the application ID carries out pre-defined and updating maintenance by long Connection Service side.
Alternatively, add pre-defined includes using ID detailed process:Applied described in the long Connection Service direction
Client is provided comprising application developmentpackage and the license passport using ID correspondingly applied;Described in the applications client use
During application developmentpackage, read automatically in the license passport using ID and be stored in the Options fields of Transmission Control Protocol.
To achieve the above object, the present invention also provide it is a kind of it is long connection application access security management and control system, applied to should
With client and long connection server during long connecting communication is carried out based on Transmission Control Protocol, the long connection application access
Security management and control system include:Using ID add modules, it is configured in the applications client, exists for the applications client
What addition was pre-defined in the TCP connection requests of initiation applies ID;Using ID extraction modules, the long connection server is configured at
Interior, what the TCP protocol stack for the long connection server extracted in the TCP connection requests described applies ID;Relation table is deposited
Module is stored up, is configured in the long connection server, the relation using ID and corresponding Apply Names is included for storing
Table;Judge module, it is configured in the long connection server and is connected with the relation table memory module, for judges described answer
With ID whether in the relation table to be prestored in the long connection server;Control module, it is configured in the long connection server
And be connected with the judge module, the TCP connection requests are handled during for the application ID in the relation table be present, with
The applications client establishes long connection, refuses the TCP connection requests when application ID being not present in the relation table.
Alternatively, it is described described to apply ID using Options field addition of the ID add modules in Transmission Control Protocol.
Alternatively, pre-define described using 64 unsigned int numbers that ID is 8 bytes.
Alternatively, in addition to it is configured at long place of Connection Service side and is connected with the application ID add modules, for institute
State and carry out pre-defined and updating maintenance definition maintenance module using ID.
Alternatively, the maintenance module that defines includes:To applications client offer comprising application developmentpackage and correspondingly
The license passport unit of the license passport using ID of application;When the applications client uses the application developmentpackage, institute
State using ID add modules read automatically in the license passport using ID and be stored in the Options fields of Transmission Control Protocol.
As described above, the security control method and system of a kind of long connection application access of the present invention, have beneficial below
Effect:
The present invention is detected by being added in Transmission Control Protocol aspect to the application side of request access, and it is established in connection
Before using access management and control, avoid and connection is first established used by prior art, then the method disconnected saves connection and built
Resource overhead that is vertical and disconnecting.It is of the invention simple efficient, there is stronger versatility and practicality.
Embodiment
Illustrate embodiments of the present invention below by way of specific instantiation, those skilled in the art can be by this specification
Disclosed content understands other advantages and effect of the present invention easily.The present invention can also pass through specific realities different in addition
The mode of applying is embodied or practiced, the various details in this specification can also be based on different viewpoints with application, without departing from
Various modifications or alterations are carried out under the spirit of the present invention.
It is existing for solving it is an object of the invention to provide a kind of security control method and system of long connection application access
There is the problem of long connection application access management and control takes substantial amounts of time and internal memory in technology.Described in detail below of the invention one
The security control method of the long connection application access of kind and the principle and embodiment of system, make those skilled in the art to create
The property made work is appreciated that the security control method and system of a kind of long connection application access of the present invention.
The present embodiment provides a kind of security control method of long connection application access, and what is solved is to be based on Transmission Control Protocol
The safety issue of the long Connection Service applications client access of (Transmission Control Protocol, TCP).
The present embodiment provides a kind of security control method of long connection application access, using in field as defined in Transmission Control Protocol
ID (App ID) is applied in middle addition, and this, by long Connection Service provider unified definition, is safeguarded and issued, for identifying it using ID
Each application side approved.Long connection server is when receiving the connection request of applications client initiation, the extraction of its TCP protocol stack
This is using ID and is checked whether as valid application, and such as not by checking, server will refuse the connection request.Meanwhile should
Regularly replaced and safeguarded by long Connection Service provider with ID, to strengthen the safety and reliability of the mechanism.
Specifically, as shown in figure 1, the present embodiment provides a kind of security control method of long connection application access, it is applied to
During long connecting communication is carried out based on Transmission Control Protocol, the long connection application connects for applications client and long connection server
The security control method entered comprises the following steps.
Step S11, applications client add pre-defined application ID in the TCP connection requests of initiation;Wherein, it is described
Pre-defined and updating maintenance is carried out by long Connection Service side using ID, to ensure its safety and reliability.It is that is, long
The various application definitions that Connection Service Fang Weiqi allows to access (or certification) apply ID (App ID) accordingly.
It is pre-defined described using 64 unsigned int numbers that ID is 8 bytes.
Specifically, in the present embodiment, the applications client adds the application in the Options fields of Transmission Control Protocol
ID.It is, apply ID using related using the Options fields storage of Transmission Control Protocol.
According to RFC 793, Transmission Control Protocol defines the Options fields in TCP Header, and the field, which is used to carry, to be aided in
Property information.The present invention is carried using the Options fields and applies id information.Options field definitions are as shown in table 1.
Table 1
Include as shown in Fig. 2 addition is pre-defined using ID detailed process:Should described in the long Connection Service direction
There is provided with client comprising application developmentpackage and the license passport using ID correspondingly applied;Institute is used in the applications client
When stating application developmentpackage, read automatically in the license passport using ID and be stored in the Options fields of Transmission Control Protocol.
Long Connection Service provider is responsible for regularly updating and maintenance application ID, to ensure its safety and reliability, definition
It is following using ID issue and update mode:
1) long Connection Service direction application side provides license passport, contains in the certificate and effectively applies ID.
2) long Connection Service side provides application developmentpackage (App SDK), automatic to read when applications client uses SDK
The Options fields applied ID, be stored in TCP connections in license passport.
3) long Connection Service side reaches purpose of the renewal using ID by regularly updating license passport.
Therefore a kind of security control method of long connection application access of the present embodiment offer uses and applies ID (App
ID) application is identified, the sign is issued and safeguarded by ad hoc fashion by long Connection Service provider unified definition.
Step S12, what the TCP protocol stack of long connection server extracted in the TCP connection requests described applies ID;Specifically
Ground, in the present embodiment, long connection server, which is checked in TCP connection Options fields, applies ID, to judge the legal of application
Property, and whether long Connection Service is provided.
Step S13, the long connection server judge described whether prestored in the long connection server using ID
In relation table, if so, then then step S14, if it is not, then then step S15.Wherein, definition and maintenance in long connection server
Using the related table between ID and application, as shown in table 2.
Table 2
Using ID |
Application name |
0x02FF |
Using 1 |
0x045A |
Using 2 |
0x03AC |
Using 3 |
… |
… |
Step S14, the TCP connection requests are handled, long connection is established with the applications client.
Step S15, refuse the TCP connection requests.
To make the long security control method for connecting application access it is further understood that in the present embodiment,
The implementation process of the security control method of long connection application access in the present embodiment described further below.
When applications client uses SDK, the automatic Options for applying ID, being stored in TCP connections read in license passport
Field, applications client define Options fields in the TCP connection requests of initiation by as above rule, long connection server
Options fields is using ID values using ID values, long connection server inspection extraction in TCP protocol stack extraction connection request
In the no related table in server, such as exist, then continue with connection request, until connection is established, be such as not present, then refuse
Exhausted connection request.Long Connection Service provider be responsible for regularly updating with maintenance application ID, to ensure its safety and reliability.This
The security control method of long connection application access in embodiment adds to enter the application side of request access in Transmission Control Protocol aspect
Row detection, carry out, using access management and control, first establishing connection used by avoiding prior art, then disconnect before connection establishment
Method, save connection establish and disconnect resource overhead.
To achieve the above object, the present embodiment provides a kind of security management and control system of long connection application access, to be solved
It is that the long Connection Service applications client based on Transmission Control Protocol (Transmission Control Protocol, TCP) accesses
Safety issue.The present embodiment provides a kind of security management and control system of long connection application access, applied to applications client and length
Connection server, should using being added in field as defined in Transmission Control Protocol during long connecting communication is carried out based on Transmission Control Protocol
With ID (App ID), this by long Connection Service provider unified definition, is safeguarded and issued using ID, is approved for identifying it
Each application side.When receiving the connection request of applications client initiation, its TCP protocol stack extracts this and applies ID long connection server
And checked whether as valid application, such as not by checking, server will refuse the connection request.Meanwhile using ID by growing
Connection Service provider regularly replaces and safeguarded, to strengthen the safety and reliability of the mechanism.
Specifically, in the present embodiment, as shown in figure 3, the security management and control system 1 of long connection application access includes:Using
ID add modules 11, relation table memory module 12, using ID extraction modules 13, judge module 14, control module 15 and definition
Maintenance module 16.
Be configured at using ID add modules 11 in the applications client, relation table memory module 12, using ID extract mould
Block 13, judge module 14, control module 15 are configured in the long connection server, are defined maintenance module 16 and are configured at long connection
At service side.
As shown in figure 4, it is shown as the connection signal between applications client, long connection server and long Connection Service side
Figure.Wherein long Connection Service direction applications client is issued to be opened comprising the certificate using ID, applications client using the application
When giving out a contract for a project, read automatically in the license passport and apply ID.Applications client is initiated to carry to long connection server applies ID
TCP connections, long connection server establishes long connecting communication by detection using ID and applications client.
Be configured at using ID add modules 11 in the applications client, for the applications client initiation TCP
What addition was pre-defined in connection request applies ID.Specifically, in the present embodiment, the application ID add modules 11 are in TCP
The Options fields addition of agreement is described to apply ID.
Wherein, the application ID carries out pre-defined and updating maintenance by long Connection Service side, with ensure its security and
Reliability.Define maintenance module 16 be configured at long place of Connection Service side and be connected with the application ID add modules 11, for pair
The application ID carries out pre-defined and updating maintenance.
Specifically, in the present embodiment, the maintenance module 16 that defines includes:There is provided to include to the applications client and answer
The license passport unit for the license passport using ID with kit and correspondingly applied;Described answer is used in the applications client
During with kit, it is described using ID add modules 11 read automatically in the license passport using ID and be stored in Transmission Control Protocol
Options fields.
That is, the various application definitions that long Connection Service Fang Weiqi allows to access (or certification) apply ID accordingly
(App ID)。
It is pre-defined described using 64 unsigned int numbers that ID is 8 bytes.
Specifically, in the present embodiment, the applications client adds the application in the Options fields of Transmission Control Protocol
ID.It is, apply ID using related using the Options fields storage of Transmission Control Protocol.
According to RFC 793, Transmission Control Protocol defines the Options fields in TCP Header, and the field, which is used to carry, to be aided in
Property information.The present invention is carried using the Options fields and applies id information.Options field definitions are as shown in Table 1 above.
Applications client offer described in the long Connection Service direction includes application developmentpackage and that correspondingly applies applies ID
License passport;When the applications client uses the application developmentpackage, the application in the license passport is read automatically
ID and the Options fields for being stored in Transmission Control Protocol.
It is configured at using ID extraction modules 13 in the long connection server, the TCP for the long connection server is assisted
What view stack extracted in the TCP connection requests described applies ID.
Long Connection Service provider is responsible for regularly updating and maintenance application ID, to ensure its safety and reliability, definition
It is following using ID issue and update mode:
1) long Connection Service direction application side provides license passport, contains in the certificate and effectively applies ID.
2) long Connection Service side provides application developmentpackage (App SDK), automatic to read when applications client uses SDK
The Options fields applied ID, be stored in TCP connections in license passport.
3) long Connection Service side reaches purpose of the renewal using ID by regularly updating license passport.
Therefore a kind of security management and control system 1 of long connection application access of the present embodiment offer uses and applies ID
(App ID) is identified to application, and the sign is issued and tieed up by ad hoc fashion by long Connection Service provider unified definition
Shield.
Relation table memory module 12 is configured in the long connection server, for storing comprising the application ID and correspondingly
Apply Names relation table.Wherein, the relation table in relation table memory module 12 between definition and maintenance application ID and application
Lattice, shown in table 2 as described above.
Judge module 14 is configured in the long connection server and is connected with the relation table memory module 12, for sentencing
It is disconnected described using ID whether in the relation table to be prestored in the long connection server, and will determine that result is sent to control module
In 15.
Control module 15 is configured in the long connection server and is connected with the judge module 14, in the pass
The TCP connection requests are handled when being and the application ID in table be present, long connection are established with the applications client, in the pass
Refuse the TCP connection requests when being and the application ID being not present in table.
To make it is further understood that the security management and control system of the long connection application access in the present embodiment
1, the course of work of the security management and control system 1 of long connection application access in the present embodiment described further below.
When applications client uses SDK, the ID that applies in license passport, deposit are read automatically using ID add modules 11
The Options fields of TCP connections, applications client define Options words in the TCP connection requests of initiation by as above rule
Section, the application for extracting Options fields in connection request by TCP protocol stack using ID extraction modules 13 of long connection server
ID values, long connection server by judge module 14 judge extraction using ID values whether the pass in relation table memory module 12
It is in table, such as exists, then the control of control module 15 continues with connection request, until connection is established, is such as not present, then controls mould
The control refusal connection request of block 15.Long Connection Service side by define maintenance module 16 regularly update with maintenance application ID, with protect
Demonstrate,prove its safety and reliability.
In summary, the present invention is detected by being added in Transmission Control Protocol aspect to the application side of request access, even
Carried out before connecing foundation using access management and control, connection, then the method disconnected are first established used by avoiding prior art, is saved
The resource overhead that connection is established and disconnected.It is of the invention simple efficient, there is stronger versatility and practicality.So this hair
It is bright effectively to overcome various shortcoming of the prior art and have high industrial utilization.
The above-described embodiments merely illustrate the principles and effects of the present invention, not for the limitation present invention.It is any ripe
Know the personage of this technology all can carry out modifications and changes under the spirit and scope without prejudice to the present invention to above-described embodiment.Cause
This, those of ordinary skill in the art is complete without departing from disclosed spirit and institute under technological thought such as
Into all equivalent modifications or change, should by the present invention claim be covered.