CN114257575A - Client data processing method and device, electronic equipment and storage medium - Google Patents

Client data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114257575A
CN114257575A CN202111547162.3A CN202111547162A CN114257575A CN 114257575 A CN114257575 A CN 114257575A CN 202111547162 A CN202111547162 A CN 202111547162A CN 114257575 A CN114257575 A CN 114257575A
Authority
CN
China
Prior art keywords
data
request
sending
browser
client data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111547162.3A
Other languages
Chinese (zh)
Other versions
CN114257575B (en
Inventor
陈文豪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Yizhangtong Cloud Technology Shenzhen Co ltd
Original Assignee
Ping An Yizhangtong Cloud Technology Shenzhen 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 Yizhangtong Cloud Technology Shenzhen Co ltd filed Critical Ping An Yizhangtong Cloud Technology Shenzhen Co ltd
Priority to CN202111547162.3A priority Critical patent/CN114257575B/en
Publication of CN114257575A publication Critical patent/CN114257575A/en
Application granted granted Critical
Publication of CN114257575B publication Critical patent/CN114257575B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Abstract

The embodiment of the invention discloses a method and a device for processing client data, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring data sending request association creation data; the data sending request association creation data comprises browser state data and/or client data state association data; creating data according to the data sending request association to generate a client data sending request; the client data sending request is used for sending the client data collected by the browser to the server; determining a target request sending mode of a client data sending request according to the request sending associated data; requesting to send the associated data, wherein the associated data comprises browser associated data and/or client data volume; and sending the client data sending request to a server according to the target request sending mode. The technical scheme of the embodiment of the invention can ensure the fluency and high efficiency of the operation of the user at the browser end while the browser sends the client data, thereby improving the user experience.

Description

Client data processing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a client data processing method and device, electronic equipment and a storage medium.
Background
The client data collection means that a certain technical method is adopted to directly obtain behavior data of interaction conditions between a user and a website, such as equipment type, network environment, user behavior, terminal performance data and the like, from a World Wide Web (Web) client, namely a browser, and send the obtained data to a server. The user behavior data collected from the client can reduce the human interference factors, the obtained data is more real and accurate, the defects of data collection of the server are overcome, and the resource consumption of the server is reduced.
Currently, there are several methods for sending client data collected by a browser to a server:
(1) client data is sent through an XHR (Xml Http Request) API (Application Programming Interface). The XHR API is a web API interface provided by a mainstream browser, and client data collected by the browser can be transmitted to a server through an HTTP (Hyper Text Transfer Protocol) Protocol by calling the web API interface. The XHR API is highly compatible with browsers.
(2) Client data is sent through the Fetch API (which provides a common definition for Request and Response objects). The Fetch API is a web API interface provided by modern browsers, which can also be invoked to transport client data to servers via the HTTP protocol. Compared with the XHR API, the Fetch API has better expansibility and simpler grammar, but is supported by the browser with low compatibility and higher version.
(3) Client data is transmitted by inserting a script, an image (two types of HTTP tags), and other tags that can load an external resource into an HTTP document of a browser. The server address (src address) of the receiving client data can be set by dynamically inserting these tags. And after the browser collects the client data, dynamically adding the acquired client data to the tag through a built-in script, and sending the acquired client data to the corresponding server through the tag according to the preset src address. The sending mode of the client data is simple to realize, cross-domain access is allowed, the size of the sent message is limited, and the method is suitable for data with small sending quantity.
In the process of implementing the invention, the inventor finds that the prior art has the following defects: all of the above three ways of sending client data of a browser to a server need to initiate an HTTP request to the corresponding server through the browser. However, the number of HTTP requests sent by the browser to the same server in parallel under the same domain name is limited. The HTTP request for sending the client data inevitably affects the completion time of the HTTP request triggered when the user normally uses the web page, resulting in a long operation waiting time of the user at the browser end, thereby reducing user experience.
Disclosure of Invention
The embodiment of the invention provides a client data processing method and device, electronic equipment and a storage medium, which can ensure the fluency and high efficiency of the operation of a user at a browser end while the browser sends the client data, thereby improving the user experience.
In a first aspect, an embodiment of the present invention provides a method for processing client data, including:
acquiring data sending request association creation data; the data sending request association creation data comprises browser state data and/or client data state association data;
creating data according to the data sending request association to generate a client data sending request; the client data sending request is used for sending the client data collected by the browser to the server;
determining a target request sending mode of the client data sending request according to the request sending associated data; wherein the request sending associated data comprises browser associated data and/or client data volume;
and sending the client data sending request to the server according to the target request sending mode.
In a second aspect, an embodiment of the present invention further provides a device for processing client data, where the device includes:
the data sending request association creation data acquisition module is used for acquiring data sending request association creation data; the data sending request association creation data comprises browser state data and/or client data state association data;
the client data sending request generating module is used for creating data according to the data sending request association and generating a client data sending request; the client data sending request is used for sending the client data collected by the browser to the server;
the target request sending mode determining module is used for determining a target request sending mode of the client data sending request according to the request sending associated data; wherein the request sending associated data comprises browser associated data and/or client data volume;
and the client data sending request sending module is used for sending the client data sending request to the server according to the target request sending mode.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing client data provided by any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for processing client data provided in any embodiment of the present invention.
According to the embodiment of the invention, the client data sending request is generated by associating and creating data according to the obtained data sending request such as the browser state data and/or the client data state associated data, the target request sending mode of the client data sending request is determined according to the request sending associated data such as the browser associated data and the client data quantity, the client data sending request is sent to the server according to the determined target request sending mode, so that the client data is sent to the server through the client data sending request.
Drawings
Fig. 1 is a flowchart of a method for processing client data according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for processing client data according to a second embodiment of the present invention;
fig. 3 is a flowchart of a method for processing client data according to a second embodiment of the present invention;
fig. 4 is a flowchart of a method for processing client data according to a second embodiment of the present invention;
fig. 5 is a flowchart of a method for processing client data according to a second embodiment of the present invention;
fig. 6 is a flowchart of a method for processing client data according to a third embodiment of the present invention;
fig. 7 is a schematic diagram of a client data processing apparatus according to a fourth embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a client data processing method according to an embodiment of the present invention, where this embodiment is applicable to a case where client data is sent to a server through a browser on the premise of ensuring fluency and efficiency of user operations at the browser, and this method may be executed by a client data processing apparatus, which may be implemented by software and/or hardware, and may be generally integrated in an electronic device, which may be any type of terminal device and used in cooperation with the server for receiving the client data. Accordingly, as shown in fig. 1, the method comprises the following operations:
s110, acquiring data sending request association creation data; the data sending request association creation data comprises browser state data and/or client data state association data.
The data transmission request association creation data may be reference data used in the browser to generate the client data transmission request association. The client data sending request, that is, a request related to the client data sent by the browser to the server, where the request may be an HTTP request or any other request type that may be used to send data to the server, which is not limited in this embodiment of the present invention. The client data may include, but is not limited to, the device type of the terminal device running the browser, the network environment in which the browser is currently located, the user's operating behavior in the browser, and terminal performance data, among others. The browser state data may be related data that can reflect the browser state. Optionally, the browser state may include, but is not limited to, a state of the browser itself, such as an open or closed state of the browser, and may also include a state of loading a web page in the browser, such as an open or closed state of each network. The client data state association data may be data related to the client data state that has been collected in the browser. Optionally, the client data state may include, but is not limited to, a data amount of the client data, a collection number of the client data, and the like. The embodiment of the invention does not limit the specific data types and data contents of the browser state data and the client data state associated data.
In the embodiment of the invention, the browser can acquire the data sending request association creation data for generating the client data sending request for sending the client data to the server in real time while collecting the client data. Optionally, the data sending request association creation data may include, but is not limited to, browser state data and/or client data state association data, and any data that may be used for referring to generate a client data sending request may be used as the data sending request association creation data.
S120, creating data according to the data sending request association to generate a client data sending request; the client data sending request is used for sending the client data collected by the browser to the server.
The method and the device avoid that a client data sending request sent by a browser to a server influences a related request triggered when a user normally uses a browser webpage, so that the normal request of the user is slow to lose effectiveness due to the limitation of concurrent requests of the browser, and the user operation experience is seriously quoted. In the embodiment of the invention, the browser is prohibited from transmitting the collected client data to the server in real time after collecting the client data. After the browser acquires the data transmission request association creation data, a reasonable time for generating the client data transmission request can be determined according to the acquired data transmission request association creation data, so that the client data transmission request is generated by triggering under the condition that a request generation condition is met.
S130, determining a target request sending mode of the client data sending request according to the request sending associated data; wherein the request sending associated data comprises browser associated data and/or client data volume.
The request-to-send associated data may be related data for determining a sending manner matched with the client data sending request. The browser related data may be related data in the browser for determining a sending manner that the client data sending request matches. The client data size may then be the data size of the client data. The target request transmission mode may be a mode in which the browser transmits a client data transmission request to the server.
The client data sending request can be generated by determining the reasonable time for generating the client data sending request, so that the high-concurrency browser sending request caused by the real-time generation of the client data sending request is avoided. In the embodiment of the present invention, after the client data sending request is generated, a target request sending method adapted to the client data sending request may be further determined, so that the browser sends the client data to the server through a reasonable target request sending method, thereby further improving sending efficiency and sending success rate of the client data.
S140, sending the client data sending request to the server according to the target request sending mode.
Correspondingly, after the target request sending mode matched with the client data is determined, the browser can send the client data sending request to the server according to the determined target request sending mode, so that the collected client data can be sent to the server through the client data sending request.
According to the embodiment of the invention, the client data sending request is generated by associating and creating data according to the obtained data sending request such as the browser state data and/or the client data state associated data, the target request sending mode of the client data sending request is determined according to the request sending associated data such as the browser associated data and the client data quantity, the client data sending request is sent to the server according to the determined target request sending mode, so that the client data is sent to the server through the client data sending request.
Example two
Fig. 2 is a flowchart of a client data processing method according to a second embodiment of the present invention, fig. 3 is a flowchart of a client data processing method according to a second embodiment of the present invention, fig. 4 is a flowchart of a client data processing method according to a second embodiment of the present invention, and fig. 5 is a flowchart of a client data processing method according to a second embodiment of the present invention, which is embodied based on the above-described embodiments. Accordingly, as shown in fig. 2, fig. 3, fig. 4 and fig. 5, the method of the present embodiment may include:
s210, acquiring data sending request association creation data; the data sending request association creation data comprises browser state data and/or client data state association data.
Accordingly, S220 may include the following parallel operations:
s221a, determining the webpage label displayed on the browser interface of the browser according to the browser state data.
The web page tags are also tags used for switching web pages in the browser, and different web pages can be switched by clicking each web page tag.
In the embodiment of the present invention, if the data transmission request association creation data includes browser state data, a web page tag displayed on a browser interface of a browser may be determined according to the browser state data, so as to determine a reasonable time for generating a client data transmission request according to a state of the web page tag displayed on the browser interface of the browser. Optionally, the web page tag displayed on the browser interface of the browser is determined according to the browser state data, which may be a web page tag displayed on the browser interface of the browser determined according to the state data of each web page tag currently managed by the browser.
S222a, monitoring the visibility change event of each web tag, so as to determine the web tag status of each web tag according to the monitoring result of the visibility change event.
Wherein the visibility change event is also referred to as visibilichange event. The webpage tag state may include, but is not limited to, states of respective webpage tags being displayed or hidden.
When a user uses a browser to switch a webpage label, the content of the webpage label can become visible or hidden, and when the state of the webpage label changes, a visibility change event of a webpage label document can be triggered. Correspondingly, when a reasonable time for generating a client data transmission request is determined according to the state of the webpage tags displayed on the browser interface of the browser, visibility change events of the webpage tags displayed on the browser interface can be monitored through an SDK (Software Development Kit) of the browser, so as to obtain the webpage tag states of the webpage tags.
S223a, determining the webpage label state as the hidden webpage label of the webpage label hidden state.
The hidden web page tag is a web page tag currently hidden in a browser interface of the browser. Hiding means that although the webpage tab is already opened in the browser interface, the tab of browsing is not currently displayed.
And S224a, generating a client data sending request matched with the hidden webpage label.
It can be understood that the hidden web page tag with the web page tag hidden state is hidden in the browser, which indicates that the user has currently suspended using the web page corresponding to the hidden web page tag. Therefore, in general, the user does not trigger the user operation to generate the HTTP request in the hidden webpage tag. At this time, the matched client data sending request is generated for the hidden webpage label, so that normal operation of the user on the webpage corresponding to the hidden webpage label can be ensured.
S221b, determining the webpage label displayed on the browser interface of the browser according to the browser state data.
S222b, monitoring the webpage tags and/or the document unloading events of the browser, and determining the webpage tag state of each webpage tag and/or the browser state of the browser according to the monitoring result of the document unloading events.
Among them, the document unloading event is also an unload event. The web page tab state may also include, but is not limited to, an open or closed state of the respective web page tab. The browser state may include, but is not limited to, an open or closed state of the browser.
In the embodiment of the present invention, if the data transmission request association creation data includes browser state data, the web page tags displayed on the browser interface of the browser are determined according to the browser state data, and when a reasonable time for generating a client data transmission request is determined according to the states of the web page tags displayed on the browser interface of the browser, the web page tag states of the web page tags and/or the browser state of the browser may also be determined by the browser. Alternatively to this, the first and second parts may,
when closing a webpage label or a browser, a user can trigger a document unloading event of the browser. Correspondingly, when a reasonable time for generating a client data sending request is determined according to the state of the webpage label displayed on the browser interface of the browser and/or the browser state, the document unloading event of the browser can be monitored through the SDK of the browser, so that the webpage label state of each webpage label and the browser state of the browser can be obtained.
S223b, determining the webpage label state as a closed webpage label of the webpage label closed state, and/or determining the browser state as a closed browser of the browser closed state.
Wherein, closing the webpage label, that is, the closed webpage label, and closing the browser, that is, the closed browser.
S224b, generating the closing web page label and/or the client data sending request matched with the closing browser.
It can be understood that the closed web page tag, whose web page tag state is the web page tag closed state, has been closed by the user in the browser, indicating that the user has currently stopped using the web page corresponding to the closed web page tag. Therefore, the user does not trigger the user operation to generate the HTTP request when the webpage tag is closed. Similarly, a closed browser with a browser state of browser closed state has been closed by the user, indicating that the user has currently stopped using the browser. Therefore, the user does not trigger the user operation to generate the HTTP request when the browser is closed.
At this time, the matched client data sending request is generated for closing the webpage tag, and/or the matched client data sending request is generated for closing the browser, so that normal operation of closing the webpage corresponding to the webpage tag and/or closing the browser for the user can be ensured.
It will be appreciated that when the browser is closed, the browser may close multiple web page tabs at the same time. At this time, as long as the webpage tag is configured with the document unloading event monitoring function, the browser can generate a matched client data sending request for the webpage tag. Therefore, when the client data transmission request for closing the browser matching is generated, the client data transmission request for closing a plurality of different closed web tags for the browser matching may be generated.
S221c, determining the sending time period of the client data according to the browser state data.
The client data sending time period may be a period preset by the browser and used for sending the client data to the server, and may be specifically set according to requirements of different browsers or web tags, for example, 5 minutes, and the like.
S222c, judging whether the current system time reaches the client data sending time period, if yes, executing S223c, otherwise, executing S225 c.
S223c, judging whether the browser has unsent client data, if yes, executing S224c, otherwise, returning to execute S222 c.
And S224c, generating the client data sending request.
S225c, locally caching the client data.
In the embodiment of the present invention, if the data transmission request association creation data includes browser state data, a client data transmission time period for the browser to transmit the client data to the server may also be determined according to the browser state data. If it is determined that the current system time reaches the client data transmission time period and the browser has client data that is not transmitted, a client data transmission request may be generated. Correspondingly, if the current system time is determined not to reach the client data sending time period and/or the browser is determined not to have unsent client data, the client data can be cached locally, and the execution is returned to judge whether the current system time reaches the client data sending time period or not until a client data sending request is generated. The benefits of this arrangement are: the browser generates a client data sending request under the condition that client data exist through a set client data sending time period, so that the condition that the client data are lost due to long-time non-operation of a user can be effectively avoided, and the timeliness and the comprehensiveness of the client data are guaranteed.
Optionally, the client data sending time period is determined according to the browser state data, and may be a client data sending time period preset by obtaining configuration data in the current state of the browser. It is understood that the client data transmission time period can be dynamically configured in real time, such as adjusting in real time according to the user operation frequency or according to the transmission amount of the client data by the browser, so as to maximally cooperate with the operation of the user at the browser end.
S221d, determining the client data quantity threshold and/or the client data collection time threshold of each webpage label according to the client data state related data.
The client data amount threshold may be a threshold set for the client data amount, and the client data collection time threshold may be a threshold set for the client data collection time. The client data volume threshold and the client data collection frequency threshold may be set adaptively according to the type of the web tag or the service requirement, and the specific values of the client data volume threshold and the client data collection frequency threshold are not limited in the embodiment of the present invention.
S222d, determining whether the current client data size of the current netpage tag reaches the client data size threshold of the current netpage tag, if yes, executing S224d, otherwise, executing S223 d.
S223d, judging whether the current client data collection times of the current webpage label reach the client data collection times threshold of the current webpage label, if so, executing S224d, otherwise, returning to the step S222 d.
And S224d, generating a client data sending request of the current webpage label.
In the embodiment of the present invention, if the data transmission request association creation data includes browser state data, the client data amount threshold and/or the client data collection time threshold of each web tag may be determined according to configuration data of a web tag preset in the browser state data. Correspondingly, if the browser determines that the current client data amount of the current webpage label reaches the client data amount threshold of the current webpage label, and/or determines that the current client data collection frequency of the current webpage label reaches the client data collection frequency threshold of the current webpage label, the current webpage label can send the client data to the server. At this time, the browser may generate a client data transmission request of the current webpage tag. And if the browser determines that the current client data amount of the current webpage label does not reach the client data amount threshold value of the current webpage label and determines that the current client data collection frequency of the current webpage label does not reach the client data collection frequency threshold value of the current webpage label, the current webpage label cannot send the client data to the server. At this time, the browser may first cache the client data collected for the current webpage tag, and suspend the client data transmission request for generating the current webpage tag. Alternatively, the browser may cache the collected client Data in a local database IndexDB (Index Data Base), a kind of front-end database.
In an optional embodiment of the present invention, the client data state related data may further include a client data service index of each web tag; the determining the client data quantity threshold and/or the client data collection time threshold of each webpage tag according to the client data state association data may include: acquiring the current network environment of the browser; and determining a client data volume threshold value and/or a client data collection frequency threshold value of each webpage label according to the client data service index and the network environment type of the current network environment.
The client data service index can be the service requirement of different webpage labels on the client data.
In order to meet the sending requirements of different webpage labels on client data, different types of webpage labels can set a matched client data volume threshold and a client data collection frequency threshold according to specific service requirements. For example, when the demand of webpage tag 1 on the client data volume is large, in order to avoid that frequent sending of client data affects normal webpage operation of a user, the client data volume threshold value may be set to be relatively large; when the demand for client data volume by netpage tag 2 is small, then the client data volume threshold may be set relatively small. However, when the client data amount threshold is set too large, the client data is likely to be lost. Therefore, on the basis of the client data volume threshold, a client data collection time threshold can be set for each webpage label. By setting the threshold value of the client data collection times, the problem of client data loss caused by excessive client data collection times can be avoided.
Meanwhile, the sending situation of the client data is also influenced by the difference of the current network environment of the browser. Therefore, the client data amount threshold value and/or the client data collection time threshold value of each webpage label can be determined according to the network environment type of the current network environment of the browser. Specifically, if the current network environment is a network environment with better communication quality, such as a WiFi (Wireless-Fidelity) network, the client data amount threshold and the client data collection time threshold may be set to be relatively larger. Accordingly, if the current network environment is a network environment with poor communication quality, such as a mobile data network, the client data amount threshold and the client data collection time threshold may be set relatively small.
Therefore, by combining the client data service index and the network environment type of the current network environment of the browser, the client data quantity threshold and the client data collection frequency threshold of each webpage label can be dynamically configured in real time, the sending requirement of the browser on the client data can be met in real time, the sending frequency of sending the client data sending request to the server can be reduced, and the completion timeliness of related requests triggered when a user normally uses a webpage can be reduced.
And S230, determining a target request sending mode of the client data sending request according to the request sending associated data.
Wherein the request sending associated data comprises browser associated data and/or client data volume.
S240, sending the client data sending request to the server according to the target request sending mode.
According to the technical scheme, the client data sending request is generated in various modes according to the browser state data and/or the client data state associated data, the reasonable time of the client data sending request can be accurately determined, so that the browser can generate the client data sending request at the reasonable time, the client data is sent to the server through the client data sending request, the fluency and the high efficiency of the operation of a user at the browser end can be guaranteed while the browser sends the client data, and the user experience is improved.
EXAMPLE III
Fig. 6 is a flowchart of a processing method for client data according to a third embodiment of the present invention, which is embodied based on the foregoing embodiments, and in this embodiment, a variety of specific optional implementation manners for determining a target request sending manner of the client data sending request according to request sending associated data are provided. Correspondingly, as shown in fig. 6, the method of this embodiment may include:
s310, acquiring data sending request association creation data; the data sending request association creation data comprises browser state data and/or client data state association data.
And S320, creating data according to the data sending request association to generate a client data sending request.
The client data sending request is used for sending the client data collected by the browser to the server.
S331a, judging whether the browser version is the first browser version, if so, executing S332a, otherwise, executing S333 a.
S332a, the XHR API is used as the target request sending mode of the client data sending request.
S333a, determining the browser version as the second browser version according to the browser related data, and using the Fetch API as the target request sending mode of the client data sending request.
Wherein the first browser version may be a lower browser version and the second browser version may be a higher browser version.
Considering that the browsers of different versions are different in compatibility, different target request sending modes can be adopted to send client data sending requests to the server for the browsers of different versions. Specifically, the version of the browser may be determined according to browser-related data, such as browser attribute data. If the browser version is determined to be the first browser version, which indicates that the browser version is low, the XHR API with high browser compatibility may be used as a target request sending method for the client data sending request, so as to ensure that the client data sending request can be successfully sent. If the browser version is determined to be the second browser version, which indicates that the browser version is higher, the Fetch API with higher expansibility and simpler grammar can be used as a target request sending mode of the client data sending request, so that the sending efficiency of the client data sending request is improved.
S331b, judging whether the browser and/or the webpage label are in a closed state, if so, executing S332b, otherwise, executing S331 a.
S332b, using sendBeacon API as the target request sending mode of the client data sending request.
In the embodiment of the present invention, if it is determined that the browser and/or the webpage tag is in the closed state according to the browser-related data, the sendBeacon API may be used as a target request sending mode of the client data sending request. The sendBeacon API can still send the client data sending request to the server under the condition that the browser and/or the webpage tag are in the closed state, so that the client data loss caused by closing of the browser and/or the webpage tag is effectively avoided.
And S331c, judging whether the data volume of the client exceeds a preset data volume threshold, if so, executing S332c, otherwise, executing S333 c.
The preset data volume threshold may be another threshold set for the client data volume, and is used to determine the sending mode of the client data sending request.
S332c, the XHR API is used as the target request sending mode of the client data sending request.
S333c, using the external resource tag of the HTML document as the target request sending mode of the client data sending request.
In the embodiment of the present invention, if the target request sending manner of the client data sending request is determined according to the client data amount, it may be determined whether the client data amount of the client data to be sent by the browser exceeds a preset data amount threshold. Since the external resource tag of the HTML document can only send a small amount of client data, if it is determined that the client data amount of the client data to be sent by the browser exceeds the preset data amount threshold, indicating that the browser needs to send a large amount of client data, the XHR API may be used as a target request sending manner of the client data sending request. If it is determined that the client data amount of the client data to be sent by the browser does not exceed the preset data amount threshold, which indicates that the browser does not need to send a large amount of client data, at this time, an external resource tag such as a script and/or an image of the HTML document may be used as a target request sending mode of the client data sending request.
S340, sending the client data sending request to the server according to the target request sending mode.
According to the technical scheme, the target request sending mode matched with the client data sending request is determined in multiple modes according to the browser related data and/or the client data volume, so that the browser selects a reasonable mode to send the client data sending request to the server, the client data is sent to the server through the client data sending request, fluency and high efficiency of operation of a user at the browser end can be guaranteed while the browser sends the client data, and user experience is improved.
It should be noted that any permutation and combination between the technical features in the above embodiments also belong to the scope of the present invention.
Example four
Fig. 7 is a schematic diagram of a device for processing client data according to a fourth embodiment of the present invention, and as shown in fig. 7, the device includes: a data sending request association creation data acquisition module 410, a client data sending request generation module 420, a target request sending mode determination module 430 and a client data sending request sending module 440, wherein:
a data sending request association creation data obtaining module 410, configured to obtain data sending request association creation data; the data sending request association creation data comprises browser state data and/or client data state association data;
a client data transmission request generating module 420, configured to create data according to the data transmission request association to generate a client data transmission request; the client data sending request is used for sending the client data collected by the browser to the server;
a target request sending mode determining module 430, configured to determine a target request sending mode of the client data sending request according to the request sending associated data; wherein the request sending associated data comprises browser associated data and/or client data volume;
a client data sending request sending module 440, configured to send the client data sending request to the server according to the target request sending manner.
According to the embodiment of the invention, the client data sending request is generated by associating and creating data according to the obtained data sending request such as the browser state data and/or the client data state associated data, the target request sending mode of the client data sending request is determined according to the request sending associated data such as the browser associated data and the client data quantity, the client data sending request is sent to the server according to the determined target request sending mode, so that the client data is sent to the server through the client data sending request.
Optionally, if the data sending request association creating data includes the browser state data, the client data sending request generating module 420 is specifically configured to: determining a webpage label displayed on a browser interface of the browser according to the browser state data; monitoring visibility change events of the webpage tags to determine the webpage tag states of the webpage tags according to monitoring results of the visibility change events; determining that the webpage label state is a hidden webpage label of a webpage label hidden state; and generating a client data sending request matched with the hidden webpage label.
Optionally, if the data sending request association creating data includes the browser state data, the client data sending request generating module 420 is specifically configured to: determining a webpage label displayed on a browser interface of the browser according to the browser state data; monitoring the webpage tags and/or the document unloading events of the browser to determine the webpage tag state of each webpage tag and/or the browser state of the browser according to the monitoring result of the document unloading events; determining the webpage label closing state as a webpage label closing state, and/or determining the browser closing state as a browser closing state; and generating a client data sending request matched with the webpage closing tag and/or the browser closing.
Optionally, if the data sending request association creating data includes the browser state data, the client data sending request generating module 420 is specifically configured to: determining a client data sending time period according to the browser state data; and generating the client data sending request under the condition that the current system time is determined to reach the client data sending time period and the browser has the client data which is not sent.
Optionally, if the data sending request association creating data includes the client data state association data, the client data sending request generating module 420 is specifically configured to: determining a client data quantity threshold value and/or a client data collection frequency threshold value of each webpage label according to the client data state associated data; and generating a client data sending request of the current webpage label under the condition that the data quantity of the current client of the current webpage label reaches the client data quantity threshold of the current webpage label and/or under the condition that the data collection frequency of the current client of the current webpage label reaches the client data collection frequency threshold of the current webpage label.
Optionally, the client data state related data includes a client data service index of each web tag; the client data transmission request generating module 420 is specifically configured to: acquiring the current network environment of the browser; and determining a client data volume threshold value and/or a client data collection frequency threshold value of each webpage label according to the client data service index and the network environment type of the current network environment.
Optionally, if the request sending associated data includes the browser associated data, the target request sending manner determining module 430 is specifically configured to: under the condition that the browser version is determined to be the first browser version according to the browser related data, taking an XHR API as a target request sending mode of the client data sending request; under the condition that the browser version is determined to be the second browser version according to the browser related data, taking a Fetch API as a target request sending mode of the client data sending request; and under the condition that the browser and/or the webpage label are determined to be in a closed state according to the browser related data, using the sendBeacon API as a target request sending mode of the client data sending request.
Optionally, if the request sending associated data includes the client data size, the target request sending mode determining module 430 is specifically configured to: under the condition that the data volume of the client exceeds a preset data volume threshold value, taking an XHR API as a target request sending mode of the client data sending request; and under the condition that the data volume of the client does not exceed a preset data volume threshold, taking an external resource tag of an HTML document as a target request sending mode of the client data sending request.
The processing device of the client data can execute the processing method of the client data provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to a method for processing client data provided in any embodiment of the present invention.
Since the processing device for client data described above is a device capable of executing the processing method for client data in the embodiment of the present invention, based on the processing method for client data described in the embodiment of the present invention, a person skilled in the art can understand a specific implementation manner of the processing device for client data in the embodiment of the present invention and various variations thereof, and therefore, how to implement the processing method for client data in the embodiment of the present invention by the processing device for client data is not described in detail herein. The scope of the present application is intended to be protected by only those devices that implement the method for processing client data according to the embodiments of the present invention.
EXAMPLE five
Fig. 8 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. FIG. 8 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in FIG. 8, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors 16, a memory 28, and a bus 18 that connects the various system components (including the memory 28 and the processors 16).
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 8, and commonly referred to as a "hard drive"). Although not shown in FIG. 8, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an Input/Output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network such as the internet) via the Network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be appreciated that although not shown in FIG. 8, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 16 executes various functional applications and data processing by executing programs stored in the memory 28, thereby implementing the processing method of client data provided by the embodiment of the present invention: acquiring data sending request association creation data; the data sending request association creation data comprises browser state data and/or client data state association data; creating data according to the data sending request association to generate a client data sending request; the client data sending request is used for sending the client data collected by the browser to the server; determining a target request sending mode of the client data sending request according to the request sending associated data; wherein the request sending associated data comprises browser associated data and/or client data volume; and sending the client data sending request to the server according to the target request sending mode.
EXAMPLE six
An embodiment of the present invention further provides a computer storage medium storing a computer program, where the computer program is used to execute the processing method of client data according to any one of the above embodiments of the present invention when executed by a computer processor: acquiring data sending request association creation data; the data sending request association creation data comprises browser state data and/or client data state association data; creating data according to the data sending request association to generate a client data sending request; the client data sending request is used for sending the client data collected by the browser to the server; determining a target request sending mode of the client data sending request according to the request sending associated data; wherein the request sending associated data comprises browser associated data and/or client data volume; and sending the client data sending request to the server according to the target request sending mode.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM, or flash Memory), an optical fiber, a portable compact disc Read Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for processing client data, comprising:
acquiring data sending request association creation data; the data sending request association creation data comprises browser state data and/or client data state association data;
creating data according to the data sending request association to generate a client data sending request; the client data sending request is used for sending the client data collected by the browser to the server;
determining a target request sending mode of the client data sending request according to the request sending associated data; wherein the request sending associated data comprises browser associated data and/or client data volume;
and sending the client data sending request to the server according to the target request sending mode.
2. The method according to claim 1, wherein if the data transmission request association creation data includes the browser state data, the generating a client data transmission request according to the data transmission request association creation data includes:
determining a webpage label displayed on a browser interface of the browser according to the browser state data;
monitoring visibility change events of the webpage tags to determine the webpage tag states of the webpage tags according to monitoring results of the visibility change events;
determining that the webpage label state is a hidden webpage label of a webpage label hidden state;
and generating a client data sending request matched with the hidden webpage label.
3. The method according to claim 1, wherein if the data transmission request association creation data includes the browser state data, the generating a client data transmission request according to the data transmission request association creation data includes:
determining a webpage label displayed on a browser interface of the browser according to the browser state data;
monitoring the webpage tags and/or the document unloading events of the browser to determine the webpage tag state of each webpage tag and/or the browser state of the browser according to the monitoring result of the document unloading events;
determining the webpage label closing state as a webpage label closing state, and/or determining the browser closing state as a browser closing state;
and generating a client data sending request matched with the webpage closing tag and/or the browser closing.
4. The method according to claim 1, wherein if the data transmission request association creation data includes the browser state data, the generating a client data transmission request according to the data transmission request association creation data includes:
determining a client data sending time period according to the browser state data;
and generating the client data sending request under the condition that the current system time is determined to reach the client data sending time period and the browser has the client data which is not sent.
5. The method according to claim 1, wherein if the data transmission request association creation data includes the client data state association data, the generating a client data transmission request according to the data transmission request association creation data includes:
determining a client data quantity threshold value and/or a client data collection frequency threshold value of each webpage label according to the client data state associated data;
under the condition that the data volume of the current client of the current webpage label reaches the threshold value of the data volume of the client of the current webpage label, and/or under the condition that the data collection frequency of the current client of the current webpage label reaches the threshold value of the data collection frequency of the client of the current webpage label, generating a request for sending the data of the client of the current webpage label;
the client data state related data comprises client data service indexes of all webpage labels; the determining the client data volume threshold and/or the client data collection times threshold of each webpage label according to the client data state association data comprises:
acquiring the current network environment of the browser;
and determining a client data volume threshold value and/or a client data collection frequency threshold value of each webpage label according to the client data service index and the network environment type of the current network environment.
6. The method according to claim 1, wherein if the request sending associated data includes the browser associated data, the determining a target request sending manner of the client data sending request according to the request sending associated data includes:
under the condition that the browser version is determined to be the first browser version according to the browser related data, taking an XHR API as a target request sending mode of the client data sending request;
under the condition that the browser version is determined to be the second browser version according to the browser related data, taking a Fetch API as a target request sending mode of the client data sending request;
and under the condition that the browser and/or the webpage label are determined to be in a closed state according to the browser related data, using the sendBeacon API as a target request sending mode of the client data sending request.
7. The method of claim 1, wherein if the request for sending associated data includes the amount of the client data, the determining a target request sending manner of the client data sending request according to the request for sending associated data includes:
under the condition that the data volume of the client exceeds a preset data volume threshold value, taking an XHR API as a target request sending mode of the client data sending request;
and under the condition that the data volume of the client does not exceed a preset data volume threshold, taking an external resource tag of an HTML document as a target request sending mode of the client data sending request.
8. An apparatus for processing client data, comprising:
the data sending request association creation data acquisition module is used for acquiring data sending request association creation data; the data sending request association creation data comprises browser state data and/or client data state association data;
the client data sending request generating module is used for creating data according to the data sending request association and generating a client data sending request; the client data sending request is used for sending the client data collected by the browser to the server;
the target request sending mode determining module is used for determining a target request sending mode of the client data sending request according to the request sending associated data; wherein the request sending associated data comprises browser associated data and/or client data volume;
and the client data sending request sending module is used for sending the client data sending request to the server according to the target request sending mode.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more computer programs;
the one or more computer programs, when executed by the one or more processors, cause the one or more processors to perform the method for processing client data recited in any of claims 1-7.
10. A computer storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for processing client data according to any one of claims 1 to 7.
CN202111547162.3A 2021-12-16 2021-12-16 Client data processing method and device, electronic equipment and storage medium Active CN114257575B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111547162.3A CN114257575B (en) 2021-12-16 2021-12-16 Client data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111547162.3A CN114257575B (en) 2021-12-16 2021-12-16 Client data processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114257575A true CN114257575A (en) 2022-03-29
CN114257575B CN114257575B (en) 2024-04-16

Family

ID=80795418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111547162.3A Active CN114257575B (en) 2021-12-16 2021-12-16 Client data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114257575B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020099818A1 (en) * 2000-11-16 2002-07-25 Russell Ethan George Method and system for monitoring the performance of a distributed application
CN102272757A (en) * 2009-01-08 2011-12-07 国际商业机器公司 Method for server-side logging of client browser state through markup language
CN103714119A (en) * 2013-11-29 2014-04-09 北京奇虎科技有限公司 Method and device for processing browser data
US20150309971A1 (en) * 2012-11-21 2015-10-29 Roofoveryourhead Marketing Ltd. A browser extension for the collection and distribution of data and methods of use thereof
CN109145249A (en) * 2018-09-27 2019-01-04 视联动力信息技术股份有限公司 Data rendering method and device
CN109168031A (en) * 2018-11-06 2019-01-08 杭州云英网络科技有限公司 Streaming Media method for pushing and device, steaming media platform
CN110247957A (en) * 2019-05-22 2019-09-17 东软集团股份有限公司 Network system and its data transmission method, electronic equipment
CN111259299A (en) * 2020-01-16 2020-06-09 中国平安财产保险股份有限公司 Data processing method, data processing device, computer equipment and storage medium
CN112231604A (en) * 2020-06-12 2021-01-15 北京沃东天骏信息技术有限公司 Page display method and device, electronic equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020099818A1 (en) * 2000-11-16 2002-07-25 Russell Ethan George Method and system for monitoring the performance of a distributed application
CN102272757A (en) * 2009-01-08 2011-12-07 国际商业机器公司 Method for server-side logging of client browser state through markup language
US20150309971A1 (en) * 2012-11-21 2015-10-29 Roofoveryourhead Marketing Ltd. A browser extension for the collection and distribution of data and methods of use thereof
CN103714119A (en) * 2013-11-29 2014-04-09 北京奇虎科技有限公司 Method and device for processing browser data
CN109145249A (en) * 2018-09-27 2019-01-04 视联动力信息技术股份有限公司 Data rendering method and device
CN109168031A (en) * 2018-11-06 2019-01-08 杭州云英网络科技有限公司 Streaming Media method for pushing and device, steaming media platform
CN110247957A (en) * 2019-05-22 2019-09-17 东软集团股份有限公司 Network system and its data transmission method, electronic equipment
CN111259299A (en) * 2020-01-16 2020-06-09 中国平安财产保险股份有限公司 Data processing method, data processing device, computer equipment and storage medium
CN112231604A (en) * 2020-06-12 2021-01-15 北京沃东天骏信息技术有限公司 Page display method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114257575B (en) 2024-04-16

Similar Documents

Publication Publication Date Title
KR101748196B1 (en) Determining message data to present
US8935798B1 (en) Automatically enabling private browsing of a web page, and applications thereof
US11579902B2 (en) User interface rendering performance
JP2011108102A (en) Web server, web browser and web system
US20150222512A1 (en) Event pages for web applications and extensions
CN110287146B (en) Method, device and computer storage medium for downloading application
CN111190673B (en) Page display method and device based on operation monitoring and electronic equipment
CN110012165B (en) Method and device for presenting session list page and readable medium
CN110837480A (en) Processing method and device of cache data, computer storage medium and electronic equipment
CN109491873B (en) Cache monitoring method, medium, device and computing equipment
CN109495549B (en) Method, equipment and computer storage medium for application pull alive
CN112612546A (en) Page loading method and device, electronic equipment and storage medium
US20150193394A1 (en) Scheduling processing of resource requests to ensure fulfillment of foreground requests
CN113220403B (en) Method and device for h5 intercepting Android return event and electronic equipment
CN112507259A (en) Webpage loading method and device, electronic equipment and storage medium
US20120124487A1 (en) Issuing behavioral and contextual notifications
CN111783010B (en) Webpage blank page monitoring method, device, terminal and storage medium
CN114257575B (en) Client data processing method and device, electronic equipment and storage medium
CN116126808A (en) Behavior log recording method, device, computer equipment and storage medium
CN114036431A (en) Page cache skipping method and device, electronic equipment and storage medium
US11288336B2 (en) Systems and methods for providing content items in situations involving suboptimal network conditions
CN113656102A (en) Data point burying method and device, storage medium and electronic equipment
KR101498920B1 (en) Web page pre-caching system and method for offline-executing
CN111767486A (en) Method, device, electronic equipment and computer readable medium for displaying page
CN112468829B (en) Sharing method of cache video, electronic device and computer readable storage medium

Legal Events

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