CN108989371B - Data reporting method and device - Google Patents

Data reporting method and device Download PDF

Info

Publication number
CN108989371B
CN108989371B CN201710405644.2A CN201710405644A CN108989371B CN 108989371 B CN108989371 B CN 108989371B CN 201710405644 A CN201710405644 A CN 201710405644A CN 108989371 B CN108989371 B CN 108989371B
Authority
CN
China
Prior art keywords
data
page
reported
reporting
identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710405644.2A
Other languages
Chinese (zh)
Other versions
CN108989371A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710405644.2A priority Critical patent/CN108989371B/en
Publication of CN108989371A publication Critical patent/CN108989371A/en
Application granted granted Critical
Publication of CN108989371B publication Critical patent/CN108989371B/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
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Abstract

The invention provides a data reporting method, which comprises the following steps: acquiring an operation instruction for a page, and generating reported data according to the operation instruction; sending reported data to a server corresponding to the page based on a cross-domain data interaction protocol; and receiving a report result of the reported data returned by the server. The reporting result of the data can be obtained, so that the possibility of re-reporting is provided when the reporting is failed based on the reporting result, and therefore, the data reporting method and the data reporting device are high in reliability.

Description

Data reporting method and device
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a data reporting method and apparatus.
Background
In large-scale website applications, the operation behavior of a user on a webpage generally needs to be counted, and the optimization and development of product functions can be guided by analyzing the operation form of the user on the webpage. The operation behaviors of the user on the webpage comprise browsing the webpage, clicking a button, jumping to the webpage and the like, the client reports the behaviors to a specified server in a data mode, and the specified server acquires and analyzes the operation behaviors of the user.
The traditional data reporting method adopts picture address reporting, specifically, a picture is newly built through a script language and added into a page, and the address of the picture is the address and the parameter of a server to be reported. The advantage of reporting by picture address is that cross-domain reporting can be supported simply (the domain name of the web page and the domain name of the reporting server are not the same). However, this data reporting method cannot know whether the reporting is successful.
However, if reliable reporting of data is to be achieved, it is necessary to know that each reporting is performed, and whether data is successfully reported cannot be known by using a conventional data reporting method, which is low in reliability.
Disclosure of Invention
Therefore, a data reporting method and device are provided for solving the problem of low reliability of data reporting.
In order to achieve the above purpose, one embodiment adopts the following technical scheme:
a data reporting method comprises the following steps:
acquiring an operation instruction for a page, and generating reported data according to the operation instruction;
sending the reported data to a server corresponding to the page based on a cross-domain data interaction protocol;
and receiving a report result of the reported data returned by the server.
A data reporting apparatus, comprising: the device comprises an acquisition module, a sending module and a receiving module;
the acquisition module is used for acquiring an operation instruction for a page and generating reported data according to the operation instruction;
the sending module is used for sending the reported data to a server corresponding to the page based on a cross-domain data interaction protocol;
the receiving module is configured to receive a reporting result of the reported data returned by the server.
According to the data reporting method and device, when a user accesses a page, the reporting data is generated according to the operation instruction of the page, the reporting data is sent to the server based on the cross-domain data interaction protocol, and the reporting result of the reporting data returned by the server is received. The reporting result of the data can be obtained, so that the possibility of re-reporting is provided when the reporting is failed based on the reporting result, and therefore, the data reporting method and the data reporting device are high in reliability.
Drawings
Fig. 1 is a schematic application environment diagram of a data reporting method and apparatus according to an embodiment;
fig. 2 is a schematic internal structure diagram of a terminal according to an embodiment;
fig. 3 is a flowchart of a data reporting method according to an embodiment;
fig. 4 is a flowchart of a data reporting method according to another embodiment;
FIG. 5 is a system architecture diagram corresponding to the data reporting method of FIG. 4;
fig. 6 is a flowchart of a data reporting method according to yet another embodiment;
fig. 7 is a flowchart of a data reporting method according to another embodiment;
fig. 8 is an interaction diagram of a terminal and a server implementing a data reporting method according to an embodiment;
fig. 9 is an interaction diagram of a terminal and a server implementing a data reporting method according to another embodiment;
fig. 10 is a block diagram illustrating a data reporting apparatus according to an embodiment;
fig. 11 is a block diagram of a data reporting apparatus according to another embodiment;
fig. 12 is a block diagram of a data reporting apparatus according to another embodiment;
fig. 13 is a block diagram of a data reporting apparatus according to still another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the detailed description and specific examples, while indicating the scope of the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides a data reporting method, wherein when a user accesses a page through a terminal, the terminal acquires an operation instruction for the page, generates reported data according to the operation instruction, sends the reported data to a server corresponding to the page based on a cross-domain data interaction protocol, and receives a reported result of the reported data returned by the server. The reporting result of the data can be obtained, so that the possibility of re-reporting is provided when the reporting is failed based on the reporting result, and therefore, the data reporting method and the data reporting device are high in reliability.
Fig. 1 is a schematic application environment diagram of a data reporting method and apparatus according to an embodiment. As shown in fig. 1, the application environment includes a terminal 101 and a server 103, and the terminal 101 and the server 103 communicate via a network. The user operates through the terminal 101 to access the page, and the terminal 101 uploads the acquired reported data to the server through the network. The terminal 101 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like.
Fig. 2 is a schematic internal structure diagram of the terminal in one embodiment. As shown in fig. 1, the terminal includes a processor, a storage medium, a memory, a network interface, a display screen, and an input device, which are connected through a system bus. Wherein, the processor is used for providing calculation and control capability and supporting the operation of the whole terminal. The storage medium of the terminal stores an operating system and a computer program of a data reporting device, and the computer program of the data reporting device is used for realizing a data reporting method when being executed by a processor. The memory in the terminal provides an environment for the operation of the data reporting device in the storage medium, and the network interface is used for communicating with the server, for example, sending the reported data to the server. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen, the input device can be a touch layer covered on the display screen, and can also be an external keyboard, a touch pad or a mouse, and the user accesses the page by operating the input device. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is a block diagram of only a portion of the configuration associated with the inventive arrangements and does not constitute a limitation of the terminal to which the inventive arrangements are applied, and that a particular terminal may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Fig. 3 is a flowchart of a data reporting method according to an embodiment, where the method is executed in the terminal 101 shown in fig. 1, and includes the following steps:
s302: and acquiring an operation instruction for the page, and generating reported data according to the operation instruction.
The operation instruction refers to an instruction generated by a user accessing a page through a terminal and operating the terminal on the corresponding page, and the operation includes access operation, touch operation, click operation and the like. The terminal may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like. The reported data is the user-shaped operation data and is generated according to the operation instruction.
S304: and sending the reported data to a server corresponding to the page based on a cross-domain data interaction protocol.
The cross-domain data interaction protocol in this embodiment may adopt jsonp (JSON with tagging), which is a "usage mode" of JSON (JavaScript Object notification, JSON Object tag), and may be used to solve the problem of cross-domain data access of a mainstream browser. When data is sent to the server through a cross-domain data interaction protocol, the terminal is allowed to transmit a callback parameter to the server, when the server returns the data, the callback parameter is used as a function name to wrap JSON (JavaScript Object Notation) data, and the client can customize own function at will to automatically process the returned data.
S306: and receiving a report result of the reported data returned by the server.
The terminal and the server transmit the reported data and the reported result in a cross-domain data interaction protocol mode, and the reported result comprises the success or failure of reporting. And when the received reporting result is that the reporting is successful, indicating that the reported data is successfully reported. And reporting results are returned to fail, which indicates that the reported data is reported to fail. The report result, that is, the callback parameter returned by the server is used as a function name to wrap JSON (JS Object notification, JS Object tag) data representing the report result.
According to the data reporting method, when a user accesses a page, the reported data is generated according to an operation instruction of the page, the reported data is sent to the server based on the cross-domain data interaction protocol, and the reported result of the reported data returned by the server is received. The reporting result of the data can be obtained, so that the possibility of re-reporting is provided when the reporting is failed based on the reporting result, and therefore, the data reporting method and the data reporting device are high in reliability.
Fig. 4 is a flowchart of a data reporting method according to another embodiment, and fig. 5 is a system architecture diagram corresponding to the data reporting method of fig. 4. As shown in fig. 4 and 5, the method includes the steps of:
s402: and acquiring an operation instruction for the page, and generating reported data according to the operation instruction.
The operation instruction refers to an instruction generated by a user accessing a page through a terminal and operating the terminal on the corresponding page, and the operation includes access operation, touch operation, click operation and the like. The terminal may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like. The reported data is the user-shaped operation data and is generated according to the operation instruction.
S404: and generating a data identifier of the reported data.
The data identification is the only identification of each piece of reported data and is used for distinguishing each piece of reported data. In order to ensure the uniqueness of the data identification, the data identification is generated by adopting a time stamp and a random number. For example, the data identifies the current timestamp millisecond +17 bit random number. The random numbers may be generated using a random number generator.
S406: and sending the reported data to a server corresponding to the page based on a cross-domain data interaction protocol.
The sent reported data carries a data identifier. The cross-domain data interaction protocol in this embodiment may adopt jsonp (JSON with tagging), which is a "usage mode" of JSON and may be used to solve the problem of cross-domain data access of a mainstream browser. When data is sent to the server through a cross-domain data interaction protocol, the terminal is allowed to transmit a callback parameter to the server, when the server returns the data, the callback parameter is used as a function name to wrap JSON (JavaScript Object Notation) data, and the client can customize own function at will to automatically process the returned data.
S408: and storing the reported data locally according to the data identification.
Local storage, i.e., local storage that the website uses for persistence. Storing the reported data locally according to the data identifier means establishing a corresponding relationship between the data identifier and the reported data. It is understood that step S406 and step S408 are parallel steps, and there is no order of priority. When the terminal accesses the page, the local storage is used as a cache area for reporting data, so that the backup can be found in the cache area even if the data reporting fails.
S410: and receiving a report result of the reported data returned by the server.
And reporting the result to carry the data identifier. The report result, that is, the callback parameter returned by the server is used as a function name to wrap JSON (JS Object notification, JS Object tag) data representing the report result. The reporting result comprises reporting success or reporting failure.
S412: and judging whether the received reporting result comprises a reporting failure message. If yes, go to step S414.
S414: and according to the data identification carried by the report result, acquiring corresponding report data stored in the local and returning to the step of sending the report data to the server corresponding to the page based on the cross-domain data interaction protocol until the data report is successful.
Further, if the determination result in step S412 is no, step S413 is executed: and deleting the reported data which is stored locally and corresponds to the data identifier.
According to the data reporting method, the reporting data are sent to the server corresponding to the page based on the cross-domain data interaction protocol and are stored locally, when the received reporting result comprises the reporting failure information, the corresponding reporting data stored locally are obtained according to the data identification carried by the reporting result, and reporting is carried out again, so that the loss of the reporting data caused by factors such as page jumping is reduced, the reliability of data reporting is improved, and the reporting data stored locally are deleted when the reporting is successful. Only when the reporting result is that the reporting is successful, the corresponding reporting data in the local storage is cleared, so that the reliability of data reporting is further improved.
Specifically, step S408 includes: storing the reported data and generating a storage identifier for the stored reported data; and establishing a corresponding relation between the storage identifier and the data identifier.
The storage identifier is a unique identification identifier of each piece of reported data in the local area, and is used for distinguishing which piece of sent reported data corresponds to the piece of reported data stored in the local area. In order to distinguish the storage identifier from the data identifier, a uniform prefix may be added to the data identifier to obtain the storage identifier. The storage identity corresponds to the data identity.
Correspondingly, step S413 includes: searching a storage identifier corresponding to the data identifier carried by the reported result according to the corresponding relation; and deleting the reported data which is stored locally and corresponds to the storage identifier.
In this embodiment, the corresponding data is searched in the local storage by storing the corresponding relationship between the identifier and the data identifier.
In another embodiment, to ensure that the reported data is reported successfully, the terminal will detect whether there is residual reported data in the local storage each time the page is opened. And when the residual reported data is detected, finding the corresponding data and reporting, and only when the reported data is successful, clearing the locally stored reported data. Specifically, as shown in fig. 6, the method includes the following steps:
s602: and acquiring a page access instruction, and loading and displaying corresponding page content.
S604: and detecting whether the reported data associated with the domain name is stored locally or not according to the domain name corresponding to the page. If yes, go to step S606.
The purpose of a domain name is to facilitate the address of a set of servers (web site, email, FTP, etc.) that are remembered and communicated. The domain name is used as the name of the internet participant that can be forgotten by force, such as a computer, a network and a service. And when the reported data is cached in the local storage, associating the stored reported data with the domain name. Specifically, the domain names are used as units for storage, that is, the storage addresses of the reported data of the pages with the same domain name are the same. For example, a domain name is used as a folder, and the reported data of pages with the same domain name is stored in the folder named by the domain name.
When the access instruction of the page is acquired, the corresponding page is opened, and whether the reported data associated with the domain name of the page is stored in the local storage or not is detected. When the reported result of successful report is received, the terminal deletes the reported data stored in the local, so that when the page is opened and the reported data associated with the domain name of the page is detected to be stored in the local storage, the residual reported data is indicated.
S606: and sending the detected reported data to a server corresponding to the page based on a cross-domain data interaction protocol.
And when the participated reported data is detected, sending the detected reported data to a server corresponding to the page based on a cross-domain data interaction protocol.
It can be understood that, after step S606, the reporting result of the reported data returned by the server is also received, and when the received reporting result includes the reporting failure information, the reporting is continued, and when the received reporting result includes the reporting success information, the locally corresponding reported data is deleted.
According to the data reporting method, when the page is opened every time, the initialization logic of data reporting is executed, whether residual reported data exist in the local is checked, if the residual reported data exist in the local, the reported data are reported again, and only when the reported data are reported successfully, the reported data in the cache are cleared.
In another embodiment, most sites may suffice using a single domain name. Some larger web sites, however, divide the different services by multiple domain names. At this time, there is a problem in reporting data by domain name association. For example, the user clicks a link in the page of the A domain name, and jumps to the page of the B domain name. Because A and B are different domain names, the reported data of two pages cannot be associated with the same domain name. The data that fails to be reported in the domain name page a cannot be reported again in time in the domain name page B. In this case, only when the user accesses the page under the a domain name again, the data that failed to be reported in the a domain name page is reported again.
In order to solve the problem that reported data under different domain names are stored locally and cannot be used universally, an iframe (embedded frame) agent is introduced to realize the scheme.
Specifically, as shown in fig. 7, before step S402, step S401 is further included: and when the proxy page is called to jump from the parent page to the child page, acquiring the corresponding relation between the parent page and the child page and the local storage address of the reported data of the parent page.
Specifically, a frame iframe is created on the subdomain page (i.e., on the second web page), a destination address is specified for the frame, and then the parent and child pages are communicated across domains using the HTML5API postMessage (a module that addresses cross-domain communication in HTML 5). The module for performing cross-domain communication is an existing implementation manner, and in the embodiment of the present application, the cross-domain communication module is utilized by creating an iframe and using a proxy page.
And when the proxy page is called to jump from the parent page to the child page, acquiring the corresponding relation between the parent page and the child page and the local storage address of the reported data of the parent page.
Step S408 includes: and storing the reported data of the sub-page locally according to the acquired storage address.
Specifically, the reported data of the sub-page is stored under the address by acquiring the storage address of the parent page, so that the reported data of the parent page and the sub-page are associated with the storage address of the parent page. When the user accesses the parent page, the data which are failed to be reported in the child page can be reported in time without re-accessing the child page.
According to the data reporting method, the same data can be repeatedly reported in certain scenes, for example, when a page jumps, the reported JSONP request is completely sent out, the reporting server successfully receives the data, but when a reporting result returns, the previous page jumps to other pages, and the logic of deleting the cache cannot be executed, so that the data which is successfully reported at this time can be repeatedly reported and reported in the next page once. Therefore, after the server receives the reported data, the reported data is counted, deduplication needs to be performed according to the data identifier of the reported data, and the reported data obtained after deduplication is an accurate result.
The data reporting method of the present invention will be described with reference to specific implementations.
As shown in fig. 8, the terminal generates report data according to the operation behavior of the user. And the terminal adds seq _ number to the reported data and generates a data identifier for the data. The terminal caches the reported data locally according to the data identification, the reported data is sent to the server, and the server returns the reported result to the terminal. And the terminal and the server transmit the reported data and the reported result based on a cross-domain data interaction protocol. And when the terminal receives a successful reporting result, searching the reported data in the local cache according to the data identification carried by the reporting result and deleting the reported data. Only when the report result is that the report is successful, the corresponding report data in the local storage is cleared, thereby further improving the reliability of data report
As shown in fig. 9, when the terminal acquires an access instruction to a page, the corresponding page content is loaded and displayed. When the terminal opens the page, whether the reported data associated with the domain name of the page is stored in the local storage is detected. When the reported result of successful report is received, the terminal deletes the reported data stored in the local, so that when the page is opened and the reported data associated with the domain name of the page is detected to be stored in the local storage, the residual reported data is indicated. And the terminal reads the corresponding reported data and sends the reported data to the server, and the server returns the reported result to the terminal. And the terminal and the server transmit the reported data and the reported result based on a cross-domain data interaction protocol. And when the terminal receives a successful reporting result, searching the reported data in the local cache according to the data identification carried by the reporting result and deleting the reported data. When a page is opened every time, executing initialization logic of data reporting, checking whether residual reported data exist in the local, if so, reporting the reported data again, and only when the reporting is successful, clearing the reported data in the cache.
The present invention also provides a data reporting apparatus, as shown in fig. 10, including: an acquisition module 101, a sending module 102 and a receiving module 103.
The obtaining module 101 is configured to obtain an operation instruction for a page, and generate report data according to the operation instruction.
The sending module 102 is configured to send the report data to a server corresponding to the page based on a cross-domain data interaction protocol.
The receiving module 103 is configured to receive a report result of the report data returned by the server.
When a user accesses a page, the data reporting device generates reported data according to an operation instruction of the page, sends the reported data to the server based on a cross-domain data interaction protocol, and receives a reported result of the reported data returned by the server. The reporting result of the data can be obtained, so that the possibility of re-reporting is provided when the reporting is failed based on the reporting result, and the reliability of the data reporting device is high.
In another embodiment, as shown in fig. 11, the data reporting apparatus further includes a generating module 104, a storing module 105, and a searching and acquiring module 106.
A generating module 104, configured to generate a data identifier of reported data; the sent reported data carries a data identifier.
The storage module 105 is used for storing the reported data locally according to the data identifier;
reporting the result to carry a data identifier; the search obtaining module 106 is configured to, when the received reporting result includes reporting failure information, obtain, according to a data identifier carried in the reporting result, corresponding reporting data stored locally.
In another embodiment, the apparatus further includes a deleting module 107, configured to delete the report data stored locally and corresponding to the data identifier when the report result received includes the report success information.
According to the data reporting device, the reported data are sent to the server corresponding to the page based on the cross-domain data interaction protocol and are stored locally, when the received reported result comprises the report failure information, the corresponding reported data stored locally are obtained according to the data identification carried by the reported result, and reporting is carried out again, so that the reported data loss caused by factors such as page skipping is reduced, the reliability of data reporting is improved, and the reported data stored locally are successfully deleted in reporting. Only when the reporting result is that the reporting is successful, the corresponding reporting data in the local storage is cleared, so that the reliability of data reporting is further improved.
In another embodiment, the storage module 105 is configured to store the reported data, and generate a storage identifier for the stored reported data; and establishing a corresponding relation between the storage identifier and the data identifier.
And the deletion storage 107 is used for searching for a storage identifier corresponding to the data identifier carried by the report result according to the corresponding relation, and deleting the report data which is locally stored and corresponds to the storage identifier.
In another embodiment, as shown in fig. 12, the data reporting apparatus further includes a detection module 108. The obtaining module 101 is further configured to obtain a page access instruction, load and display corresponding page content.
The detecting module 108 is configured to detect whether reporting data associated with the domain name is locally stored according to the domain name corresponding to the page.
And a sending module 102, configured to send the detected report data to a server corresponding to the page based on a cross-domain data interaction protocol when the detection result of the detecting module is yes.
The data reporting device executes the initialization logic of data reporting when a page is opened every time, checks whether residual reported data exists in the local area, if so, reports the reported data again, and only when the reporting is successful, the reported data in the cache is cleared.
In another embodiment, as shown in fig. 13, the data reporting apparatus further includes an address obtaining module 109, where when the page is a child page, the address obtaining module 109 is configured to obtain a correspondence between the parent page and the child page and a local storage address of the reported data of the parent page when the proxy page is called to jump from the parent page to the child page.
And the storage module 105 is configured to store the reported data of the sub-page locally according to the obtained storage address.
According to the data reporting device, the reported data of the sub-page is stored under the address by acquiring the storage address of the father page, so that the reported data of the father page and the reported data of the sub-page are associated with the storage address of the father page. When the user accesses the parent page, the data which are failed to be reported in the child page can be reported in time without re-accessing the child page.
It will be understood by those skilled in the art that all or part of the processes in the methods of the embodiments described above may be implemented by hardware related to instructions of a computer program, and the program may be stored in a non-volatile computer readable storage medium, and in the embodiments of the present invention, the program may be stored in a storage medium of a computer system and executed by at least one processor in the computer system, so as to implement the processes of the embodiments including the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A data reporting method is characterized by comprising the following steps:
acquiring a page access instruction, loading and displaying corresponding page content;
detecting whether residual reported data associated with the domain name is stored locally or not according to the domain name corresponding to the page; the method comprises the steps that reported data of pages with the same domain name are stored in a folder named by the domain name;
if so, sending the detected reported data to a server corresponding to the page based on a cross-domain data interaction protocol;
acquiring an operation instruction for a page, and generating reported data according to the operation instruction;
sending the reported data to a server corresponding to the page based on a cross-domain data interaction protocol;
receiving a report result of the reported data returned by the server;
and when the report result including the report success information is received, deleting the report data which is stored locally and corresponds to the data identifier.
2. The data reporting method of claim 1, wherein:
after the step of generating the report data according to the operation instruction and before the step of sending the report data to the server corresponding to the page based on a cross-domain data interaction protocol, the method further includes: generating a data identifier of the reported data; the sent reported data carries the data identifier;
the method further comprises the following steps: storing the reported data locally according to the data identification;
the reported result carries the data identifier; and when the received report result comprises report failure information, acquiring corresponding report data stored locally according to the data identifier carried by the report result, and returning to the step of sending the report data to a server corresponding to the page based on the cross-domain data interaction protocol.
3. The data reporting method of claim 1, wherein the step of locally storing the reported data according to the data identifier comprises: storing the reported data and generating a storage identifier for the stored reported data; establishing a corresponding relation between the storage identifier and the data identifier;
the step of deleting the reported data stored locally and corresponding to the data identifier comprises: searching a storage identifier corresponding to the data identifier carried by the report result according to the corresponding relation; and deleting the reported data which is stored locally and corresponds to the storage identifier.
4. The data reporting method of claim 2, wherein:
when the page is a sub-page, before the steps of obtaining an operation instruction for the page and generating report data according to the operation instruction, the method further comprises: when the proxy page is called to jump from the parent page to the child page, acquiring the corresponding relation between the parent page and the child page and the local storage address of the reported data of the parent page;
the step of storing the reported data locally comprises: and storing the reported data of the sub-page locally according to the acquired storage address.
5. A data reporting apparatus, comprising: the device comprises an acquisition module, a sending module, a receiving module and a detection module;
the acquisition module is used for acquiring a page access instruction, loading and displaying corresponding page content;
the detection module is used for detecting whether residual report data associated with the domain name is stored locally or not according to the domain name corresponding to the page;
the sending module is configured to send the detected reported data to a server corresponding to the page based on a cross-domain data interaction protocol when the detection result of the detecting module is yes
The acquisition module is also used for acquiring an operation instruction for the page and generating reported data according to the operation instruction;
the sending module is further configured to send the reported data to a server corresponding to the page based on a cross-domain data interaction protocol;
the receiving module is configured to receive a reporting result of the reported data returned by the server;
and the deleting module is used for deleting the reported data which is stored locally and corresponds to the data identifier when the reported result which comprises the report success information is received.
6. The data reporting device of claim 5, wherein: the device also comprises a generating module, a storage module and a searching and acquiring module;
the generating module is used for generating a data identifier of the reported data; the sent reported data carries the data identifier;
the storage module is used for storing the reported data locally according to the data identification;
the reported result carries the data identifier; the search acquisition module is configured to acquire corresponding report data stored locally according to the data identifier carried in the report result when the received report result includes report failure information.
7. The apparatus for reporting data of claim 5, wherein the storage module is configured to store the reported data and generate a storage identifier for the stored reported data; establishing a corresponding relation between the storage identifier and the data identifier;
and the deleting storage is used for searching the storage identifier corresponding to the data identifier carried by the reporting result according to the corresponding relation and deleting the reporting data which is locally stored and corresponds to the storage identifier.
8. The apparatus according to claim 6, wherein the page comprises a sub-page, the apparatus further comprises an address obtaining module,
the address acquisition module is used for acquiring the corresponding relation between the parent page and the child page and the local storage address of the reported data of the parent page when the calling proxy page jumps from the parent page to the child page;
and the storage module is used for locally storing the reported data of the sub-page according to the acquired storage address.
9. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 4.
10. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 4.
CN201710405644.2A 2017-06-01 2017-06-01 Data reporting method and device Active CN108989371B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710405644.2A CN108989371B (en) 2017-06-01 2017-06-01 Data reporting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710405644.2A CN108989371B (en) 2017-06-01 2017-06-01 Data reporting method and device

Publications (2)

Publication Number Publication Date
CN108989371A CN108989371A (en) 2018-12-11
CN108989371B true CN108989371B (en) 2021-05-28

Family

ID=64502521

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710405644.2A Active CN108989371B (en) 2017-06-01 2017-06-01 Data reporting method and device

Country Status (1)

Country Link
CN (1) CN108989371B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612687A (en) * 2020-12-24 2021-04-06 平安科技(深圳)有限公司 User behavior data uploading method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101826085B (en) * 2009-12-30 2012-01-18 厦门市美亚柏科信息股份有限公司 AJAX-based method for importing/exporting large file into/from web page on line
CN103166827A (en) * 2011-12-09 2013-06-19 北京神州泰岳软件股份有限公司 Method and system for user behavior data reporting
CN103186565A (en) * 2011-12-28 2013-07-03 中国移动通信集团浙江有限公司 Method and device for judging user preference according to web browsing behavior of user
CN104462491A (en) * 2014-12-22 2015-03-25 上海斐讯数据通信技术有限公司 Image uploading method and system and corresponding server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101826085B (en) * 2009-12-30 2012-01-18 厦门市美亚柏科信息股份有限公司 AJAX-based method for importing/exporting large file into/from web page on line
CN103166827A (en) * 2011-12-09 2013-06-19 北京神州泰岳软件股份有限公司 Method and system for user behavior data reporting
CN103186565A (en) * 2011-12-28 2013-07-03 中国移动通信集团浙江有限公司 Method and device for judging user preference according to web browsing behavior of user
CN104462491A (en) * 2014-12-22 2015-03-25 上海斐讯数据通信技术有限公司 Image uploading method and system and corresponding server

Also Published As

Publication number Publication date
CN108989371A (en) 2018-12-11

Similar Documents

Publication Publication Date Title
US9483572B2 (en) Interactivity analyses of web resources based on reload events
CN104767775B (en) Web application information push method and system
CN106528657A (en) Control method and device for browser skipping to application program
CN107181779B (en) Method, device and system for processing access request
CN106528587B (en) Page display method and device in composite webpage system
US10491629B2 (en) Detecting sensitive data sent from client device to third-party
CN109672658B (en) JSON hijacking vulnerability detection method, device, equipment and storage medium
CN111740992B (en) Website security vulnerability detection method, device, medium and electronic equipment
CN112703496B (en) Content policy based notification to application users regarding malicious browser plug-ins
CN104580540A (en) Method and device for achieving website access
CN108574721B (en) Login method, device, server, user terminal and readable storage medium
CN113204730A (en) Resource acquisition method, webvpn proxy server, system and server
CN109190067B (en) Browser input box display method and device, computer equipment and storage medium
KR20230059015A (en) System for blocking harmful site and method thereof
CN104834588A (en) Permanent residence cross site script vulnerability detection method and apparatus
CN113469866A (en) Data processing method and device and server
CN111431767A (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
CN111106983A (en) Method and device for detecting network connectivity
CN108989371B (en) Data reporting method and device
CN112241298A (en) Page display method and device, storage medium and electronic device
CN112769674B (en) Mailbox signature generation method and device, readable storage medium and computer equipment
CN107526678B (en) Web application program testing method and device
CN111552643A (en) Multi-browser webpage access synchronization method and system
CN110674435A (en) Page access method, server, terminal, electronic equipment and readable storage medium
CN108021593B (en) Information transfer method and device and browser

Legal Events

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