Summary of the invention
The application's technical matters to be solved is to provide a kind of multi-process management method and device, to solve existing setting button as boss's key function, cannot realize the problem of the unified control and management between the multi-process of different application.
In order to address the above problem, the application discloses a kind of multi-process management method, comprising: current process receives the instruction of the setting button of input, according to the window of current process operation described in described instruction show or hide; Described current process is according to other process of described instruction notification, makes the window of other process operation described in described other process show or hide; Wherein, described current process and described other process are for meeting the process of a plurality of application of setting rule.
Preferably, receive the step of instruction of setting button of input in described current process before, also comprise: a process in the process of described a plurality of application receives instruction is set; Receive the described process that instruction is set by the described instruction notification that arranges to except himself, all processes in the process of described a plurality of application; Wherein, described the information that instruction comprises described setting button is set, described the window of its operation of process show or hide that instruction is used to indicate the instruction of the described setting button that receives input is set.
Preferably, in each process in the process of described a plurality of application, be provided with Inter-Process Communication manager, described Inter-Process Communication manager is for preserving and manage the progress information of the process of described a plurality of application by mapping table, and described progress information comprises the information of process identification (PID) and main window handle.
Preferably, a process in the process of described a plurality of application also comprises before receiving the step that instruction is set: while having process initiation in the process of described a plurality of application, the new process starting sends registration message to the process having started; The described process having started is obtained the information of the process of described new startup by described registration message, and in the Inter-Process Communication manager of the process having started described in being saved to; The described process having started sends and receives the response to the process of described new startup, described in progress information in the Inter-Process Communication manager of the process that started described in carrying in receiveing the response; Progress information in the Inter-Process Communication manager of the process that the process of described new startup has started described in obtaining, and be saved in the Inter-Process Communication manager of process of described new startup.
Preferably, the process that the described process having started is top-level windows place; Or the described process having started comprises a plurality of, in described a plurality of processes that started, first process that receives described registration message is obtained the information of the process of described new startup by described registration message, and receives the response to the process transmission of described new startup.
Preferably, described current process comprises according to the step of described other process of instruction notification: described current process is obtained the progress information of described other process of preserving in the Inter-Process Communication manager of described current process; According to the progress information of described other process, by other process described in described instruction notification.
Preferably, described satisfied set rule a plurality of are applied as a plurality of application of simultaneously using same browser execution.
Preferably, described satisfied a plurality of a plurality of game that are applied as use game plug-in unit startup in a browser of setting rule.
In order to address the above problem, disclosed herein as well is a kind of multi-process management devices, comprising: the first receiver module, for making current process receive the instruction of the setting button of input, according to the window of current process operation described in described instruction show or hide; The first notification module, for making described current process according to other process of described instruction notification, the window of other process operation described in other process show or hide described in making; Wherein, described current process and described other process are for meeting the process of a plurality of application of setting rule.
Preferably, this multi-process management devices also comprises: the second receiver module, for making at described the first receiver module, before described current process receives the instruction of described setting button of input, by a process in the process of described a plurality of application, receive instruction is set; The second notification module, for make to receive the described process that instruction is set by the described instruction notification that arranges to except himself, all processes in the process of described a plurality of application; Wherein, described the information that instruction comprises described setting button is set, described the window of its operation of process show or hide that instruction is used to indicate the instruction of the described setting button that receives input is set.
Preferably, in each process in the process of described a plurality of application, be provided with Inter-Process Communication manager, described Inter-Process Communication manager is for preserving and manage the progress information of the process of described a plurality of application by mapping table, and described progress information comprises the information of process identification (PID) and main window handle.
Preferably, this multi-process management devices also comprises: Registering modules, before at described the second receiver module, a process by the process of a plurality of application receives instruction is set, while having process initiation in the process of described a plurality of application, the new process starting sends registration message to the process having started; The first acquisition module, obtains the information of the process of described new startup for the process having started described in making by described registration message, and in the Inter-Process Communication manager of the process having started described in being saved to; Reply module, for the process that started described in making, to the process of described new startup, send and receive the response, described in progress information in the Inter-Process Communication manager of the process that started described in carrying in receiveing the response; The second acquisition module, for making the progress information of the Inter-Process Communication manager of the process that the process of described new startup started described in obtaining, and is saved in the Inter-Process Communication manager of process of described new startup.
Preferably, the process that the described process having started is top-level windows place; Or the described process having started comprises a plurality of, in described a plurality of processes that started, first process that receives described registration message is obtained the information of the process of described new startup by described registration message, and receives the response to the process transmission of described new startup.
Preferably, described the first notification module, the progress information of described other process of preserving for the Inter-Process Communication manager that makes described current process obtain described current process; According to the progress information of described other process, by other process described in described instruction notification, the window of other process operation described in other process show or hide described in making.
Preferably, described satisfied set rule a plurality of are applied as a plurality of application of simultaneously using same browser execution.
Preferably, described satisfied a plurality of a plurality of game that are applied as use game plug-in unit startup in a browser of setting rule.
Compared with prior art, the application has the following advantages:
Pass through the application, make to meet between the different processes of a plurality of application of certain rule interrelated (as interrelated between the process of a plurality of game), when current process is received the instruction of setting button (as boss's key), the window of show or hide self-operating not only, also notify the window of other process show or hide each self-operating associated with it, so that the window of a plurality of application while show or hide, thereby solved existing setting keypress function, cannot realize the problem of the unified control and management between the multi-process of different application, effectively improved the function of setting button, realized the unified control and management of the setting button under multi-process pattern.
Embodiment
For the application's above-mentioned purpose, feature and advantage can be become apparent more, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
Embodiment mono-
With reference to Fig. 1, show according to the flow chart of steps of a kind of multi-process management method of the embodiment of the present application one.
The multi-process management method of the present embodiment comprises the following steps:
Step S102: current process receives the instruction of the setting button of input, according to the window of described instruction show or hide current process operation.
Step S104: current process, according to other process of described instruction notification, makes the window of other process operation of other process show or hide.
Wherein, current process and other process are for meeting the process of a plurality of application of setting rule.Setting rule can be set according to actual conditions flexibly by those skilled in the art, a plurality of application that are generally the application of a plurality of same types or use same program to open, as, be set as the application of using same browser to open, or be set as the application of using same plug-in unit to open, or be set as the application of application type identical (as being the application of game class or e-book class), or be set as all accepting a plurality of browsers etc. of boss's key, the application is not restricted this.
Preferably, that meet to set rule is a plurality ofly applied as a plurality of application of simultaneously using same browser execution, as a plurality of game of using game plug-in unit to open in same browser simultaneously.
For instance, while using boss's key function to unify a plurality of games window of control and management, because boss's key function is a game subsidiary function being built in game plug-in unit, and game plug-in unit is to carry out running game in independent process mode after opening game.Therefore, can make between the process of a plurality of game (rule that meet to use game plug-in unit to open) interrelatedly, use the management of boss's key and control the process of these a plurality of game that are mutually related, realize the unified control and management of a plurality of games windows.Wherein, correlation form can have multiple, as use contingency table to record the information between a plurality of processes, according to the information in contingency table, notify other process etc., but be not limited to this, can also use in actual applications other any appropriate format, as real-time searching obtains the information of associated process, according to the information notice associated process of Real-time Obtaining etc.
In the present embodiment, when current game process receives after the instruction of boss's key that user presses, the games window of the current game process operation of meeting show or hide, simultaneously, by the message informing that receives user and press boss's key, give other process associated with it, that is, other game process of operation, to indicate other game process to close corresponding games window.
It should be noted that, these are only exemplary illustration, it should be understood by those skilled in the art that the present embodiment also can be applicable to the scene that other meet to set a plurality of application of rule, as e-book reading etc., the application is not restricted this.
Pass through the present embodiment, make to meet between the different processes of a plurality of application of certain rule interrelated, when current process is received the instruction of setting button, the window of show or hide self-operating not only, also notify the window of other process show or hide each self-operating associated with it, so that the window of a plurality of application while show or hide, thereby solved existing boss's key function, cannot realize the problem of the unified control and management between the multi-process of different application, effectively improved the function of boss's key, realized the unified control and management of the boss's key under multi-process pattern.Certainly, the scene of the many application of other key management or multi-process all can be carried out with reference to the present embodiment.
Embodiment bis-
With reference to Fig. 2, show according to the flow chart of steps of a kind of multi-process management method of the embodiment of the present application two.
In the present embodiment, a plurality of game process that use boss's key control and management to use game plug-in unit to open in a plurality of Shipping Options Pages of a browser of take are example, multi-process management method to the application describes, but be not limited to this, the scene of a plurality of application processes of other similar use hot key control and management all can be carried out with reference to the present embodiment.
In the present embodiment, boss's key function is a game subsidiary function being built in game plug-in unit, can hide or unlatching games window by a key.Use game plug-in unit to open after game, game is to carry out running game in independent process mode, opens so a plurality of game and just has a plurality of processes and move simultaneously, so need to there be manager to manage the game process of all operations.In the present embodiment, to the management of game, adopt the mode of star to carry out the game process of management operating, when the game process that uses game plug-in unit to open has when a plurality of, after each process initiation, can send registration message to top-level windows, except the game process at top-level windows place, after every other opened game process is received, can upgrade the IPC manager (Inter-Process Communication manager) of oneself, and send and receive the response to the process that sends message, and carry current existing process, all like this processes all couple together.When user arranges after boss's key in a certain process, this process can be called API (application programming interfaces) registration boss key, and sends boss's key assignments that other processes inform that active user arranges simultaneously.User presses boss's key, and first the process of registration boss key can respond, and this process notifies every other process to force show or hide window after handling.
Particularly, the multi-process management method of the present embodiment comprises the following steps:
Step S202: while having process initiation in the process of a plurality of application, the new process starting sends registration message to the process having started.
In the present embodiment, be a plurality ofly applied as a plurality of game of using game plug-in unit to open, the process having started is for having started the process at the top-level windows place of game.When using game plug-in unit to open a new game, the process of this game can send registration message to the game process of top-level windows.Certainly, the process having started also may have a plurality of, and at this moment, the new process starting can send registration message to a plurality of processes that started.
Step S204: the process having started is obtained the information of the process of new startup by registration message, and be saved in the Inter-Process Communication manager of the process having started.
Wherein, in each process in the process of a plurality of application, be provided with Inter-Process Communication manager, Inter-Process Communication manager is for preserving and manage the progress information of the process of a plurality of application.By Inter-Process Communication manager, can quick obtaining progress information, determine process status, improve the multi-process efficiency of management.
In the present embodiment, the game process of top-level windows obtains the progress information of new game, and is saved in the Inter-Process Communication manager of oneself, if without other game process, now, in the game process of top-level windows, the progress information of himself and new game process will be preserved.
If it is a plurality of that the process having started has, receive at first that the process of registration message of the process of new startup obtains the progress information of startup process, and this information is saved to the Inter-Process Communication manager of oneself, notify the information in the Inter-Process Communication manager that other process having started upgrades this process, so that each information having started in the Inter-Process Communication manager of process is synchronous simultaneously.
Step S206: the process having started is receiveed the response to the process transmission of new startup.
Wherein, carry the progress information in the Inter-Process Communication manager of the process having started in receiveing the response.
In the present embodiment, the game process of top-level windows sends and receives the response to new game process, and this carries the game process of top-level windows and the progress information of new game process in receiveing the response.
If it is a plurality of that the process having started has, the process of registration message of receiving at first the process of new startup sends and to receive the response to startup process, wherein carry the progress information in himself Inter-Process Communication manager, the new process starting is received after this message, the progress information obtaining is wherein saved in the Inter-Process Communication manager of startup process, thereby the information having realized between the process that the process of new startup started with other is synchronizeed.By receiving that at first the process of registration message notifies other process and transmission to receive the response, improved Message Processing efficiency, accelerated the window show or hide time, promoted user's experience.
Certainly, in actual applications, be not limited to receive at first that the process of registration message notifies other process and transmission to receive the response, those skilled in the art can be according to actual conditions, adopt other appropriate strategy to determine reception and the response pattern of registration message, the application is not restricted this.
Step S208: the new process starting is obtained the progress information in the Inter-Process Communication manager of the process having started, and be saved in the Inter-Process Communication manager of process of new startup.
In the present embodiment, the progress information of the game process of the top-level windows that new game process is carried in obtaining and receiveing the response and new game process, and be saved in the Inter-Process Communication manager of new game process.
So far, between the process of a plurality of application, set up interrelatedly, by the Inter-Process Communication manager of any one process, all can obtain the progress information of all processes of a plurality of application.
Step S210 a: process in the process of a plurality of application receives instruction is set.
Take boss's key as example, user can be in the process of a plurality of application any one arrange, arrange instruction comprise set button information (as, set the information which button button all comprises), arrange instruction be used to indicate the setting button that receives input instruction its operation of process show or hide window (as, current process receives that user presses the instruction of boss's key, carries out the show or hide of window).
By any one process input, instruction is set, has improved the compatibility of multi-process management, promoted user's experience.
Step S212: receive process that instruction is set and will instruction notification be set to except himself, all processes in the process of a plurality of application.
Once there be process to receive, instruction is set, illustrates that user has carried out button setting (as, boss's key arranges), at this moment, this process can be notified other associated process, informs the button setting that other process user carries out, and button is arranged relevant all onsets of all processes.
Step S214: current process receives the instruction of the setting button of input, according to the window of described instruction show or hide current process operation.
When pressing, user sets after button, current process (as, the game process of current operation) receive instruction, by the window show or hide of current process operation.
Step S216: current process is obtained the progress information of other process of preserving in the Inter-Process Communication manager of current process.
Step S218: current process, according to the progress information of other process, by other process of described instruction notification, makes the window of other process operation of other process show or hide.
In the Inter-Process Communication manager of current process, preserve the progress information of all relevant processes, user presses while setting button, current process is the window of show or hide self-operating not only, notify associated process also to carry out the show or hide of respective window simultaneously, thereby realize, set button to the unified management of a plurality of application or control.
The present embodiment be take boss's key as example, and in the present embodiment, boss's key function is one and is built in the game subsidiary function of game in plug-in unit, and the boss's key function by the present embodiment can a key be hidden or opens all games windows.In the present embodiment, in a process, boss's key is set, all web game processes or Flash game process all can receive that boss's key carries out hide window or display window, thereby the unified of boss's key of having realized under multi-process pattern controlled.
Compare with existing boss's key function: in (1) the present embodiment, user arranges boss's key one time, all effective to all processes, reduced the number of times that user arranges, improved user's experience; (2) process that boss's key has been set can arbitrarily exit, other processes still can be hidden or display window, compare traditional one process boss's key is set, this process arranges the situation that other process does not arrange, avoided one process boss key to exit the problem that rear boss's key function lost efficacy, boss's key function is improved; (3) window is set can uses unified interface of boss's key in all Process Windows, and the progress information of each process can be synchronous, facilitated like this setting of user to boss's key.
Embodiment tri-
With reference to Fig. 3, show according to the flow chart of steps of a kind of multi-process management method of the embodiment of the present application three.
The multi-process management method of the present embodiment comprises the following steps:
Step S302: show boss's key window, receive the instruction that user carries out the setting of boss's key.
In this step, can use any one application meeting in a plurality of application of setting rule to show boss's key window, for user, arrange.
Step S304: registration boss key.
In this step, user arranges after boss's key in the process of a certain application, and this process can be called API registration boss key, and sends other associated process in a plurality of application simultaneously, informs boss's key assignments that active user arranges.
In addition, before step S302, or after step S304, may have the process initiation of the regular application of new satisfied setting, during this process initiation, can send registration message to the process having started.When a startup process is received the registration message that certain process sends, this message has been carried the information of process identification (PID) and main window handle, as, the main window handles of game ID, account ID, establishment etc., receive that the process of registration message can be saved in the IPC manager of current process as a unique key according to game ID and account ID combination (process identification (PID)).Preferably, IPC manager can use map table (mapping table) to preserve and manage the progress information of the process of a plurality of application.
When a process is received after the registration message of certain process, showing has new process initiation, but the new process starting now and do not know to have started at present how many processes, so which process is first received after the registration message of new startup process, will preferentially respond this message, carried in passing the current specifying information that has how many processes and each process, specifying information can be also as game ID, account ID, the process identification (PID)s such as main window handle that create and the information of main window handle, the process that has guaranteed so new startup has known that the information of other processes supplies subsequent treatment.Wherein, the progress information of other processes of a process preservation can be shown to preserve by map, and then can be delivered to other processes by Memory Mapping File and its.
After having set up contact between a plurality of processes of a plurality of application, the setting of boss's key and registration meeting are known by each process, so that the unified control and management of follow-up boss's key to multi-process.
Step S306: current process receives the instruction that user presses boss's key.
Step S308: the window of its operation is hidden or shown to current process.
Step S310: current process is pressed user the instruction of boss's key and notified to other processes with the form of message.
Current process is when notifying other processes, and the map table of preserving according to himself obtains the progress information of other processes, and then according to progress information notice associated process.
Step S312: other processes receive boss's key message that current process sends.
Step S314: other process hidings or show corresponding window.
Other processes, after receiving the message that current process sends, are hidden or show each self-corresponding window.
Pass through the present embodiment, realized boss's key has been set in the process of an application, a plurality of processes to a plurality of application are unified control and management, solved existing boss's key function, cannot realize the problem of the unified control and management between the multi-process of different application, effectively improve the function of boss's key, realized the unified control and management of the boss's key under multi-process pattern.
Embodiment tetra-
With reference to Fig. 4, show according to the structured flowchart of a kind of multi-process management devices of the embodiment of the present application four.
The multi-process management devices of the present embodiment comprises: the first receiver module 402, for making current process receive the instruction of the setting button of input, according to the window of described instruction show or hide current process operation; The first notification module 404, for making current process according to other process of described instruction notification, makes the window of other process operation of other process show or hide; Wherein, current process and other process are for meeting the process of a plurality of application of setting rule.
Preferably, the multi-process management devices of the present embodiment also comprises: the second receiver module 406, for making at the first receiver module 402, before current process receives the instruction of setting button of input, by a process in the process of a plurality of application, receive instruction is set; The second notification module 408, will arrange instruction notification to except himself, all processes in the process of a plurality of application for making to receive process that instruction is set; Wherein, instruction is set and comprises the information of setting button, the window of its operation of process show or hide that instruction is used to indicate the instruction of the setting button that receives input is set.
Preferably, in each process in the process of a plurality of application, be provided with Inter-Process Communication manager, Inter-Process Communication manager is for preserving and manage the progress information of the process of a plurality of application.
Preferably, the progress information of the process of a plurality of application preserved and managed by Inter-Process Communication manager by mapping table.
Preferably, progress information comprises the information of process identification (PID) and main window handle.
Preferably, the multi-process management devices of the present embodiment also comprises: Registering modules 410, before at the second receiver module 406, a process by the process of a plurality of application receives instruction is set, while having process initiation in the process of a plurality of application, the new process starting sends registration message to the process having started; The first acquisition module 412, obtains the information of the process of new startup for the process that makes to have started by registration message, and is saved in the Inter-Process Communication manager of the process having started; Reply module 414, for the process that makes to have started, to the process of new startup, send and receive the response, in receiveing the response, carry the progress information in the Inter-Process Communication manager of the process having started; The second acquisition module 416, for making the new process starting obtain the progress information of the Inter-Process Communication manager of the process having started, and is saved in the Inter-Process Communication manager of process of new startup.
Preferably, the process having started is the process at top-level windows place.
Preferably, the process having started comprises a plurality of; In a plurality of processes that started, first process that receives registration message is obtained the information of the process of new startup by registration message, and receives the response to the process transmission of new startup.
Preferably, the first notification module 404, the progress information of other process of preserving for the Inter-Process Communication manager that makes current process obtain current process; According to the progress information of other process, by other process of described instruction notification, make the window of other process operation of other process show or hide.
That preferably, meet to set rule is a plurality ofly applied as a plurality of application of simultaneously using same browser execution.
Preferably, satisfied a plurality of a plurality of game that are applied as use game plug-in unit startup in a browser of setting rule.
The multi-process management devices of the present embodiment is used for realizing the corresponding multi-process management method of aforementioned a plurality of embodiment of the method, and has the beneficial effect of corresponding embodiment of the method, does not repeat them here.
It should be noted that, a plurality of embodiment of the application all take game be example, but be not limited to this, the application's multi-process Managed Solution also can be applicable to other similar scene, as opened the browser of a plurality of support boss keys simultaneously, boss's key is set in a browser can work to a plurality of browsers of opening simultaneously, once user presses boss's key, the window of these browsers will be hidden simultaneously or show.Or, as opened the program of a plurality of same types simultaneously, as WORD program, in a WORD program, hot key is set, can realize opening or closing a plurality of WORD documents of opening.Visible, by the application's multi-process Managed Solution, effectively improved and set button as the function of boss's key, realized the unified control and management of the setting button under multi-process pattern.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.For device embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
A kind of multi-process management method and the device that above the application are provided are described in detail, applied specific case herein the application's principle and embodiment are set forth, the explanation of above embodiment is just for helping to understand the application's method and core concept thereof; Meanwhile, for one of ordinary skill in the art, the thought according to the application, all will change in specific embodiments and applications, and in sum, this description should not be construed as the restriction to the application.