CN112243039B - Remote access method, device, equipment and computer readable medium of chrome browser - Google Patents

Remote access method, device, equipment and computer readable medium of chrome browser Download PDF

Info

Publication number
CN112243039B
CN112243039B CN202011414075.6A CN202011414075A CN112243039B CN 112243039 B CN112243039 B CN 112243039B CN 202011414075 A CN202011414075 A CN 202011414075A CN 112243039 B CN112243039 B CN 112243039B
Authority
CN
China
Prior art keywords
target
server
browser
information
request
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
CN202011414075.6A
Other languages
Chinese (zh)
Other versions
CN112243039A (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.)
Shenzhen Fangduoduo Network Technologies Co ltd
Original Assignee
Shenzhen Fangduoduo Network Technologies 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 Shenzhen Fangduoduo Network Technologies Co ltd filed Critical Shenzhen Fangduoduo Network Technologies Co ltd
Priority to CN202011414075.6A priority Critical patent/CN112243039B/en
Publication of CN112243039A publication Critical patent/CN112243039A/en
Application granted granted Critical
Publication of CN112243039B publication Critical patent/CN112243039B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention relates to the technical field of communication, and discloses a method, a device, equipment and a computer readable medium for remotely accessing a Chromium browser, wherein the method comprises the following steps: receiving chrome service request information sent by a target application layer through a load server; determining a target node server through a load server and sending the marginal service request information to the target node server; acquiring a local IP address and local port information of a host provided with a target browser and corresponding to a target node server; and generating a target service request according to the local IP address, the local port information and the chromosome service request information through the target node server, and sending the target service request to the target browser. Target service information corresponding to a target service request returned by a target browser is obtained through a target node server and is sent to a load server; and sending the target service information to a target application layer through the load server. Through the mode, the embodiment of the invention improves the remote access efficiency of the Chromium browser.

Description

Remote access method, device, equipment and computer readable medium of chrome browser
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method, a device, equipment and a computer readable medium for remotely accessing a Chromium browser.
Background
A chromosome header browser in a chromosome browser is a powerful browser without a user interface, and can provide a chromosome service, which includes a plurality of debugging functions and is often used to execute various requests initiated by an application layer, such as crawlers, screenshot services, and automated testing. In the prior art, application layers with different demand types need to be installed and compiled together with a chrome browser respectively, so that services of the chrome browser can be called on the application layer with the specific type. Thus, each time a new function needs to be implemented, a chrome browser needs to be installed on the application layer with the corresponding function, but because the volume of the data packet of the application layer is large, the time cost and the computing resource cost for recompiling the application layer after installing the chrome browser each time are large. This results in inefficient access to the chrome browser by the application layer in the prior art.
Disclosure of Invention
In view of the foregoing problems, embodiments of the present invention provide a method, an apparatus, a device, and a storage medium for remote access to a chrome browser, which are used to solve the problem in the prior art that the efficiency is low when accessing the chrome browser.
According to an aspect of an embodiment of the present invention, there is provided a method for remotely accessing a chrome browser, the method including:
the method is based on an access device, the access device comprises a load server and a plurality of node servers, the load server establishes communication connection with each node server, each node server is arranged on a host and establishes communication connection with a chrome browser on the host, and the method comprises the following steps:
receiving, by the load server, chrome service request information sent by a target application layer;
determining a node server from the plurality of node servers as a target node server through the load server, and sending the chromosome service request information to the target node server;
determining a marginal browser on a host corresponding to the target node server as a target browser, and acquiring a local IP address and local port information of the host corresponding to the target browser;
generating a target service request according to the local IP address, the local port information and the chromosome service request information by the target node server;
sending the target service request to the target browser through the target node server so that the target browser can verify the target service request;
when the verification is passed, obtaining target service information corresponding to the target service request returned by the target browser through the target node server, and sending the target service information to the load server through the target node server;
and sending the target service information to the target application layer through the load server so that the target application layer accesses the target browser according to the target service information.
In a selectable manner, the pending service request information includes communication protocol information, the target service request includes a request header information, and the request header information includes request server port information and a request server IP address, and the method further includes:
setting the request server port information as the local port information and the request server IP address as the local IP address by the target node server;
and generating the target service request according to the communication protocol information and the Host request header information by the target node server.
In an optional manner, the method further comprises:
respectively acquiring service port information of each node server;
and configuring the load server according to the service port information so as to enable the load server to establish communication connection with each node server respectively.
In an optional manner, the method further comprises:
installing one node server on a host corresponding to each Chromium browser;
and respectively configuring each node server so that each node server respectively establishes communication connection with the chrome browser on the corresponding host.
In an optional manner, the method further comprises:
and determining the target node server through the load server according to a preset load balancing strategy.
In an optional manner, the target service information includes a target access link, and the target access link is used to provide a target access interface, and the method further includes:
obtaining the operation request information sent by the target application layer on the target access interface,
determining a target operation request according to the operation request information, the local IP address and the local port information;
sending the target operation request to the target browser through the target node server so that the target browser can verify the target operation request;
and when the verification is passed, executing the target operation request through the target browser.
According to another aspect of the embodiments of the present invention, there is provided a remote access apparatus for a chrome browser, including:
the receiving module is used for receiving the chroma service request information sent by the target application layer through the load server;
a first sending module, configured to determine a target node server from the multiple node servers, and send the pending service request message to the target node server;
an obtaining module, configured to determine a premium browser on a host corresponding to the target node server as a target browser, and obtain a local IP address and local port information of the host corresponding to the target browser;
the determining module is used for generating a target service request according to the local IP address, the local port information and the chromosome service request information through the target node server;
a second sending module, configured to send the target service request to the target browser through the target node server, so that the target browser verifies the target service request;
a third sending module, configured to, when the verification passes, obtain, by the target node server, target service information corresponding to the target service request returned by the target browser, and send the target service information to the load server;
a fourth sending module, configured to forward the target service information to the target application layer through the load server, so that the target application layer accesses the target browser according to the target service information.
In an optional manner, the determining module further includes:
the setting module is used for determining the local port information as the request server port information and determining the local IP address as the request server IP address;
and the generating module is used for determining the target service request according to the communication protocol information and Host request header information, wherein the Host request header information comprises the port information of the request server and the IP address of the request server.
According to another aspect of the embodiments of the present invention, there is provided a remote access device for a chrome browser, the device including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operations of the remote access method of the Chromium browser in any one of the embodiments.
According to another aspect of the embodiments of the present invention, there is provided a computer-readable storage medium having at least one executable instruction stored therein, which when run on a remote access device of a chrome browser, causes the remote access device of the chrome browser to perform the operations of the remote access method of the chrome browser as in any one of the embodiments.
In the embodiment of the invention, the load server receives the chromosome service request information sent by the target application layer, and then the load server forwards the chromosome service request information to the target node server in a plurality of node servers connected with the load server. And establishing communication connection with a target chromosome browser on a corresponding host through the target node server, so that the target node server generates a target service request according to local port information, a local IP address and chromosome service request information of the target chromosome browser and sends the target service request to the target chromosome browser for verification. And when the verification is carried out, the target service information returned by the target Chromium browser is acquired and sent to the target application layer, so that the target application layer can access the target Chromium browser through the target service information.
The invention transmits and proxies the service request of the chromosome browser through the load server and the node server, the target application layer does not need to install the chromosome browser, and only needs to establish communication with the load server and the node server, thereby decoupling the chromosome browser from the application layer, realizing cluster access of the chromosome browser, and improving the remote access efficiency of the chromosome browser.
The foregoing description is only an overview of the technical solutions of the embodiments of the present invention, and the embodiments of the present invention can be implemented according to the content of the description in order to make the technical means of the embodiments of the present invention more clearly understood, and the detailed description of the present invention is provided below in order to make the foregoing and other objects, features, and advantages of the embodiments of the present invention more clearly understandable.
Drawings
The drawings are only for purposes of illustrating embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating a remote access method for a chrome browser according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a remote access device of a chrome browser according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a remote access device of a chrome browser according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Fig. 1 is a flowchart illustrating a remote access method for a chrome browser according to an embodiment of the present invention, where the method is performed by an access device, and the access device includes a load server and a plurality of node servers. The load server is connected with each node server, and each node server is arranged on a host and establishes communication connection with a chrome browser on the host. The chrome browser on each host is connected with a chrome server.
Therefore, the received remote access Chromium request sent by the target application layer can be forwarded to each node server in a load balancing manner through the load server in the access device, each node server is arranged on a host provided with a Chromium browser, so that the node servers can communicate with the Chromium browser on the corresponding host, the Chromium service information of the Chromium browser is acquired and forwarded to the load server, and finally the service information is returned to the target application layer through the load server, so that the target application layer can access the Chromium browser.
As shown in fig. 1, the method comprises the steps of:
step 110: and receiving the chrome service request information sent by the target application layer through the load server.
The target application layer may be a function module interface integrating a plurality of functions, and when detecting that the requested function in the function module needs to call the chromosome service, the target application layer sends the chromosome service request information to the load server. The pending service request information includes communication protocol information, such as communication protocol version information. The target application layer accesses the chrome browser based on the communication protocol, thereby invoking various functions provided by the chrome browser to perform a series of operations.
In one embodiment of the present invention, the load server may be a proxy server with load function, such as Nginx, docker, or the like.
Step 120: and determining one node server from the plurality of node servers as a target node server through the load server, and sending the chromosome service request information to the target node server.
Before forwarding the pending service request message to the corresponding target node server through the load server, the load server needs to be configured first, so that the load server establishes communication with the plurality of node servers, in an embodiment of the present invention, step 120 further includes step 1201-.
Step 1201: and respectively acquiring the service port information of each node server.
The service port information is a monitoring port exposed by each node server, the service port information of different node servers is different, and each node server monitors the message from the service port, so that the message sent to the service port from the outside is processed. In one embodiment of the present invention, the service port information of one node server may be the port number 9222.
Step 1202: and configuring the load server according to the service port information so as to enable the load server to establish communication connection with each node server respectively.
In the process of configuring the load server, the service port information monitored outwards by each node server is written into the configuration file of the forwarding module of the load server. When the type of the load server is Nginx, the specific forwarding module may be an upstream module.
Considering that there may be a plurality of pending requests sent by the target application layer within a period of time, in order to process each pending request in time and avoid the pending requests of pending requests or the node servers crashed due to the agent load being greater than the processing capacity, in an embodiment of the present invention, a policy setting of load balancing may be further performed on the load servers to balance and schedule the pending requests of pending requests.
In an embodiment of the present invention, the process of determining one node server from a plurality of node servers that have established a connection with a load server as a target node server may be that the target node server is determined by the load server according to a preset load balancing policy.
The specific load balancing policy may include the following: first, a polling method: and forwarding the Chromium service request information to each node server in turn according to the time sequence of the received Chromium service request. Secondly, a weighted polling method: and determining the weight value corresponding to each node server according to the current load condition and the system configuration condition of each node server. And when the load server receives the chroma service requests, the load server distributes the chroma service requests to the node servers in sequence according to the time sequence of the chroma service requests received by the load server and the descending sequence of the weight values of the node servers. Third, minimum connection number method: and dynamically selecting one node server with the least current waiting connection number as a target node server to process the current Chromium service request according to the current connection condition of each node server. And writing the load strategy into a configuration file of a forwarding module of the load server, wherein when the type of the load server is Nginx, the specific forwarding module can be an upstream module.
Step 130: and determining a marginal browser on a host corresponding to the target node server as a target browser, and acquiring the local IP address and the local port information of the host corresponding to the target browser.
Firstly, because the operating communication protocol of the chromosome browser is the DevTools protocol, which is a debugging protocol, only allows the local IP address and the request of the local port to operate the chromosome browser, and the host corresponding to one chromosome browser corresponds to one local port and one or more IP addresses. In order to enable each node server to send the chromosome service request information from the load server to the host corresponding to the browser corresponding to the node server, it is first necessary to install each node server to the host corresponding to one chromosome browser, and set each node server, so as to establish a communication connection between the node server and the host corresponding to the chromosome browser corresponding to the node server.
Therefore, before sending the chroma service request message to the target node server, the target node server needs to be sent, and steps 1301-1302 are also included.
Step 1301: and installing one node server on the host corresponding to each Chromium browser.
The node server and the chrome browser are installed on the same host, so that in one embodiment of the present invention, the node server may be a proxy server with reverse proxy function, such as Nginx, squird, and Varnish.
Step 1302: and respectively configuring each node server so that each node server respectively establishes communication connection with the chrome browser on the corresponding host.
The process of configuring the node server includes first setting the IP address and port of the local server,
and in the configuration file of the server module of the node server, an address transferred by the proxy is set as a local IP address and a local port of the host corresponding to the local chrome browser by using a proxy address setting command (such as a proxy _ pass command).
After the configuration of the node servers is completed, the service of the node servers is started, so that communication connection is established between each node server and the chrome browser on the host computer where the node servers are arranged.
Therefore, different from the technical scheme that the resource of the chrome browser is directly accessed without being proxied and the access of the resource of the chrome browser is required to be bound, installed and compiled with the chrome browser again when the application layer is changed and modified in the prior art, one embodiment of the invention proxies the access request of the load server to the chrome browser on the host where the node server is located through the node server, so that the target application layer only needs to communicate with the load server connected with the node server, the process of communicating with the host corresponding to the chrome browser is completed by the node server and the load server, the logical change of other business parts of the target application layer is not changed, and the decoupling of the access functions of the application layer and the chrome browser is realized. Meanwhile, the remote access efficiency of the chrome browser is improved based on the load balancing function of the load server and the plurality of node servers.
Step 140: and generating a target service request according to the local IP address, the local port information and the chromosome service request information by the target node server.
The Chromium service request information comprises communication protocol information, the target service request comprises Host request header information, and the Host request header information comprises request server port information and a request server IP address. The request server port information here refers to the server port information of the host that transmitted the target service request, and the request server IP address refers to the server port information of the host that transmitted the target service request.
In one embodiment of the present invention, step 140 further comprises steps 1401-1402:
step 1401: and setting the request server port information as the local port information and setting the request server IP address as the local IP address through the target node server.
In an embodiment of the present invention, a setting statement of a Host request header is first defined in a server configuration file of a target node server, where the setting statement of the Host request header is as follows:
proxy_set_header Host $server_addr$port。
where the $ server _ addr variable represents the local server IP address and the $ port variable represents the local server port information.
The method comprises the steps of firstly obtaining a local IP address and local port information, then writing the setting statement into a configuration file of a server module of a target node server, setting a request server port for sending a service request in a Host request header as the local port information of a Host corresponding to a chromosome browser, and setting the request server IP address for sending the service request as the local IP address of the Host corresponding to the chromosome browser.
In one embodiment of the invention, configuring the target node server may include the following: the method comprises the steps of firstly setting a monitoring port of a target node server, then setting a local port of a Host corresponding to the target node server, setting an http communication protocol version in the proxy process, setting Host request header information and setting a target address of the proxy.
Specifically, the step of setting the Host request header may be to write a proxy _ set _ header Host $ server _ addr $ port statement in the configuration file of the target node server, and set the Host request header as a combination of the local port information of the Host corresponding to the target browser and the local IP address of the Host, that is, to make the address of the client request identified by the target browser be the local port information plus the local IP address.
The target address to which the proxy is set may be a proxy _ passttp:// 127.0.0.1:9221 statement written in the configuration file of the target server, so that the requesting proxy is forwarded to http://127.0.0.1:9221 (i.e. the local IP address of the host corresponding to the chrome browser where the target node server is located plus the local port address) for processing.
Step 1402: and generating the target service request according to the communication protocol information and the Host request header information by the target node server.
Step 150: and sending the target service request to the target browser through the target node server so that the target browser verifies the target service request.
Step 160: and when the verification is passed, acquiring target service information corresponding to the target service request returned by the target browser through the target node server, and sending the target service information to the load server through the target node server.
In an embodiment of the present invention, the target service information includes a target access link, where the target access link is used to provide a target access interface, and the obtained target service information may include the following aspects: the Browser information is 'Browser', which is a HeadlessChrome, Google headless Browser, as 'HeadlessChrome/85.0.4183.121'. Communication Protocol Version information such as "Protocol-Version": 1.3 "and target service links such as" webSocketDebuggerUrl ": ws://192.168.1.45: 9221/DevTools/brown/edeb 113e-70e3-45a6-bad7-a50d66cceef 9".
Based on a service mechanism of a Google headless browser, the communication protocol type of the target service link is a Websocket type, in the Websocket communication protocol, a browser server and a client only need to complete one-time handshake, and persistent connection can be directly established between the browser server and the client, and bidirectional data transmission is carried out. The target access link corresponds to a target access interface, and the target application layer can access the resource provided by the host corresponding to the chromosome browser on the target access interface based on a debugging protocol approved by the chromosome browser, such as the DevTools protocol, wherein the target access interface can be a client based on the DevTool protocol, which is configured in advance.
Step 170: and sending the target service information to the target application layer through the load server so that the target application layer accesses the target browser according to the target service information.
The process of controlling access may further include steps 1701-1705 after returning the target service information to the target application layer.
Step 1701: and acquiring the operation request information sent by the target application layer on the target access interface.
The specific target access interface may be a client based on the DevTools protocol, and the client communicates with the target chrome browser based on the DevTools protocol. For example, in the case that the operation request is a screenshot, the operation information sent by the target application layer may include, for example, simulation device information, screenshot website information, screenshot area information, and the like.
Step 1702: and determining a target operation request according to the operation request information, the local IP address and the local port information.
After obtaining the chrome service information, writing the approved local IP address and the local port information into the target operation request together with the operation request information through the target node server again, so that the target browser passes the authentication of the target operation request.
Considering that the service authentication mechanism of the chromosome browser, the request sent on the target access interface opened by the service information is regarded as legal, so in an optional embodiment of the present invention, the target application layer operation request information may be directly sent to the target browser without proxy through the target node server.
Step 1703: and sending the target operation request to the target browser so that the target browser verifies the target operation request.
Step 1704: and when the verification is passed, executing the target operation request through the target browser.
According to different target operation requests, the target browser can perform different responses, such as resource return, information display, page opening/closing and the like, and display the request response information on the target access interface.
In an alternative embodiment, in order to further ensure the security of access, the request of the target application layer may be authenticated, for example, the identity of the request in the application layer needs to be authenticated first, for example, the account password is authenticated first, and the load server forwards the request to the node server only when the authentication is passed. Or the target service request comprises an application layer access IP address, a legal access IP address list is stored in the load server, and the application layer access IP address is matched with the legal access IP address list to reject the access request of the application layer from the unregistered IP address, so that the security of the chromosome browser in cluster remote access is improved.
Fig. 2 is a schematic structural diagram of a remote access device of a chrome browser according to an embodiment of the present invention. As shown in fig. 2, the apparatus 200 includes: the receiving module 210, the first sending module 220, the obtaining module 230, the determining module 240, the second sending module 250, the third sending module 260, and the fourth sending module 270.
A receiving module 210, configured to receive, by the load server, the chroma service request information sent by the target application layer;
a first sending module 220, configured to determine a target node server from the multiple node servers, and send the pending service request message to the target node server;
an obtaining module 230, configured to determine a premium browser on a host corresponding to the target node server as a target browser, and obtain a local IP address and local port information of the host corresponding to the target browser;
a determining module 240, configured to generate, by the target node server, a target service request according to the local IP address, the local port information, and the pending service request information;
a second sending module 250, configured to send, by the target node server, the target service request to the target browser, so that the target browser verifies the target service request;
a third sending module 260, configured to, when the verification passes, obtain, by the target node server, target service information corresponding to the target service request returned by the target browser, and send the target service information to the load server;
a fourth sending module 270, configured to forward the target service information to the target application layer through the load server, so that the target application layer accesses the target browser according to the target service information.
In an optional manner, the determining module 240 further includes: a setting module 2401, configured to determine the local port information as the request server port information, and determine the local IP address as the request server IP address;
a generating module 2402, configured to determine the target service request according to the communication protocol information and Host request header information, where the Host request header information includes the request server port information and a request server IP address.
The specific working process of the remote access device of the chrome browser provided by the embodiment of the present invention is the same as the specific flow steps of the remote access method of the chrome browser, and is not described herein again.
The remote access device of the chrome browser provided by the embodiment of the invention forwards and proxies the service request of the chrome browser through the load server and the node server, and the target application layer does not need to install the chrome browser and only needs to establish communication with the load server and the node server, so that the chrome browser and the application layer are decoupled, the cluster access of the chrome browser is realized, and the remote access efficiency of the chrome browser is improved.
Fig. 3 is a schematic structural diagram of a remote access device of a chrome browser according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the remote access device of the chrome browser.
As shown in fig. 3, the remote access device of the chrome browser may include: a processor (processor)302, a communication Interface 304, a memory 306, and a communication bus 308.
Wherein: the processor 302, communication interface 304, and memory 306 communicate with each other via a communication bus 408. A communication interface 304 for communicating with network elements of other devices, such as clients or other servers. The processor 302 is configured to execute the program 310, and may specifically perform the relevant steps in the above embodiment of the remote access method for a chrome browser.
In particular, program 310 may include program code comprising computer-executable instructions.
The processor 302 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The remote access device of the chrome browser includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 306 for storing a program 310. Memory 306 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 310 may specifically be invoked by the processor 302 to cause a remote access device of a chrome browser to perform the following operations:
receiving, by the load server, chrome service request information sent by a target application layer;
determining a node server from the plurality of node servers as a target node server through the load server, and sending the chromosome service request information to the target node server;
determining a marginal browser on a host corresponding to the target node server as a target browser, and acquiring a local IP address and local port information of the host corresponding to the target browser;
generating a target service request according to the local IP address, the local port information and the chromosome service request information by the target node server;
sending the target service request to the target browser through the target node server so that the target browser can verify the target service request;
when the verification is passed, obtaining target service information corresponding to the target service request returned by the target browser through the target node server, and sending the target service information to the load server through the target node server;
and sending the target service information to the target application layer through the load server so that the target application layer accesses the target browser according to the target service information.
In an optional manner, the pending service request information includes communication protocol information, the target service request includes Host request header information, and the Host request header information includes request server port information and a request server IP address; the program 310 may specifically be invoked by the processor 302 to cause a remote access device of a chrome browser to perform the following operations:
setting the request server port information as the local port information and the request server IP address as the local IP address by the target node server;
and generating the target service request according to the communication protocol information and the Host request header information by the target node server.
In an alternative embodiment, the program 310 may be specifically invoked by the processor 302 to cause a remote access device of a chrome browser to perform the following operations:
respectively acquiring service port information of each node server;
and configuring the load server according to the service port information so as to enable the load server to establish communication connection with each node server respectively.
In an alternative embodiment, the program 310 may be specifically invoked by the processor 302 to cause a remote access device of a chrome browser to perform the following operations:
installing one node server on a host corresponding to each Chromium browser;
and respectively configuring each node server so that each node server respectively establishes communication connection with the chrome browser on the corresponding host.
In an alternative embodiment, the program 310 may be specifically invoked by the processor 302 to cause a remote access device of a chrome browser to perform the following operations:
and determining the target node server through the load server according to a preset load balancing strategy.
In an optional embodiment, the target service information includes a target access link, and the target access link is used for providing a target access interface; the program 310 may specifically be invoked by the processor 302 to cause a remote access device of a chrome browser to perform the following operations:
obtaining the operation request information sent by the target application layer on the target access interface,
determining a target operation request according to the operation request information, the local IP address and the local port information;
sending the target operation request to the target browser through the target node server so that the target browser can verify the target operation request;
and when the verification is passed, executing the target operation request through the target browser.
The specific working process of the remote access device of the chrome browser provided by the embodiment of the present invention is the same as the specific flow steps of the remote access method of the chrome browser, and is not described herein again.
The remote access device of the chrome browser provided by the embodiment of the invention forwards and proxies the service request of the chrome browser through the load server and the node server, and the target application layer does not need to install the chrome browser and only needs to establish communication with the load server and the node server, so that the chrome browser and the application layer are decoupled, the cluster access of the chrome browser is realized, and the remote access efficiency of the chrome browser is improved.
An embodiment of the present invention provides a computer-readable storage medium, where the storage medium stores at least one executable instruction, and when the executable instruction runs on a remote access device of a chrome browser, the remote access device of the chrome browser executes a remote access method of the chrome browser in any method embodiment described above.
The executable instructions may specifically be configured to cause a remote access device of a chrome browser to perform the following operations:
receiving, by the load server, chrome service request information sent by a target application layer;
determining a node server from the plurality of node servers as a target node server through the load server, and sending the chromosome service request information to the target node server;
determining a marginal browser on a host corresponding to the target node server as a target browser, and acquiring a local IP address and local port information of the host corresponding to the target browser;
generating a target service request according to the local IP address, the local port information and the chromosome service request information by the target node server;
sending the target service request to the target browser through the target node server so that the target browser can verify the target service request;
when the verification is passed, obtaining target service information corresponding to the target service request returned by the target browser through the target node server, and sending the target service information to the load server through the target node server;
and sending the target service information to the target application layer through the load server so that the target application layer accesses the target browser according to the target service information.
In an optional manner, the pending service request information includes communication protocol information, the target service request includes Host request header information, and the Host request header information includes request server port information and a request server IP address; the executable instructions may be further specifically configured to cause a remote access device of a chrome browser to perform the following operations: setting the request server port information as the local port information and the request server IP address as the local IP address by the target node server;
and generating the target service request according to the communication protocol information and the Host request header information by the target node server.
In an optional manner, the executable instructions may be specifically further configured to cause a remote access device of a chrome browser to perform the following operations: respectively acquiring service port information of each node server;
and configuring the load server according to the service port information so as to enable the load server to establish communication connection with each node server respectively.
In an optional manner, the executable instructions may be specifically further configured to cause a remote access device of a chrome browser to perform the following operations:
installing one node server on a host corresponding to each Chromium browser;
and respectively configuring each node server so that each node server respectively establishes communication connection with the chrome browser on the corresponding host.
In an optional manner, the executable instructions may be specifically further configured to cause a remote access device of a chrome browser to perform the following operations:
and determining the target node server through the load server according to a preset load balancing strategy.
In an optional manner, the target service information includes a target access link, and the target access link is used for providing a target access interface; the executable instructions may be further specifically configured to cause a remote access device of a chrome browser to perform the following operations:
obtaining the operation request information sent by the target application layer on the target access interface,
determining a target operation request according to the operation request information, the local IP address and the local port information;
sending the target operation request to the target browser through the target node server so that the target browser can verify the target operation request;
and when the verification is passed, executing the target operation request through the target browser.
The specific working process of the computer readable medium provided by the embodiment of the present invention is the same as the specific flow steps of the above-mentioned remote access method for a chrome browser, and is not described herein again.
The computer readable medium provided by the embodiment of the invention forwards and proxies the service request of the chromosome browser through the load server and the node server, and the target application layer does not need to install the chromosome browser and only needs to establish communication with the load server and the node server, so that the chromosome browser is decoupled from the application layer, the cluster access of the chromosome browser is realized, and the remote access efficiency of the chromosome browser is improved.
The embodiment of the invention provides a remote access device of a chromosome browser, which is used for executing the remote access method of the chromosome browser.
Embodiments of the present invention provide a computer program, where the computer program can be called by a processor to enable a remote access device of a chrome browser to execute a remote access method of the chrome browser in any of the above method embodiments.
Embodiments of the present invention provide a computer program product comprising a computer program stored on a computer-readable storage medium, the computer program comprising program instructions that, when run on a computer, cause the computer to perform the remote access method of a chrome browser in any of the above-described method embodiments.
The algorithms or displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. In addition, embodiments of the present invention are not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words load, node, and third, etc. do not denote any order. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specified otherwise.

Claims (8)

1. A remote access method of a Chromium browser is characterized in that the method is based on an access device, the access device comprises a load server and a plurality of node servers, the load server establishes communication connection with each node server respectively, each node server is arranged on a host and establishes communication connection with the Chromium browser on the host, and the method comprises the following steps:
receiving, by the load server, chrome service request information sent by a target application layer;
determining a node server from the plurality of node servers as a target node server through the load server, and sending the marginal service request information to the target node server, wherein the marginal service request information comprises communication protocol information;
determining a marginal browser on a host corresponding to the target node server as a target browser, and acquiring a local IP address and local port information of the host corresponding to the target browser;
setting the request server port information as the local port information and setting the request server IP address as the local IP address through the target node server;
generating a target service request by the target node server according to communication protocol information and Host request header information, wherein the Host request header information comprises the request server port information and the request server IP address;
sending the target service request to the target browser through the target node server so that the target browser can verify the target service request;
when the verification is passed, obtaining target service information corresponding to the target service request returned by the target browser through the target node server, and sending the target service information to the load server through the target node server;
and sending the target service information to the target application layer through the load server so that the target application layer accesses the target browser according to the target service information.
2. The method of claim 1, wherein before receiving, by the load server, the Chromium service request information sent by the target application layer, the method further comprises:
respectively acquiring service port information of each node server;
and configuring the load server according to the service port information so as to enable the load server to establish communication connection with each node server respectively.
3. The method according to claim 1, further comprising, before obtaining, by the target node server, the local IP address and the local port information of the host corresponding to the target browser:
installing one node server on a host corresponding to each Chromium browser;
and respectively configuring each node server so that each node server respectively establishes communication connection with the chrome browser on the corresponding host.
4. The method of claim 1, wherein the determining a target node server from the plurality of node servers, sending the Chromium service request message to the target node server, further comprises:
and determining the target node server through the load server according to a preset load balancing strategy.
5. The method of claim 1, wherein the target service information includes a target access link, and the target access link is used to provide a target access interface; after returning the target service information to the load server and forwarding the target service information to the target application layer through the load server, the method further includes:
obtaining the operation request information sent by the target application layer on the target access interface,
determining a target operation request according to the operation request information, the local IP address and the local port information;
sending the target operation request to the target browser through the target node server so that the target browser can verify the target operation request;
and when the verification is passed, executing the target operation request through the target browser.
6. A remote access apparatus for a chrome browser, the apparatus comprising: the receiving module is used for receiving the chroma service request information sent by the target application layer through the load server;
a first sending module, configured to determine a target node server from multiple node servers, and send the pending service request information to the target node server, where the pending service request information includes communication protocol information;
an obtaining module, configured to determine a premium browser on a host corresponding to the target node server as a target browser, and obtain a local IP address and local port information of the host corresponding to the target browser;
the setting module is used for determining the local port information as the port information of the request server and determining the local IP address as the IP address of the request server;
a generating module, configured to determine a target service request according to communication protocol information and Host request header information, where the Host request header information includes the request server port information and the request server IP address; a second sending module, configured to send the target service request to the target browser through the target node server, so that the target browser verifies the target service request;
a third sending module, configured to, when the verification passes, obtain, by the target node server, target service information corresponding to the target service request returned by the target browser, and send the target service information to the load server;
a fourth sending module, configured to forward the target service information to the target application layer through the load server, so that the target application layer accesses the target browser according to the target service information.
7. A remote access device for a chrome browser, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus; the memory is used for storing at least one executable instruction, which causes the processor to execute the operations of the remote access method of the chrome browser according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that the storage medium has stored therein at least one executable instruction, which when run on a remote access device of a chrome browser, causes the remote access device of the chrome browser to perform the operations of the remote access method of the chrome browser according to any one of claims 1 to 5.
CN202011414075.6A 2020-12-07 2020-12-07 Remote access method, device, equipment and computer readable medium of chrome browser Active CN112243039B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011414075.6A CN112243039B (en) 2020-12-07 2020-12-07 Remote access method, device, equipment and computer readable medium of chrome browser

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011414075.6A CN112243039B (en) 2020-12-07 2020-12-07 Remote access method, device, equipment and computer readable medium of chrome browser

Publications (2)

Publication Number Publication Date
CN112243039A CN112243039A (en) 2021-01-19
CN112243039B true CN112243039B (en) 2021-03-12

Family

ID=74175264

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011414075.6A Active CN112243039B (en) 2020-12-07 2020-12-07 Remote access method, device, equipment and computer readable medium of chrome browser

Country Status (1)

Country Link
CN (1) CN112243039B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105554160A (en) * 2016-01-29 2016-05-04 四川长虹电器股份有限公司 Dubbo distributed cluster system architecture method based on nginx load balancing
CN109039807A (en) * 2018-07-13 2018-12-18 郑州云海信息技术有限公司 A kind of load balance of network system detection method based on Open Stack
CN110958239A (en) * 2019-11-26 2020-04-03 腾讯科技(深圳)有限公司 Method and device for verifying access request, storage medium and electronic device
CN111221590A (en) * 2019-11-25 2020-06-02 无锡安腾软件开发有限公司 Method for acquiring URL of browser with chrome as kernel
CN111475764A (en) * 2020-06-29 2020-07-31 平安国际智慧城市科技股份有限公司 Search engine optimization method, device, terminal and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105554160A (en) * 2016-01-29 2016-05-04 四川长虹电器股份有限公司 Dubbo distributed cluster system architecture method based on nginx load balancing
CN109039807A (en) * 2018-07-13 2018-12-18 郑州云海信息技术有限公司 A kind of load balance of network system detection method based on Open Stack
CN111221590A (en) * 2019-11-25 2020-06-02 无锡安腾软件开发有限公司 Method for acquiring URL of browser with chrome as kernel
CN110958239A (en) * 2019-11-26 2020-04-03 腾讯科技(深圳)有限公司 Method and device for verifying access request, storage medium and electronic device
CN111475764A (en) * 2020-06-29 2020-07-31 平安国际智慧城市科技股份有限公司 Search engine optimization method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN112243039A (en) 2021-01-19

Similar Documents

Publication Publication Date Title
CN109067914B (en) web service proxy method, device, equipment and storage medium
WO2017097123A1 (en) Access request conversion method and device
US7743160B2 (en) System and method of delaying connection acceptance to support connection request processing at layer-7
US11392675B2 (en) Request authorization using recipe-based service coordination
CN106790758A (en) A kind of method and device of the network object of access NAT network internals
CN114172829B (en) Server health monitoring method and system and computing equipment
CN113259428A (en) Data access request processing method and device, computer equipment and medium
CN111614624A (en) Risk detection method, device, system and storage medium
EP3837660A1 (en) Method and system for prediction of smart contract violation using dynamic state space creation
CN112199621B (en) Method and device for quickly generating poster and computer equipment
CN114205342A (en) Routing method, electronic device, medium, and program product for service debugging
US10015086B2 (en) Multi GTM based routing to avoid latencies
Boranbayev et al. Estimation of the degree of reliability and safety of software systems
CN112243039B (en) Remote access method, device, equipment and computer readable medium of chrome browser
CN111600755B (en) Internet access behavior management system and method
CN112448978B (en) Data management method and system
CN110049106B (en) Service request processing system and method
US6763387B1 (en) Method and system for sharing a single communication port between a plurality of servers
CN115396221A (en) Authorization processing method, device and system, electronic equipment and storage medium
US11729167B2 (en) Authorization proxy
CN115567605A (en) Data center user request processing method, system, equipment and storage medium
US8499023B1 (en) Servlet-based grid computing environment using grid engines and switches to manage resources
CN115516842A (en) Orchestration broker service
US20190230146A1 (en) Communicating with a remote service through a hypertext transfer protocol (http) session
CN116260855B (en) Communication method, communication device, electronic equipment and storage medium

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