Summary of the invention
In view of this, the application provides a kind of method and device for handling message, deposited simultaneously on a computer with realizing
In the operation of multiple system users, the function that same network interface card corresponds to different system users still may be implemented, to not homologous ray
Generated message is handled when user operates;And this method has preferable applicability and stability.
Specifically, the application is achieved by the following technical solution:
According to the embodiment of the present application in a first aspect, providing a kind of method for handling message, which comprises
It is identified according to object message to be processed, obtains the identification parameters of the object message;
According to the identification parameters, the corresponding system user of the object message is determined;
The object message is handled by the corresponding network interface card control strategy of the system user.
Optionally, described to be identified according to object message to be processed, obtain the identification parameters of the object message;Root
According to the identification parameters, the corresponding system user of the object message is determined, comprising:
It is identified according to object message to be processed, obtains application process belonging to the object message;
According to the application process, the corresponding system user of the object message is determined.
Optionally, after the corresponding system user of the determination object message, further includes:
Record the message characteristic of the object message and the corresponding relationship of the system user;
The method also includes:
When determining object message to be processed includes the message characteristic, according to the message characteristic and the corresponding pass
System, determines the corresponding system user of the object message.
Optionally, the message characteristic includes:
Source port number, destination slogan, purpose IP address and transport layer protocol.
According to the second aspect of the embodiment of the present application, a kind of device for handling message is provided, which is characterized in that described device
Include:
Get parms unit, for being identified according to object message to be processed, obtains the identity of the object message
Parameter;
Subscriber unit is determined, for determining the corresponding system user of the object message according to the identification parameters;
Processing unit, for handling the object message by the corresponding network interface card control strategy of the system user.
Optionally, the unit that gets parms, is specifically used for: being identified according to object message to be processed, obtains institute
State application process belonging to object message;
The determining subscriber unit is specifically used for determining the corresponding system of the object message according to the application process
User.
Optionally, described device further include:
Recording unit, for recording the object message after determining the corresponding system user of the object message
The corresponding relationship of message characteristic and the system user;
The determining subscriber unit, is also used to: when determining object message to be processed includes the message characteristic, according to
The message characteristic and the corresponding relationship, determine the corresponding system user of the object message.
Optionally, the message characteristic includes:
Source port number, destination slogan, purpose IP address and transport layer protocol.
As seen from the above-described embodiment, by identifying to object message to be processed, the identity of the object message is obtained
Parameter, according to accessed identification parameters can determine the object message corresponding to system user, with realize be by this
Network interface card control strategy corresponding to system user handles the object message.It is achieved thereby that more when being logged in simultaneously on a computer
When a system user, while realizing the network interface card function of corresponding to different system users;Also, since this method is not necessarily to monitoring system
The switching of user, so that this method has preferable applicability and stability.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with the application.On the contrary, they be only with it is such as appended
The example of the consistent device and method of some aspects be described in detail in claims, the application.
It is only to be not intended to be limiting the application merely for for the purpose of describing particular embodiments in term used in this application.
It is also intended in the application and the "an" of singular used in the attached claims, " described " and "the" including majority
Form, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein refers to and wraps
It may be combined containing one or more associated any or all of project listed.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the application
A little information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not departing from
In the case where the application range, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as
One information.Depending on context, word as used in this " if " can be construed to " ... when " or " when ...
When " or " in response to determination ".
The connection of computer and extraneous local area network can be by being inserted into one piece of network interface in the mainframe box of computer
Plate is realized.Network interface board is usually said " network interface card ".Network interface card is that computer and transmission medium are connected in local area network
Interface, the physical connection and electric signal being not only able to achieve between computer and local network transport medium match, and further relates to frame
Send and receive, the encapsulation of frame and opening, medium access control, the coding of data and the function of decoding and data buffer storage
Deng.
In the prior art, can be set it is same throw the net to be stuck in different network interface card function may be implemented under different system users
Can, for example, letting pass or blocking the function such as message, ARP (Address Resolution Protocol, address resolution protocol) protection
Energy.Following Figure 1A, for an application schematic diagram for realizing network interface card function in the prior art.It may include: computer in Figure 1A
11, it may include UI interface module 111, service module 112, network driver block 113, network interface card 114 on the computer 11.Its
In, user can obtain the information and network interface card information of system user by UI interface module 111, and network interface card is arranged and corresponds to
The network interface card control strategy of each system user;The information of above-mentioned setting can also be issued to network drive by UI interface module 111
Dynamic model block 113.Service module 112 can be used for the switching of monitoring system user, after listening to system user switching, service mould
The identity information of the system user currently logged in, such as user name can be issued to network driver block 113 by block 112.Network
Drive module 113 then can be according to the identity information of the system user currently logged in and the corresponding network interface card control of the system user
System strategy, control network interface card 114 realize the corresponding network interface card function of the system user.
Seen from the above description, in the prior art, when there is the login of multiple system users on a computer simultaneously, then
It is unable to control network interface card 114 while realizing that it corresponds to the network interface card function of different system users;Also, in the foregoing description, if thinking
It realizes that network interface card 114 corresponds to the network interface card function of system user, needs the switching of the monitoring system user in real time of service module 112,
If service module 112 fails, will be unable to accurately realize that network interface card 114 corresponds to the network interface card function of different system users, thus, it is existing
There is technology that there is limitation and unstability.
In order to be effectively prevented from the above problem, this application provides the method and devices of processing message, to realize when one
When computer logs in multiple system users simultaneously, the network interface card function that network interface card corresponds to different system users can be realized simultaneously, and
And method provided herein has preferably applicability and stability.It as follows will be to processing message provided herein
Method and device elaborates.
In order to enable those skilled in the art can be more clearly understood that method provided herein, it first will be to application
The computer of this method makes introduction.Following Figure 1B is the application schematic diagram that network interface card function is realized in the application.
It may include: computer 12 in Figure 1B, may include UI interface module 121 on the computer 12, obtain message body
Part information module 122, network driver block 123, network interface card 124.Wherein, the function of UI interface module 121 can be with above-mentioned Figure 1A
Shown in UI interface module 111 function it is identical.In an exemplary application, obtaining message identity information module 122 can
It to be matched with network driver block 123, to execute method provided herein, can specifically include: obtaining message identity
Information module 122 is determined for system user belonging to the message that computer 12 is uploaded or issued, for convenience, this
In application, the message that computer 12 is uploaded or issued is known as to object message to be processed, it can also be by identified target report
The information of system user corresponding to text is issued to network driver block 123.Network driver block 123 receive it is to be processed
After object message, then it can determine that system corresponding to the object message is used according to the information of the system user received
Family then controls network interface card 124 according to the corresponding network interface card control strategy of the system user and handles the object message.
It can be seen that computer 12 may be implemented to work as on computer 12 simultaneously by executing method provided herein
When logging in multiple system users, network interface card 124 can be realized simultaneously the network interface card function corresponding to multiple system users, and this method
With preferable applicability and stability.
It is understood that above-mentioned described exemplary application is as just citing, it is intended to illustrate computer 12 be as
What executes method provided herein.In practical applications, there can also be the cooperation of other modules, the application does not make this
Limitation.
Following Fig. 2, illustrates one embodiment flow chart that the application handles the method for message, and this method can be applied
On the computer 12 shown in above-mentioned Figure 1B, it may comprise steps of:
Step S201: being identified according to object message to be processed, obtains the identification parameters of the object message.
In the application, computer 12 shown in Figure 1B can be identified object message to be processed, for example, calling
In Windows API (Application Programming Interface, the application programming interfaces) function write in advance
GetCurrentProcessId function and other correlation functions, obtain the identification parameters of object message, for example, object message
The process ID of affiliated application process, the source IP address of object message, source port number, purpose IP address, destination slogan, transport layer
Agreement, etc..
In an exemplary application, which can be executed as the acquisition message identity information module 122 shown in Figure 1B
Rapid S201.
Step S202: according to the identification parameters, the corresponding system user of the object message is determined.
In an optional implementation, when executing the step S201, the identification parameters of object message are got, and should
When including the process ID of the affiliated application process of object message in identification parameters, computer 12 can call Windows api function,
For example, OpenProcess, OpenProcessToken, GetTokenInformation, LookupAccountSid, etc.,
The system user for calling application process corresponding to the process ID is got, that is, gets the use of system corresponding to the object message
Family.
It, in some cases, can also be according to source accessed in step S201 in another optional implementation
IP address, source port number, purpose IP address, destination slogan, transport layer protocol determine the corresponding system user of object message,
Specifically how to determine, may refer to the related introduction in following embodiments, is not described further first herein.
In an exemplary application, which can be executed as the acquisition message identity information module 122 shown in Figure 1B
Rapid S201.
Step S203: the object message is handled by the corresponding network interface card control strategy of the system user.
In an exemplary application, by executing step S201 and step S202, obtaining message identity information module 122 can
To get the corresponding system user of object message.It is subsequent, message identity information module 122 is obtained, it can also be by object message
Identity information, for example, corresponding system user, is issued to network driver block 123.Network driver block 123 is receiving
When object message, then it can determine that the corresponding system of object message is used according to the identity information of the object message received
Family, thus, network interface card 124, which is controlled, by network interface card control strategy corresponding to the system user handles the object message.
As seen from the above-described embodiment, by identifying to object message to be processed, the identity of the object message is obtained
Parameter, according to accessed identification parameters can determine the object message corresponding to system user, with realize be by this
Network interface card control strategy corresponding to system user handles the object message.It is achieved thereby that more when being logged in simultaneously on a computer
When a system user, while realizing the network interface card function of corresponding to different system users;Also, since this method is not necessarily to monitoring system
The switching of user, so that this method has preferable applicability and stability.
Following Fig. 3 illustrates another embodiment flow chart that the application handles the method for message, this is shown in Fig. 3
On the basis of process process shown in above-mentioned Fig. 2, still for being applied on computer 12 shown in above-mentioned Figure 1B, may include
Following steps:
Step S301: according to the message characteristic of object message to be processed, it is corresponding with system user to search message characteristic
Relationship thens follow the steps S302 if finding the message characteristic;If not finding the message characteristic, then follow the steps
S303。
It is a kind of example of the corresponding relationship of the message characteristic and system user such as the following table 1:
Table 1
|
Purpose IP address |
Destination slogan |
Source port number |
Transport layer protocol |
System user 1 |
10.121.23.10 |
9020 |
9021 |
TCP |
System user 2 |
10.121.23.20 |
5284 |
5283 |
TCP |
… |
… |
… |
… |
… |
System user n |
… |
… |
… |
… |
Message characteristic exemplified by above-mentioned table 1 may include: purpose IP address, destination slogan, source port number, transport layer
Agreement.Since in this application, object message to be processed is the message that computer 12 is uploaded or issued, then the source of object message
IP address is the IP address of computer 12 itself, to can not include source IP address in message characteristic exemplified by table 1.
" corresponding relationship " exemplified by above-mentioned table 1 can refer to: in the object message corresponding to same system user, including phase
Same message characteristic, so as to determine system user corresponding to object message by message characteristic.So, in this step
In, then it can be according to the message characteristic look-up table 1 of object message to be processed, when finding the message characteristic in table 1, then
Step S302 can be executed;When not finding the message characteristic in table 1, then step S303 can be executed.
In an exemplary application, obtains on message identity information module 122, can preserve exemplified by above-mentioned table 1
" corresponding relationship ", also, obtaining message identity information module 122 can also be according to the recognition result to object message, and foundation is simultaneously
It safeguards exemplified by above-mentioned table 1 " corresponding relationship ".Specifically how to establish and safeguard, may refer to detailed in following step
Description is not described further first herein.
Step S302: it determines the corresponding system user of the object message, continues to execute step S306.
Step S303: being identified according to object message to be processed, obtains application process belonging to the object message.
Step S304: according to the application process, the corresponding system user of the object message is determined.
Step S303 may refer to that above-mentioned steps S201 is related in step S202 to be retouched to the detailed description of step S304
It states, does not remake be described in detail herein.
Step S305: the message characteristic of the object message and the corresponding relationship of the system user are recorded.
In this step, after determining the corresponding system user of object message to be processed, it can recorde the target report
Corresponding relationship between the message characteristic system user corresponding with the object message of text, which can be for above-mentioned table
Shown in 1.
In an exemplary application, obtaining message identity information module 122 can recorde message characteristic and system user
The corresponding relationship of record can also be issued to network driver block 123 by corresponding relationship, to realize to network driver block
123 issue the identity information of object message.Network driver block 123 can then save the corresponding relationship, the corresponding pass saved
System can also be as shown in Table 1 above.
Step S306: the object message is handled according to the corresponding network interface card control strategy of the system user.
In an exemplary application, network driver block 123, then can basis after receiving object message to be processed
The message characteristic of the object message searches the corresponding relationship of saved message characteristic and system user, when finding the target report
When the message characteristic of text, then system user corresponding to the available object message, then controls network interface card 124 according to the system
The corresponding network interface card control strategy of user handles the object message.
Further, it is to be appreciated that step S305 and step S306 may be performed simultaneously, in the application to step S305 and
The execution sequence of step S306 is with no restriction.
As seen from the above-described embodiment, by the message characteristic according to object message to be processed, the message for searching preservation is special
Sign and the corresponding relationship of system user can be directly obtained corresponding to the object message when finding the message characteristic
System user;When not finding the message characteristic, it can be identified, be determined corresponding to the object message according to the message
System user, and the message characteristic of the object message and the corresponding relationship of system user are recorded, pass through the system user to realize
Corresponding network interface card control strategy handles the object message.It is achieved thereby that when multiple systems are logged on a computer simultaneously
When user, the network interface card function corresponding to different system users can be realized simultaneously;Also, due to not needing to each target report
Text all carries out the identification of identity information, in some cases, can determine that the corresponding system of object message is used by searching for operating
Family, to improve the efficiency of processing message;Also, since this method is not necessarily to the switching of monitoring system user, thus this method
With preferable applicability and stability.
Corresponding with the embodiment of the method for aforementioned processing message, present invention also provides the implementations of the device of processing message
Example.
The embodiment that the application handles the device of message can be applied on the network equipment, such as computer.Device is implemented
Example can also be realized by software realization by way of hardware or software and hardware combining.Taking software implementation as an example, as
Device on one logical meaning is by the processor of the network equipment where it by calculating corresponding in nonvolatile memory
Machine program instruction is read into memory what operation was formed.For hardware view, as shown in figure 4, handling message for the application
A kind of hardware structure diagram of the network equipment where device, in addition to processor 41 shown in Fig. 4, memory 42, network interface 43 and
Except nonvolatile memory 44, the network equipment in embodiment where device generally according to the network equipment actual functional capability,
It can also include other hardware, this is repeated no more.
Referring to FIG. 5, one embodiment block diagram that the application handles the device of message is illustrated, the apparatus may include:
Get parms unit 51, determine subscriber unit 52, processing unit 53.
Wherein, get parms unit 51, can be used for being identified according to object message to be processed, obtains the target
The identification parameters of message;
It determines subscriber unit 52, can be used for determining that the corresponding system of the object message is used according to the identification parameters
Family;
Processing unit 53 can be used for handling the target report by the corresponding network interface card control strategy of the system user
Text.
In one embodiment, the unit 51 that gets parms, specifically can be used for: be carried out according to object message to be processed
Identification, obtains application process belonging to the object message;
The determining subscriber unit 52 specifically can be used for determining that the object message is corresponding according to the application process
System user.
Referring to FIG. 6, another embodiment block diagram that the application handles the device of message is illustrated, Fig. 6 shown device
It can also include: recording unit 54 on the basis of above-mentioned Fig. 5 shown device.
The recording unit 54 can be used for after determining the corresponding system user of the object message, record the mesh
Mark the message characteristic of message and the corresponding relationship of the system user;
In one embodiment, the determining subscriber unit 52, can be also used for: when determining that object message to be processed includes
When the message characteristic, according to the message characteristic and the corresponding relationship, the corresponding system user of the object message is determined.
In another embodiment, the message characteristic may include: source port number, destination slogan, purpose IP address, with
And transport layer protocol.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus
Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with
It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual
The purpose for needing to select some or all of the modules therein to realize application scheme.Those of ordinary skill in the art are not paying
Out in the case where creative work, it can understand and implement.
The foregoing is merely the preferred embodiments of the application, not to limit the application, all essences in the application
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the application protection.