CN112528206A - Webpage log collection method and device, electronic equipment and storage medium - Google Patents

Webpage log collection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112528206A
CN112528206A CN202011561969.8A CN202011561969A CN112528206A CN 112528206 A CN112528206 A CN 112528206A CN 202011561969 A CN202011561969 A CN 202011561969A CN 112528206 A CN112528206 A CN 112528206A
Authority
CN
China
Prior art keywords
proxy server
log
user request
response
user
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.)
Pending
Application number
CN202011561969.8A
Other languages
Chinese (zh)
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011561969.8A priority Critical patent/CN112528206A/en
Publication of CN112528206A publication Critical patent/CN112528206A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5055Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering software capabilities, i.e. software resources associated or available to the machine

Landscapes

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

Abstract

The invention relates to the field of data acquisition, and provides a web page log collection method, which comprises the steps of firstly connecting a proxy server between a web page client and a resource server, enabling the web page client to send a user request to the resource server through the proxy server, then confirming whether a request party of the user request belongs to a white list recorded in the proxy server through the proxy server, if the request party belongs to the white list, forwarding the user request to the resource server, sending a response to the proxy server by the resource server, then returning a consistency return text and a log collection script to the web page client, injecting the log collection script in the response to form a response log, and uploading the response log to a log platform for log collection, so that the web page logs of all web page users do not need to be collected together in a large scale, the storage cost is reduced, and the collection efficiency is improved, and the method is more targeted and can be used for more accurately assisting in positioning the production problem.

Description

Webpage log collection method and device, electronic equipment and storage medium
Technical Field
The invention relates to the field of data acquisition, in particular to a method and a device for collecting webpage logs, electronic equipment and a computer-readable storage medium.
Background
The web page is the basic carrier of internet services, and even under the background that the traditional internet form is gradually giving way to the mobile internet nowadays, the HTML page still is the most common business form, and for the internet products and services taking the web page as the basic presentation form, the basic indexes for measuring the business level are the web page browsing volume (PV) and the visitor number (UV). Therefore, the records of the pages loaded and displayed by the browser need to be collected, which is the most original requirement for collecting internet logs and is the basis and premise for developing all internet data analysis.
However, the conventional log collection is mainly directed at collecting logs of all users together, so for a log storage end, log data of all users need to be stored every day, the value of the log is mainly that when a problem occurs to a user, the production problem needs to be positioned through real-time log data of the user, but a large amount of logs are not needed or are worthless, and collecting the logs together does not improve the accuracy of the positioning problem but also increases the storage cost.
Therefore, a method for collecting a weblog is needed to save storage cost and improve log search speed.
Disclosure of Invention
The invention provides a webpage log collecting method, a device, electronic equipment and a computer readable storage medium, and mainly aims to collect only a webpage log which is valuable for problem location, so that the cost of storing the log is saved, the log searching speed is improved, and when the webpage log is collected, a thread different from a webpage operation is adopted, the webpage log is collected while the webpage log is used, and the webpage log are independent and do not influence each other.
In order to achieve the above object, the present invention provides a method for collecting a web log, comprising:
connecting a proxy server between a webpage client and a resource server, so that the webpage client sends a user request to the resource server through the proxy server;
intercepting and receiving the user request through the proxy server, confirming whether a requesting party of the user request belongs to a white list recorded in the proxy server, and forwarding the user request to the resource server if the requesting party of the user request belongs to the white list; the white list comprises a test ID and a user ID with a webpage operation error;
acquiring a response made to the user request from the resource server through the proxy server, and adaptively modifying the response to form a consistency return text;
and returning the consistency return text and the log collection script to the webpage client, injecting the log collection script into the response to form a response log, and uploading the response log to a log platform for log collection.
Optionally, the process of connecting a proxy server between a web client and a resource server, and enabling the web client to issue a user request to the resource server via the proxy server, includes:
initiating a connection request to the proxy server through the webpage client;
the proxy server acquires the specification information of the webpage client according to the connection request;
evaluating the safety coefficient of the webpage client according to the specification information;
if the safety coefficient of the webpage client is greater than a preset safety threshold value, the proxy server sends a connection response to the webpage client so as to establish the connection between the webpage client and the proxy server and acquire a home address of a user request sent by the webpage client;
the proxy server searches the resource server according to the home address and sends a trust instruction to the resource server;
and judging the security of the proxy server according to the trust instruction, and if the security reaches the standard, replying a trust return code to the proxy server by the resource server so as to establish the connection between the resource server and the proxy server.
Optionally, before the proxy server intercepts and receives the user request and confirms whether a requester of the user request belongs to a white list recorded in the proxy server, the method further includes automatically establishing the white list, and the process of automatically establishing the white list includes:
obtaining monitoring authorization of a user of the webpage client;
performing operation monitoring on the user through the monitoring component based on the monitoring authorization to acquire an operation flow line of the user;
extracting webpage operation error information from the operation flow line, packaging the webpage operation error information into an error log, and acquiring a user ID of a user to which the webpage operation error information belongs;
uploading the error log and the user ID to a log platform, wherein the user ID is stored in a white list of the log platform.
Optionally, before intercepting and receiving the user request by the proxy server and confirming whether a requester of the user request belongs to a white list recorded in the proxy server, the method further includes actively adding the white list, and the process of actively adding the white list includes:
storing the test ID of the tester into a white list of the log platform;
performing cyclic repeated operation in the webpage client by using the test ID to obtain test feedback;
acquiring the defect operation of the webpage client according to the test feedback, integrating the data of the defect operation into a defect log, uploading the defect log to a log platform, and marking a defect mark on the test ID to update the white list.
Optionally, before the process of intercepting, by the proxy server, the user request and confirming whether a requester of the user request belongs to the white list recorded in the proxy server, the method further includes:
the proxy server sends a request instruction to the log platform at regular time according to preset time;
according to the solicitation instruction, the log platform sends a white list updated in real time to the proxy server;
and the proxy server acquires the real-time updated white list and stores the user ID or the test ID updated in the real-time updated white list into a storage database of the proxy server.
Optionally, the process of intercepting, by the proxy server, the user request and confirming whether a requester of the user request belongs to the white list recorded in the proxy server includes:
intercepting and receiving the user request;
analyzing the user request to obtain an information packet of the user request;
extracting the user ID to which the user request belongs from the information packet;
and judging whether the user ID is stored in a storage database of the proxy server.
Optionally, the resource server responds to the user request, and sends the response to the proxy server, so that the proxy server adaptively modifies the response to form a consistent return text, including:
the resource server receives the user request forwarded by the proxy server;
the resource server acquires the address of the request resource requested by the user;
the resource server extracts the request resource according to the address of the request resource and generates an extraction bar;
the resource server integrates the request resource and the extraction bar into a response and sends the response to the proxy server;
the proxy server analyzes the response to obtain a response text, obtains an error code and an error instruction in the response text through an error monitoring script, and adaptively modifies the error code and the error instruction in the response text to form a consistent return text.
In order to solve the above problem, the present invention further provides a weblog collecting apparatus, including:
the server transfer unit is used for connecting a proxy server between a webpage client and a resource server so that the webpage client sends a user request to the resource server through the proxy server;
a user request judging unit, configured to intercept and receive the user request through the proxy server, and determine whether a requesting party of the user request belongs to a white list recorded in the proxy server, and forward the user request to the resource server if the requesting party of the user request belongs to the white list; the white list comprises a test ID and a user ID with a webpage operation error;
the response unit is used for enabling the resource server to respond to the user request and sending the response to the proxy server so that the proxy server can adaptively modify the response to form a consistent return text;
and the log collection unit is used for returning the consistency return text and the log collection script to the webpage client, injecting the log collection script into the response to form a response log, and uploading the response log to a log platform for log collection.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the steps of the webpage log collection method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is executed by a processor in an electronic device to implement the above weblog collection method.
The embodiment of the invention firstly connects a proxy server between a webpage client and a resource server, so that the webpage client sends a user request to the resource server through the proxy server, then intercepts and receives the user request through the proxy server, confirms whether a requester of the user request belongs to a white list recorded in the proxy server, if the requester of the user request belongs to the white list, forwards the user request to the resource server, obtains a response made aiming at the user request from the resource server through the proxy server, namely the resource server responds to the user request, and sends the response to the proxy server so as to ensure that the proxy server carries out adaptive modification aiming at the response to form a consistency return text, then returns the consistency return text and a log collection script to the webpage client, and injects the log collection script into the response to form a response log, and the response logs are uploaded to a log platform for log collection, so that only the test ID of a tester and the webpage logs operated by the user ID with the webpage operation error history are collected, the webpage logs of all webpage users do not need to be collected together in a large scale, the storage cost is reduced, the collection efficiency is improved, the method is more targeted, and the production problem can be accurately positioned in an auxiliary manner.
Drawings
Fig. 1 is a schematic flowchart of a web log collection method according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of a weblog collecting apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device implementing a web log collection method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a webpage log collection method. Fig. 1 is a schematic flow chart of a web log collection method according to an embodiment of the present invention. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the method for collecting a weblog includes:
s1: connecting a proxy server between the webpage client and the resource server, so that the webpage client sends a user request to the resource server through the proxy server;
the process of step S1, including:
s11: initiating a connection request to a proxy server through a webpage client;
s12: the proxy server acquires the specification information of the webpage client according to the connection request;
s13: evaluating the safety coefficient of the webpage client according to the specification information;
s14: if the safety coefficient of the webpage client is greater than a preset safety threshold value, the proxy server sends a connection response to the webpage client so as to establish the connection between the webpage client and the proxy server and acquire a home address of a user request sent by the webpage client;
s15: the proxy server searches for the resource server according to the home address and initiates a trust instruction to the resource server;
s16: and judging the security of the proxy server according to the trust instruction, and if the security reaches the standard, replying a trust return code to the proxy server by the resource server so as to establish the connection between the resource server and the proxy server.
In this instance, the web page client uses a portal page, that is, a proxy server needs to be established between the portal page and a resource acquisition site (resource server) corresponding to the portal page, so that the proxy server is responsible for forwarding a user request sent by the portal page and transmitting a return text returned by aiming at the user request to the portal page to serve as a microphone between the portal page and the resource server; in this embodiment, a proxy server is first selected, an IP of the proxy server is then obtained, the portal page sends a connection request to the proxy server according to the IP of the proxy server, and the connection request may be based on a local area network or may be connected through a remote desktop, which is not limited herein; when the proxy server receives a connection request sent by a portal page, the specification information of the portal page is obtained according to the connection request, the safety factor of the portal page is obtained according to the specification information, the mode of obtaining the safety factor is not specifically limited, the safety factor can be evaluated through software or manual evaluation by workers, if the safety factor of the portal page is greater than a preset safety threshold, the proxy server sends a connection response to the portal page, so that the connection between the portal page and the proxy server is completed, it needs to be stated that the safety threshold is preset in advance, and specific numerical values are determined according to the environment of the portal page, and are not limited; specifically, the proxy server acquires the home address of the resource server to which the proxy server sends the user request through the portal webpage, finds the resource server to which the portal webpage sends the user request according to the home address, and sends a trust instruction to the resource server.
S2: intercepting and receiving a user request through a proxy server, confirming whether a request party of the user request belongs to a white list recorded in the proxy server, and forwarding the user request to a resource server if the request party of the user request belongs to the white list; the white list comprises a test ID and a user ID with a webpage operation error;
before step S2, the method further includes building a white list, and in one embodiment, the building the white list automatically includes:
s21-1: acquiring monitoring authorization of a user of a webpage client;
s21-2: the operation of the user is monitored through the monitoring component based on the monitoring authorization so as to obtain an operation flow line of the user;
s21-3: extracting webpage operation error information from the operation flow line, packaging the webpage operation error information into an error log, and acquiring a user ID of a user to which the webpage operation error information belongs;
s21-4: and uploading the error log and the user ID to a log platform, wherein the user ID is stored in a white list of the log platform.
In another embodiment, the active addition of the white list includes:
s22-1: storing the test ID of the tester into a white list of a log platform;
s22-2: performing cyclic repeated operation in the webpage client by using the test ID to obtain test feedback;
s22-3: and acquiring the defect operation of the webpage client according to the test feedback, integrating the data of the defect operation into a defect log, uploading the defect log to a log platform, and marking a defect mark on the test ID to update the white list.
Before step S2, that is, before the process of intercepting the received user request by the proxy server and confirming whether the requester of the user request belongs to the white list recorded in the proxy server, the method further includes:
s23-1: the proxy server sends a request instruction to the log platform at regular time according to preset time;
s23-2: according to the solicitation instruction, the log platform sends a white list updated in real time to the proxy server;
s23-3: and the proxy server acquires the real-time updated white list and stores the user ID or the test ID updated in the real-time updated white list into a storage database of the proxy server.
In step S2, the process of receiving the user request and confirming whether the requester of the user request belongs to the white list recorded in the proxy server through the proxy server includes:
s24-1: intercepting and receiving a user request;
s24-2: analyzing the user request to obtain an information packet of the user request;
s24-3: extracting a user ID to which the user request belongs from the information packet;
s24-4: it is determined whether the user ID is stored in a storage database of the proxy server.
When the user request reaches the proxy server, if the user ID is in the white list, analyzing the user request type, in this embodiment, dividing the request type into three types, and judging through the text type in the return body in the user request; the first type is html resources, if the type of the resources is the html resources, before the proxy server returns to a user, a web page event and an error monitoring script are injected into an html text; the second type is a common data request (the data return type is json or text), all request inclusion in the user request is recorded by the request, and an error monitoring script is injected; the third type is other than the first type and is directly injected with an error monitoring script.
S3: the method comprises the steps that a response made for a user request is obtained from a resource server through a proxy server, the response is adaptively modified to form a consistency return text, namely the resource server makes a response for the user request, and the response is sent to the proxy server, so that the proxy server adaptively modifies the response to form the consistency return text;
in step S3, the resource server responding to the user request and sending the response to the proxy server, so that the proxy server adaptively modifies the response to form a consistent returned text, includes:
s31: the resource server receives a user request forwarded by the proxy server;
s32: the resource server acquires the address of a request resource requested by a user;
s33: the resource server extracts the request resource according to the address of the request resource and generates an extraction bar;
s34: the resource server integrates the request resource and the extraction bar into a response and sends the response to the proxy server;
s35: the proxy server analyzes the response to obtain a response text, obtains an error code and an error instruction in the response text through the error monitoring script, and adaptively modifies the error code and the error instruction in the response text to form a consistent return text.
Specifically, still taking web portal as an example, in this embodiment, a user operates on a portal web page to form a user request, the proxy server forwards the user request to a resource server, the resource server receives the user request forwarded by the proxy server, obtains an address of a request resource of the user request in the user request, extracts a corresponding resource according to the address of the resource and generates an extraction bar, so as to integrate the request resource and the extraction bar into a request response, and sends the request response to the proxy server, it should be noted that since the user request is forwarded by the proxy server, that is, the user ID of the user request is in a white list, that is, the user ID has an error operation history, the proxy server needs to determine whether an error code and an error instruction exist in the response, in other words, the proxy server needs to determine whether the response matches the user request, and then adaptively modify the error code and the error instruction in the response text to form a consistent return text, so as to modify the response into a response completely consistent with the user request, thereby avoiding the user from generating an error response in operation.
S4: returning the consistency return text and the log collection script to the webpage client, injecting the log collection script into a response to form a response log, and uploading the response log to a log platform for log collection;
in step S4, encapsulating the error code and the error instruction in the response text, adding the user ID to which the response text belongs, and injecting a log collection script to form a response log; returning the consistency return text to the webpage client to enable the webpage client to complete normal webpage operation; and uploading the response log to a log platform to complete the collection of the log, and an operator can inquire the log of the user through the user ID.
As mentioned above, the web page log collecting method provided by the invention firstly connects the proxy server between the web page client and the resource server, makes the web page client send out the user request to the resource server through the proxy server, then intercepts and receives the user request through the proxy server, and confirms whether the request party of the user request belongs to the white list recorded in the proxy server, if the request party belongs to the white list, the user request is forwarded to the resource server, the resource server responds to the user request, and sends the response to the proxy server, so that the proxy server carries out adaptive modification to the response to form a consistent return text, and then returns the consistent return text and the log collecting script to the web page client, injects the log collecting script in the response to form a response log, and uploads the response log to the log platform for log collection, therefore, only the test ID of the tester and the webpage log operated by the user ID with the webpage operation error history are collected, so that the webpage logs of all webpage users do not need to be collected together on a large scale, the storage cost is reduced, the collection efficiency is improved, the pertinence is realized, and the production problem can be accurately positioned in an auxiliary mode.
As shown in fig. 2, the present invention provides a weblog collecting apparatus 100, which can be installed in an electronic device. According to the realized functions, the weblog collection apparatus 100 may include a server relay unit 101, a user request judgment unit 102, a response unit 103, and a log collection unit 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
a server transfer unit 101, configured to connect a proxy server between a web client and a resource server, so that the web client sends a user request to the resource server via the proxy server;
a user request judging unit 102, configured to intercept and receive a user request through a proxy server, determine whether a requesting party of the user request belongs to a white list recorded in the proxy server, and forward the user request to the resource server if the requesting party of the user request belongs to the white list; the white list comprises a test ID and a user ID with a webpage operation error;
a response unit 103, configured to enable the resource server to respond to the user request, and send the response to the proxy server, so that the proxy server adaptively modifies the response to form a consistent return text;
and the log collection unit 104 is configured to return the consistency return text and the log collection script to the web page client, inject the log collection script into a response to form a response log, and upload the response log to the log platform for log collection.
As shown in fig. 3, the present invention provides an electronic device 1 capable of implementing a weblog collecting method.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a weblog collecting program 12, stored in the memory 11 and executable on said processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of a weblog collecting program, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (e.g., a weblog collecting program, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The weblog collecting program 12 stored in the memory 11 of the electronic device 1 is a combination of instructions, which when executed in the processor 10, can implement:
connecting a proxy server between the webpage client and the resource server, so that the webpage client sends a user request to the resource server through the proxy server;
intercepting and receiving a user request through a proxy server, confirming whether a request party of the user request belongs to a white list recorded in the proxy server, and forwarding the user request to a resource server if the request party of the user request belongs to the white list; the white list comprises a test ID and a user ID with a webpage operation error;
acquiring a response made for a user request from a resource server through a proxy server, and adaptively modifying the response to form a consistent return text;
and returning the consistency return text and the log collection script to the webpage client, injecting the log collection script into a response to form a response log, and uploading the response log to a log platform for log collection.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A web log collection method, comprising:
connecting a proxy server between a webpage client and a resource server, so that the webpage client sends a user request to the resource server through the proxy server;
intercepting and receiving the user request through the proxy server, confirming whether a requesting party of the user request belongs to a white list recorded in the proxy server, and forwarding the user request to the resource server if the requesting party of the user request belongs to the white list; the white list comprises a test ID and a user ID with a webpage operation error;
acquiring a response made to the user request from the resource server through the proxy server, and adaptively modifying the response to form a consistency return text;
and returning the consistency return text and the log collection script to the webpage client, injecting the log collection script into the response to form a response log, and uploading the response log to a log platform for log collection.
2. The web log collecting method according to claim 1, wherein the process of connecting a proxy server between a web client and a resource server to make the web client issue a user request to the resource server via the proxy server comprises:
initiating a connection request to the proxy server through the webpage client;
the proxy server acquires the specification information of the webpage client according to the connection request;
evaluating the safety coefficient of the webpage client according to the specification information;
if the safety coefficient of the webpage client is greater than a preset safety threshold value, the proxy server sends a connection response to the webpage client so as to establish the connection between the webpage client and the proxy server and acquire a home address of a user request sent by the webpage client;
the proxy server searches the resource server according to the home address and sends a trust instruction to the resource server;
and judging the security of the proxy server according to the trust instruction, and if the security reaches the standard, replying a trust return code to the proxy server by the resource server so as to establish the connection between the resource server and the proxy server.
3. The method of claim 2, wherein before intercepting, by the proxy server, the user request and confirming whether a requester of the user request belongs to a white list recorded in the proxy server, further comprising automatically establishing the white list, the automatically establishing the white list comprises:
obtaining monitoring authorization of a user of the webpage client;
performing operation monitoring on the user through the monitoring component based on the monitoring authorization to acquire an operation flow line of the user;
extracting webpage operation error information from the operation flow line, packaging the webpage operation error information into an error log, and acquiring a user ID of a user to which the webpage operation error information belongs;
uploading the error log and the user ID to a log platform, wherein the user ID is stored in a white list of the log platform.
4. The web page log collecting method according to claim 3, wherein before intercepting, by the proxy server, the user request and confirming whether a requester of the user request belongs to a white list recorded in the proxy server, further comprising actively adding the white list, the actively adding the white list comprises:
storing the test ID of the tester into a white list of the log platform;
performing cyclic repeated operation in the webpage client by using the test ID to obtain test feedback;
acquiring the defect operation of the webpage client according to the test feedback, integrating the data of the defect operation into a defect log, uploading the defect log to a log platform, and marking a defect mark on the test ID to update the white list.
5. The web page log collecting method of claim 4, prior to the process of intercepting, by the proxy server, the reception of the user request and confirming whether a requester of the user request belongs to a white list recorded in the proxy server, further comprising:
the proxy server sends a request instruction to the log platform at regular time according to preset time;
according to the solicitation instruction, the log platform sends a white list updated in real time to the proxy server;
and the proxy server acquires the real-time updated white list and stores the user ID or the test ID updated in the real-time updated white list into a storage database of the proxy server.
6. The web page log collecting method of claim 5, wherein intercepting, by the proxy server, a process of receiving the user request and confirming whether a requester of the user request belongs to a white list recorded in the proxy server, comprises:
intercepting and receiving the user request;
analyzing the user request to obtain an information packet of the user request;
extracting the user ID to which the user request belongs from the information packet;
and judging whether the user ID is stored in a storage database of the proxy server.
7. The method for collecting webpage logs, according to claim 1, wherein the resource server responds to the user request and sends the response to the proxy server, so that the proxy server adapts to the response to form a consistent return text, comprising:
the resource server receives the user request forwarded by the proxy server;
the resource server acquires the address of the request resource requested by the user;
the resource server extracts the request resource according to the address of the request resource and generates an extraction bar;
the resource server integrates the request resource and the extraction bar into a response and sends the response to the proxy server;
the proxy server analyzes the response to obtain a response text, obtains an error code and an error instruction in the response text through an error monitoring script, and adaptively modifies the error code and the error instruction in the response text to form a consistent return text.
8. An apparatus for collecting a weblog, the apparatus comprising:
the server transfer unit is used for connecting a proxy server between a webpage client and a resource server so that the webpage client sends a user request to the resource server through the proxy server;
a user request judging unit, configured to intercept and receive the user request through the proxy server, and determine whether a requesting party of the user request belongs to a white list recorded in the proxy server, and forward the user request to the resource server if the requesting party of the user request belongs to the white list; the white list comprises a test ID and a user ID with a webpage operation error;
the response unit is used for enabling the resource server to respond to the user request and sending the response to the proxy server so that the proxy server can adaptively modify the response to form a consistent return text;
and the log collection unit is used for returning the consistency return text and the log collection script to the webpage client, injecting the log collection script into the response to form a response log, and uploading the response log to a log platform for log collection.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the weblog collection method of any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the weblog collecting method according to any one of claims 1 to 7.
CN202011561969.8A 2020-12-25 2020-12-25 Webpage log collection method and device, electronic equipment and storage medium Pending CN112528206A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011561969.8A CN112528206A (en) 2020-12-25 2020-12-25 Webpage log collection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011561969.8A CN112528206A (en) 2020-12-25 2020-12-25 Webpage log collection method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112528206A true CN112528206A (en) 2021-03-19

Family

ID=74976513

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011561969.8A Pending CN112528206A (en) 2020-12-25 2020-12-25 Webpage log collection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112528206A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590492A (en) * 2021-08-23 2021-11-02 宁畅信息产业(北京)有限公司 Information processing method, system, electronic device and computer readable storage medium
CN115576792A (en) * 2022-11-24 2023-01-06 北京宝兰德软件股份有限公司 Log collection system and method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010035379A (en) * 2001-02-08 2001-05-07 오충용 An web log analyzing service method, the system thereof and the recording medium thereof
CN101651707A (en) * 2009-09-22 2010-02-17 西安交通大学 Method for automatically acquiring user behavior log of network
CN106100936A (en) * 2016-08-10 2016-11-09 乐视控股(北京)有限公司 Webpage method for monitoring performance and device and the webserver, client
CN109710490A (en) * 2018-12-20 2019-05-03 网易(杭州)网络有限公司 Acquisition method, device, storage medium and the electronic equipment of client log

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010035379A (en) * 2001-02-08 2001-05-07 오충용 An web log analyzing service method, the system thereof and the recording medium thereof
CN101651707A (en) * 2009-09-22 2010-02-17 西安交通大学 Method for automatically acquiring user behavior log of network
CN106100936A (en) * 2016-08-10 2016-11-09 乐视控股(北京)有限公司 Webpage method for monitoring performance and device and the webserver, client
CN109710490A (en) * 2018-12-20 2019-05-03 网易(杭州)网络有限公司 Acquisition method, device, storage medium and the electronic equipment of client log

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590492A (en) * 2021-08-23 2021-11-02 宁畅信息产业(北京)有限公司 Information processing method, system, electronic device and computer readable storage medium
CN113590492B (en) * 2021-08-23 2024-07-19 宁畅信息产业(北京)有限公司 Information processing method, system, electronic device and computer readable storage medium
CN115576792A (en) * 2022-11-24 2023-01-06 北京宝兰德软件股份有限公司 Log collection system and method

Similar Documents

Publication Publication Date Title
CN112491602B (en) Behavior data monitoring method and device, computer equipment and medium
CN110069297B (en) SPRING MVC-based exception handling method, SPRING MVC-based exception handling device, computer equipment and storage medium
CN112528206A (en) Webpage log collection method and device, electronic equipment and storage medium
CN104394121B (en) Terminal label method and apparatus
CN112527664A (en) Method and device for generating test case, electronic equipment and storage medium
CN113704665B (en) Dynamic service release method and device, electronic equipment and storage medium
CN104767653A (en) Method and device for monitoring network interfaces
CN115150261B (en) Alarm analysis method, device, electronic equipment and storage medium
CN112528307A (en) Service request checking method and device, electronic equipment and storage medium
CN113176968A (en) Safety test method, device and storage medium based on interface parameter classification
CN113282854A (en) Data request response method and device, electronic equipment and storage medium
CN104639387B (en) A kind of user network behavior tracking method and apparatus
CN114006885A (en) Data acquisition method and device based on intelligent equipment and electronic equipment
CN104239297A (en) Webpage bookmarking method, system and device
CN117113430A (en) Webpage violation picture detection method and device, electronic equipment and storage medium
CN114185502B (en) Log printing method, device, equipment and medium based on production line environment
CN114157634B (en) Unique account identification method, device, equipment and storage medium
CN111159988B (en) Model processing method, device, computer equipment and storage medium
CN115022397A (en) Interface parameter simplifying method and device, electronic equipment and storage medium
CN114942855A (en) Interface calling method and device, electronic equipment and storage medium
CN114567374A (en) Method for checking operating conditions of a facility point, and associated device
CN114268559A (en) Directional network detection method, device, equipment and medium based on TF-IDF algorithm
CN114387021A (en) Service state generation method, device, equipment and storage medium
CN113326421B (en) Data identification method and device for record carrier, electronic equipment and storage medium
CN114371969A (en) Page performance testing method and 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