CN115658605A - Method and device for processing page snapshot - Google Patents

Method and device for processing page snapshot Download PDF

Info

Publication number
CN115658605A
CN115658605A CN202211332733.6A CN202211332733A CN115658605A CN 115658605 A CN115658605 A CN 115658605A CN 202211332733 A CN202211332733 A CN 202211332733A CN 115658605 A CN115658605 A CN 115658605A
Authority
CN
China
Prior art keywords
page
data
photographing
photo data
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211332733.6A
Other languages
Chinese (zh)
Inventor
万立群
熊浩
喻才益
张晓靖
王伟
曾欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202211332733.6A priority Critical patent/CN115658605A/en
Publication of CN115658605A publication Critical patent/CN115658605A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for processing a page snapshot, and relates to the technical field of big data. One embodiment of the method comprises: monitoring the data of the embedded points of the page in real time; calling a page photographing interface under the condition that the buried point data meets a first preset condition; acquiring target registration information of a target page by using a page photographing interface, and photographing the target page according to the target registration information to obtain current photo data; and obtaining historical photo data corresponding to the target page from the cache, and storing difference data between the current photo data and the historical photo data. According to the implementation mode, the automatic page photographing process is realized by calling the photographing interface, abuse of the photographing function is reduced by pre-registering, and the use safety of the front-end plug-in is improved. In addition, only the difference data between the current photo data and the historical photo data is stored, unnecessary repeated storage is reduced, and storage space is saved.

Description

Page snapshot processing method and device
Technical Field
The invention relates to the technical field of big data, in particular to a method and a device for processing a page snapshot.
Background
In the prior art, usually, the photographed pages are converted into a text format of a Document Object Model (DOM) based on a jsp framework for serialized full-volume storage, that is, full-volume storage is performed once for each photographed page, which occupies a large amount of storage space. Meanwhile, the captured page, the specific captured field and the capturing time need to be written in the code, so that the method cannot be flexibly customized and has low usability.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for processing a page snapshot, which can call a photographing interface according to a first preset condition configured in advance by monitoring data of a buried point in real time, that is, perform automatic photographing once when the photographing interface is called, so as to implement an automatic page photographing process. And the photographed target page is registered in advance and is stored with the registration information, so that abuse of the photographing function can be reduced, and the use safety of the front-end plug-in is improved. Meanwhile, the photo data obtained by photographing every time does not need to be stored in full, and only the difference data between the current photo data and the historical photo data is stored, so that unnecessary repeated storage is reduced, and the storage space is saved.
To achieve the above object, according to an aspect of the embodiments of the present invention, a method for processing a page snapshot is provided.
The method for processing the page snapshot comprises the following steps: monitoring the data of the embedded points of the page in real time; calling a page photographing interface under the condition that the buried point data meets a first preset condition; acquiring target registration information of a target page by using the page photographing interface, and photographing the target page according to the target registration information to obtain current photo data; and obtaining historical photo data corresponding to the target page from a cache, and storing difference data between the current photo data and the historical photo data.
Optionally, before the calling the page photographing interface, the method further includes: under the condition that the buried point data meet a second preset condition, registering one or more pages, and determining registration information corresponding to the pages; wherein the registration information includes: a page ID and one or more photo areas.
Optionally, the obtaining target registration information of a target page by using the page photographing interface, and photographing the target page according to the target registration information includes: determining target registration information from one or more pieces of registration information according to the target page ID corresponding to the target page; and photographing the target page according to one or more photographing regions in the target registration information.
Optionally, the method further comprises: and storing the current photo data into a cache corresponding to the page ID, and deleting the historical photo data with the longest storage time from the cache, so that the number of the total photo data stored in the cache is not greater than a preset threshold value.
Optionally, the storing the difference data between the current photo data and the historical photo data includes: aiming at the condition that the historical photo data are multiple, determining target historical photo data which is closest to the current photo data according to the photographing time corresponding to the historical photo data; storing difference data between the current photo data and the target historical photo data.
Optionally, the storing difference data between the current photo data and the target historical photo data includes: determining a difference field and a corresponding difference field value according to fields and field values in the current photo data and the historical photo data; and correspondingly storing the difference field, the difference field value and the photographing time corresponding to the current photo data to a hard disk.
Optionally, the registration information further includes: service codes respectively corresponding to one or more photographing regions; correspondingly storing the difference field, the difference field value and the photo sequence number corresponding to the current photo data to a hard disk, including: encoding, for each of the services: and according to the photographing time, storing the difference field and the difference field value corresponding to the service code to a hard disk in a chained mode.
Optionally, the method further comprises: receiving a query request; the query request comprises a service code to be queried; acquiring a chain record corresponding to the service code from the hard disk; the chain record indicates a difference field and a difference field value which are sequentially stored according to the photographing time; and responding to the query request, and outputting the chain record.
Optionally, the first preset condition is that a user operation in the buried point data meets a preset operation and registration information corresponding to the buried point data exists.
Optionally, the second condition is that a uniform resource locator in the buried point data matches a preset resource locator.
Optionally, in a case that uniform resource locators corresponding to multiple pages are the same, registering one or more pages and determining registration information corresponding to the pages includes: registering the multiple pages respectively, and determining registration information corresponding to each page; wherein each of the pages corresponds to a different page ID.
Optionally, a method for taking a picture of a page is implemented based on a jQuery frame.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a page snapshot processing apparatus.
The processing device of the page snapshot of the embodiment of the invention comprises: the monitoring module is used for monitoring the data of the embedded points of the page in real time; the calling module is used for calling a page photographing interface under the condition that the buried point data meets a first preset condition; the photographing module is used for acquiring target registration information of a target page by using the page photographing interface and photographing the target page according to the target registration information to obtain current photo data; and the storage module is used for acquiring historical photo data corresponding to the target page from a cache and storing difference data between the current photo data and the historical photo data.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided an electronic device for processing a page snapshot.
The electronic equipment for processing the page snapshot in the embodiment of the invention comprises: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the page snapshot processing method according to the embodiment of the invention.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable storage medium.
A computer-readable storage medium of an embodiment of the present invention stores thereon a computer program, and when the program is executed by a processor, the program implements a method for processing a page snapshot of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: by monitoring the buried point data in real time, the photographing interface can be called according to a first preset condition which is configured in advance, namely, the photographing interface is called once, so that automatic photographing is carried out once, and the automatic page photographing process is realized. And the photographed target page is registered in advance and is stored with the registration information, so that abuse of the photographing function can be reduced, and the use safety of the front-end plug-in is improved. Meanwhile, the photo data obtained by photographing each time does not need to be stored in full, and only the difference data between the current photo data and the historical photo data is stored, so that unnecessary repeated storage is reduced, and the storage space is saved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a flowchart illustrating a method for processing a page snapshot according to an embodiment of the present invention;
FIG. 2 is a schematic view of a process of taking a picture of a target page according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a cache container storing current photo data according to an embodiment of the invention;
FIG. 4 is a schematic flow chart of storing difference data according to an embodiment of the present invention;
FIG. 5 is a flow chart illustrating a process of determining difference data according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating querying photo data according to an embodiment of the invention;
FIG. 7 is a schematic diagram of the main blocks of a processing device of a page snapshot according to an embodiment of the present invention;
FIG. 8 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 9 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments of the present invention and the technical features of the embodiments may be combined with each other without conflict.
It should be noted that, in the technical solution of the present invention, the aspects of collecting, analyzing, using, transmitting, storing, etc. of the related user personal information all conform to the regulations of the relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside the aspects of legal use, etc., and are under the supervision and management of the supervision department. Necessary measures should be taken for the personal information of the user to prevent illegal access to such personal information data, ensure that personnel who have access to the personal information data comply with the regulations of relevant laws and regulations, and ensure the security of the personal information of the user. Once these user personal information data are no longer needed, the risk should be minimized by limiting or even prohibiting data collection and/or deleting data.
User privacy is protected by de-identifying data, as applicable, including in certain related applications, such as by removing particular identifiers (e.g., date of birth, etc.), controlling the amount or specificity of stored data (e.g., collecting location data at a city level rather than at a specific address level), controlling how data is stored, and/or other methods of de-identifying, as applicable.
In the existing page photographing technology, the existing photographing method is as follows:
(1) The Canvas screenshot. The html2Canvas is a JavaScript class library, uses some new functional characteristics of html5 and css3, clones the copy by traversing page DOM and style information, redraws the copy on the Canvas, and finally renders the copy into a Canvas picture, thereby realizing the function of screenshot for the page.
(2) And (6) carrying out SVG screenshot. SVG and Canvas are not consistent in implementation mode, but the core idea is the same, namely, DOM is drawn to Canvas, and pictures are output through Canvas. The method specifically comprises the following steps: copy cloning is carried out by traversing page DOM and style information, then the DOM is used as an external resource to be embedded in the SVG by using the forignObject of the SVG, the SVG is redrawn on Canvas, the SVG is applied to a corresponding drawing element according to the style of the DOM, and finally a picture is generated through the Canvas.
(3) Based on the rrweb screenshot. rrweb is a native JavaScript-based snapshot recording feature pack that records and plays back by capturing changes in the page DOM and serializing them. The view state in the page can be described by the DOM tree form, namely, the state of the DOM tree at each time point is recorded, and photo data is generated once the state is recorded. Html actually realizes deep copying of a DOM object into a memory, but the object itself is not serializable, so we cannot save the DOM object into a specific text format (such as JSON) for transmission, and cannot record remotely.
(4) A page snapshot based on a novel lightweight front-end framework design. In the lightweight front-end frameworks such as vue, angular, exact and the like, since data and page template separation is realized compared with the traditional frameworks, and a global state manager such as vueX, exact and the like can store data in a centralized way, the snapshot function can be quickly and conveniently made by utilizing the characteristics of the frameworks, and even the function of undo, redo and the like can be easily realized.
However, the various methods described above all have certain drawbacks. The screenshot obtained based on Canvas cannot render cross-domain resources, canvas does not support iframe and Flash, SVG cannot render lazy loading resources and the like. Meanwhile, for storing the photo data, the support of an unstructured database is needed, and the requirement on storage space is large. The need for serialized full-scale storage based on rrweb screenshots, even in structured databases, presents significant challenges to storage and subsequent access. Although the page snapshot based on the design of the novel lightweight front-end frame is simple and flexible to develop, the page of a part of systems in the market is also based on a jsp frame made by jQuery, and cannot be adapted to the novel lightweight front-end frame, so that certain application limitation exists. Therefore, the embodiment of the invention starts from a jQuery framework, performs incremental storage in a data embedding mode, meets the requirement of the full amount of unstructured data on the storage space, and can avoid a series of problems caused by Canvas screenshot.
Fig. 1 is a schematic diagram of main steps of a method for processing a page snapshot according to an embodiment of the present invention.
As shown in fig. 1, the method for processing a page snapshot according to the embodiment of the present invention mainly includes the following steps:
step S101: monitoring data of buried points of a page in real time;
step S102: calling a page photographing interface under the condition that the buried point data meet a first preset condition;
step S103: acquiring target registration information of a target page by using a page photographing interface, and photographing the target page according to the target registration information to obtain current photo data;
step S104: and obtaining historical photo data corresponding to the target page from the cache, and storing difference data between the current photo data and the historical photo data.
It should be noted that the page snapshot refers to a process of backing up a web page when a search engine collects the web page, and usually stores backed-up web page data (photo data) in a cache of a server, and when a user clicks a "page snapshot" link in the search engine, the search engine displays the history photographed and stored web page content. The target page in step S103 is the page to be photographed (backed up).
The data of the buried point refers to data stored when a user triggers a preset buried point, and the triggering operation of the user and the corresponding triggering time are recorded. In an actual application scenario, a data product manager, a data operation and a data analyst are generally used, based on business requirements (for example, counting the number of clicks of each advertisement position in CPC pay-per-click advertisements), product requirements (for example, the number of exposures of recommended goods and the number of clicks in a recommendation system) perform buried point development on a position corresponding to each event of user behavior, and report data results of the buried points through an SDK (software development kit) to obtain buried point data, so as to perform subsequent analysis, promote product optimization or guide operation.
In an alternative embodiment, the first preset condition is that a user operation in the buried point data satisfies a preset operation and there is registration information corresponding to the buried point data. The existence of the registration information corresponding to the buried point data can be understood as that the corresponding registration information exists only for the page which is registered in advance and generates the registration information. And the preset operation may include: single click, double click, long press, drag, etc. That is, step S102 is to call the page photographing interface once only for the registered pages when it is monitored that the user completes the specified operation. By limiting the condition of calling the interface, the invalid page (such as an advertisement popup window) can be prevented from being photographed, and only the registered page needs to be photographed, so that abuse of the front-end plug-in is reduced, and the use safety is improved.
In a further optional embodiment, before calling the page photographing interface, a registration process is further included, which specifically includes: under the condition that the buried point data meet a second preset condition, registering one or more pages, and determining registration information corresponding to the pages; wherein, the registration information includes: a page ID and one or more photo areas.
The second preset condition can be set according to actual conditions so as to limit the page to be registered. In an alternative embodiment of the present invention, the second predetermined condition may be that the uniform resource locator in the buried point data matches the predetermined resource locator. Since the operation, the operation area, the operation time and the uniform resource locator of the page are usually recorded in the buried point data, the page can be screened according to the uniform resource locator, and only the page corresponding to the buried point data existing in the preset resource locator is registered by comparing the page with the preset uniform resource locator.
Through the process, the page can be registered in a targeted manner, namely, the matching verification is realized through the registration process, and the registration of invalid and abnormal pages is avoided. Meanwhile, the pages needing to be photographed are further limited through the registered pages, the page photographing interface can be called when all the registered pages are opened, the page photographing interface can also be called when part of the registered pages are opened, the photographed pages are further screened, the occupation of invalid photographing and invalid photo data on the storage space is reduced, and the use safety of the front-end plug-in is improved.
It should be noted that, during the registration process for the page, a plurality of registration information related to the page is generated, including the page ID and one or more photographing regions. In the embodiment of the invention, no matter the same page or different pages are opened once, a new ID is generated for the page, and the ID is irrelevant to the content of the page. That is, in the case that the uniform resource locators corresponding to the multiple pages are the same, the process of determining the registration information corresponding to the page includes: respectively registering a plurality of pages, and determining registration information corresponding to each page; wherein each page corresponds to a different page ID. The photographing region indicates a region to be photographed in the whole page, which may be the whole page or a part of the page.
Step S103 may be performed after the registration process of the page is completed, in an optional embodiment, step S103 is as shown in fig. 2, and further includes:
step S201: determining target registration information from one or more pieces of registration information according to the target page ID corresponding to the target page;
step S202: and photographing the target page according to one or more photographing regions in the target registration information.
After the pages meeting the second preset condition are registered, the registration information corresponding to each page is stored in a unified manner, specifically, the registration information may be stored correspondingly according to the association relationship between the page ID and the registration information. When the buried point data meets the first preset condition, it indicates that the registered target page needs to be photographed, so that the corresponding target registration information needs to be acquired from the plurality of registration information according to the page target page ID of the target page in step S201, and then the target page is photographed according to the photographing region in the target registration information.
In an optional embodiment of the present invention, the current photo data is first stored in a cache, and then compared with the historical photo data, and the difference data obtained by the comparison is stored in a hard disk. By this storage method, all photo data can be permanently stored in the hard disk in full, and since the file stored in the cache belongs to a temporary file, the present invention hopes to reduce the data storage in the cache as much as possible, that is, in an optional embodiment, after the page photographing is completed, the method further includes: storing the current photo data into a cache corresponding to the page ID, and deleting the historical photo data with the longest storage time from the cache, so that the number of the total photo data stored in the cache is not greater than a preset threshold value.
Specifically, two buffer containers may be disposed in the buffer, as shown in fig. 3, and each time there is a new current photo data to be stored, the historical photo data with the earliest photographing time is deleted, so as to ensure that two storage records are always guaranteed in the buffer. By the method, the storage space in the cache can be saved as much as possible, useless historical photo data or historical photo data with too early time can be deleted in time, and only the latest historical photo data is reserved for storage.
It should be noted that when the cache in the cache container is empty, it indicates that the target page has not been photographed, and there is no corresponding historical photo data, and then the current photo data is directly stored as the first cache data. When the target page has been taken for a plurality of times, there may be a plurality of historical photograph data in the cache container, and in this case, the process of storing the difference data in step S104 may further include:
step S401: determining target historical photo data closest to the current photo data according to the photographing time corresponding to the historical photo data;
step S402: storing difference data between the current photograph data and the target historical photograph data.
The target historical photo data is data closest to the current historical photo data in time, the current photo data of each time of photographing is compared with the target historical photo data closest to the current historical photo data, so that difference data between two times of photographing can be obtained, the change of the page after each operation of a user at different time nodes can be obtained by storing the difference data between two times of photographing, and the incremental chain storage is realized for the target page.
In a further alternative embodiment, the process of determining the difference data in step S402, as shown in fig. 5, includes:
step S501: determining a difference field and a corresponding difference field value according to fields and field values in the current photo data and the historical photo data;
step S502: and correspondingly storing the difference field, the difference field value and the photographing time corresponding to the current photo data to the hard disk.
The change of the page can be correspondingly obtained by recording the field and the field value in the photo data obtained by each photo, so that the photo data obtained by each photo can be completely recorded in the hard disk only by correspondingly storing the difference field and the difference field value with the current photo data.
In a further optional embodiment, the registration information may further include: and the service codes respectively correspond to one or more photographing regions. That is, in the storing process of step S502, for each service, it may be encoded: and storing the difference field and the difference field value corresponding to the service code to a hard disk in a chained mode according to the photographing time. By setting the service codes, the respective storage according to the services is realized, so that the photographing data of the page corresponding to each service can be directly inquired subsequently according to the service codes.
Specifically, the query process is shown in fig. 6, and includes:
step S601: receiving a query request; the query request comprises a service code to be queried;
step S602: acquiring a chain record corresponding to the service code from the hard disk; the chain records indicate the difference fields and the difference field values which are sequentially stored according to the photographing time;
step S603: the chained records are output in response to a query request.
The query request may be input by a user or sent by another terminal. If the user inputs the chain record, the chain record can be directly displayed through an interface, and if the chain record is sent by other terminals, the chain record only needs to be fed back to the other terminals.
In order to match with the existing system page, the embodiment of the invention discloses a method for realizing page photographing based on a jQuery frame.
According to the method for processing the page snapshot, the data of the buried point is monitored in real time, the photographing interface can be called according to the first preset condition which is configured in advance, namely, the photographing interface is called once, the automatic photographing is carried out once, and the automatic page photographing process is realized. And the photographed target page is registered in advance and is stored with the registration information, so that abuse of the photographing function can be reduced, and the use safety of the front-end plug-in is improved. Meanwhile, the photo data obtained by photographing each time does not need to be stored in full, and only the difference data between the current photo data and the historical photo data is stored, so that unnecessary repeated storage is reduced, and the storage space is saved.
Fig. 7 is a schematic diagram of main blocks of a processing apparatus of a page snapshot according to an embodiment of the present invention.
As shown in fig. 7, a processing apparatus 700 for a page snapshot according to an embodiment of the present invention includes:
the monitoring module 701 is used for monitoring the data of the embedded points of the page in real time;
a calling module 702, configured to call a page photographing interface when the buried point data meets a first preset condition;
the photographing module 703 is configured to acquire target registration information of a target page by using the page photographing interface, and photograph the target page according to the target registration information to obtain current photo data;
a storage module 704, configured to obtain historical photo data corresponding to the target page from a cache, and store difference data between the current photo data and the historical photo data.
In an optional embodiment of the present invention, the processing apparatus 700 further includes a registration module, configured to register one or more pages and determine registration information corresponding to the page before the page photographing interface is called, where the buried point data meets a second preset condition; wherein the registration information includes: a page ID and one or more photo areas.
In an optional embodiment of the present invention, the photographing module 703 further includes: determining target registration information from one or more pieces of registration information according to the target page ID corresponding to the target page; and photographing the target page according to one or more photographing regions in the target registration information.
In an optional embodiment of the present invention, the storage module 704 is further configured to store the current photo data in a cache corresponding to the page ID, and delete the historical photo data with the longest storage time from the cache, so that the number of total photo data stored in the cache is not greater than a preset threshold.
In an optional embodiment of the present invention, the storage module 704 is further configured to, for a case that there are a plurality of historical photograph data, determine, according to the photographing time corresponding to the historical photograph data, target historical photograph data that is closest to the current photograph data time; storing difference data between the current photo data and the target historical photo data.
In an optional embodiment of the present invention, the storage module 704 is further configured to determine a difference field and a corresponding difference field value according to fields and field values in the current photo data and the historical photo data; and correspondingly storing the difference field, the difference field value and the photographing time corresponding to the current photo data to a hard disk.
In an optional embodiment of the present invention, the registration information further includes: service codes respectively corresponding to one or more photographing regions; the storage module 704 is further configured to, for each of the service codes: and according to the photographing time, storing the difference field and the difference field value corresponding to the service code to a hard disk in a chained mode.
In an optional embodiment of the present invention, the apparatus further includes a query module, configured to accept a query request; the query request comprises a service code to be queried; acquiring a chain record corresponding to the service code from the hard disk; the chain record indicates the difference field and the difference field value which are sequentially stored according to the photographing time; and outputting the chained record in response to the query request.
In an optional embodiment of the present invention, the first preset condition is that a user operation in the buried point data satisfies a preset operation, and there is registration information corresponding to the buried point data.
In an optional embodiment of the present invention, the second condition is that a uniform resource locator in the buried point data matches a preset resource locator.
In an optional embodiment of the present invention, in a case that uniform resource locators corresponding to a plurality of pages are the same, the registration module is further configured to register the plurality of pages respectively, and determine registration information corresponding to each of the pages respectively; wherein each of the pages corresponds to a different page ID.
In an optional embodiment of the present invention, the apparatus 700 implements a method for taking a picture of a page based on a jQuery framework.
According to the processing device of the page snapshot, the data of the embedded point is monitored in real time, the calling of the shooting interface can be carried out according to the first preset condition which is configured in advance, namely, the automatic shooting is carried out once when the shooting interface is called, and the automatic page shooting process is realized. And the photographed target page is registered in advance and has registration information stored, so that abuse of the photographing function can be reduced, and the use safety of the front-end plug-in is improved. Meanwhile, the photo data obtained by photographing every time does not need to be stored in full, and only the difference data between the current photo data and the historical photo data is stored, so that unnecessary repeated storage is reduced, and the storage space is saved.
Fig. 8 shows an exemplary system architecture 800 of a page snapshot processing method or a page snapshot processing apparatus to which an embodiment of the present invention may be applied.
As shown in fig. 8, the system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. The network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and a server 805. Network 804 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 801, 802, 803 to interact with a server 805 over a network 804 to receive or transmit data or the like. The terminal devices 801, 802, 803 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like.
The terminal devices 801, 802, 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 805 may be a server that provides various services, such as a back-office management server that provides support for buried point data monitored by users using the terminal devices 801, 802, 803. The background management server may analyze and perform other processing on the received data such as the buried point data and the query request, and feed back a processing result (e.g., photo data and chain record) to the terminal device.
It should be noted that the method for processing a page snapshot provided in the embodiment of the present invention is generally executed by the terminal devices 801, 802, and 803, and accordingly, the device for processing a page snapshot is generally disposed in the terminal devices 801, 802, and 803.
It should be understood that the number of terminal devices, networks, and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation.
Referring now to FIG. 9, shown is a block diagram of a computer system 900 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU) 901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the system 900 are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output portion 907 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 909 and/or installed from the removable medium 911. The above-described functions defined in the system of the present invention are executed when the computer program is executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. 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 of the computer readable storage medium may include, but are not limited to: 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 present invention, 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. In the present invention, however, 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, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises a module, a calling module, a photographing module and a storage module. The names of these modules do not in some cases constitute a limitation on the module itself, and for example, a monitoring module may also be described as a "module that monitors the buried point data of a page in real time".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: monitoring data of buried points of a page in real time; calling a page photographing interface under the condition that the buried point data meets a first preset condition; acquiring target registration information of a target page by using the page photographing interface, and photographing the target page according to the target registration information to obtain current photo data; and obtaining historical photo data corresponding to the target page from a cache, and storing difference data between the current photo data and the historical photo data.
According to the technical scheme of the embodiment of the invention, the data of the buried points is monitored in real time, the photographing interface can be called according to the preset first preset condition, namely, the photographing interface is called once, and the automatic photographing is carried out once, so that the automatic page photographing process is realized. And the photographed target page is registered in advance and has registration information stored, so that abuse of the photographing function can be reduced, and the use safety of the front-end plug-in is improved. Meanwhile, the photo data obtained by photographing each time does not need to be stored in full, and only the difference data between the current photo data and the historical photo data is stored, so that unnecessary repeated storage is reduced, and the storage space is saved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (19)

1. A method for processing a page snapshot is characterized by comprising the following steps:
monitoring the data of the embedded points of the page in real time;
calling a page photographing interface under the condition that the buried point data meets a first preset condition;
acquiring target registration information of a target page by using the page photographing interface, and photographing the target page according to the target registration information to obtain current photo data;
and obtaining historical photo data corresponding to the target page from a cache, and storing difference data between the current photo data and the historical photo data.
2. The method of claim 1, prior to the invoking of the paged photographing interface, further comprising:
under the condition that the buried point data meet a second preset condition, registering one or more pages, and determining registration information corresponding to the pages; wherein the registration information includes: a page ID and one or more photo areas.
3. The method according to claim 2, wherein the acquiring target registration information of a target page by using the page photographing interface and photographing the target page according to the target registration information comprises:
determining target registration information from one or more pieces of registration information according to the target page ID corresponding to the target page;
and photographing the target page according to one or more photographing regions in the target registration information.
4. The method of claim 3, further comprising:
and storing the current photo data into a cache corresponding to the page ID, and deleting the historical photo data with the longest storage time from the cache, so that the number of the total photo data stored in the cache is not greater than a preset threshold value.
5. The method of claim 1, wherein storing the difference data between the current photo data and the historical photo data comprises:
determining target historical photo data which is closest to the current photo data according to the photographing time corresponding to the historical photo data under the condition that the historical photo data are multiple;
storing difference data between the current photo data and the target historical photo data.
6. The method of claim 5, wherein storing the difference data between the current photo data and the target historical photo data comprises:
determining a difference field and a corresponding difference field value according to fields and field values in the current photo data and the historical photo data;
and correspondingly storing the difference field, the difference field value and the photographing time corresponding to the current photo data to a hard disk.
7. The method of claim 6, wherein the registration information further comprises: service codes respectively corresponding to one or more photographing regions; correspondingly storing the difference field, the difference field value and the photo sequence number corresponding to the current photo data to a hard disk, including:
encoding, for each of the services: and according to the photographing time, storing the difference field and the difference field value corresponding to the service code to a hard disk in a chained mode.
8. The method of claim 7,
receiving a query request; the query request comprises a service code to be queried;
acquiring a chain record corresponding to the service code from the hard disk; the chain record indicates the difference field and the difference field value which are sequentially stored according to the photographing time;
and outputting the chained record in response to the query request.
9. The method according to claim 1, wherein the first preset condition is that a user operation in the buried point data satisfies a preset operation and there is registration information corresponding to the buried point data.
10. The method of claim 2, wherein the second condition is that a uniform resource locator in the buried point data matches a preset resource locator.
11. The method according to claim 10, wherein, in a case that uniform resource locators corresponding to a plurality of pages are the same, the registering one or more pages and determining registration information corresponding to the pages includes:
registering the multiple pages respectively, and determining registration information corresponding to each page; wherein each of the pages corresponds to a different page ID.
12. The method according to any one of claims 1 to 11, wherein the method for taking the picture of the page is implemented based on a jQuery frame.
13. A processing apparatus for page photographing, comprising:
the monitoring module is used for monitoring the data of the embedded points of the page in real time;
the calling module is used for calling a page photographing interface under the condition that the buried point data meets a first preset condition;
the photographing module is used for acquiring target registration information of a target page by using the page photographing interface and photographing the target page according to the target registration information to obtain current photo data;
and the storage module is used for acquiring historical photo data corresponding to the target page from a cache and storing difference data between the current photo data and the historical photo data.
14. The apparatus of claim 13, further comprising:
the registration module is used for registering one or more pages and determining registration information corresponding to the pages under the condition that the buried point data meets a second preset condition before the page photographing interface is called; wherein the registration information includes: a page ID and one or more photo areas.
15. The apparatus of claim 14, wherein the storage module is further configured to store the current photo data in a cache corresponding to the page ID, and delete the historical photo data stored for the longest time from the cache, so that the number of total photo data stored in the cache is not greater than a preset threshold.
16. The apparatus according to claim 13, wherein the storage module is further configured to, for a case where the historical photograph data is multiple, determine target historical photograph data that is closest in time to the current photograph data according to a photographing time corresponding to the historical photograph data; storing difference data between the current photo data and the target historical photo data.
17. An electronic device for processing a page snapshot, comprising:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method recited in any of claims 1-12.
18. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-12.
19. A computer program product comprising a computer program, characterized in that the computer program realizes the method according to any of claims 1-12 when executed by a processor.
CN202211332733.6A 2022-10-28 2022-10-28 Method and device for processing page snapshot Pending CN115658605A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211332733.6A CN115658605A (en) 2022-10-28 2022-10-28 Method and device for processing page snapshot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211332733.6A CN115658605A (en) 2022-10-28 2022-10-28 Method and device for processing page snapshot

Publications (1)

Publication Number Publication Date
CN115658605A true CN115658605A (en) 2023-01-31

Family

ID=84992472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211332733.6A Pending CN115658605A (en) 2022-10-28 2022-10-28 Method and device for processing page snapshot

Country Status (1)

Country Link
CN (1) CN115658605A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117892698A (en) * 2024-03-14 2024-04-16 成都数之联科技股份有限公司 Text gradual change rendering method, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117892698A (en) * 2024-03-14 2024-04-16 成都数之联科技股份有限公司 Text gradual change rendering method, equipment and storage medium
CN117892698B (en) * 2024-03-14 2024-06-07 成都数之联科技股份有限公司 Text gradual change rendering method, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111078140B (en) Nuclear power station file uploading management method and device, terminal equipment and medium
US20210383370A1 (en) Enhanced multi-party user data deletion
US20180089374A1 (en) Method and System for Transferring Mammograms with Blockchain Verification
CN109472540B (en) Service processing method and device
CN114047854B (en) Information interaction method and device for document processing, electronic equipment and storage medium
CN113343312A (en) Page tamper-proofing method and system based on front-end point burying technology
CN113849473A (en) Operation recording method, operation recording device, electronic device, and storage medium
CN115357761A (en) Link tracking method and device, electronic equipment and storage medium
CN115658605A (en) Method and device for processing page snapshot
CN107329981B (en) Page detection method and device
CN116450622B (en) Method, apparatus, device and computer readable medium for data warehouse entry
CN111222067B (en) Information generation method and device
CN111753141A (en) Data management method and related equipment
CN114240392A (en) Information processing method, task approval method, and information processing apparatus
CN110309121B (en) Log processing method and device, computer readable medium and electronic equipment
CN113449886A (en) Data processing method, processing device, equipment and storage medium
TWI627545B (en) Online community media instant news screening and notification method
CN112699116A (en) Data processing method and system
CN113434754A (en) Method and device for determining recommended API (application program interface) service, electronic equipment and storage medium
CN112988806A (en) Data processing method and device
CN112965946B (en) Method, device, equipment and computer readable medium for processing document
CN110363537B (en) Remote surface signature screen calling method and device, storage medium and computer equipment
US20220391465A1 (en) System and Method to Update a Bookmarked Document Link and Avoid a Broken Link
CN113760586A (en) Picture detection method and device
CN117171463A (en) Method, apparatus, device and computer readable medium for displaying digital newspaper

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