Summary of the invention
The present invention is for solving above-mentioned the deficiencies in the prior art part, and a kind of alert notice method showing foremost under windows platform free position is provided, and the alert notice method that this shows foremost has versatility.
To achieve these goals, the technical solution used in the present invention is as follows:
The alert notice method showing foremost under windows platform free position of the present invention, comprises the following steps:
Step 1, service processes monitor Session list change:
Session list is made up of several Session, by Session0, and Session1 ... SessionN composition;
Described Session comprises Session state and Session identifier;
Described Session state comprises activation, locking, release, disconnection;
Described Session identifier is Session identifier 0, Session identifier 1 ... Session identifier N;
Service processes utilizes the api interface that Windows operating system provides to monitor Session list change: if receive Session list Notification of Changes, and execution step two; If do not receive Session list Notification of Changes, execution step one;
Step 2, service processes are analyzed Session list Notification of Changes:
The api interface that service processes utilizes Windows operating system to provide obtains Session list;
Service processes checks the each Session in Session list, and choosing Session state is the Session activating, and the Session identifier that is the Session of activation by Session state is kept in service processes internal memory;
Step 3, service processes are that each Session state is that the Session activating starts respectively new consumer process:
Service processes uses the Session identifier being kept in service processes internal memory as parameter, and for this Session identifier, corresponding Session starts new consumer process;
Service processes is deleted all Session identifiers that are kept in service processes internal memory;
Step 4, the only corresponding consumer process of Session of setting:
Consumer process is kept at the Session identifier of its corresponding Session in consumer process internal memory, in consumer process internal memory, search and whether have the Session identifier identical with this Session identifier, if existed, consumer process is deposited in the Session identifier of its corresponding Session in consumer process internal memory and is deleted from internal memory, finish this consumer process, execution step one; If there is no, execution step five;
Step 5, newly-built and its Session state are consumer process that the Session that activates is corresponding in this Session display alarm notice foremost:
Newly-built and its Session state is that consumer process corresponding to Session activating reads alert notice from service processes;
This consumer process is demonstration foremost by the stacked setup of attribute of alert notice place window;
This consumer process makes alert notice more obvious by the attribute that changes alert notice place window;
The attribute of described window is word brightness, acquiescence text color and the acquiescence character size of window;
Step 6, current Session state are the Session Status Change that the consumer process corresponding to Session of activation monitors its corresponding Session:
The api interface that current Session state utilizes Windows operating system to provide for consumer process corresponding to Session activating monitors the Session Status Change of its corresponding Session: if receive Session Status Change notice, this Session state is after changing kept in consumer process internal memory to execution step seven; If do not receive Session Status Change notice, execution step six;
Consumer process corresponding to Session that step 7, Session state occur to change analyzed paid-in Session Status Change notice:
Consumer process corresponding to Session that Session state occurs to change judge whether this Session state being after changing kept in consumer process internal memory is locking: lock if, use Session identifier 0 for parameter, notification service process, execution step six;
Service processes receives after the Session identifier 0 of this consumer process transmission, and service processes is kept at Session identifier 0 in service processes internal memory, execution step three;
If consumer process corresponding to Session that Session state occurs to change judge that this Session state being after changing kept in consumer process internal memory is for locking, judge whether this Session state is after changing release, release if, whether the Session state that judges Session0 is activation, activates if execution step six, if not for activating, use Session identifier 0 as parameter, notification service process, execution step six;
Service processes receives after the Session identifier 0 of consumer process transmission, and service processes finishes the consumer process of Session identifier 0 correspondence, execution step one;
If this Session state is after changing not release, judge whether this Session state is after changing disconnection, disconnect if, finish active user's process, execution step one, if not for disconnecting, execution step six.
The invention has the beneficial effects as follows: compared with prior art, monitor that by service processes Session Status Change, consumer process that Session list change, consumer process monitor its corresponding Session are in the current Session mode of display alarm notice foremost, solved the problem that the alert notice window that causes cannot show in the time that mode of operation changes.Alert notice method of the present invention, can under the modes of operation such as login, locking, cancellation, realize the notice of display alarm foremost, what solved that traditional alert Notification Method exists cannot display alarm notice under particular state or the alert notice window problem of being blocked by other forms, make user can understand in time alert notice information, prevent important information loss, thereby avoided because important information is lost the heavy losses that cause.
Embodiment
Below in conjunction with drawings and Examples, the alert notice method showing foremost under windows platform free position of the present invention is described in further detail.
The switching of mode of operation in Windows operating system, by having been switched by different Session, when logining, lock, when the change of the mode of operation such as cancellation, corresponding Session state also changes thereupon.
Operating system shows before a window, need to first create a Session, to determine corresponding viewing area; And then create the consumer process that this Session is corresponding.The corresponding multiple consumer process of next Session of normal conditions, a consumer process can be opened multiple windows simultaneously.In Windows operating system, system only shows that Session state is the window of consumer process corresponding to Session that activate.
Session identifier is conventionally by 0,1, and 2 numerals such as grade form;
Alert notice method of the present invention, sets the only corresponding consumer process of a Session, and a consumer process only shows an alert notice window, has solved the Uniqueness of alert notice window foremost; And monitor that by service processes Session list change, consumer process monitor the Session Status Change of its corresponding Session, consumer process is the mode showing foremost by the stacked setup of attribute of alert notice place window, has realized under free position the notice of display alarm foremost;
The Conceptions of alert notice method of the present invention is described as follows:
Session: the viewing area mutually isolating in system, an only corresponding consumer process of Session;
Service processes: the process that the backstage just starting after system starts monitors;
Consumer process: the Session Status Change of its corresponding Session of charge of overseeing, consumer process comprises an alert notice window.
Embodiment
For example, alert notice method applied environment of the present invention is common LAN (Local Area Network), when the terminal computer in network is during by poisoning intrusion, the alert notice method showing foremost of the present invention can be presented at Windows operating system foremost poisoning intrusion alert notice window on server.
The alert notice method showing foremost under windows platform free position of the present invention, alert notice system comprises server, display, keyboard, mouse, operating system is Windows operating system.
The current existence of the present embodiment three Session:Session0, Session1, Session2, the state of three Session and Session identifier are as follows:
Session0(activates, Session identifier 0), respective user process 0;
Session1(disconnects, Session identifier 1), Session state, for disconnecting, does not have corresponding consumer process;
Session2(disconnects, Session identifier 2), Session state, for disconnecting, does not have corresponding consumer process;
As shown in Figure 1, the alert notice method showing foremost under windows platform free position of the present invention, specific works step is as follows:
Step 101 service processes monitors Session list change:
Session list is made up of three Session, i.e. Session0, Session1 and Session2;
Described Session comprises Session state and Session identifier;
Described Session state comprises activation, locking, release, disconnection;
Service processes utilizes api interface that Windows operating system provides to monitor that Session list changes, and the present embodiment Session list is changed, newly-built Session3, and service processes can be received Session list Notification of Changes, performs step 102; If (do not receive Session list Notification of Changes, execution step 101, service processes continues to monitor Session list change; )
Step 102 service processes is analyzed Session list Notification of Changes:
The api interface that service processes utilizes Windows operating system to provide obtains Session list, and now, described Session list is made up of four Session, i.e. Session0, Session1, Session2 and Session3;
Now, the Session state of four Session and Session identifier are as follows:
Session0(activates, Session identifier 0), respective user process 0;
Session1(disconnects, Session identifier 1), Session1 state, for disconnecting, does not have corresponding consumer process;
Session2(disconnects, Session identifier 2), Session2 state, for disconnecting, does not have corresponding consumer process;
Session3(activates, Session identifier 3), respective user process 3;
Service processes checks the each Session in Session list, and choosing Session state is Session0 and the Session3 activating, and Session identifier 0 corresponding Session0 is kept in service processes internal memory; Session identifier 3 corresponding Session3 is kept in service processes internal memory;
Step 103 service processes is that each Session state is that the Session activating starts respectively new consumer process:
Now the Session state of Session3 and Session0 is activation, and therefore service processes starts new consumer process 3 and consumer process 4;
Service processes uses the Session identifier 3 being kept in service processes internal memory as parameter, starts new consumer process 3;
Service processes uses the Session identifier 0 being kept in service processes internal memory as parameter, starts new consumer process 4;
Service processes is deleted all Session identifiers that are kept in service processes internal memory, delete Session identifier 0 in service processes internal memory, Session identifier 3(because the Session state of Session1 and Session2 is disconnection, therefore before Session identifier 1 and Session identifier 2, be not stored in service processes internal memory);
Step 104 is set the only corresponding consumer process of a Session:
Each Session is in the time creating, its Session state is all from state of activation, therefore each Session can be in the time that its session state be activation for the first time, start new consumer process through step 103 by service processes, then be that the Session activating sets an only corresponding consumer process through step 104 to this Session state, in the present embodiment, Session0 and Session3 Session state is now activation, therefore only Session0 and Session3 is set to the only operation of a consumer process of correspondence of a Session;
Consumer process 3 and consumer process 4 proceed as follows respectively:
Consumer process 3 operations are as follows:
Consumer process 3 is kept at the Session identifier 3 of its corresponding Session3 in consumer process internal memory, in consumer process internal memory, search and whether have the Session identifier identical with this Session identifier 3, the present embodiment does not exist, be the consumer process that service processes did not start these Session identifier 3 correspondences before, execution step 105;
Consumer process 4 operations are as follows:
Consumer process 4 is kept at the Session identifier 0 of its corresponding Session0 in consumer process internal memory, in consumer process internal memory, search and whether have the Session identifier identical with this Session identifier 0, the present embodiment exists, it is the consumer process 0 that service processes had started this Session identifier 0 correspondence before, the Session identifier 0 that consumer process 4 is deposited in consumer process internal memory is deleted from consumer process internal memory, end user process 4, execution step 101;
Newly-built and its Session state of step 105 is that consumer process corresponding to Session activating shows poisoning intrusion alert notice foremost at this Session:
Consumer process 3 reads poisoning intrusion alert notice from service processes;
Consumer process 3 is demonstration foremost by the stacked setup of attribute of poisoning intrusion alert notice place window;
Consumer process 3 change poisoning intrusion alert notice place window word brightness, text color is set for red, increasing acquiescence character size is 50mm*50mm, so that poisoning intrusion alert notice shows is more obvious;
The current Session state of step 106 is the Session Status Change that the consumer process corresponding to Session of activation monitors its corresponding Session:
The Session state of current Session0 and Session3 is activation;
Consumer process 0 and consumer process 3 proceed as follows respectively:
Consumer process 0 operation is as follows:
The api interface that consumer process 0 utilizes Windows operating system to provide monitors the Session0 Status Change of its corresponding Session0; If receive Session0 Status Change notice, 0 of consumer process is kept at Session0 state after changing in consumer process internal memory, execution step 107; If do not receive Session0 Status Change notice, execution step 106;
Consumer process 3 operations are as follows:
The api interface that consumer process 3 utilizes Windows operating system to provide monitors the Session3 Status Change of its corresponding Session3; If receive Session3 Status Change notice, 3 of consumer process are kept at Session3 state after changing in consumer process internal memory, execution step 107; If do not receive Session3 Status Change notice, execution step 106, current Session state is the Session Status Change that consumer process corresponding to Session that activate continues to monitor its corresponding Session;
There is Session3 state and change to locking from activating in the present embodiment, now, Session state and the Session identifier of four Session are as follows:
Session0(activates, Session identifier 0);
Session1(disconnects, Session identifier 1);
Session2(disconnects, Session identifier 2);
Session3(locking, Session identifier 3);
Therefore, consumer process 3 can be received Session3 Status Change notice, and now, consumer process 3 operations are as follows:
The api interface that consumer process 3 utilizes Windows operating system to provide monitors the Session3 Status Change of its corresponding Session3; Consumer process 3 is received Session3 Status Change notice, this Session3 state is after changing kept in consumer process internal memory to execution step 107;
Consumer process corresponding to Session that step 107 Session state occurs to change analyzed paid-in Session Status Change notice:
There is Session3 state and change to locking from activating in the present embodiment;
Therefore the consumer process 3 that Session3 is corresponding judges whether the Session3 state being after changing kept in consumer process internal memory is locking: this Session3 state after changing of the present embodiment is locking, use Session identifier 0 for parameter, notification service process, execution step 106;
Service processes receives after the Session identifier 0 that consumer process 3 sends, service processes is kept at Session identifier 0 in service processes internal memory, execution step 103, being Session state is that the Session0 activating starts consumer process (if the Session state of certain Session is locking, the Session0 state of Session0 must be just to activate);
If (consumer process 3 judges that this Session3 state being after changing kept in consumer process internal memory is not locking, judge whether this Session3 state is after changing release, release if, whether the Session0 state that judges Session0 is activation, activates if execution step 106, if not for activating, use Session identifier 0 as parameter, notification service process, execution step 106;
Service processes receives after the Session identifier 0 that consumer process 3 sends, and service processes finishes the consumer process 0 of Session identifier 0 correspondence, execution step 101;
If Session3 state is after changing not release, judge whether this Session3 state is after changing disconnection, disconnect if, finish active user's process 3, execution step 101, if not for disconnecting, execution step 106; )
Above-mentioned alert notice method; Computing machine is presented to Windows operating system foremost by the alert notice window of poisoning intrusion, solve the problem that alert notice window is blocked by other forms under particular state that traditional alert Notification Method exists, make user can understand in time alert notice information, prevent important information loss, thereby avoided because important information is lost the heavy losses that cause.