CN115277396A - Message driving method and system for simulating browser operation - Google Patents
Message driving method and system for simulating browser operation Download PDFInfo
- Publication number
- CN115277396A CN115277396A CN202210935562.XA CN202210935562A CN115277396A CN 115277396 A CN115277396 A CN 115277396A CN 202210935562 A CN202210935562 A CN 202210935562A CN 115277396 A CN115277396 A CN 115277396A
- Authority
- CN
- China
- Prior art keywords
- worker
- master
- role
- acquisition
- message
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000004088 simulation Methods 0.000 claims abstract description 33
- 230000006854 communication Effects 0.000 claims description 25
- 238000004891 communication Methods 0.000 claims description 25
- 230000005540 biological transmission Effects 0.000 claims description 21
- 230000003993 interaction Effects 0.000 claims description 6
- 230000007175 bidirectional communication Effects 0.000 claims description 5
- 238000012546 transfer Methods 0.000 claims description 4
- 239000000284 extract Substances 0.000 claims description 3
- 230000006399 behavior Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 4
- 230000009191 jumping Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 239000003999 initiator Substances 0.000 description 2
- BUGBHKTXTAQXES-UHFFFAOYSA-N Selenium Chemical compound [Se] BUGBHKTXTAQXES-UHFFFAOYSA-N 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 229910052711 selenium Inorganic materials 0.000 description 1
- 239000011669 selenium Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0823—Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
- H04L41/083—Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability for increasing network speed
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a message-driven method and a message-driven system for simulating browser operation. The message driving method comprises the steps that a local area network is configured into a master-worker structure; the PC machine serving as a master administrator role issues tasks, the PC machines serving as worker roles receive the tasks, and a browser simulation acquisition task is performed through the PC machines serving as worker roles; after the PC machine serving as the worker role finishes the browser simulation acquisition task, returning a result to the PC machine serving as the master administrator role, and collecting and displaying the acquisition task by the PC machine serving as the master administrator role; the message driven system includes modules corresponding to the message driven method steps.
Description
Technical Field
The invention discloses a message driving method and a message driving system for simulating browser operation, and belongs to the technical field of data acquisition.
Background
The simulation collection is that WebDriver drives a browser, a series of operations such as clicking, inputting, jumping and the like are carried out on the browser by simulating human behaviors, and data analyzed by the browser DOM in the operation process is collected as collected data. And the number of browsers started by the Webdriver of the simulator of a single PC is limited, namely the concurrent acquisition capability is limited.
Disclosure of Invention
The invention provides a message driving method and a message driving system for simulating browser operation, which are used for solving the problems of limited browser number started by a WebDriver of a simulator for simulating a single PC (personal computer) of an existing collector and low concurrent acquisition capacity, a local area network is configured into a Master-Worker structure, namely, at least one PC is used as a Master to distribute tasks, the rest are used as Worker to receive tasks, after the simulator finishes the simulated acquisition task of the browser, the result is returned to the Master, and the Master is used for collecting and displaying, and the specific technical scheme is as follows:
a message-driven method for simulating browser operations, the message-driven method comprising:
configuring a local area network into a master-worker structure; the master-worker structure comprises at least one PC machine serving as a master administrator role and a plurality of PC machines serving as worker roles;
the PC machine serving as a master administrator role issues tasks, the PC machines serving as worker roles receive the tasks, and a browser simulation acquisition task is performed through the PC machines serving as worker roles;
and after the PC machine serving as the worker role finishes the simulation acquisition task of the browser, returning a result to the PC machine serving as the master administrator role, and collecting and displaying the acquisition task by the PC machine serving as the master administrator role.
Further, the task issuing is performed by the at least one PC machine serving as a master administrator role, the tasks are received by the plurality of PC machines serving as worker roles, and the browser simulation collection task is performed by the PC machines serving as worker roles, and the task issuing method includes the steps of:
the at least one PC machine which is used as the master administrator role obtains the actual operation of the user in real time;
the at least one PC machine serving as a master administrator role extracts the real-time operation record of the user according to the actual operation of the user, and adds the operation record into an acquisition task;
transmitting the collection task to a first routing controller through a websocket;
the first routing controller transmits the acquisition task to the second routing controller through the websocket;
and the PC machine serving as the worker role outputs the acquisition task in the first routing controller and the IP address of the PC machine to a code generator, and the code generator generates an execution code.
Further, after the PC serving as the worker role completes the browser simulation collection task, the result is returned to the PC serving as the master administrator role, and the collection task is collected and displayed by the PC serving as the master administrator role, including:
controlling the browser by driving the webdriver through the execution code;
the browser executes the code according to the execution code, outputs an acquisition result, and sends the acquisition result as a load to a PC (personal computer) corresponding to the master role to which the IP address recorded in the code belongs in a message form;
the PC machine corresponding to the worker role transmits the acquisition result back to the master first routing controller to which the IP address belongs in a message form;
and the first routing controller transmits the acquisition result back to the master manager and displays the result on a manager interface.
Further, the operation process of the first routing controller includes:
the second routing controller corresponding to a plurality of PCs (personal computers) which are used as worker roles in the local area network is responsible for carrying out two-way communication and message body transmission through WebSocket;
and carrying out two-way communication with the user interface, and analyzing and sorting the acquired results.
Further, the operation process of the second routing controller includes:
the first routing controller corresponding to a PC (personal computer) which is used as a master administrator role in the local area network is responsible for carrying out two-way communication and message body transmission through WebSocket;
calling a code generator to generate a code, and driving a Webdriver to open a browser acquisition result, wherein the called code records a plurality of IP addresses corresponding to the PC machines serving as the worker roles;
and when the acquisition is finished, transmitting the acquisition result to a plurality of corresponding second routing controllers corresponding to the PC machines serving as the worker roles.
A message driven system for simulating browser operations, the message driven system comprising:
the structure configuration module is used for configuring the local area network into a master-worker structure; the master-worker structure comprises at least one PC machine serving as a master administrator role and a plurality of PC machines serving as worker roles;
the task interaction module is used for the task publishing of the at least one PC machine serving as a master administrator role, the plurality of PC machines serving as worker roles receive tasks, and the browser simulation collection tasks are carried out through the PC machines serving as worker roles;
and the collection and display module is used for returning a result to the PC machine serving as the master administrator role after the PC machine serving as the worker role completes the simulation collection task of the browser, and collecting and displaying the collection task by the PC machine serving as the master administrator role.
Further, the task interaction module comprises:
the operation acquisition module is used for acquiring the actual operation of the user in real time by the at least one PC machine which is used as the master administrator role;
the extracting and adding module is used for extracting the real-time operation record of the user by the at least one PC machine serving as the master administrator role according to the actual operation of the user and adding the operation record into an acquisition task;
the first transmission module is used for transmitting the collection task to the first routing controller through the websocket;
the second transfer module is used for transferring the acquisition task to the second routing controller through the websocket by the first routing controller;
and the transmission execution module is used for outputting the acquisition task in the first routing controller and the IP address of the PC machine serving as the worker role to the code generator, and the code generator generates an execution code.
Further, the collecting and displaying module comprises:
the third transfer module is used for transferring the execution code to the browser through the webdriver;
the code execution module is used for the browser to execute codes according to the execution codes, output acquisition results and send the acquisition results as loads to a PC (personal computer) corresponding to a worker role to which the IP address recorded in the codes belongs in a message form;
the return module is used for transmitting the acquisition result back to the first routing controller in a message form by the PC corresponding to the worker role to which the IP address belongs;
and the display module is used for transmitting the acquisition result back to the manager by the first routing controller and displaying the result on the interface of the manager.
The first routing controller is used for being responsible for carrying out two-way communication and message body transmission with a second routing controller corresponding to a plurality of PCs (personal computers) serving as worker roles in a local area network through WebSocket, carrying out two-way communication with a user interface, and analyzing and sorting acquisition results.
The second routing controller is used for being responsible for carrying out bidirectional communication and message body transmission through WebSocket with the first routing controller corresponding to the PC which is in the role of master administrator in the local area network; calling a code generator to generate a code, and driving a Webdriver to open a browser acquisition result, wherein the called generated code records an IP address corresponding to a PC (personal computer) which is in a master role; and when the acquisition is finished, the acquisition result is sent to a second routing controller corresponding to the PC machine serving as the worker role, and the second routing controller is connected to the IP address of the master role and returns the simulation acquisition result.
The invention has the beneficial effects that:
the invention provides a message driving method and a message driving system for simulating browser operation, which can simulate a series of operations such as clicking, inputting, skipping and the like of human behaviors on a browser and collect data analyzed by a browser DOM in the operation process as collected data. Meanwhile, the message driving method and the message driving system for simulating browser operation can control browsers on a plurality of personal computers through one Personal Computer (PC), so that the concurrent acquisition capacity and the number are effectively improved. And the collection and processing display of multiple tasks can be executed at the same time. The concurrent acquisition capacity and the task acquisition efficiency of the simulation browser are effectively improved.
Drawings
FIG. 1 is a schematic diagram of the method and system of the present invention;
FIG. 2 is a flow chart of the method of the present invention;
fig. 3 is a system block diagram of the system of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Example 1
The present embodiment proposes a message-driven method for simulating browser operations, as shown in fig. 1 and fig. 2, the message-driven method includes:
s1, configuring a local area network into a master-worker structure; the master-worker structure comprises at least one PC machine serving as a master administrator role and a plurality of PC machines serving as worker roles. Specifically, the system can be a plurality of masters which serve as marks of a task manager/initiator, the masters can transmit own IP to the worker, the worker writes the IP of the master into an acquisition execution code, and the execution code can be transmitted back to the IP of the task initiator, namely a certain master, through the routing controller after completing an acquisition task.
S2, the at least one PC machine serving as a master administrator role issues tasks, the plurality of PC machines serving as worker roles receive the tasks, and the PC machines serving as worker roles perform browser simulation collection tasks;
and S3, after the PC machine serving as the worker role completes the simulation acquisition task of the browser, returning the result to the PC machine serving as the master administrator role, and collecting and displaying the acquisition task by the PC machine serving as the master administrator role.
The task issuing is carried out by the at least one PC machine serving as a master administrator role, the tasks are received by the plurality of PC machines serving as worker roles, and the browser simulation acquisition task is carried out by the PC machines serving as worker roles, and the task issuing method comprises the following steps:
s201, the at least one PC machine which is used as the master administrator role obtains the actual operation of the user in real time;
s202, the at least one PC machine which is used as the master administrator role extracts the real-time operation record of the user according to the actual operation of the user, and adds the operation record into an acquisition task;
s203, transmitting the collection task to a first routing controller through a websocket;
s204, the first routing controller transmits the acquisition task to a second routing controller through a websocket;
s205, the PC machine serving as the worker role outputs the collection task in the first routing controller and the IP address of the PC machine to a code generator, and the code generator generates an execution code.
After the PC machine serving as the worker role completes the simulation acquisition task of the browser, a result is returned to the PC machine serving as the master administrator role, and the acquisition task is collected and displayed by the PC machine serving as the master administrator role, wherein the method comprises the following steps:
s301, controlling the browser by the execution code through driving webdriver;
s302, the browser executes the codes according to the execution codes, outputs acquisition results, and sends the acquisition results to a PC (personal computer) corresponding to the master role to which the IP address recorded in the codes belongs in a message form by taking the acquisition results as loads;
s303, the PC corresponding to the worker role transmits the acquisition result back to the first master routing controller to which the IP address belongs in a message form;
and S304, the first routing controller transmits the acquired result back to the master manager, and the result is displayed on a manager interface.
Wherein, the operation process of the first routing controller comprises:
the second routing controller corresponding to a plurality of PCs (personal computers) which are used as worker roles in the local area network is responsible for carrying out two-way communication and message body transmission through WebSocket;
and carrying out two-way communication with the user interface, and analyzing and sorting the acquisition result.
Wherein the operation process of the second routing controller comprises:
the first routing controller corresponding to a PC (personal computer) which is in charge of taking the role of master administrator in the local area network carries out two-way communication and message body transmission through WebSocket;
calling a code generator to generate codes for returning to different masters, and driving a Webdriver to open a browser acquisition result, wherein the called generated codes record IP addresses corresponding to a plurality of PCs serving as master roles;
and when the acquisition is finished, transmitting the acquisition result to a plurality of corresponding second routing controllers corresponding to the PC machines serving as the worker roles.
The PC end software developed by taking node.js language and electron as a framework is installed on each PC of the local area network. Master and Worker are the same software, integrate node.
The embodiment provides a message-driven method for simulating browser operation, which is PC-side software developed by taking node. Js language and electron as a framework, and is installed on each PC of a local area network. Master and Worker are the same software, integrate node. Different system environment variables can be configured according to different hardware configuration heights of the PCs, and at least one specific PC is set to be in a Master role or a Worker role. The method aims to fully utilize hardware resources of all PCs and set the PC with large memory capacity into a Worker role.
The Master and the Worker both comprise routing controllers which are responsible for a first routing controller and a second routing controller; meanwhile, a Master router controller is also responsible for the data transmission; the route controller of Worker is responsible.
The Master refers to a physical PC, which sends the collection task to the appointed Worker in a message form and recovers and combines the results returned by the Worker, and because the Master is mainly responsible for communication, the PC with low CPU performance and memory capacity can be set as the Master; there may be multiple masters within a local area network.
And the Master routing controller is responsible for carrying out two-way communication with other Worker routing controllers in the local area network through WebSocket, transmitting a message body, carrying out two-way communication with a user interface, and analyzing and sorting acquisition results.
The Worker refers to a physical PC, and analyzes a specific task instruction from a message received by the Master, and generally sets a PC with large memory capacity as the Worker because the Worker receives the task message and calls a browser in parallel to simulate user behavior.
The route controller of the Worker is responsible for carrying out two-way communication with other Master route controllers in the local area network through WebSocket, transmitting a message body, calling a code generator to generate a code, driving a Webdriver to open a browser to collect a result, recording an IP address of the Worker by the called generated code, and sending the result to the corresponding route controller of the Worker when the collection is finished.
Master can send various simulation task messages to other PCs configured in the role of Worker through the WebSocket via the local area network.
The embodiment provides a message driving method for simulating browser operation, which can simulate a series of operations such as clicking, inputting, jumping and the like performed by human behavior on a browser, and collect data analyzed by a browser DOM in an operation process as collected data. Meanwhile, the message driving method for simulating browser operation provided by the embodiment can simultaneously control browsers on a plurality of PCs through one PC, and effectively improves the concurrent acquisition capacity and the number. And the collection and processing display of multiple tasks can be executed at the same time. The concurrent acquisition capacity and the task acquisition efficiency of the simulation browser are effectively improved.
Example 2
The difference between this embodiment and embodiment 1 is that, as shown in fig. 1, the acquisition process of the message driving method for executing the message pushing task is as follows:
the specific implementation process comprises the following steps:
step 1, a routing controller of the Master establishes Websocket connection initialization with a Worker according to an IP list of a local area network.
Step 2, the user generates a 'user operation' list by clicking,
and 3, injecting a monitoring code into the webview container by the electron, intercepting various operations of the user, and generating a user operation list.
Step 4, the routing controller transmits the message to the Worker's routing controller through the IP of the Worker set by the target
And 5, after receiving the message, the routing controller of the Worker analyzes the load 1 from the payload of the message body 2, and transmits the user operation list to the code generator.
And 6, sequentially generating simulation codes based on the Selenium by the code generator according to the user operation list, and calling the Webdriver.
And 7, according to the code, simulating the performance optimization setting of the code in a header mode without loading images and the like, driving a browser through a Webdriver, sequentially completing simulation operation according to the sequence of a user operation list, and loading the acquired result on the payload of the message to return to a routing controller of the Worker.
And 8, sending the message body 3 to a Master routing controller through the Worker routing controller.
And 9, when the routing controller of the Master finds that the action is 'complete _ task', unpacking the load 2 from the message body 3 and sending the unpacked load to a Master user interface through Websocket.
And step 10, the Master user interface displays the front end of the load 2 according to a specified format.
The embodiment provides a message-driven method for simulating browser operation, which is PC-side software developed by taking node. Master and Worker are the same software, integrate node. Different system environment variables can be configured according to different hardware configuration heights of the PCs, and at least one specific PC is set to be in a Master role or a Worker role. The method aims to fully utilize hardware resources of all PCs and set the PC with large memory capacity into a Worker role.
The Master and the Worker both comprise routing controllers which are responsible for a first routing controller and a second routing controller; meanwhile, the router controller of the Master is also responsible for; the route controller of Worker is responsible.
The Master refers to a physical PC machine which sends the acquisition task to a designated Worker in a message form and recovers and combines the returned result of the Worker, and because the Master is mainly responsible for communication, the PC with low CPU performance and memory capacity can be set as the Master; there may be multiple masters within a local area network.
And the Master routing controller is responsible for carrying out two-way communication with other Worker routing controllers in the local area network through WebSocket, transmitting a message body, carrying out two-way communication with a user interface, and analyzing and sorting acquisition results.
The Worker refers to a physical PC, and analyzes a specific task instruction from a message received by the Master, and generally sets a PC with large memory capacity as the Worker because the Worker receives the task message and calls a browser in parallel to simulate user behavior.
The Worker routing controller is responsible for carrying out two-way communication with other Master routing controllers in the local area network through WebSocket, transmitting a message body, calling a code generator to generate a code, driving a Webdriver to open a browser to collect a result, recording an IP address of the Worker by the called generated code, and sending the result to the corresponding Worker routing controller when the collection is finished.
Master can send various simulation task messages to other PCs configured in the role of Worker through WebSocket via a local area network.
The embodiment provides a message driving method for simulating browser operation, which can simulate a series of operations such as clicking, inputting, jumping and the like performed on a browser by human behavior, and collect data analyzed by a browser DOM in an operation process as collected data. Meanwhile, the message driving method for simulating browser operation provided by the embodiment can simultaneously control browsers on a plurality of PCs through one PC, and effectively improves the concurrent acquisition capacity and the number. And the collection and processing display of multiple tasks can be executed at the same time. The concurrent acquisition capacity and the task acquisition efficiency of the simulation browser are effectively improved.
Example 3
The present embodiment proposes a message-driven system for simulating browser operations, as shown in fig. 3, the message-driven system includes:
the structure configuration module is used for configuring the local area network into a master-worker structure; the master-worker structure comprises at least one PC machine serving as a master administrator role and a plurality of PC machines serving as worker roles;
the task interaction module is used for the task publishing of the at least one PC machine serving as a master administrator role, the plurality of PC machines serving as worker roles receive tasks, and the browser simulation collection tasks are carried out through the PC machines serving as worker roles;
and the collection and display module is used for returning a result to the PC machine serving as the master administrator role after the PC machine serving as the worker role completes the simulation collection task of the browser, and collecting and displaying the collection task by the PC machine serving as the master administrator role.
Wherein the task interaction module comprises:
the operation acquisition module is used for acquiring the actual operation of the user in real time by the at least one PC machine which is used as the master administrator role;
the extracting and adding module is used for extracting the real-time operation record of the user by the at least one PC machine serving as the master administrator role according to the actual operation of the user and adding the operation record into an acquisition task;
the first transmission module is used for transmitting the collection task to the first routing controller through the websocket;
the second transmission module is used for transmitting the acquisition task to the second routing controller by the first routing controller through the websocket;
and the transmission execution module is used for outputting the acquisition task in the first routing controller and the IP address of the PC machine serving as the worker role to the code generator, and the code generator generates an execution code.
Wherein the collection display module comprises:
the third transfer module is used for transferring the execution code to the browser through the webdriver;
the code execution module is used for the browser to execute codes according to the execution codes, output acquisition results and send the acquisition results as loads to a PC (personal computer) corresponding to a worker role to which the IP address recorded in the codes belongs in a message form;
the return module is used for transmitting the acquisition result back to the first routing controller in a message form by the PC corresponding to the worker role to which the IP address belongs;
and the display module is used for transmitting the acquisition result back to the manager by the first routing controller and displaying the result on the interface of the manager.
The first routing controller is used for being responsible for carrying out two-way communication and message body transmission with a second routing controller corresponding to a plurality of PCs (personal computers) serving as worker roles in a local area network through WebSocket, carrying out two-way communication with a user interface, and analyzing and sorting acquisition results. The second routing controller is used for being responsible for carrying out bidirectional communication and message body transmission through WebSocket with the first routing controller corresponding to the PC which is in the role of master administrator in the local area network; calling a code generator to generate a code, and driving a WebDriver to open a browser acquisition result, wherein the called generated code records an IP address corresponding to a PC (personal computer) serving as a master role; and when the acquisition is finished, the acquisition result is sent to a second routing controller corresponding to the PC machine serving as the worker role, and the second routing controller is connected to the IP address of the master role and returns the simulation acquisition result.
The message driving system for simulating browser operation is used to execute the message driving method, and the present embodiment provides a PC-side software developed by taking node. Master and Worker are the same software, integrate node. Different system environment variables can be configured according to different hardware configuration heights of the PCs, and at least one specific PC is set to be in a Master role or a Worker role. The method aims to fully utilize hardware resources of all PCs and set the PC with large memory capacity to be in a Worker role.
The Master and the Worker both comprise routing controllers which are responsible for a first routing controller and a second routing controller; meanwhile, the router controller of the Master is also responsible for; the route controller of Worker is responsible.
The Master refers to a physical PC, which sends the collection task to the appointed Worker in a message form and recovers and combines the results returned by the Worker, and because the Master is mainly responsible for communication, the PC with low CPU performance and memory capacity can be set as the Master; there may be multiple masters within a local area network.
The Master's routing controller is responsible for performing two-way communication with other Worker routing controllers in the local area network through WebSocket, transmitting message bodies, performing two-way communication with the user interface, and analyzing and sorting acquisition results.
The Worker refers to a physical PC, and analyzes a specific task instruction from a message received by the Master, and generally sets a PC with large memory capacity as the Worker because the Worker receives the task message and calls a browser in parallel to simulate user behavior.
The route controller of the Worker is responsible for carrying out two-way communication with other Master route controllers in the local area network through WebSocket, transmitting a message body, calling a code generator to generate a code, driving a Webdriver to open a browser to collect a result, recording an IP address of the Worker by the called generated code, and sending the result to the corresponding route controller of the Worker when the collection is finished.
Master can send various simulation task messages to other PCs configured in the role of Worker through WebSocket via a local area network.
The embodiment provides a message driving system for simulating browser operation, which can simulate human behavior to click, input, jump and other series of operations on a browser, and collect data analyzed by a browser DOM in the operation process as collected data. Meanwhile, the message driving system for simulating browser operation provided by the embodiment can simultaneously control browsers on a plurality of PCs through one PC, and effectively improves the concurrent acquisition capacity and the number. And the collection and processing display of multiple tasks can be executed at the same time. The concurrent acquisition capacity and the task acquisition efficiency of the simulation browser are effectively improved.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (10)
1. A message-driven method for simulating browser operations, the message-driven method comprising:
configuring a local area network into a master-worker structure; the master-worker structure comprises at least one PC machine serving as a master administrator role and a plurality of PC machines serving as worker roles;
the method comprises the following steps that at least one PC machine serving as a master administrator role issues tasks, the plurality of PC machines serving as worker roles receive the tasks, and a browser simulation collection task is conducted through the PC machines serving as the worker roles;
and after the PC machine serving as the worker role finishes the browser simulation acquisition task, returning a result to the PC machine serving as the master administrator role, and collecting and displaying the acquisition task by the PC machine serving as the master administrator role.
2. The message driving method according to claim 1, wherein the task issuing is performed by the at least one PC functioning as a master administrator role, the tasks are received by the plurality of PCs functioning as a worker role, and a browser simulation collection task is performed by the PCs functioning as the worker role, and the method includes:
the at least one PC machine which is used as the master administrator role obtains the actual operation of the user in real time;
the at least one PC machine serving as a master administrator role extracts the real-time operation record of the user according to the actual operation of the user, and adds the operation record into an acquisition task;
transmitting the collection task to a first routing controller through a websocket;
the first routing controller transmits the acquisition task to the second routing controller through the websocket;
and the PC machine serving as the worker role outputs the acquisition task in the first routing controller and the IP address of the PC machine to a code generator, and the code generator generates an execution code.
3. The message driving method according to claim 2, wherein after the PC machine serving as the worker role completes the browser simulation collection task, the PC machine serving as the master administrator role returns the result to the PC machine, and the PC machine serving as the master administrator role collects and displays the collection task, and the method comprises the following steps:
controlling the browser by driving the webdriver through the execution code;
the browser executes the codes according to the execution codes, outputs acquisition results, and sends the acquisition results as loads to a PC (personal computer) corresponding to the master role to which the IP address recorded in the codes belongs in a message form;
the PC machine corresponding to the worker role transmits the acquisition result back to the master first routing controller to which the IP address belongs in a message form;
and the first routing controller transmits the acquisition result back to the master manager and displays the result on a manager interface.
4. The message driven method of claim 2, wherein the first routing controller is configured to operate in a process comprising:
the second routing controller corresponding to a plurality of PCs (personal computers) which are used as worker roles in the local area network is responsible for carrying out two-way communication and message body transmission through WebSocket;
and carrying out two-way communication with the user interface, and analyzing and sorting the acquired results.
5. The message driven method of claim 2, wherein the second routing controller is operable to:
the first routing controller corresponding to a PC (personal computer) which is in charge of taking the role of master administrator in the local area network carries out two-way communication and message body transmission through WebSocket;
calling a code generator to generate a code, and driving a Webdriver to open a browser acquisition result, wherein the called code records a plurality of IP addresses corresponding to the PC machines serving as the worker roles;
and when the acquisition is finished, transmitting the acquisition result to a plurality of corresponding second routing controllers corresponding to the PC machines serving as the worker roles.
6. A message driven system for simulating browser operations, the message driven system comprising:
the structure configuration module is used for configuring the local area network into a master-worker structure; the master-worker structure comprises at least one PC machine serving as a master administrator role and a plurality of PC machines serving as worker roles;
the task interaction module is used for the task publishing of the at least one PC machine serving as a master administrator role, the plurality of PC machines serving as worker roles receive tasks, and the browser simulation collection tasks are carried out through the PC machines serving as worker roles;
and the collecting and displaying module is used for returning a result to the PC machine serving as the master administrator role after the PC machine serving as the worker role completes the browser simulation collecting task, and collecting and displaying the collecting task by the PC machine serving as the master administrator role.
7. The message driven system of claim 6, wherein the task interaction module comprises:
the operation acquisition module is used for acquiring the actual operation of the user in real time by the at least one PC machine which is used as the master administrator role;
the extracting and adding module is used for extracting the real-time operation record of the user by the at least one PC machine serving as the master administrator role according to the actual operation of the user and adding the operation record into an acquisition task;
the first transmission module is used for transmitting the collection task to the first routing controller through the websocket;
the second transmission module is used for transmitting the acquisition task to the second routing controller by the first routing controller through the websocket;
and the transmission execution module is used for outputting the acquisition task in the first routing controller and the IP address of the PC machine serving as a worker role to a code generator, and the code generator generates an execution code.
8. The message driven system of claim 7, wherein the collection presentation module comprises:
the third transfer module is used for transferring the execution code to the browser through the webdriver;
the code execution module is used for executing codes according to the execution codes by the browser, outputting acquisition results, and sending the acquisition results as loads to a PC (personal computer) corresponding to the worker role to which the IP address recorded in the codes belongs in a message form;
the return module is used for transmitting the acquisition result back to the first routing controller in a message form by the PC corresponding to the worker role to which the IP address belongs;
and the display module is used for transmitting the acquisition result back to the manager by the first routing controller and displaying the result on the interface of the manager.
9. The message driving system according to claim 7, wherein the first routing controller is configured to perform bidirectional communication and message body transmission with a second routing controller corresponding to a plurality of PCs in a local area network, perform bidirectional communication with a user interface, and parse and sort the collection result.
10. The message driving system according to claim 7, wherein the second routing controller is configured to perform bidirectional communication and message body transmission via WebSocket with the first routing controller corresponding to the PC in the local area network, the PC serving as a master administrator; calling a code generator to generate a code, and driving a Webdriver to open a browser acquisition result, wherein the called generated code records an IP address corresponding to a PC (personal computer) in a master role; and when the acquisition is finished, the acquisition result is sent to a second routing controller corresponding to the PC machine serving as the worker role, and the second routing controller is connected to the IP address of the master role and returns the simulation acquisition result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210935562.XA CN115277396B (en) | 2022-08-04 | 2022-08-04 | Message driving method and system for simulating browser operation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210935562.XA CN115277396B (en) | 2022-08-04 | 2022-08-04 | Message driving method and system for simulating browser operation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115277396A true CN115277396A (en) | 2022-11-01 |
CN115277396B CN115277396B (en) | 2024-03-26 |
Family
ID=83748452
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210935562.XA Active CN115277396B (en) | 2022-08-04 | 2022-08-04 | Message driving method and system for simulating browser operation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115277396B (en) |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1567190A (en) * | 2002-12-17 | 2005-01-19 | 国际商业机器公司 | System and method for central management of built-in desktop components |
US20110191676A1 (en) * | 2010-01-29 | 2011-08-04 | Microsoft Corporation | Cross-Browser Interactivity Recording, Playback, and Editing |
CN103927253A (en) * | 2013-01-11 | 2014-07-16 | 阿里巴巴集团控股有限公司 | Multiple browser compatibility testing method and system |
CN105515837A (en) * | 2015-11-27 | 2016-04-20 | 重庆邮电大学 | Event-driven high-concurrency WEB traffic generator |
CN106991188A (en) * | 2017-04-11 | 2017-07-28 | 焦点科技股份有限公司 | A kind of efficient internet dynamic data automatic screening and grasping means and system |
US20180210819A1 (en) * | 2017-01-25 | 2018-07-26 | Macy's West Stores, Inc. | System and method of controlling a web browser plug-in for testing analytics |
WO2019196274A1 (en) * | 2018-04-10 | 2019-10-17 | 平安科技(深圳)有限公司 | Web page testing method and apparatus, electronic device, and medium |
CN110555145A (en) * | 2018-03-26 | 2019-12-10 | 上海伯言科技有限公司 | Browser-based webpage content acquisition system and acquisition method thereof |
US20200019583A1 (en) * | 2018-07-11 | 2020-01-16 | University Of Southern California | Systems and methods for automated repair of webpages |
CN110955414A (en) * | 2019-11-29 | 2020-04-03 | 电子科技大学 | User-defined data acquisition system and method |
CN111695075A (en) * | 2020-06-12 | 2020-09-22 | 国网浙江省电力有限公司信息通信分公司 | Website CMS (content management system) identification method and security vulnerability detection method and device |
CN112560244A (en) * | 2020-12-08 | 2021-03-26 | 河海大学 | Virtual simulation experiment system and method based on Docker |
CN114064144A (en) * | 2021-11-12 | 2022-02-18 | 南京论之语网络技术有限公司 | Communication plug-in unit for cross-application data acquisition and communication method |
-
2022
- 2022-08-04 CN CN202210935562.XA patent/CN115277396B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1567190A (en) * | 2002-12-17 | 2005-01-19 | 国际商业机器公司 | System and method for central management of built-in desktop components |
US20110191676A1 (en) * | 2010-01-29 | 2011-08-04 | Microsoft Corporation | Cross-Browser Interactivity Recording, Playback, and Editing |
CN103927253A (en) * | 2013-01-11 | 2014-07-16 | 阿里巴巴集团控股有限公司 | Multiple browser compatibility testing method and system |
CN105515837A (en) * | 2015-11-27 | 2016-04-20 | 重庆邮电大学 | Event-driven high-concurrency WEB traffic generator |
US20180210819A1 (en) * | 2017-01-25 | 2018-07-26 | Macy's West Stores, Inc. | System and method of controlling a web browser plug-in for testing analytics |
CN106991188A (en) * | 2017-04-11 | 2017-07-28 | 焦点科技股份有限公司 | A kind of efficient internet dynamic data automatic screening and grasping means and system |
CN110555145A (en) * | 2018-03-26 | 2019-12-10 | 上海伯言科技有限公司 | Browser-based webpage content acquisition system and acquisition method thereof |
WO2019196274A1 (en) * | 2018-04-10 | 2019-10-17 | 平安科技(深圳)有限公司 | Web page testing method and apparatus, electronic device, and medium |
US20200019583A1 (en) * | 2018-07-11 | 2020-01-16 | University Of Southern California | Systems and methods for automated repair of webpages |
CN110955414A (en) * | 2019-11-29 | 2020-04-03 | 电子科技大学 | User-defined data acquisition system and method |
CN111695075A (en) * | 2020-06-12 | 2020-09-22 | 国网浙江省电力有限公司信息通信分公司 | Website CMS (content management system) identification method and security vulnerability detection method and device |
CN112560244A (en) * | 2020-12-08 | 2021-03-26 | 河海大学 | Virtual simulation experiment system and method based on Docker |
CN114064144A (en) * | 2021-11-12 | 2022-02-18 | 南京论之语网络技术有限公司 | Communication plug-in unit for cross-application data acquisition and communication method |
Non-Patent Citations (2)
Title |
---|
S.DIJA: "A Framework for browser forensics in live windows systems", 《2017 IEEE INTERNATIONAL CONFERENCE ON COMPUTATIONAL INTELLIGENCE AND COMPUTING RESEARCH》 * |
程海峰: "远程实时数据采集***关键技术研究和***研制", 《中国优秀硕士学位论文全文数据库》 * |
Also Published As
Publication number | Publication date |
---|---|
CN115277396B (en) | 2024-03-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101136790B (en) | Cluster managerial automatization test system and method of ethernet switchboard | |
JP3574231B2 (en) | Computer network simulator | |
CN103235756B (en) | A kind of emulation test method of embedded system subregion application software | |
US6295518B1 (en) | System and method for emulating telecommunications network devices | |
US7315807B1 (en) | System and methods for storage area network simulation | |
CN108306804A (en) | A kind of Ethercat main station controllers and its communication means and system | |
CN102768642A (en) | LINUX kernel reliability evaluating system and LINUX kernel reliability evaluating method based on source code analysis | |
CN102946616A (en) | Internet of things middleware performance testing system and testing method | |
CN102523103A (en) | Industrial monitoring network data collection node | |
CN102708232A (en) | Processing method and device for distributed simulation data | |
CN113518012B (en) | Distributed cooperative flow simulation environment construction method and system | |
CN111522727A (en) | Simulation object test method, device and system | |
CN106354629A (en) | Construction method of iOS system mobile application automatic test system based on multiple stages of servers | |
CN112034732A (en) | Semi-physical satellite simulation system and simulation method | |
CN106936658A (en) | The method of testing and test platform of test case, simulation test equipment | |
CN105487403A (en) | Establishment of motion control system based on CAN and simulation modeling method | |
CN104866405A (en) | ZedBoard-based method for remote monitoring of circuit operation in FPGA | |
CN115277396A (en) | Message driving method and system for simulating browser operation | |
CN210807344U (en) | Remote FPGA experiment system | |
CN115291561A (en) | Manufacturing system and equipment virtual debugging platform, method, equipment and application | |
CN213518340U (en) | Nuclear power plant full-operation-value operation and training system | |
CN111228818B (en) | Communication interaction method and device, storage medium, processor and electronic device | |
CN113973060A (en) | Internet of things simulation method, device and system and storage medium | |
CN111221687B (en) | Cloud storage testing system and method | |
CN113395306A (en) | FPGA experimental system combining remote virtual and real |
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 |