[go: up one dir, main page]

CN106020880B - A kind of browser starting method, apparatus and electronic equipment - Google Patents

A kind of browser starting method, apparatus and electronic equipment Download PDF

Info

Publication number
CN106020880B
CN106020880B CN201610327005.4A CN201610327005A CN106020880B CN 106020880 B CN106020880 B CN 106020880B CN 201610327005 A CN201610327005 A CN 201610327005A CN 106020880 B CN106020880 B CN 106020880B
Authority
CN
China
Prior art keywords
browser
default
key value
preset
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610327005.4A
Other languages
Chinese (zh)
Other versions
CN106020880A (en
Inventor
李文靖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Baoqu Technology Co Ltd
Original Assignee
Zhuhai Seal Interest Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Seal Interest Technology Co Ltd filed Critical Zhuhai Seal Interest Technology Co Ltd
Priority to CN201610327005.4A priority Critical patent/CN106020880B/en
Publication of CN106020880A publication Critical patent/CN106020880A/en
Application granted granted Critical
Publication of CN106020880B publication Critical patent/CN106020880B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the present invention discloses a kind of browser starting method, apparatus and electronic equipment, is related to browser technology field.The described method includes: being monitored to the event of key assignments in inquiry registration table;Obtain the event message that key assignments is defaulted in inquiry default browser registry entry;Key assignments is defaulted in inquiry default browser registry entry;Judge to default whether the corresponding default browser of key assignments is scheduled first browser;If defaulting the corresponding default browser of key assignments is scheduled first browser, judge whether the enabling number of the first browser within a predetermined period of time reaches predetermined threshold, if not up to, returning to the default key assignments to start the first browser;If having reached, the corresponding default browser of key assignments will be defaulted and be redirected to the second browser, to start the second browser.The present invention is suitable for the starting of different browsers.

Description

Browser starting method and device and electronic equipment
Technical Field
The invention relates to the technical field of browsers, in particular to a browser starting method and device and electronic equipment.
Background
With the development of computer internet technology, browsers have become one of the daily applications that computer users must use. In order to seize user resources, existing browser manufacturers research the redirection of the registry of the browser, and set the browser of the manufacturers as a locked default browser on a user computer through a registry redirection technology, that is, when a user clicks a link, the opened default browser is the locked browser and is not the browser pointed by a default key value in the registry.
The realization principle of the registry redirection technology of the browser is as follows: when the user clicks the external link, the system searches for a "default" key in the lock default registry, such as the system saves and obtains the default browser registry location: in "HKEY _ USERS \ Classes \ http \ shell \ open \ command", the "default" key value is "C: \ Program Files \ Internet Explorer \ iexplore.exe ", if registry redirection technology is not adopted, for an event of querying a default key value in a registry of a default browser, the returned event should be" C: an IE browser under \ Program Files \ Internet Explorer \ iexplore.exe "; however, if a registry redirection technology is adopted, that is, a function NtQueryValueKey of a key value in a registry is queried through a hook, when a system calls and searches for a "default" key value under a default browser registry, the returned data is modified into a locked browser path (for example, the returned "default" key value data "C: \\ ProgramFiles \ Internet Explorer \ iexpolore. exe" is modified into "C: \\ users \ lens \ appdata \ local \ Liebao. exe"), so that the redirection of the browser registry is queried, that is, the browser is locked and defaulted.
At present, various browser manufacturers use similar registry redirection technical schemes, so that when a user clicks a link and needs to open a browser, registry redirection programs of the browsers compete with each other, even program conflict occurs, and user experience is poor.
Disclosure of Invention
In view of this, embodiments of the present invention provide a browser starting method and apparatus, and an electronic device, which enable a user to lock different default browsers when clicking a web page link within a predetermined time period, so that different browsers do not contend for each other, and the use efficiency of different browsers is improved.
In a first aspect, an embodiment of the present invention provides a browser starting method, including:
monitoring events for querying key values in a registry;
acquiring an event message for inquiring a default key value in a default browser registry; wherein the event message is triggered by a displayed web link being clicked;
inquiring a default key value in a default browser registry according to the event message;
judging whether a default browser corresponding to the default key value is a preset first browser or not;
if the default browser corresponding to the default key value is a preset first browser, judging whether the starting times of the first browser in a preset time period reach a preset threshold value;
if the starting times of the first browser in a preset time period do not reach a preset threshold value, returning to the default key value to start the first browser; and if the starting times of the first browser in a preset time period reach a preset threshold value, redirecting the default browser corresponding to the default key value to a second browser so as to start the second browser.
With reference to the first aspect, in a first implementation manner of the first aspect, after querying a default key value in a default browser registry entry according to the event message, the method further includes determining whether a default browser corresponding to the default key value is a predetermined first browser, and before: determining whether a predetermined first browser is installed; and if the first browser is determined to be installed, starting a step of judging whether the default browser corresponding to the default key value is a preset first browser.
With reference to the first aspect, in a second implementation manner of the first aspect, the browser launching method is applied to a Windows operating system; wherein,
before monitoring for events querying key values in the registry, the method further comprises: presetting a hook function of a function NtQueryValueKey which is hooked to key values in a query registry;
the acquiring the event message for querying the default key value in the default browser registry entry includes: and acquiring an event message for inquiring the default key value in the default browser registry through the hook function.
With reference to the first aspect, in a third implementation manner of the first aspect, if the number of times of activation of the first browser in a predetermined time period reaches a predetermined threshold, redirecting the default browser corresponding to the default key value to the second browser to start the second browser includes: if the starting times of the first browser in a preset time period reach a preset threshold value, loading a redirection rule of the first browser for locking the second browser as a default browser; and redirecting the default browser corresponding to the default key value to the second browser according to a redirection rule of the first browser for locking the second browser as the default browser so as to start the second browser.
With reference to the third implementation manner of the first aspect, in a fourth implementation manner of the first aspect, the redirection rule for locking the second browser to be a default browser of the first browser is: and returning the installation path of the second browser as the default key value.
With reference to the first aspect, in a fifth possible implementation manner of the first aspect, when the first browser is started for the last time within the predetermined time period, the method further includes: and informing the first browser to close the redirection function of the first browser, wherein the first browser is locked as a default browser.
With reference to the third implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, the browser launching method further includes: monitoring whether the predetermined time period has expired; if the preset time period is expired, clearing the loaded redirection rule of the first browser for locking the second browser as a default browser, and assigning the starting times of the first browser as an initial value 0.
With reference to the first aspect, in a seventh implementation manner of the first aspect, the predetermined time period is one day, and the predetermined threshold is 1;
when the first browser is started, recording the starting time of the first browser;
the judging whether the number of times of starting the first browser in a preset time period reaches a preset threshold value includes: reading the latest starting time of the first browser, and acquiring the date corresponding to the latest starting time according to the latest starting time; acquiring a current system date; and judging whether the date corresponding to the time of the latest starting is consistent with the current system date, if so, determining that the starting times of the first browser in the preset time period reach a preset threshold value, and if not, determining that the starting times of the first browser in the preset time period do not reach the preset threshold value.
With reference to the first aspect, in an eighth implementation manner of the first aspect, before monitoring an event that queries a key value in a registry, the method further includes: inquiring a preset open-key value; if the open key value is a preset value representing open, starting a step of acquiring an event message for inquiring a default key value in a registry of a default browser; and if the on-off key value is a preset value representing off, ending the process.
In a second aspect, an embodiment of the present invention provides a browser launching device, including: the monitoring module is used for monitoring events for inquiring key values in the registry, acquiring event messages for inquiring the default key values in the registry items of the default browser, and sending inquiry instructions to the inquiry module according to the acquired event messages; the query module is used for querying a default key value in a default browser registry according to the query instruction, sending a first judgment instruction to the first judgment module and sending the default key value to the return module; the first judgment instruction comprises a queried default key value; the first judgment module is used for judging whether the default browser corresponding to the default key value is a preset first browser or not according to a first judgment instruction, and if the default browser corresponding to the default key value is the preset first browser, sending a second judgment instruction to the second judgment module; the second judging module is used for judging whether the starting times of the first browser in the preset time period reach a preset threshold value or not according to the received second judging instruction, if the starting times of the first browser in the preset time period do not reach the preset threshold value, a first returning instruction is sent to the returning module, and if the starting times of the first browser in the preset time period reach the preset threshold value, a second returning instruction is sent to the returning module; the return module is used for returning the default key value provided by the query module according to a first return instruction so as to start the first browser; or redirecting the default browser corresponding to the default key value to the second browser according to the second return instruction so as to start the second browser.
With reference to the second aspect, in a first implementation manner of the second aspect, the first determining module includes: the installation determining submodule is used for determining whether a preset first browser is installed or not according to a first judging instruction, and if the first browser is determined to be installed, sending a default browser judging instruction comprising the default key value to the default browser judging submodule; and the default browser judging sub-module is used for judging whether the default browser corresponding to the default key value is a preset first browser or not according to a default browser judging instruction, and sending a second judging instruction to the second judging module if the default browser corresponding to the default key value is the preset first browser.
With reference to the second aspect, in a second implementation manner of the second aspect, the browser launching device further includes: the setting module is used for presetting a hook function of a function NtQueryValueKey which is hooked to key values in the query registry; and the monitoring module is used for monitoring the event for inquiring the key value in the registry through the hook function and acquiring the event message for inquiring the default key value in the default browser registry.
With reference to the second aspect, in a third implementation manner of the second aspect, the returning module loads a redirection rule that locks the second browser of the first browser as a default browser according to the second returning instruction, and redirects the default browser corresponding to the default key value to the second browser according to the redirection rule that locks the second browser of the first browser as the default browser, so as to start the second browser.
With reference to the third implementation manner of the second aspect, in a fourth implementation manner of the second aspect, the returning module returns the installation path of the second browser as the default key value according to a second return instruction, so as to start the second browser.
With reference to the second aspect, in a fifth implementation manner of the second aspect, the second determining module is further configured to send a instruction to close the first browser redirection to the returning module when determining that the number of times the first browser is enabled in the predetermined time period is less than 1 of the predetermined threshold; and the return module is further used for informing the first browser to close the redirection function of the first browser, which locks the first browser and is a default browser, according to the instruction for closing the first browser redirection.
With reference to the third implementation manner of the second aspect, in a sixth implementation manner of the second aspect, the browser launching device further includes: the timing module is used for monitoring whether a preset time period expires, and if the preset time period expires, sending a clearing instruction to the return module and the second judgment module; the return module is further configured to empty the loaded redirection rule of the first browser, which locks the second browser as a default browser, according to the empty instruction;
the second judging module is further configured to assign the starting times of the first browser to an initial value 0 according to the clearing instruction.
With reference to the second aspect, in a seventh implementation manner of the second aspect, the second determining module includes: the recording submodule is used for recording the starting time of the first browser when the first browser is started; the reading submodule is used for reading the time of the latest starting of the first browser recorded by the recording submodule according to the second judgment instruction, acquiring the date corresponding to the time of the latest starting according to the time of the latest starting, and sending the date corresponding to the time of the latest starting to the comparison submodule; and the comparison submodule is used for acquiring the current system date when the date corresponding to the time of the latest starting is received, judging whether the date corresponding to the time of the latest starting is consistent with the current system date, if so, sending a second return instruction to the return module, and if not, sending a first return instruction to the return module.
With reference to the second aspect, in an eighth implementation manner of the second aspect, the browser launching device further includes: the monitoring system comprises a on-off key value judging module, a monitoring module and a monitoring module, wherein the on-off key value judging module is used for inquiring a preset on-off key value, if the on-off key value is a preset value indicating on, a monitoring starting notice is sent to the monitoring module, and if the on-off key value is a preset value indicating off, a monitoring ending notice is sent to the monitoring module; the monitoring module is used for starting to monitor the event for inquiring the key value in the registry according to the starting monitoring notice; and the monitoring of the events for inquiring the key values in the registry is finished according to the finishing monitoring notice.
In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the mobile device; the memory is used for storing executable program codes; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to execute the browser starting method according to any one of the foregoing embodiments.
According to the browser starting method, the browser starting device and the electronic equipment, the default using times of the first browser are recorded in the preset time period, when the using times of the first browser in the preset time period do not reach the preset threshold value, the first browser is used for opening the link clicked by the user, and if the starting times of the first browser in the preset time period reach the preset threshold value, the second browser is started, so that locking default competition among different browsers is avoided, the using rate, the flow and the navigation amount of the multiple browsers in the preset time period are improved, and meanwhile the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of a first embodiment of a browser launching method according to the present invention;
FIG. 2 is a flowchart of a second browser launching method according to the present invention;
FIG. 3 is a flowchart of a third embodiment of a browser launching method according to the present invention;
FIG. 4 is a flowchart of a fourth embodiment of a browser launching method according to the present invention;
FIG. 5 is a schematic structural diagram of a first browser launching device according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a second browser launching device according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a third browser launching device according to a preferred embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a fourth browser launching device according to an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of a fifth exemplary embodiment of a browser launching device according to the present invention;
FIG. 10 is a schematic structural diagram of a sixth exemplary embodiment of a browser launching device according to the present invention;
fig. 11 is a schematic structural diagram of an embodiment of an electronic device according to the present invention.
Detailed Description
A browser booting method and apparatus according to an embodiment of the present invention are described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a first embodiment of a browser launching method according to the present invention, as shown in fig. 1, the method of this embodiment may include:
step 101, monitoring events for querying key values in a registry.
Preferably, the monitoring of the event of the key value in the query registry can be realized by presetting a hook function of a function NtQueryValueKey hooked to the key value in the query registry.
102, acquiring an event message for inquiring a default key value in a default browser registry; wherein the event message is triggered by the displayed web page link being clicked.
In this embodiment, when a user clicks a web page link, the system may generate an event for querying a default key value in a registry entry of a default browser, and if a hook function for hooking an NtQueryValueKey is preset, the hook function may intercept the event message.
Step 103, querying the default key value in the default browser registry according to the event message for querying the default key value in the default browser registry.
And 104, judging whether the default browser corresponding to the default key value is a preset first browser, and if the default browser corresponding to the default key value is the preset first browser, executing the step 105.
In this embodiment, if the default browser corresponding to the default key value is not the predetermined first browser, the subsequent process of the method provided by the present invention is not executed, and at this time, the system returns to the user the default browser path recorded by the default key value, or after the redirection functions of the browsers compete with each other, the system returns to the user the default browser path is finally locked.
And 105, judging whether the starting times of the first browser in the preset time period reach a preset threshold value.
In this embodiment, the determining step 105 determines whether the recorded number of times of enabling the first browser in the predetermined time period reaches a predetermined threshold, if yes, the process goes to step 107; if not, go to step 106.
And 106, returning to a default key value to start the first browser.
And 107, redirecting the default browser corresponding to the default key value to the second browser so as to start the second browser.
In the embodiment, by monitoring the event of querying the key value in the registry and recording the use times of the default first browser in the preset time period, when the use times of the first browser in the preset time period does not reach the preset threshold value, the link clicked by the user is opened by the first browser, and the first browser is redirected to the second browser after the use times of the first browser in the preset time period, so that locking default contention among different browsers is avoided, the use rates of multiple browsers in the preset time period are improved, and the user experience is improved.
Preferably, when the browser launching method provided by the present invention is used for the first time, a step of determining whether a predetermined first browser is installed may be further included between step 103 and step 104, and on the premise that it is determined that the first browser is installed, the subsequent steps of the present invention are normally performed. Obviously, when the default browser corresponding to the default key value needs to be redirected to the second browser, the second browser also needs to coexist with the first browser in the current system. For example, if the predetermined first browser is "QQ browser" and the second browser is "cheetah browser", the installation location of the "QQ browser" registry, such as "HKEY _ LOCAL _ MACHINE \ SOFTWARE \ procedure \ QQBrowser", may be read to determine whether the "QQ browser" is installed, and determine that the "QQ browser" coexists with the "cheetah browser" after installation.
Fig. 2 is a flowchart of a second browser launching method according to the present invention, and as shown in fig. 2, the method of this embodiment may include:
step 201, monitoring events for querying key values in the registry.
Step 202, obtaining an event message for querying a default key value in a default browser registry.
Step 203, querying the default key value in the default browser registry according to the event message for querying the default key value in the default browser registry.
In this embodiment, the process of step 201-203 is similar to that of step 101-103 of the above method embodiment, and is not described herein again.
Step 204, determining whether the default browser corresponding to the default key value is the predetermined first browser, and if the default browser corresponding to the default key value is the predetermined first browser, executing step 205.
In this embodiment, the process of step 204 is similar to that of step 104 of the above method embodiment, and is not described here again.
Step 205, judging whether the starting times of the first browser in the preset time period reaches a preset threshold value, if so, entering step 207; if not, go to step 206.
In this embodiment, the process of step 205 is similar to that of step 105 of the above method embodiment, and is not described again here.
And step 206, returning to a default key value to start the first browser.
And step 207, loading a redirection rule of the first browser for locking the second browser as a default browser.
The redirection rule of the first browser for locking the second browser as the default browser is as follows: and returning the installation path of the second browser as the default key value.
And 208, redirecting the default browser corresponding to the default key value to the second browser according to the loaded redirection rule of the first browser for locking the second browser as the default browser so as to start the second browser. Namely: in this step, the installation path of the second browser is returned, so that the first browser is redirected to the second browser, and the link clicked by the user is opened by using the second browser.
In this embodiment, when redirection to the second browser is required, the redirection driver that hooks the NtQueryValueKey function loads the preset redirection rule data of the first browser, which locks the second browser as the default browser, and when the link is opened, redirection to the second browser starts to lock the default second browser.
If the redirection rule for locking the second browser as the default browser of the first browser is loaded once in a predetermined time period, and then every time the redirection rule for locking the second browser as the default browser of the first browser needs to be loaded in step 207, it may actually be determined whether the redirection rule for locking the second browser as the default browser of the first browser is loaded, if the redirection rule is loaded, step 208 may be directly executed, if the redirection rule for locking the second browser as the default browser is not loaded, step 207 needs to be executed first, and then step 208 is executed to implement redirection of the second browser.
In order to avoid that the redirection rule, which locks the second browser as the default browser, of the first browser loaded in the current predetermined time period continues to work in the next predetermined time period (when the first browser actually needs to be started), the method provided in this embodiment further includes, after step 207: and monitoring whether the preset time period is expired, if so, clearing the loaded redirection rule of the first browser for locking the second browser as a default browser, and assigning the starting times of the first browser as an initial value 0. In this way, the method provided by the embodiment of the invention can be reused for starting the browser in the next predetermined time period.
In this embodiment, when it is determined that the number of times of activation of the first browser within the predetermined time period reaches the predetermined threshold, the default first browser event may be redirected to the second browser by loading the first browser redirection rule for returning to the installation path of the second browser. And the locking default of the second browser can be realized after the redirection rule of the first browser is loaded once, and the realization is simple and convenient.
Fig. 3 is a flowchart of a third embodiment of a browser launching method of the present invention, as shown in fig. 3, the method of this embodiment may include:
and 301, inquiring a preset open-key value.
Step 302, judging whether the on-off key value is a preset value showing on, executing step 303, otherwise, ending the process.
In this embodiment, by presetting the on-off key value, for example, the on-off key value is stored as a location of the registry: and when the value is 1, setting the on-off key value to be off, and exiting the processing flow of the technical scheme.
Step 303, monitoring the event for querying the key value in the registry, and acquiring the event message for querying the default key value in the default browser registry.
And step 304, inquiring the default key value in the default browser registry according to the event message for inquiring the default key value in the default browser registry.
Step 305, determining whether the default browser corresponding to the default key value is the predetermined first browser, and if the default browser corresponding to the default key value is the predetermined first browser, executing step 306.
Step 306, judging whether the starting times of the first browser in the preset time period reach a preset threshold value. If yes, go to step 308; if not, go to step 307.
In this embodiment, the process of step 303-306 is similar to that of step 101-105 of the above method embodiment, and is not described herein again.
Step 307, returning to a default key value to start the first browser.
And 308, redirecting the default browser corresponding to the default key value to the second browser so as to start the second browser.
In this embodiment, the process of step 308 is similar to that of step 107 or step 207-208 in the above method embodiment, and is not described herein again.
The process of this embodiment is similar to the above method embodiment, and the difference is that before monitoring the event for querying the key value in the registry, the on/off key value is queried and determined whether to be on, and through the setting and determination of the on/off key value, whether to use the technical scheme provided by the present invention to process the event for querying the default key value in the default browser registry at this point can be conveniently selected.
Since the first browser may have a redirection function for locking itself as a default browser, in the first to third embodiments, preferably, when the first browser is started for the last time within a predetermined time period, the browser starting method provided by the present invention further includes: and informing the first browser to close the redirection function of the first browser, wherein the first browser is locked as a default browser. For example, if the predetermined time period is 2 days and the predetermined threshold is 5, with the method provided by the present invention, the browser opened for the first 5 times within 2 days should be the first browser, and when the first browser is activated for the 5 th time, the first browser needs to be notified to close the redirection function of which the locked self is the default browser, that is, close the redirection function of which the first browser redirects to itself, so as to avoid that when the webpage needs to be opened by using the second browser for the 6 th time, the redirection function of which the locked self is the default browser conflicts with the redirection function of which the browser is redirected to the second browser.
The following describes in detail the technical solution of the method embodiment shown in any one of fig. 1 to 3, using a specific embodiment.
Fig. 4 is a flowchart of a fourth embodiment of a browser launching method according to the present invention, where the present embodiment is used in a case where a predetermined time period is 1 day and a predetermined threshold is 1, as shown in fig. 4, a specific browser launching method may include:
step 401, querying a preset open-key value.
And step 402, judging whether the on-off key value is a preset value indicating on, if so, continuing to execute step 403, otherwise, ending the flow.
In this embodiment, the process of steps 401-402 is similar to that of steps 301-302 of the above method embodiment, and is not described herein again.
Step 403, monitoring events for querying key values in the registry.
Step 404, obtaining an event message for querying a default key value in a default browser registry.
Step 405, querying the default key value in the default browser registry according to the event message for querying the default key value in the default browser registry.
In this embodiment, the process of step 403-.
Step 406, determining whether a predetermined first browser is installed, if the first browser is installed, executing step 407, otherwise, ending the process.
Step 407, determining whether the default browser corresponding to the default key value is the predetermined first browser, if the default browser corresponding to the default key value is the predetermined first browser, executing step 408, otherwise, ending the process.
In this embodiment, the process of step 407 is similar to that of step 104 of the above method embodiment, and is not described here again.
And 408, reading the latest starting time of the first browser, and acquiring the date corresponding to the latest starting time of the first browser according to the latest starting time of the first browser.
Step 409, acquiring the current system date. For example, when the system used by the method is a Windows operating system, the current system date may be obtained by GetLocalTime.
Step 410, judging whether the date corresponding to the time when the first browser was started last time is consistent with the current system date, if not, indicating that the first browser is not started in the day, and entering step 411; if yes, then step 412 is entered, which represents when the first browser is enabled within the day.
Step 411, returning to the default key value, starting the first browser, recording the time of starting the first browser at this time, and simultaneously notifying the first browser to close the redirection function locked as the default browser.
For example, if the first browser is an existing QQ browser, each time the QQ browser is started, the registry is written: and writing the current starting time into an ActiveTime key value, wherein the ActiveTime key value is an overlay record, namely the record always represents the time of the last starting of the QQ browser. Then, in step 408, the date corresponding to the time when the QQ browser was last started can be obtained by reading the ActiveTime key value.
Step 412, load the redirection rule of the first browser that locks the second browser as the default browser.
Step 413, redirecting the default browser corresponding to the default key value to the second browser according to the redirection rule of the first browser for locking the second browser as the default browser, and starting the second browser.
In this embodiment, the process of step 412-.
The method shown in fig. 4 further comprises: and monitoring whether the system time reaches 24 late (namely whether the preset time period expires) in real time, and if the system time reaches 24 late, clearing the loaded redirection rule of the first browser, which locks the second browser as the default browser.
According to the browser starting method provided by the embodiment, the default using time of the first browser is recorded within 1 day, when the first browser is not used within 1 day, a link clicked by a user is opened by the first browser, after the first browser is started within 1 day, the redirection function of the first browser is closed, and the first browser is redirected to the second browser through the preset redirection rule of the first browser, so that the locking default of the second browser is realized later. The locking default conflict among different browsers is avoided, the utilization rate, the flow and the navigation amount of the multiple browsers in a preset time period are improved, and the user experience is improved.
Fig. 5 is a schematic structural diagram of a first browser launching device according to an embodiment of the present invention, and as shown in fig. 5, the device of this embodiment may include: the system comprises a monitoring module 11, an inquiry module 12, a first judgment module 13, a second judgment module 14 and a return module 15; wherein,
the monitoring module 11 is configured to monitor an event for querying a key value in the registry, acquire an event message for querying a default key value in a default browser registry, and send a query instruction to the query module 12 according to the acquired event message;
the query module 12 is configured to query a default key value in a default browser registry according to a query instruction, send a first judgment instruction to the first judgment module 13, and send the default key value to the return module 15; the first judgment instruction comprises a queried default key value;
the first judging module 13 is configured to judge whether the default browser corresponding to the default key value is the predetermined first browser according to the first judging instruction, and send a second judging instruction to the second judging module 14 if the default browser corresponding to the default key value is the predetermined first browser;
the second judging module 14 is configured to judge whether the number of times of activation of the first browser in the predetermined time period reaches a predetermined threshold according to the received second judging instruction, send a first return instruction to the return module 15 if the number of times of activation of the first browser in the predetermined time period does not reach the predetermined threshold, and send a second return instruction to the return module 15 if the number of times of activation of the first browser in the predetermined time period reaches the predetermined threshold;
a returning module 15, configured to return the default key value provided by the querying module 12 according to the first returning instruction to start the first browser; or redirecting the default browser corresponding to the default key value to the second browser according to the second return instruction so as to start the second browser.
The apparatus of this embodiment may be used to implement the technical solution of the method embodiment shown in fig. 1, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of a second embodiment of the browser launching device of the present invention, as shown in fig. 6, the device of this embodiment is based on the device structure shown in fig. 5, and further, the first determining module 13 may include:
an installation determining submodule 21, configured to determine whether a predetermined first browser is installed according to the first determining instruction, and if it is determined that the first browser is installed, send a default browser determining instruction including a default key value to the default browser determining submodule 22;
the default browser determining sub-module 22 is configured to determine, according to the default browser determining instruction, whether the default browser corresponding to the default key value is the predetermined first browser, and send a second determining instruction to the second determining module 14 if the default browser corresponding to the default key value is the predetermined first browser.
Fig. 7 is a schematic structural diagram of a third embodiment of the browser launching device of the present invention, as shown in fig. 7, the device of this embodiment may further include a setting module 16, configured to preset a hook function of a function ntqueryvalue key hooked to a key value in a query registry and provide the hook function to the monitoring module 11, based on the device structure shown in fig. 5; the monitoring module 11 monitors events for querying key values in the registry through a hook function, and obtains event messages for querying default key values in the default browser registry.
Preferably, in the foregoing embodiment, the returning module 15 loads, according to the second return instruction, a redirection rule of the first browser for locking the second browser as the default browser, and redirects, according to the redirection rule of the first browser for locking the second browser as the default browser, the default browser corresponding to the default key value to the second browser, so as to start the second browser.
The apparatus of this embodiment may be used to implement the technical solution of the method embodiment shown in fig. 2, and the implementation principle and the technical effect are similar, which are not described herein again.
Preferably, the redirection rule of the first browser for locking the second browser as the default browser is: and returning the installation path of the second browser as the default key value. That is, the returning module 15 returns the installation path of the second browser as the default key value according to the second return instruction, so as to start the second browser.
Preferably, in the above embodiment, the second determining module 14 is further configured to send a instruction to close the first browser redirection module 15 when determining that the number of times the first browser is enabled in the predetermined time period is less than 1 of the predetermined threshold; the returning module 15 is further configured to notify the first browser to close the redirection function of the first browser, where the locked browser is a default browser, according to the instruction to close the first browser redirection.
Fig. 8 is a schematic structural diagram of a fourth embodiment of the browser launching device of the present invention, as shown in fig. 8, the device of this embodiment may further include a timing module 17, configured to monitor whether a predetermined time period has expired, and send an emptying instruction to the returning module 15 and the second determining module 14 if the predetermined time period has expired; the returning module 15 is further configured to empty the redirection rule of the loaded first browser, which locks the second browser as a default browser, according to the emptying instruction; the second judging module 14 is further configured to assign the starting times of the first browser to an initial value 0 according to the clearing instruction.
The apparatus of this embodiment may be used to implement the technical solutions of the method embodiments shown in fig. 1 or fig. 2, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 9 is a schematic structural diagram of a fifth embodiment of the browser launching device of the present invention, as shown in fig. 9, the device of this embodiment is based on the device structure shown in fig. 5, and further, the second determining module 14 includes: the recording submodule 31 is configured to record the time of starting the first browser at this time when the first browser is started; the reading sub-module 32 is configured to read, according to the second determination instruction, the time at which the first browser was started last, which is recorded by the recording sub-module 31, obtain, according to the time at which the first browser was started last, a date corresponding to the time at which the first browser was started last, and send the date corresponding to the time at which the first browser was started last to the comparison sub-module 33; the comparison submodule 33 is configured to, when a date corresponding to the time when the first browser was last started is received, obtain a current system date, determine whether the date corresponding to the time when the first browser was last started is consistent with the current system date, send a second return instruction to the return module 15 if the date corresponding to the time when the first browser was last started is consistent with the current system date, and send a first return instruction to the return module 15 if the date corresponding to the time when the first browser was last started is not consistent with the current system date.
The apparatus of this embodiment may be used to implement the technical solution of the method embodiment shown in fig. 4, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 10 is a schematic structural diagram of a sixth embodiment of the browser launching apparatus of the present invention, and as shown in fig. 10, the apparatus of this embodiment further includes an on-off key value determining module 18, based on the apparatus structure shown in fig. 5, configured to query a preset on-off key value, send a start monitoring notification to the monitoring module 11 if the on-off key value is a predetermined value indicating on, and send an end monitoring notification to the monitoring module 11 if the on-off key value is a predetermined value indicating off. The monitoring module 11 is configured to start monitoring an event for querying a key value in a registry according to the start monitoring notification; and the monitoring of the events for inquiring the key values in the registry is finished according to the finishing monitoring notice.
The apparatus of this embodiment may be used to implement the technical solution of the method embodiment shown in fig. 3, and the implementation principle and the technical effect are similar, which are not described herein again.
The embodiment of the invention also provides the electronic equipment. Fig. 11 is a schematic structural diagram of an embodiment of an electronic device of the present invention, which may implement the process of the embodiment shown in fig. 1 or fig. 2 of the present invention, and as shown in fig. 11, the electronic device may include: the device comprises a shell 41, a processor 42, a memory 43, a circuit board 44 and a power circuit 45, wherein the circuit board 44 is arranged inside a space enclosed by the shell 41, and the processor 42 and the memory 43 are arranged on the circuit board 44; a power supply circuit 45 for supplying power to each circuit or device of the electronic apparatus; the memory 43 is used for storing executable program code; the processor 42 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 43, so as to execute the browser launching method according to any one of the foregoing embodiments.
The electronic device exists in a variety of forms, including but not limited to:
(1) a mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include: smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as ipads.
(3) A portable entertainment device: such devices can display and play multimedia content. This type of device comprises: audio and video playing modules (such as an iPod), handheld game consoles, electronic books, and intelligent toys and portable car navigation devices.
(4) A server: the device for providing the computing service comprises a processor, a hard disk, a memory, a system bus and the like, and the server is similar to a general computer architecture, but has higher requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like because of the need of providing high-reliability service.
(5) And other electronic equipment with data interaction function.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
For convenience of description, the above devices are described separately in terms of functional division into various units/modules. Of course, the functionality of the units/modules may be implemented in one or more software and/or hardware implementations of the invention.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (19)

1. A browser launching method, comprising:
monitoring events for querying key values in a registry;
acquiring an event message for inquiring a default key value in a default browser registry; wherein the event message is triggered by a displayed web link being clicked;
inquiring a default key value in a default browser registry according to the event message;
judging whether a default browser corresponding to the default key value is a preset first browser or not;
if the default browser corresponding to the default key value is a preset first browser, judging whether the starting times of the first browser in a preset time period reach a preset threshold value;
if the starting times of the first browser in a preset time period do not reach a preset threshold value, returning to the default key value to start the first browser; and if the starting times of the first browser in a preset time period reach a preset threshold value, redirecting the default browser corresponding to the default key value to a second browser so as to start the second browser.
2. The method according to claim 1, wherein after querying a default key value in a default browser registry key according to the event message, determining whether a default browser corresponding to the default key value is a predetermined first browser, the method further comprises:
determining whether a predetermined first browser is installed;
and if the first browser is determined to be installed, starting a step of judging whether the default browser corresponding to the default key value is a preset first browser.
3. The browser launching method of claim 1, wherein the browser launching method is applied to a Windows operating system; wherein,
before monitoring for events querying key values in the registry, the method further comprises: presetting a hook function of a function NtQueryValueKey which is hooked to key values in a query registry;
the acquiring the event message for querying the default key value in the default browser registry entry includes: and acquiring an event message for inquiring the default key value in the default browser registry through the hook function.
4. The method according to claim 1, wherein if the number of times of activation of the first browser in a predetermined time period reaches a predetermined threshold, redirecting the default browser corresponding to the default key value to the second browser to start the second browser includes:
if the starting times of the first browser in a preset time period reach a preset threshold value, loading a redirection rule of the first browser for locking the second browser as a default browser;
and redirecting the default browser corresponding to the default key value to the second browser according to a redirection rule of the first browser for locking the second browser as the default browser so as to start the second browser.
5. The browser launching method of claim 4, wherein the redirection rule of the first browser for locking the second browser as a default browser is: and returning the installation path of the second browser as the default key value.
6. The browser launching method of claim 1, wherein upon a last launch of the first browser within the predetermined time period, the method further comprises:
and informing the first browser to close the redirection function of the first browser, wherein the first browser is locked as a default browser.
7. The browser launching method according to claim 4, further comprising:
monitoring whether the predetermined time period has expired;
if the preset time period is expired, clearing the loaded redirection rule of the first browser for locking the second browser as a default browser, and assigning the starting times of the first browser as an initial value 0.
8. The browser launching method according to claim 1, characterized in that the predetermined period of time is one day, the predetermined threshold is 1;
when the first browser is started, recording the starting time of the first browser;
the judging whether the number of times of starting the first browser in a preset time period reaches a preset threshold value includes:
reading the latest starting time of the first browser, and acquiring the date corresponding to the latest starting time according to the latest starting time;
acquiring a current system date;
and judging whether the date corresponding to the time of the latest starting is consistent with the current system date, if so, determining that the starting times of the first browser in the preset time period reach a preset threshold value, and if not, determining that the starting times of the first browser in the preset time period do not reach the preset threshold value.
9. The browser launching method of claim 1, wherein prior to monitoring for events that query key values in a registry, the method further comprises:
inquiring a preset open-key value;
if the open key value is a preset value representing open, starting a step of acquiring an event message for inquiring a default key value in a registry of a default browser;
and if the on-off key value is a preset value representing off, ending the process.
10. A browser launching device, comprising:
the monitoring module is used for monitoring events for inquiring key values in the registry and acquiring event messages for inquiring the default key values in the registry items of the default browser;
the monitoring module is used for acquiring event information of a default key value in a default browser registry, and inquiring the default key value in the default browser registry;
the first judging module is used for judging whether the default browser corresponding to the default key value inquired by the inquiring module is a preset first browser or not;
the second judging module is used for judging whether the starting times of the first browser in a preset time period reach a preset threshold value or not when the first judging module judges that the default browser corresponding to the default key value is a preset first browser;
the returning module is used for returning the default key value provided by the query module to start the first browser when the second judging module judges that the starting times of the first browser in a preset time period do not reach a preset threshold value; or when the second judging module judges that the starting times of the first browser in a preset time period reach a preset threshold value, the default browser corresponding to the default key value is redirected to the second browser so as to start the second browser.
11. The browser launching device of claim 10, wherein the first determining module comprises:
an installation determination submodule for determining whether a predetermined first browser is installed;
and the default browser judging submodule is used for judging whether the default browser corresponding to the default key value inquired by the inquiring module is the preset first browser or not when the installation determining submodule determines that the preset first browser is installed.
12. The browser launching device of claim 10, further comprising:
the setting module is used for presetting a hook function of a function NtQueryValueKey which is hooked to key values in the query registry;
and the monitoring module is used for monitoring the event for inquiring the key value in the registry through the hook function and acquiring the event message for inquiring the default key value in the default browser registry.
13. The browser starting device according to claim 10, wherein the returning module is configured to, when the second determining module determines that the number of times the first browser is enabled within the predetermined time period reaches a predetermined threshold, load a redirection rule of the first browser that locks the second browser as a default browser, and redirect the default browser corresponding to the default key value to the second browser according to the redirection rule of the first browser that locks the second browser as the default browser, so as to start the second browser.
14. The browser starting device according to claim 13, wherein the returning module is configured to return the installation path of the second browser as the default key value to start the second browser when the second determining module determines that the number of times of enabling the first browser in the predetermined time period reaches the predetermined threshold.
15. The browser launching device of claim 10, wherein the returning module is further configured to notify the first browser to close the redirection function of the first browser, which is locked by itself as a default browser, when the second determining module determines that the number of times the first browser is enabled in the predetermined time period is less than 1 than the predetermined threshold.
16. The browser launching device of claim 13, further comprising:
the timing module is used for monitoring whether a preset time period expires;
the returning module is further configured to empty the loaded redirection rule of the first browser, which locks the second browser as a default browser, when the predetermined time period monitored by the timing module has expired;
the second judging module is further configured to assign an initial value of 0 to the number of times of activation of the first browser when the predetermined time period monitored by the timing module has expired.
17. The browser launching device of claim 10, wherein the second determining module comprises:
the recording submodule is used for recording the starting time of the first browser when the first browser is started;
the reading submodule is used for reading the time of the latest starting of the first browser recorded by the recording submodule and acquiring the date corresponding to the time of the latest starting according to the time of the latest starting;
and the comparison submodule is used for acquiring the current system date and judging whether the date corresponding to the time of the latest starting read by the reading submodule is consistent with the current system date, if so, determining that the starting frequency of the first browser in a preset time period reaches a preset threshold value, and if not, determining that the starting frequency of the first browser in the preset time period does not reach the preset threshold value.
18. The browser launching device of claim 10, further comprising:
and the on-off key value judging module is used for inquiring a preset on-off key value, and triggering the monitoring module to start working if the on-off key value is a preset value showing on.
19. An electronic device, characterized in that the electronic device comprises: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the browser launching method of any one of the preceding claims 1 to 9.
CN201610327005.4A 2016-05-17 2016-05-17 A kind of browser starting method, apparatus and electronic equipment Active CN106020880B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610327005.4A CN106020880B (en) 2016-05-17 2016-05-17 A kind of browser starting method, apparatus and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610327005.4A CN106020880B (en) 2016-05-17 2016-05-17 A kind of browser starting method, apparatus and electronic equipment

Publications (2)

Publication Number Publication Date
CN106020880A CN106020880A (en) 2016-10-12
CN106020880B true CN106020880B (en) 2019-05-07

Family

ID=57098564

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610327005.4A Active CN106020880B (en) 2016-05-17 2016-05-17 A kind of browser starting method, apparatus and electronic equipment

Country Status (1)

Country Link
CN (1) CN106020880B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110889066A (en) * 2018-08-16 2020-03-17 广州金山移动科技有限公司 Method and device for opening webpage in client software and electronic equipment
CN112667997A (en) * 2020-12-31 2021-04-16 广州点云科技有限公司 Method and device for forbidding Windows system browser
CN112784186A (en) * 2021-02-02 2021-05-11 珠海格力电器股份有限公司 Link address opening method and device, storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7058701B1 (en) * 2000-08-02 2006-06-06 International Business Machines Corporation Time-based browser toolbar configurations according to at least two predefined time-based browsing settings
CN101655863A (en) * 2009-04-24 2010-02-24 北京搜狗科技发展有限公司 Method for loading web pages in browser and browser
CN104881291A (en) * 2015-06-03 2015-09-02 北京金山安全软件有限公司 Control method and device of default browser and terminal
CN105450694A (en) * 2014-08-22 2016-03-30 阿里巴巴集团控股有限公司 Redirecting the service request to destination address;
CN105574190A (en) * 2015-12-24 2016-05-11 北京金山安全软件有限公司 Webpage access method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7058701B1 (en) * 2000-08-02 2006-06-06 International Business Machines Corporation Time-based browser toolbar configurations according to at least two predefined time-based browsing settings
CN101655863A (en) * 2009-04-24 2010-02-24 北京搜狗科技发展有限公司 Method for loading web pages in browser and browser
CN105450694A (en) * 2014-08-22 2016-03-30 阿里巴巴集团控股有限公司 Redirecting the service request to destination address;
CN104881291A (en) * 2015-06-03 2015-09-02 北京金山安全软件有限公司 Control method and device of default browser and terminal
CN105574190A (en) * 2015-12-24 2016-05-11 北京金山安全软件有限公司 Webpage access method and device

Also Published As

Publication number Publication date
CN106020880A (en) 2016-10-12

Similar Documents

Publication Publication Date Title
CN105843650B (en) Application program management method and device in intelligent terminal
CN111782295B (en) Application program running method and device, electronic equipment and storage medium
CN112099800B (en) Code data processing method, device and server
CN103049692A (en) Application installation method, device and facility
CN105446776A (en) Application program closing method and device and electronic equipment
CN109960521B (en) Application program upgrading method and device, electronic equipment and storage medium
CN106020880B (en) A kind of browser starting method, apparatus and electronic equipment
CN106250182B (en) File processing method and device and electronic equipment
CN109451076B (en) Network request merging processing method and device and electronic equipment
CN108287647B (en) Application running method and device
CN106203092B (en) Method and device for intercepting shutdown of malicious program and electronic equipment
CN116523457A (en) Workflow processing method, device, equipment and storage medium based on business process
CN108563472B (en) Method and device for loading service plug-in based on multi-open application
CN111580445B (en) Electrical equipment operation switching method and device, electronic equipment and storage medium
CN107633080B (en) User task processing method and device
CN102622254B (en) Television outage disposal route and system
CN106022117A (en) Method and device for preventing system environment variable from being modified and electronic equipment
CN104811795A (en) Online video playing method and online video playing device
CN111782294A (en) Application program running method and device, electronic equipment and storage medium
CN106933615B (en) APP awakening method and device
CN108446144B (en) Application program starting method and device, terminal and storage medium
CN111400037A (en) Memory management method and device, computer storage medium and terminal
CN109729001A (en) A kind of information push method and device
CN111782362B (en) Message task scheduling method and device and electronic equipment
CN110941484B (en) Application program calling method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20190115

Address after: 519031 Room 105-53811, No. 6 Baohua Road, Hengqin New District, Zhuhai City, Guangdong Province

Applicant after: Zhuhai Leopard Technology Co.,Ltd.

Address before: 100085 East District, No. 33 Xiaoying West Road, Haidian District, Beijing

Applicant before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd.

GR01 Patent grant
GR01 Patent grant