CN110633156A - Method and device for associating application program with browser, electronic equipment and storage medium - Google Patents

Method and device for associating application program with browser, electronic equipment and storage medium Download PDF

Info

Publication number
CN110633156A
CN110633156A CN201810651499.0A CN201810651499A CN110633156A CN 110633156 A CN110633156 A CN 110633156A CN 201810651499 A CN201810651499 A CN 201810651499A CN 110633156 A CN110633156 A CN 110633156A
Authority
CN
China
Prior art keywords
window
browser
specified
application program
service process
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.)
Granted
Application number
CN201810651499.0A
Other languages
Chinese (zh)
Other versions
CN110633156B (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Hangzhou Hikvision System Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201810651499.0A priority Critical patent/CN110633156B/en
Priority to EP19821564.2A priority patent/EP3671449A4/en
Priority to PCT/CN2019/087078 priority patent/WO2019242435A1/en
Priority to US16/652,656 priority patent/US11262883B2/en
Publication of CN110633156A publication Critical patent/CN110633156A/en
Application granted granted Critical
Publication of CN110633156B publication Critical patent/CN110633156B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

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

Abstract

The invention provides a method and a device for associating application programs with a browser, electronic equipment and a storage medium, wherein the method comprises the following steps: receiving a window request instruction from a Web client through the connection between a local specified service process and the Web client; searching a specified browser window where the Web client is located and creating an application program window used for being associated to the specified browser window through a local specified service process according to the window request instruction; and associating the application program window to the specified browser window through a local specified service process. The desired application can be presented on the Web client and the data services of the application are not limited by the performance of the Web client.

Description

Method and device for associating application program with browser, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for associating an application program with a browser, an electronic device, and a storage medium.
Background
Existing Web (World Wide Web) applications are based on a browser container, and develop Web programs using Javascript (an interpreted scripting language). For conventional Web applications, it is true that Javascript prior art can be used to do so, but when some industry applications are encountered, the JS kernel engine in the browser cannot meet higher application requirements.
Disclosure of Invention
In view of the above, the present invention provides a method and an apparatus for associating an application program with a browser, an electronic device, and a storage medium, which can present a desired application on a Web client, and the data service of the application is not limited by the performance of the Web client.
The invention provides a method for associating application programs by a browser in a first aspect, which comprises the following steps:
receiving a window request instruction from a Web client through the connection between a local specified service process and the Web client;
searching a specified browser window where the Web client is located and creating an application program window used for being associated to the specified browser window through a local specified service process according to the window request instruction;
and associating the application program window to the specified browser window through a local specified service process.
According to an embodiment of the present invention, after associating the application window to the specified browser window through a local specified service process, the method further includes:
and triggering the application program window to establish connection with an application server through a local specified service process according to an application request instruction from the Web client, so that the application server provides data service for the application program window through the connection with the application program window.
According to an embodiment of the present invention, searching for the specified browser window where the Web client is located according to the window request instruction by the local specified service process includes:
analyzing the specified identification carried by the window request instruction through a local specified service process;
and traversing the local window through a local specified service process to find the browser window with the title at least comprising the specified identification, and determining the found browser window as the specified browser window.
According to an embodiment of the present invention, said associating the application window to the specified browser window by the local specified service process comprises:
calling the appointed browser window by using the handle of the appointed browser window;
and associating the application program window to the specified browser window called by the handle through a local specified service process.
According to one embodiment of the present invention, associating the application window to the designated browser window called by the handle through a local designated service process comprises:
analyzing the embedded parameters carried by the window request instruction through a local specified service process;
judging whether the embedding parameters indicate that embedding is allowed or not through a local specified service process;
if so, establishing a parent-child relationship between the specified browser window called by the handle and an application program window through the local specified service process, and taking the application program window as an embedded child window of the specified browser window;
if not, starting a position tracking timer through the local specified service process, setting the application program window at the specified position of the specified browser window called by the handle, and setting the application program window to automatically follow the specified browser window.
According to one embodiment of the invention, the specified browser window comprises at least a first tab page and a second tab page which are switchable, and the application program window is associated in the first tab page of the specified browser window;
the method further comprises the following steps:
hiding the application program window through the local specified service process according to a hiding instruction from the Web client; the hiding instruction is sent when the Web client monitors that the appointed browser window is switched from the first tab page to the second tab page, and is used for indicating to hide the application program window displayed in the first tab page of the appointed browser window; and
displaying the application program window through the local specified service process according to a display instruction from the Web client; and the display instruction is sent when the Web client monitors that the browser window is switched from the second tab page to the first tab page, and is used for indicating the hidden application program window to be displayed in the first tab page of the specified browser window.
A second aspect of the present invention provides an apparatus for associating an application program with a browser, the apparatus comprising:
the instruction receiving module is used for receiving a window request instruction from the Web client through the connection between the local specified service process and the Web client;
the search creation module is used for searching a specified browser window where the Web client is located through a local specified service process according to the window request instruction and creating an application program window which is used for being associated to the specified browser window;
and the window association module is used for associating the application program window to the specified browser window through a local specified service process.
According to an embodiment of the present invention, the window associating module further includes:
and the application connection module is used for triggering the application program window to establish connection with an application server through a local specified service process according to an application request instruction from the Web client, so that the application server provides data service for the application program window through the connection with the application program window.
According to one embodiment of the invention, the lookup creation module comprises:
the identification analyzing unit is used for analyzing the specified identification carried by the window request instruction through a local specified service process;
and the window searching unit is used for traversing the local window through a local specified service process to search the browser window with the title at least comprising the specified identification, and determining the searched browser window as the specified browser window.
According to one embodiment of the invention, the window association module comprises:
the handle calling unit is used for calling the specified browser window by using the handle of the specified browser window;
and the window association unit is used for associating the application program window to the specified browser window called by the handle through a local specified service process.
According to an embodiment of the present invention, the window associating unit includes:
the parameter analysis subunit is used for analyzing the embedded parameters carried by the window request instruction through a local specified service process;
the parameter judgment subunit is used for judging whether the embedding parameter indicates that the embedding is allowed or not through a local specified service process;
the embedded mode sub-unit is used for establishing a parent-child relationship between the specified browser window called by the handle and an application program window through the local specified service process if the specified browser window is the embedded child window of the specified browser window, and taking the application program window as the embedded child window of the specified browser window;
and the following mode subunit is used for starting a position tracking timer through the local specified service process if the position tracking timer is not started, setting the application program window at the specified position of the specified browser window called by the handle, and setting the application program window to automatically follow the specified browser window.
According to one embodiment of the invention, the specified browser window comprises at least a first tab page and a second tab page which are switchable, and the application program window is associated in the first tab page of the specified browser window;
the device also includes:
the window hiding module is used for hiding the application program window through the local specified service process according to a hiding instruction from the Web client; the hiding instruction is sent when the Web client monitors that the appointed browser window is switched from the first tab page to the second tab page, and is used for indicating to hide the application program window displayed in the first tab page of the appointed browser window; and
the window display module is used for displaying the application program window through the local specified service process according to a display instruction from the Web client; and the display instruction is sent when the Web client monitors that the browser window is switched from the second tab page to the first tab page, and is used for indicating the hidden application program window to be displayed in the first tab page of the specified browser window.
A third aspect of the invention provides an electronic device comprising a processor and a memory; the memory stores a program that can be called by the processor; wherein, when the processor executes the program, the method for associating the application program with the browser is implemented as in any one of the foregoing embodiments.
A fourth aspect of the present invention provides a machine readable storage medium having stored thereon a program which, when executed by a processor, implements a method of browser-associated application program as described in any one of the preceding embodiments.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
the application program window is associated in the browser window through the local specified service process, and the application program window can be presented on the browser window, however, when the data service is carried out, the data service of the application program window is independent of the Web client, and the data loaded into the application program window is not required to be realized through an interface of the Web client, so that the data service of the application program is not influenced by the performance of the Web client, the problem of analyzing private information is avoided, and the performance of the application program when the application program is presented on the Web client is ensured.
Drawings
Fig. 1 is a flowchart illustrating a method for associating applications with a browser according to an embodiment of the present invention;
FIG. 2 is a block diagram of an apparatus for associating applications with a browser according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for associating applications with a browser according to another embodiment of the present invention;
FIG. 4 is a block diagram of an apparatus for associating applications with a browser according to another embodiment of the present invention;
fig. 5 is a block diagram of the structure of the search creating module according to an embodiment of the present invention;
FIG. 6 is a block diagram of a window association module according to an embodiment of the present invention;
fig. 7 is a block diagram illustrating a structure of a window association unit in a window association module according to an embodiment of the present invention;
FIG. 8 is a flowchart illustrating a method for associating applications with a browser according to a more specific embodiment of the present invention;
FIG. 9 is a flowchart illustrating a method for associating an application with a browser having a graphical interface according to an embodiment of the present invention;
fig. 10 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present invention. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The embodiment of the invention can solve the limitations and performance bottlenecks existing when some applications are realized by the existing Javascript technology, particularly the industrial applications such as monitoring applications and the like are not limited, so that the Web client can meet higher application requirements, the problem that the Web client needs to analyze private information does not exist, and the data service of the application program is not influenced by the performance of the Web client.
The method for associating the application program with the browser in the embodiment of the present invention may be applied to terminal devices with a browser, such as a PC (personal computer) device and a tablet device, but is not limited thereto, and may also be other terminal devices that support running of the browser to load a Web page (Web client). The operating systems on the terminal devices may be, for example, Windows systems, MAC systems, etc., and different systems may be different in call control of browser Windows, etc., and may be specifically adjusted adaptively according to actual situations.
The following describes the method for associating application programs with a browser according to an embodiment of the present invention in detail, but should not be limited thereto.
In one embodiment, referring to FIG. 1, a method of browser-associated application is shown, the method comprising the steps of:
s10: receiving a window request instruction from a Web client through the connection between a local specified service process and the Web client;
s20: searching a specified browser window where the Web client is located and creating an application program window used for being associated to the specified browser window through a local specified service process according to the window request instruction;
s30: and associating the application program window to the specified browser window through a local specified service process.
The local designated service process is a process set in the terminal device according to the embodiment of the present invention, and the local designated service process may be started on the terminal device in an installation package manner, and the above steps S10 to S30 are completed by the local designated service process. The acquisition mode of the installation package is not limited, and the installation package may be stored locally, or acquired through an external storage device, or may be downloaded and acquired on a Web client. And setting a local specified service process on the local so as to provide the service for the Web client locally.
In step S10, a window request instruction from the Web client is received through a connection between the local specified service process and the Web client.
The local browser is provided with a browser, and the browser is a container for bearing a webpage, so when the browser loads the webpage, the local browser bears a Web client, and a browser window is correspondingly opened on a local desktop. The local desktop may be the entire desktop, or a separate desktop on the desktop, or multiple associated desktops.
In order to enable the local designated service process to provide local service for the Web client, data interaction is required between the local designated service process and the Web client, so that a connection needs to be established between the local designated service process and the Web client. The process of establishing the connection may be that the Web client sends a connection request instruction by external triggering, and the local specified service process receives the connection request instruction and then connects with the Web client.
The connection established between the locally-specified service process and the Web client may be, for example, a WS connection (Websocket connection), a WSs connection (Websocket connection based on SSL secure transmission), an HTTP connection, or an HTTPs connection, so that after the connection is established between the locally-specified service process and the Web client, a plurality of request/response operations may be performed on the connection.
After the connection between the local specified service process and the Web client is successfully established, data interaction can be carried out between the Web client and the local specified service process, and a window request instruction from the Web client can be received through the connection between the local specified service process and the Web client. The Web client can generate a window request instruction under page initialization or external trigger and send the window request instruction to a local specified service process.
In step S20, according to the window request instruction, the local specified service process searches for a specified browser window where the Web client is located, and creates an application window for associating with the specified browser window.
And after receiving the window request instruction, the local specified service process searches a specified browser window where the Web client is located locally according to the window request instruction. The searching mode can traverse all windows on the desktop, for example, when only one browser window is provided, the browser window can be found only by distinguishing the browser window from the self characteristics of other windows when the browser window is traversed; when there is more than one browser window, the matching browser window can be found by other features, which is described in detail in the following embodiments.
The local appointed service process also can create a needed application program window according to the window request instruction, the application program window can be blank or customized, when in customization, corresponding customization parameters can be set in the local appointed service process or the window request instruction, so that the corresponding application program window is created when the window request instruction is received, and the application program window is subsequently used for being associated to the searched appointed browser window.
The number of application windows is not limited and can be set as desired. When the number of the application windows is multiple, the relationship between the application windows may also be set in a locally specified service process or in a window request instruction, for example, stacking, expanding, misplacing, and the like, and the relationship between the application windows may be fixed or active, for example, the first application window may be switched from being located above the second application window to being located below the second application window.
And (4) specifying the search of the browser window and the creation of the application program window, wherein the sequence of the search and the creation of the application program window is not limited. Step S30 may be performed after the specified browser window is found and the application window is established.
In step S30, the application window is associated to the specified browser window by a local specified service process.
The application window created in step S20 is associated with the found specified browser window by the local specified service process, for example, the application window is set in the browser window and is always located in the browser window. The application program window is used as an application client side and is connected with the application server to realize interaction so as to load application data, the application program window is independent of the Web client side in data service, and the mode of the application program window for running the application data is also the mode of the application program window as the running mode of the application client side, so that the performance of the application program window is not limited by the constraint of the Web client side.
The application program window is associated in the browser window through the local specified service process, and the application program window can be presented on the browser window, however, when the data service is carried out, the data service of the application program window is independent of the Web client, and the data loaded into the application program window is not required to be realized through an interface of the Web client, so that the data service of the application program is not influenced by the performance of the Web client, the problem of analyzing private information is avoided, and the performance of the application program when the application program is presented on the Web client is ensured.
In one embodiment, the above method flow can be executed by the device 1 for browser-associated application, as shown in fig. 2, the device 1 for browser-associated application mainly includes 3 modules: an instruction receiving module 10, a lookup creation module 20, and a window association module 30. The command receiving module 10 is configured to perform the step S10, the search creating module 20 is configured to perform the step S20, and the window associating module 30 is configured to perform the step S30.
In one embodiment, referring to fig. 3, a method for associating applications with a browser, based on steps S10 to S30, may further include:
step S40: and triggering the application program window to establish connection with an application server through a local specified service process according to an application request instruction from the Web client, so that the application server provides data service for the application program window through the connection with the application program window.
Steps S10 to S30 are performed to associate the designated browser window with the application window, and the application window is already presented on the designated browser window, but in practice, the application is usually run, and thus application data needs to be loaded in the application window.
After the application is associated with the browser window, for the loading of subsequent application data, the Web client can send an application request instruction to the local specified service process, and the local specified service process can trigger the application program window to establish connection with the application server after receiving the application request instruction.
Of course, the application window itself may also be provided with an input component for triggering the application window to establish a connection with the application server, for example, the input component may be a button, and the external click button may click and trigger the application window to connect with the application server.
After the application program window is connected with the application server, the application server can provide application data for the application program window. The application window acts as an application client requesting data from the application server. The application window may be triggered to request data by an input means on the application window, or the application window may be triggered to request data by a locally specified service process, or the application window may automatically request data after connection. An application server refers to a server that can provide application data, such as, but not limited to, video data, audio data, text data, and the like.
In step S40, after receiving the application request instruction, the local specification service process may request the application data through the connection between the application window and the application server, and the application server may send the application data to the application window in response to the request without interaction with the Web client. Thus, the ability of the application window to load and run application data is not limited by the Web client.
Referring to fig. 4, the apparatus 1 for browser-associated application program may further include an application connection module 40 for executing the above step S40.
In one embodiment, the step of searching, by the local specified service process according to the window request instruction, the specified browser window where the Web client is located in step S20 includes the following steps:
s21: analyzing the specified identification carried by the window request instruction through a local specified service process;
s22: and traversing the local window through a local specified service process to find the browser window with the title at least comprising the specified identification, and determining the found browser window as the specified browser window.
In step S21, after receiving the window request instruction, the local specified service process may parse the specified identifier carried in the window request instruction.
Since there are more than one type of browser, such as IE browser, firefox browser, UC browser, 360 browser, etc., and these browsers can be opened at the same time and may switch to work on the same device, when there is more than one browser window on the desktop, it is necessary to identify each browser window by a specified identifier to perform a searchable specified browser window and operate on the specified browser window in a locally specified service process, otherwise the locally specified service process may not be able to determine which is the specified browser window.
After the connection between the local designated service process and the Web client is successfully established, the local designated service process can return a designated identifier to the Web client, so that the Web client modifies the title of the browser window by using the designated identifier, and the designated identifier is carried in subsequent instructions of interaction between the Web client and the local designated service process. The title of the browser window is the title bar name of the browser window. Through the interaction of the local designated service process and the Web client, the two can achieve the consensus on the same target browser window.
The specified identification is globally unique in all local windows, after receiving the instruction of the Web client, the local specified service process can analyze the specified identification from the instruction, and can uniquely find out the matched browser window according to the specified identification so as to perform subsequent operation on the browser window. The specific identifier can be preset in the local and can be distributed through a local specific service process during operation.
When modifying the title of the browser window, the Web client may completely replace the title with the designated identifier, may replace a part of the title with the designated identifier, or may add the designated identifier to the title, which is not limited specifically, as long as the title of the browser window may be unique.
Then, step S22 is executed, the local window is traversed by the local specified service process to find the browser window whose title at least includes the specified identifier, and the found browser window is determined as the specified browser window.
After the designated identifier of the window request instruction of the Web client is analyzed, the local designated service process can find the designated browser window with the name containing the designated identifier according to the designated identifier to perform subsequent operation, so that the problem of finding a wrong window due to instruction cross interaction when more than one browser windows work together is avoided.
After finding the designated browser window, the local designated service process may obtain a handle of the browser window, where the handle may implement an operation on the browser window, and the handle is an identifier of the browser window in the system, and may call and operate the corresponding browser window through the handle, so that in step S30, the handle is used to implement an associated operation on the designated browser window.
In one embodiment, as shown in fig. 5, the lookup creating module 20 includes an identification parsing unit 21 and a window lookup unit 22, and step S21 may be performed by the identification parsing unit 21, and step S22 may be performed by the window lookup unit 22.
In one embodiment, the associating the application window to the specified browser window by the local specified service process in step S30 includes the following steps:
s31: calling the appointed browser window by using the handle of the appointed browser window;
s32: and associating the application program window to the specified browser window called by the handle through a local specified service process.
After finding the designated browser window, the local designated service process may obtain the handle of the browser window, and in step S31, the handle may be used to call the corresponding designated browser window, and the location parameter, the call function, and the like of the designated browser window may be called without limitation.
In step S32, the application window is associated with the designated browser window called by the handle through the local designated service process, and each calling function of the corresponding designated browser window is called by the handle of the designated browser window, so that the designated browser window can be operated as needed. For example, if the association is to establish the relationship between parent and child windows, the setparent function of the specified browser window may be called.
In one embodiment, as shown in FIG. 6, the window associating module 30 includes a handle calling unit 31 and a window associating unit 32, and the step S31 may be performed by the handle calling unit 31 and the step S32 may be performed by the window associating unit 32.
Further, in step S32, the associating the application window with the specified browser window called by the handle through a local specified service process includes the following steps:
s321: analyzing the embedded parameters which are carried by the window request instruction and used for identifying whether embedding is allowed or not through a local specified service process;
s322: judging whether the appointed browser window supports embedding or not through a local appointed service process according to the embedding parameters;
s323: if so, establishing a parent-child relationship between the specified browser window called by the handle and an application program window through the local specified service process, and taking the application program window as an embedded child window of the specified browser window;
s324: if not, starting a position tracking timer through the local specified service process, setting the application program window at the specified position of the specified browser window called by the handle, and setting the application program window to automatically follow the specified browser window.
In step S321, the embedded parameter in the window request instruction can be parsed out by the local specified service process. The embedded parameter may be set in a fixed field of the window request instruction so that the embedded parameter is available only by reading data in the fixed field. The embedding parameter may be generated by the Web client parsing the browser type and written into the window request instruction, so that the embedding parameter identifies whether the current browser window supports embedding.
Then, step S322 is executed, and whether the specified browser window supports embedding is determined by the local specified service process according to the embedding parameter. Since the embedding parameter can indicate whether embedding is supported, only the embedding parameter needs to be judged to obtain a corresponding indication result.
Step S323 is a case that the specified browser window supports embedding, and the parent-child relationship between the specified browser window called by the handle and the application window is established by the local specified service process, and the application window is used as an embedded child window of the specified browser window. The setparent function of the specified browser window may be invoked with the handle of the specified browser window to establish a parent-child relationship between the specified browser window and the application window.
Step S324 is a case that the designated browser window does not support embedding, a location tracking timer is started through the local designated service process, the application program window is set at the designated location of the designated browser window called by the handle, and the application program window is set to automatically follow the designated browser window. It is achieved that the application window is at a specified position in the browser window no matter how the browser window moves.
Because of different operating systems and different browsers, the application program window can not be normally embedded in the individual browser, so the invention is further improved, and when the embedding is supported, an embedding mode is adopted; and when the browser window cannot be embedded, starting a position tracking timer in a local specified service process by adopting a following mode, and automatically adjusting the position of the application program window when the position of the browser window is changed.
In one embodiment, as shown in fig. 7, the window associating unit 32 includes a parameter parsing subunit 321, a parameter judging subunit 322, an embedded mode subunit 323, and a following mode subunit 324, and step S321 may be performed by the parameter parsing subunit 321, step S322 may be performed by the parameter judging subunit 322, step S324 may be performed by the embedded mode subunit 323, and step S324 may be performed by the following mode subunit 324.
Further, the window request instruction also carries a location parameter of the application program window. In step S30, the application window is associated with the specified position of the specified browser window according to the position parameter by the local specified service process.
The position parameter may include a start point position coordinate and a size of the application program window, and of course, the position parameter may also be other parameters, such as the start point position coordinate and the end point position coordinate, and it is not limited to the specific parameters as long as it can determine a specific position of the application program window in the browser window.
In the embedded mode: embedding the application program window in the browser window at the position determined by the position parameter in the window request instruction.
In the following mode: and setting the application program window in the browser window at the position determined by the position parameter in the window request instruction, and setting the application program window to automatically follow the browser window. The application program window can be arranged at a designated position in the browser window through the indication of the position parameter, and the application program window can automatically follow after the tracking timer is started, so that the position of the application program window in the browser window cannot be changed along with the movement of the browser window.
In one embodiment, the designated browser window comprises at least a first tab page and a second tab page that are switchable, and the application window is embedded in the first tab page of the designated browser window;
the method for associating the application program with the browser further comprises the following steps:
s51: hiding the application program window through the local specified service process according to a hiding instruction from the Web client; the hiding instruction is sent when the Web client monitors that the appointed browser window is switched from the first tab page to the second tab page, and is used for indicating to hide the application program window displayed in the first tab page of the appointed browser window; and
s52: displaying the application program window through the local specified service process according to a display instruction from the Web client; and the display instruction is sent when the Web client monitors that the browser window is switched from the second tab page to the first tab page, and is used for indicating the hidden application program window to be displayed in the first tab page of the specified browser window.
Because more browser windows can support multiple tab pages, the browser windows share one browser window, and when tab page switching occurs, the tab page where the application program window is located is not displayed in the browser window any more, so that the application program window can be hidden at the moment, the application program window is prevented from entering other tab pages, and when the tab page where the application program window is located is switched back, the application program window can be displayed in the browser window again.
The Web client can monitor events occurring on a browser window, if the switching of a label page is monitored, a hiding instruction or a display instruction is issued, when the designated browser window is switched from a first label page to a second label page, the Web client sends the hiding instruction to a local designated service process, the local designated service process hides an application program window, when the designated browser window is switched back from the second label page to the first label page, the Web client sends the display instruction to the local designated service process, the local designated service process displays the application program window in the designated browser window, and the display position and size can be unchanged.
Certainly, the designated browser window may further include other switchable tab pages, and the relationship and processing manner between the other tab pages and the first tab page are the same as those between the second tab page and the first tab page, and are not described herein again.
Referring to fig. 8, after the connection between the Web client and the local specified service process (which may be a WS/WSs connection or an HTTP/HTTPs connection) is established successfully, the local specified service process returns a specified identifier to the Web client, and the specified identifier is carried in subsequent protocol instruction interaction between the Web client and the local specified service process. A Web client sends a window request instruction (which can include the position and size of a preview window) for creating the preview window to a local process, the Web client modifies the title of a browser window into an appointed identification before sending the instruction, after the local appointed service process receives the window request instruction, all windows of a desktop are traversed, the appointed identification is used as a window name, a browser window where the Web client is located is matched, a handle of the browser window is obtained at the same time, the local appointed service process creates the preview window according to the window request instruction, whether the browser window supports embedding is judged according to an embedding parameter carried by the window request instruction, if yes, the preview window is set as a sub-window of the browser window, so that the embedding effect is achieved, and the subsequent preview window moves along with the browser window; if not, setting the position of the preview window in the browser window according to the position parameter in the window request instruction, and starting a position tracking timer for tracking.
Described below in a more specific embodiment with a graphical interface, with reference to fig. 9, where the Web client is loaded in a browser for display in tab1, the following interactions between the Web client and the locally specified service processes occur:
1) establishing connection between a Web client and a local appointed service process, and returning the local appointed service process to the Web client by an appointed identifier UUID;
2) the Web client sets the title bar name of a browser window where the Web client is located by using the specified identifier UUID: title ═ UUID;
3) the Web client then sends a window request instruction to the local specified service process, which may include: specifying identification, coordinates (x, y), a position (width), and an embedding parameter;
4) and traversing the window of the desktop by the local appointed service process according to the appointed mark of the window request instruction, comparing the title of the window with the appointed mark, finding out a matched browser window, and embedding or following the window on the browser according to the embedding parameters, the coordinates (x, y) and the position (width, height) after the application program window is established. The application window is embedded in tab1 of the browser window or is located in tab1 and follows the browser window.
The present invention also provides a device for associating application programs with a browser, and in one embodiment, referring to fig. 2, the device 1 includes:
the instruction receiving module 10 is configured to receive a window request instruction from a Web client through a connection between a local specified service process and the Web client;
a search creation module 20, configured to search, by a local specified service process according to the window request instruction, a specified browser window where the Web client is located, and create an application window for associating with the specified browser window;
a window associating module 30, configured to associate the application window with the specified browser window through a local specified service process.
In one embodiment, referring to fig. 4, following the window association module 30, the apparatus 1 further comprises:
and the application connection module 40 is configured to trigger the application program window to establish connection with an application server through a local specified service process according to an application request instruction from the Web client, so that the application server provides data service for the application program window through connection with the application program window.
In one embodiment, referring to fig. 5, the lookup creation module 20 includes:
the identifier analyzing unit 21 is configured to analyze the specified identifier carried by the window request instruction through a local specified service process;
and the window searching unit 22 is configured to traverse the local window through the local specified service process to search the browser window whose title at least includes the specified identifier, and determine the searched browser window as the specified browser window.
In one embodiment, referring to fig. 6, the window association module 30 includes:
a handle calling unit 31, configured to call the specified browser window by using the handle of the specified browser window;
a window associating unit 32, configured to associate the application window with the specified browser window called by the handle through a local specified service process.
In one embodiment, referring to fig. 7, the window associating unit 32 includes:
a parameter analyzing subunit 321, configured to analyze, through a local specified service process, the embedded parameter carried by the window request instruction;
a parameter judgment subunit 322, configured to judge, by a local specified service process, whether the embedding parameter indicates that embedding is allowed;
an embedded mode sub-unit 323, configured to establish, if yes, a parent-child relationship between the specified browser window called by the handle and an application window through the local specified service process, and use the application window as an embedded sub-window of the specified browser window;
and a following mode subunit 324, configured to, if not, start a location tracking timer through the local specified service process, set the application window at a specified location of the specified browser window called by the handle, and set that the application window automatically follows the specified browser window.
In one embodiment, the designated browser window comprises at least a first tab page and a second tab page that are switchable, and the application window is associated in the first tab page of the designated browser window;
the device 1 further comprises:
the window hiding module is used for hiding the application program window through the local specified service process according to a hiding instruction from the Web client; the hiding instruction is sent when the Web client monitors that the appointed browser window is switched from the first tab page to the second tab page, and is used for indicating to hide the application program window displayed in the first tab page of the appointed browser window; and
the window display module is used for displaying the application program window through the local specified service process according to a display instruction from the Web client; and the display instruction is sent when the Web client monitors that the browser window is switched from the second tab page to the first tab page, and is used for indicating the hidden application program window to be displayed in the first tab page of the specified browser window.
The implementation processes of the functions and actions of each module and unit in the above device are specifically described in the implementation processes of the corresponding steps in the above method, and are not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts shown as units may or may not be physical units.
The invention also provides an electronic device, which comprises a processor and a memory; the memory stores a program that can be called by the processor; wherein, when the processor executes the program, the method for associating the application program with the browser is implemented as in any one of the foregoing embodiments.
The embodiment of the device for associating the browser with the application program can be applied to electronic equipment. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. From a hardware aspect, as shown in fig. 10, fig. 10 is a hardware structure diagram of an electronic device where an image processing apparatus 1 is located according to an exemplary embodiment of the present invention, and besides the processor 510, the memory 530, the interface 520, and the nonvolatile memory 540 shown in fig. 10, the electronic device where the apparatus 1 is located in the embodiment may also include other hardware according to an actual function of the electronic device, which is not described again.
The present invention also provides a machine readable storage medium, on which a program is stored, which when executed by a processor, implements a method of browser-associated application program as described in any of the preceding embodiments.
The present invention may take the form of a computer program product embodied on one or more storage media including, but not limited to, disk storage, CD-ROM, optical storage, and the like, having program code embodied therein. Machine-readable storage media include both permanent and non-permanent, removable and non-removable media, and the storage of information may be accomplished by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of machine-readable storage media include, but are not limited to: phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technologies, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium, may be used to store information that may be accessed by a computing device.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (14)

1. A method for associating an application program with a browser, the method comprising:
receiving a window request instruction from a Web client through the connection between a local specified service process and the Web client;
searching a specified browser window where the Web client is located and creating an application program window used for being associated to the specified browser window through a local specified service process according to the window request instruction;
and associating the application program window to the specified browser window through a local specified service process.
2. The method for browser-associated application program of claim 1, wherein associating the application program window to the designated browser window by a local designated service process further comprises:
and triggering the application program window to establish connection with an application server through a local specified service process according to an application request instruction from the Web client, so that the application server provides data service for the application program window through the connection with the application program window.
3. The method for associating an application program with a browser according to claim 1, wherein the step of searching for the specified browser window where the Web client is located according to the window request instruction through a local specified service process comprises:
analyzing the specified identification carried by the window request instruction through a local specified service process;
and traversing the local window through a local specified service process to find the browser window with the title at least comprising the specified identification, and determining the found browser window as the specified browser window.
4. The browser-associated application method of claim 1, wherein said associating the application window to the specified browser window by a local specified service process comprises:
calling the appointed browser window by using the handle of the appointed browser window;
and associating the application program window to the specified browser window called by the handle through a local specified service process.
5. The browser-associated application method of claim 4, wherein associating the application window to the specified browser window of the handle call by a local specified service process comprises:
analyzing the embedded parameters carried by the window request instruction through a local specified service process;
judging whether the embedding parameters indicate that embedding is allowed or not through a local specified service process;
if so, establishing a parent-child relationship between the specified browser window called by the handle and an application program window through the local specified service process, and taking the application program window as an embedded child window of the specified browser window;
if not, starting a position tracking timer through the local specified service process, setting the application program window at the specified position of the specified browser window called by the handle, and setting the application program window to automatically follow the specified browser window.
6. The browser-associated application method of claim 1, wherein the designated browser window includes at least a first tab page and a second tab page that are switchable, the application window being associated in the first tab page of the designated browser window;
the method further comprises the following steps:
hiding the application program window through the local specified service process according to a hiding instruction from the Web client; the hiding instruction is sent when the Web client monitors that the appointed browser window is switched from the first tab page to the second tab page, and is used for indicating to hide the application program window displayed in the first tab page of the appointed browser window; and
displaying the application program window through the local specified service process according to a display instruction from the Web client; and the display instruction is sent when the Web client monitors that the browser window is switched from the second tab page to the first tab page, and is used for indicating the hidden application program window to be displayed in the first tab page of the specified browser window.
7. An apparatus for associating an application with a browser, the apparatus comprising:
the instruction receiving module is used for receiving a window request instruction from the Web client through the connection between the local specified service process and the Web client;
the search creation module is used for searching a specified browser window where the Web client is located through a local specified service process according to the window request instruction and creating an application program window which is used for being associated to the specified browser window;
and the window association module is used for associating the application program window to the specified browser window through a local specified service process.
8. The browser-associated application program apparatus of claim 7, wherein the window association module is followed by further comprising:
and the application connection module is used for triggering the application program window to establish connection with an application server through a local specified service process according to an application request instruction from the Web client, so that the application server provides data service for the application program window through the connection with the application program window.
9. The browser-associated application apparatus of claim 7, wherein the lookup creation module comprises:
the identification analyzing unit is used for analyzing the specified identification carried by the window request instruction through a local specified service process;
and the window searching unit is used for traversing the local window through a local specified service process to search the browser window with the title at least comprising the specified identification, and determining the searched browser window as the specified browser window.
10. The browser-associated application program apparatus of claim 7, wherein the window association module comprises:
the handle calling unit is used for calling the specified browser window by using the handle of the specified browser window;
and the window association unit is used for associating the application program window to the specified browser window called by the handle through a local specified service process.
11. The apparatus for browser-associated application according to claim 10, wherein the window associating unit comprises:
the parameter analysis subunit is used for analyzing the embedded parameters carried by the window request instruction through a local specified service process;
the parameter judgment subunit is used for judging whether the embedding parameter indicates that the embedding is allowed or not through a local specified service process;
the embedded mode sub-unit is used for establishing a parent-child relationship between the specified browser window called by the handle and an application program window through the local specified service process if the specified browser window is the embedded child window of the specified browser window, and taking the application program window as the embedded child window of the specified browser window;
and the following mode subunit is used for starting a position tracking timer through the local specified service process if the position tracking timer is not started, setting the application program window at the specified position of the specified browser window called by the handle, and setting the application program window to automatically follow the specified browser window.
12. The browser-associated application apparatus of claim 7, wherein the designated browser window includes at least a first tab page and a second tab page that are switchable, the application window being associated in the first tab page of the designated browser window;
the device also includes:
the window hiding module is used for hiding the application program window through the local specified service process according to a hiding instruction from the Web client; the hiding instruction is sent when the Web client monitors that the appointed browser window is switched from the first tab page to the second tab page, and is used for indicating to hide the application program window displayed in the first tab page of the appointed browser window; and
the window display module is used for displaying the application program window through the local specified service process according to a display instruction from the Web client; and the display instruction is sent when the Web client monitors that the browser window is switched from the second tab page to the first tab page, and is used for indicating the hidden application program window to be displayed in the first tab page of the specified browser window.
13. An electronic device comprising a processor and a memory; the memory stores a program that can be called by the processor; wherein the processor, when executing the program, implements a method of a browser-associated application program as claimed in any one of claims 1 to 6.
14. A machine readable storage medium, having stored thereon a program which, when executed by a processor, carries out a method of browser-associated application according to any one of claims 1 to 6.
CN201810651499.0A 2018-06-22 2018-06-22 Method and device for associating application program with browser, electronic equipment and storage medium Active CN110633156B (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN201810651499.0A CN110633156B (en) 2018-06-22 2018-06-22 Method and device for associating application program with browser, electronic equipment and storage medium
EP19821564.2A EP3671449A4 (en) 2018-06-22 2019-05-15 Application association for browser
PCT/CN2019/087078 WO2019242435A1 (en) 2018-06-22 2019-05-15 Application association for browser
US16/652,656 US11262883B2 (en) 2018-06-22 2019-05-15 Associating browser with application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810651499.0A CN110633156B (en) 2018-06-22 2018-06-22 Method and device for associating application program with browser, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110633156A true CN110633156A (en) 2019-12-31
CN110633156B CN110633156B (en) 2022-03-25

Family

ID=68967232

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810651499.0A Active CN110633156B (en) 2018-06-22 2018-06-22 Method and device for associating application program with browser, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110633156B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111309408A (en) * 2020-02-24 2020-06-19 深圳震有科技股份有限公司 Program embedding method, system and storage medium
CN111580878A (en) * 2020-04-29 2020-08-25 浙江大华技术股份有限公司 Method, device, equipment and medium for realizing linkage of page and client application
CN111880946A (en) * 2020-07-14 2020-11-03 杭州海康威视数字技术股份有限公司 Local service providing method, device and equipment and storage medium
CN113055747A (en) * 2021-03-29 2021-06-29 重庆锐明信息技术有限公司 Cross-browser integration system based on video client
CN113986447A (en) * 2021-12-24 2022-01-28 畅捷通信息技术股份有限公司 Interaction method and device of local application service and browser and storage medium
CN115175002A (en) * 2022-06-28 2022-10-11 青岛海信移动通信技术股份有限公司 Video playing method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6370552B1 (en) * 1997-05-14 2002-04-09 Citrix Systems, Inc. Apparatus and method for displaying application output in an HTML document
US20100313116A1 (en) * 2009-06-05 2010-12-09 Michael Hyman Microsite Delivery
CN103064738A (en) * 2013-01-15 2013-04-24 珠海金山办公软件有限公司 Method and system for embedding local application program window into browser in Linux
CN103150312A (en) * 2011-12-23 2013-06-12 腾讯科技(深圳)有限公司 Method and terminal for opening external link in network application
US20140317537A1 (en) * 2011-12-22 2014-10-23 Tencent Technology (Shenzhen) Company Limited Browser based application program extension method and device
CN104239063A (en) * 2014-09-23 2014-12-24 福建星网视易信息系统有限公司 Web browser and method for calling local application program through web browser
US20170054793A1 (en) * 2004-06-24 2017-02-23 Julian M. Urbach Virtual application execution system and method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6370552B1 (en) * 1997-05-14 2002-04-09 Citrix Systems, Inc. Apparatus and method for displaying application output in an HTML document
US20170054793A1 (en) * 2004-06-24 2017-02-23 Julian M. Urbach Virtual application execution system and method
US20100313116A1 (en) * 2009-06-05 2010-12-09 Michael Hyman Microsite Delivery
US20140317537A1 (en) * 2011-12-22 2014-10-23 Tencent Technology (Shenzhen) Company Limited Browser based application program extension method and device
CN103150312A (en) * 2011-12-23 2013-06-12 腾讯科技(深圳)有限公司 Method and terminal for opening external link in network application
CN103064738A (en) * 2013-01-15 2013-04-24 珠海金山办公软件有限公司 Method and system for embedding local application program window into browser in Linux
CN104239063A (en) * 2014-09-23 2014-12-24 福建星网视易信息系统有限公司 Web browser and method for calling local application program through web browser

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111309408A (en) * 2020-02-24 2020-06-19 深圳震有科技股份有限公司 Program embedding method, system and storage medium
CN111580878A (en) * 2020-04-29 2020-08-25 浙江大华技术股份有限公司 Method, device, equipment and medium for realizing linkage of page and client application
CN111880946A (en) * 2020-07-14 2020-11-03 杭州海康威视数字技术股份有限公司 Local service providing method, device and equipment and storage medium
WO2022012586A1 (en) * 2020-07-14 2022-01-20 杭州海康威视数字技术股份有限公司 Local service provision method and apparatus, device, and storage medium
CN111880946B (en) * 2020-07-14 2024-04-19 杭州海康威视数字技术股份有限公司 Local service providing method, device and equipment and storage medium
CN113055747A (en) * 2021-03-29 2021-06-29 重庆锐明信息技术有限公司 Cross-browser integration system based on video client
CN113986447A (en) * 2021-12-24 2022-01-28 畅捷通信息技术股份有限公司 Interaction method and device of local application service and browser and storage medium
CN113986447B (en) * 2021-12-24 2022-03-29 畅捷通信息技术股份有限公司 Interaction method and device of local application service and browser and storage medium
CN115175002A (en) * 2022-06-28 2022-10-11 青岛海信移动通信技术股份有限公司 Video playing method and device
CN115175002B (en) * 2022-06-28 2023-11-03 青岛海信移动通信技术有限公司 Video playing method and device

Also Published As

Publication number Publication date
CN110633156B (en) 2022-03-25

Similar Documents

Publication Publication Date Title
CN110633156B (en) Method and device for associating application program with browser, electronic equipment and storage medium
CN108153551B (en) Method and device for displaying business process page
US11262883B2 (en) Associating browser with application
CN110209966B (en) Webpage refreshing method, webpage system and electronic equipment
JP6404816B2 (en) Method and apparatus for responding to web page access request
US20090193363A1 (en) Representing Multiple Computing Resources Within A Predefined Region Of A Graphical User Interface For Displaying A Single Icon
WO2014194654A1 (en) Method and apparatus for page view switching
US9880861B2 (en) Method and apparatus for page view switching
US9503551B2 (en) Hybrid native networked applications
CN112579948A (en) Webpage screenshot method and device, storage medium and electronic equipment
US10541854B2 (en) Component loading based on user interactions
US20130081010A1 (en) Template and server content download using protocol handlers
CN114329281A (en) Rendering server, webpage rendering method and webpage rendering device
US11570280B2 (en) Systems and methods for rendering interactive web pages
CN113076501A (en) Page processing method, storage medium and equipment
US10095791B2 (en) Information search method and apparatus
CN110708270B (en) Abnormal link detection method and device
CN107436841B (en) Page preview method and device
CN111381745A (en) Page switching method, device and equipment
US9134930B2 (en) Delayed content production
CN112579221A (en) Modal popup display method and device
TW201640375A (en) Display of server capabilities
CN111104623A (en) Webpage data caching method, device, server and storage medium
CN107092485B (en) Tab label dynamic updating method and device
JP2007157003A (en) Web page browsing path analysis method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant