CN112257004B - Method, device, server and storage medium for page backup - Google Patents

Method, device, server and storage medium for page backup Download PDF

Info

Publication number
CN112257004B
CN112257004B CN202011231702.2A CN202011231702A CN112257004B CN 112257004 B CN112257004 B CN 112257004B CN 202011231702 A CN202011231702 A CN 202011231702A CN 112257004 B CN112257004 B CN 112257004B
Authority
CN
China
Prior art keywords
subtask
backup
task
backed
processing result
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
CN202011231702.2A
Other languages
Chinese (zh)
Other versions
CN112257004A (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.)
Weiyiyun Hangzhou Holding Co ltd
Original Assignee
Weiyiyun Hangzhou Holding 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 Weiyiyun Hangzhou Holding Co ltd filed Critical Weiyiyun Hangzhou Holding Co ltd
Priority to CN202011231702.2A priority Critical patent/CN112257004B/en
Publication of CN112257004A publication Critical patent/CN112257004A/en
Application granted granted Critical
Publication of CN112257004B publication Critical patent/CN112257004B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Abstract

The embodiment of the invention provides a method, a device, a server and a storage medium for page backup, wherein the method comprises the following steps: generating an access instruction according to timing information preset in the backup task; sending an access instruction to a target browser so that the target browser executes each subtask to be backed up based on the access instruction, and feeding back a subtask processing result corresponding to each subtask to be backed up; receiving each subtask processing result, sending the subtask processing results to a cloud storage space, and receiving subtask links corresponding to each subtask processing result and fed back by the cloud storage space; and taking each subtask link and the corresponding subtask state as a backup result corresponding to the backup task, and updating and storing the backup result into the target database so as to obtain a subtask processing result based on the subtask link. According to the technical scheme, the service of automatically backing up the webpage quickly and efficiently by the server is realized, and the technical effect of improving the page backup efficiency is achieved.

Description

Method, device, server and storage medium for page backup
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method, a device, a server and a storage medium for backing up a page.
Background
At present, when a user needs to save a page, the user needs to access the corresponding page on the mobile terminal first, and manually trigger a page saving function to manually save the page for backup.
However, when the above method is used for page backup, the user needs to access the corresponding page first and save the page, and when there are many pages to be saved, the above steps need to be repeatedly executed, which has a technical problem of low page backup efficiency.
Furthermore, in the process of backing up the page, the backed-up page is mostly stored locally, so that when the page is down, the page cannot be backed up, and the corresponding page cannot be opened based on the backup file, which results in the problem that the page is invalid.
Disclosure of Invention
The invention provides a method, a device, a server and a storage medium for page backup, which are used for realizing the technical effect of automatic and efficient page backup.
In a first aspect, an embodiment of the present invention provides a method for backing up a page, where the method is applied in a server, and includes:
generating an access instruction according to timing information preset in the backup task; the backup task comprises at least one subtask to be backed up;
sending the access instruction to a target browser to enable the target browser to execute each subtask to be backed up based on the access instruction, and feeding back a subtask processing result corresponding to each subtask to be backed up; the subtask processing result comprises a backup page corresponding to the backup subtask;
receiving each subtask processing result, sending the subtask processing result to a cloud storage space, and receiving a subtask link corresponding to each subtask processing result and fed back by the cloud storage space;
taking each subtask link and the corresponding subtask state as a backup result corresponding to the backup task, and updating and storing the backup result into a target database so as to obtain a subtask processing result based on the task link; and the subtask state corresponds to a subtask processing result.
In a second aspect, an embodiment of the present invention further provides an apparatus for backing up a page, where the apparatus is configured in a server, and includes:
the access instruction generating module is used for generating an access instruction according to the preset timing information in the backup task; the backup task comprises at least one subtask to be backed up;
the subtask processing result determining module is used for sending the access instruction to a target browser so that the target browser executes each subtask to be backed up based on the access instruction, and feeds back a subtask processing result corresponding to each subtask to be backed up; the subtask processing result comprises a backup page corresponding to the backup subtask;
the subtask link determining module is used for receiving each subtask processing result, sending the subtask processing result to the cloud storage space, and receiving a subtask link corresponding to each subtask processing result and fed back by the cloud storage space;
the backup result generation module is used for updating and storing the backup result into a target database to obtain a sub-task processing result based on the task link, wherein each sub-task link and the corresponding sub-task state are used as the backup result corresponding to the backup task; and the subtask state corresponds to a subtask processing result.
In a third aspect, an embodiment of the present invention further provides a server, where the server includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for snooping exception data according to any one of the embodiments of the present invention.
In a fourth aspect, the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method for snooping abnormal data according to any one of the embodiments of the present invention.
According to the technical scheme of the embodiment of the invention, each pre-established subtask to be backed up is executed based on the headless browser, and the subtask processing result corresponding to the subtask to be backed up, namely the corresponding backup page, can be simultaneously obtained, so that the multiple pages can be simultaneously accessed and backed up, and the technical effect of page backup efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a schematic flowchart of a method for backing up a page according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for backing up a page according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a device for backing up a page according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a server according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flowchart of a method for backing up a page according to an embodiment of the present invention, where the embodiment is applicable to a situation in which a web page file and a web page resource of a current site are backed up in a server, and the method may be executed by a device for backing up a page, and the device may be implemented in a form of software and/or hardware.
As shown in fig. 1, the method of the present embodiment includes:
s110, generating an access instruction according to timing information preset in the backup task; the backup task comprises at least one subtask to be backed up.
The backup task comprises a plurality of children to be backed up. The number of the subtasks to be backed up corresponds to the actual demand of the user, for example, if the user needs to back up ten web files, the number of the subtasks to be backed up may be ten, and the subtasks to be backed up may be taken as a whole, that is, the backup task. That is, the subtask to be backed up is a task for determining which pages, resources, or web page files to back up. The timing information is time information for executing each sub task to be backed up in the backup task, for example, if the page acquisition time corresponding to a certain sub task to be backed up is eleven points, the timing information is eleven points, and a corresponding access instruction, that is, an instruction for accessing the page corresponding to the sub task to be backed up, may be generated based on the timing information in the backup task. Of course, the timing information may also be the time interval duration, i.e. how often the backup task is executed.
Before generating an access instruction according to timing information preset in a backup task, the method further comprises the following steps: receiving a backup task and storing the backup task to a target position; the method comprises the following steps that a backup task is created in advance, and the creation of the backup task comprises the following steps: determining a link to be accessed of each page to be backed up, generating a subtask to be backed up based on the link to be accessed, and generating a backup task based on each subtask to be backed up.
It can be understood that before backing up each page based on the backup task, a sub task to be backed up may be created in advance, the sub task to be backed up may be a page or a file that is desired to be saved, a link to be accessed corresponding to each page to be backed up may be determined, and the link to be accessed is taken as the sub task to be backed up. A plurality of subtasks to be backed up can be stored at the same time, and serve as the tasks to be backed up.
It should be further noted that, after the task to be backed up is generated, the time length for executing the task to be backed up may be determined, for example, the backup task is executed at intervals of many times, and optionally, the time length of the task interval is 1 hour, and the backup task may be executed at intervals of one hour. It should be noted that the task interval duration is set according to actual requirements, and is not specifically limited herein, and only the backup task may be executed at regular time.
That is, the timing information includes a task interval duration for executing the backup task, and the generating of the access instruction according to the preset timing information in the backup task includes: determining the historical moment of executing the backup task at the previous time; and if the actual interval duration between the current moment and the historical moment reaches the task interval duration, generating an access instruction for executing the backup task.
After the previous backup task is executed, the historical time of the previous backup task can be recorded, when the fact that the actual interval duration between the current time and the historical time reaches the task interval duration in the timing information is detected, the backup task can be executed again, and correspondingly, an access instruction corresponding to the backup task can be generated.
It should be further noted that one or more task interval durations may be set by the user according to actual needs, and optionally, the task interval duration may be set by executing the backup task every two hours.
S120, sending an access instruction to the target browser so that the target browser executes each subtask to be backed up based on the access instruction, and feeding back a subtask processing result corresponding to each subtask to be backed up; the subtask processing result includes a backup page corresponding to the backup subtask.
The target browser may be a headless browser, which is a browser without a graphical user interface, and generally operates in a server command line, but may perform the same functions as a general browser, such as accessing a web page, executing a web page script, and capturing a web page screenshot. Correspondingly, the subtask to be backed up is a task to be backed up, such as a content of a web page file or a web page resource of the current site. After the server generates the access instruction, the server may send a corresponding access instruction to the target browser, and the target browser may simultaneously execute each sub-task to be backed up in the backup tasks or sequentially execute each sub-task to be backed up based on the access instruction. After the sub task to be backed up is executed, the task processing result can be fed back to the server.
It should be noted that the to-be-backed-up subtask may be a link for accessing a web page of a certain site, and correspondingly, the executing of the to-be-backed-up subtask may be opening a page corresponding to the access link, and therefore, the feedback of the processing result of the task refers to feedback of the back-up page corresponding to the access link. It can be understood that, when the subtask to be backed up is executed, the page corresponding to the access link may be opened, and the screenshot or the storage may be performed on the page, and accordingly, the feedback result is the page that is stored or the screenshot.
Optionally, sending an access instruction to the target browser, so that the target browser executes each sub-task to be backed up based on the access instruction, and feeds back a sub-task processing result corresponding to each sub-task to be backed up, where the method includes: and sending an access instruction to the headless browser so that the headless browser accesses the to-be-accessed links corresponding to the subtasks to be backed up according to the access instruction, and taking the to-be-backed up pages corresponding to the to-be-accessed links as the subtask processing results corresponding to the subtasks to be backed up.
That is to say, an access instruction is sent to the target browser, and the target browser executes each to-be-backed-up subtask in the backup task according to the access instruction, that is, the headless browser accesses to-be-backed-up links corresponding to each to-be-backed-up subtask, that is, a page corresponding to the to-be-backed-up link can be opened, and the page corresponding to the to-be-backed-up link is the to-be-backed-up page. And saving or screenshot the page to be backed up based on the headless browser, and feeding back the page to be backed up to the server as a subtask processing result.
And S130, receiving each subtask processing result, sending the subtask processing result to a cloud storage space, and receiving a subtask link corresponding to each subtask processing result fed back by the cloud storage space.
The task processing result corresponding to each sub-task to be backed up may be used as the sub-task processing result. In this embodiment, the subtask processing result is a backup page corresponding to the subtask to be backed up. In order to save local resources, the subtask processing result corresponding to each subtask to be backed up may be stored in the cloud, that is, the cloud storage space. After the subtask processing results are stored in the cloud storage space, a storage link corresponding to each subtask processing result may be generated, that is, the subtask processing results are stored in a specific location in the cloud, or through what way the corresponding subtask processing results may be obtained from the cloud storage space. And taking the storage link corresponding to each subtask processing result as a subtask link. Subtask links may be fed back to the server. The subtask link is a link stored in the cloud from a backup page corresponding to the subtask to be backed up.
Optionally, each page to be backed up is sent to the cloud storage space, a subtask link corresponding to the page to be backed up and fed back by the cloud storage space is received, the subtask link corresponds to the page to be backed up, and the corresponding page to be backed up can be obtained from the corresponding position of the cloud storage space according to the subtask link.
And S140, taking each subtask link and the corresponding subtask state as a backup result corresponding to the backup task, and updating and storing the backup result into a target database so as to obtain a subtask processing result based on the task link, wherein the subtask state corresponds to the subtask processing result.
Wherein the backup result corresponds to the backup task. And sub task links corresponding to the sub tasks to be backed up are stored in the backup result. In order to facilitate management of the sub-task processing results corresponding to the backup task, the sub-task processing results corresponding to the sub-tasks to be backed up may be stored as a whole, i.e., the backup results. The backup result is stored in a target database, which can be a local database, so that the setting has the advantages that the memory occupied by the backup page is large, and the problem of memory occupation exists when the backup page is stored locally.
It should be noted that the target database may be accessed to the server in the form of a plug-in, and when a certain page fails, the subtask link corresponding to the failed page may be called from the database, so that the backup page corresponding to the subtask link is called from the cloud, and a technical effect of quickly restoring the page is achieved.
In this embodiment, for each subtask to be backed up, if a subtask processing result corresponding to the subtask to be backed up is received, the task state of the subtask to be backed up is marked as a completed state, and is bound to the identification information of the subtask to be backed up; and taking the subtask link, the identification information and the task state corresponding to each subtask to be backed up as a backup result of the backup task, and updating and storing the backup result into a target database.
It should be noted that, in the actual application process, there is a case that the page corresponding to the access link is not accessed, and therefore, the page corresponding to the access link is not acquired, that is, the sub-task processing result corresponding to the sub-task to be backed up is not acquired, and at this time, the sub-task to be backed up may be marked as an incomplete state. And meanwhile, binding the incomplete state with the corresponding subtasks to be backed up. Certainly, after the subtask processing result corresponding to the subtask to be backed up is obtained, the subtask processing result and the corresponding subtask to be backed up can be bound, which has the advantage that the user can quickly determine whether to obtain the corresponding backup page, thereby determining whether to re-execute the corresponding subtask to be backed up, and further obtaining the corresponding backup page.
Specifically, after the subtask processing result corresponding to each subtask to be backed up is obtained, the subtask link, the identification information, and the task state corresponding to the subtask to be backed up may be bound and used as the backup result of the backup task. The backup results may be updated into the target database.
Wherein, updating the backup result to the target database may be: and taking the backup result corresponding to the current moment as a latest backup result, and updating the backup result in the target database into the latest backup result. The method can also comprise the following steps: and storing the backup result corresponding to each execution time in a target database so as to fetch the backup page corresponding to each execution time.
On the basis of the technical scheme, the method further comprises the following steps: when a target task link is detected to be triggered, a target backup page corresponding to the target task link is obtained from a cloud storage space, and a display page corresponding to the target task link is updated based on the target backup page.
In the actual application process, the user can trigger each subtask link stored in the target database, and the subtask link triggered by the user can be used as the target task link. If the user triggers the target task link, a backup page corresponding to the target task link, namely a subtask processing result corresponding to the target subtask link, can be acquired from the cloud storage space according to the target task link, and the target backup page can be updated on a display page corresponding to the target task link.
According to the technical scheme of the embodiment of the invention, each pre-established subtask to be backed up is executed based on the headless browser, and the subtask processing result corresponding to the subtask to be backed up, namely the corresponding backup page, can be simultaneously obtained, so that the multiple pages can be simultaneously accessed and backed up, and the technical effect of page backup efficiency is improved.
According to the technical scheme, the webpage backup is achieved without manual operation of a user on the basis of the headless browser technology, the webpage after the backup is completed can be stored in the cloud, the user can download the webpage at any time, meanwhile, the server can send the access instruction for executing the backup task to the headless browser on the basis of the timing task by setting the timing task in the backup task, and when the mode is adopted, the webpage snapshot before a period of time can be kept even when the website is down, so that the technical effect of displaying the webpage is achieved. Finally, the headless browser can simultaneously access a plurality of pages for backup, and the efficiency of webpage backup is greatly improved.
Example two
As a preferred embodiment of the foregoing embodiment, fig. 2 is a schematic flowchart of a method for backing up a page according to a second embodiment of the present invention. The technical terms that are the same as or corresponding to the above embodiments are not repeated herein.
As shown in fig. 2, the method includes:
s201, accessing a webpage backup background.
Specifically, the user accesses the web page backup background to create a backup task.
S202, creating a backup task, and setting corresponding configuration, wherein the configuration comprises a timing interval and a page address.
Specifically, the user may set a web page link to which a page or a file that needs to be backed up is mapped according to actual requirements, and then the web page link is used as a sub task to be backed up in the backup task.
Illustratively, a user needs to backup pages on ten websites, and the website of each website can be used as a subtask to be backed up.
Meanwhile, after the setting of the backup task is completed, the time interval for executing the backup task may be set, for example, the backup task is executed every two hours. The advantage of setting the execution interval duration of the backup task is that the backup result corresponding to the backup task can be obtained regularly, so that when the backup page needs to be obtained, the backup page can be called from the backup result at the corresponding moment.
It should be noted that the web address of a certain page in the website is a page address.
S203, the headless browser reads the configuration and starts to execute the task in the backup task.
The configuration refers to the website and timing information of the access page in the backup task.
Specifically, the backup task may be sent to the server, and the server may determine an interval duration between the current time and the previous time when the backup task is executed, and may send a task execution instruction, that is, an access instruction for accessing a web site corresponding to each subtask to be backed up in the backup task, to the headless browser after the interval duration reaches a timing interval set in the backup task. And according to the access instruction, an access link of each subtask to be backed up of the backup task can be opened, a corresponding page can be intercepted after the access link is opened, and the page is taken as a subtask processing result.
And S204, after the execution of each task in the backup tasks is finished, storing the backup result to a cloud disk, and receiving a resource link fed back by the cloud disk.
The resource link can be understood as a subtask link corresponding to the subtask processing result after the subtask processing result is stored in the cloud.
It can be understood that after the execution of each sub task to be backed up in the backup task is completed, the sub task processing result corresponding to each sub task to be backed up is stored in the cloud disk. Meanwhile, resource links corresponding to each subtask to be backed up, namely subtask links, fed back by the cloud disk can be received. The subtask link corresponds to a subtask processing result.
And S205, storing the resource link into a database.
Specifically, after receiving subtask links corresponding to subtasks to be backed up in the backup task, each subtask link can be stored to the database as a backup result.
And S206, displaying the task state and the download link in the background so that the user can trigger the corresponding download link to download the corresponding page.
Specifically, the task state and the resource link corresponding to each sub task to be backed up, that is, the sub task link, may be displayed in the background. When the user triggers any resource link, the backup page corresponding to the resource link can be acquired from the cloud storage space.
According to the technical scheme of the embodiment of the invention, each pre-established subtask to be backed up is executed based on the headless browser, and the subtask processing result corresponding to the subtask to be backed up, namely the corresponding backup page, can be simultaneously obtained, so that the multiple pages can be simultaneously accessed and backed up, and the technical effect of page backup efficiency is improved.
According to the technical scheme, the webpage backup is achieved without manual operation of a user on the basis of the headless browser technology, the webpage after the backup is completed can be stored in the cloud, the user can download the webpage at any time, meanwhile, the server can send the access instruction for executing the backup task to the headless browser on the basis of the timing task by setting the timing task in the backup task, and when the mode is adopted, the webpage snapshot before a period of time can be kept when the website is down, so that the technical effect of displaying the webpage is achieved. Finally, the headless browser can simultaneously access a plurality of pages for backup, and the efficiency of webpage backup is greatly improved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an abnormal data monitoring device according to a third embodiment of the present invention, where the device configuration and the microservice include: an access instruction generating module 310, a subtask processing result determining module 320, a subtask link determining module 330, and a backup result generating module 340.
The access instruction generating module 310 is configured to generate an access instruction according to timing information preset in the backup task; the backup task comprises at least one subtask to be backed up;
a subtask processing result determining module 320, configured to send the access instruction to a target browser, so that the target browser executes each subtask to be backed up based on the access instruction, and feeds back a subtask processing result corresponding to each subtask to be backed up; the subtask processing result comprises a backup page corresponding to the backup subtask;
the subtask link determining module 330 is configured to receive each subtask processing result, send the subtask processing result to a cloud storage space, and receive a subtask link corresponding to each subtask processing result and fed back by the cloud storage space;
a backup result generating module 340, configured to take each subtask link and a corresponding subtask state as a backup result corresponding to the backup task, update and store the backup result in a target database, so as to obtain a subtask processing result based on the task link; on the basis of the technical scheme, the subtask state corresponds to the subtask processing result, and the access instruction generation module is used before being used for generating an access instruction according to the preset timing information in the backup task;
receiving a backup task and storing the backup task to a target position; the backup task is created in advance, and the creating of the backup task comprises the following steps: determining a link to be accessed of each page to be backed up, generating subtasks to be backed up based on the link to be accessed, and generating the backup tasks based on the subtasks to be backed up.
On the basis of the above technical solution, the access instruction generating module further includes:
a history time determining unit, configured to determine a history time at which the backup task was executed last time;
and the access instruction generating unit is used for generating an access instruction for executing the backup task if the actual interval duration between the current moment and the historical moment reaches the task interval duration.
On the basis of the above technical solutions, the subtask processing result determining module is further configured to send an access instruction to the headless browser, so that the headless browser accesses the to-be-accessed link corresponding to each subtask to be backed up according to the access instruction, and uses the to-be-backed up page corresponding to the to-be-accessed link as the subtask processing result corresponding to the subtask to be backed up.
On the basis of the technical schemes, the subtask link determining module is used for sending each page to be backed up to the cloud storage space and receiving the subtask link corresponding to the page to be backed up and fed back by the cloud storage space.
On the basis of the technical solutions, the backup result generation module is used for marking the task state of the current subtask to be backed up as a completed state and binding the task state with the identification information of the current subtask to be backed up, if a subtask processing result corresponding to the current subtask to be backed up is received for each subtask to be backed up; and taking the subtask link, the identification information and the task state corresponding to each subtask to be backed up as a backup result of the backup task, and updating and storing the backup result into a target database.
On the basis of the above technical solutions, the apparatus further includes: and the updating module is used for acquiring a target backup page corresponding to the target task link from a cloud storage space when the target task link is detected to be triggered, and updating a display page corresponding to the target task link based on the target backup page.
According to the technical scheme of the embodiment of the invention, each pre-established subtask to be backed up is executed based on the headless browser, and the subtask processing results corresponding to the subtasks to be backed up, namely corresponding backup pages, can be simultaneously obtained, so that a plurality of pages can be simultaneously accessed and backed up, and the technical effect of page backup efficiency is improved.
The device for backing up the page provided by the embodiment of the invention can execute the method for backing up the page provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
Example four
Fig. 4 is a schematic structural diagram of a server according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary server 40 suitable for use in implementing embodiments of the present invention. The server 40 shown in fig. 4 is only an example, and should not bring any limitation to the function and the use range of the embodiment of the present invention.
As shown in fig. 4, the server 40 is in the form of a general purpose computing device. The components of server 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 that couples various system components including the system memory 402 and the processing unit 401.
Bus 403 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The server 40 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by server 40 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 404 and/or cache memory 405. The server 40 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 by one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored, for example, in the memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which may comprise an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the described embodiments of the invention.
The server 40 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), with one or more devices that enable a user to interact with the server 40, and/or with any devices (e.g., network card, modem, etc.) that enable the server 40 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interfaces 411. Also, server 40 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 412. As shown, the network adapter 412 communicates with the other modules of the server 40 over the bus 403. It should be appreciated that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with the server 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 401 executes various functional applications and data processing by executing programs stored in the system memory 402, for example, to implement the method for backing up pages provided by the embodiment of the present invention.
EXAMPLE five
Embodiments of the present invention also provide a storage medium containing computer-executable instructions for performing a method of backing up pages when executed by a computer processor.
The method comprises the following steps:
generating an access instruction according to timing information preset in the backup task; the backup task comprises at least one subtask to be backed up;
sending the access instruction to a target browser so that the target browser executes each subtask to be backed up based on the access instruction, and feeding back a subtask processing result corresponding to each subtask to be backed up; the subtask processing result comprises a backup page corresponding to the backup subtask;
receiving each subtask processing result, sending the subtask processing result to a cloud storage space, and receiving a subtask link corresponding to each subtask processing result and fed back by the cloud storage space;
taking each subtask link and the corresponding subtask state as a backup result corresponding to the backup task, and updating and storing the backup result into a target database so as to obtain a subtask processing result based on the task link; and the subtask state corresponds to a subtask processing result.
Computer storage media for embodiments of the present invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing description is only exemplary of the invention and that the principles of the technology may be employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in some detail by the above embodiments, the invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the invention, and the scope of the invention is determined by the scope of the appended claims.

Claims (10)

1. A method for backing up a page is applied to a server and comprises the following steps:
generating an access instruction according to timing information preset in the backup task; the backup task comprises at least one subtask to be backed up;
sending the access instruction to a target browser so that the target browser simultaneously executes the subtasks to be backed up based on the access instruction, or sequentially executes the subtasks to be backed up and feeds back a subtask processing result corresponding to each subtask to be backed up; the subtask processing result comprises a backup page corresponding to the backup subtask;
receiving each subtask processing result, sending the subtask processing result to a cloud storage space, and receiving a subtask link corresponding to each subtask processing result and fed back by the cloud storage space;
taking each subtask link and the corresponding subtask state as a backup result corresponding to the backup task, and updating and storing the backup result into a target database to obtain a subtask processing result based on the subtask link; and the subtask state corresponds to a subtask processing result.
2. The method according to claim 1, before generating the access instruction according to the timing information preset in the backup task, further comprising;
receiving a backup task and storing the backup task to a target position;
the backup task is created in advance, and the creating of the backup task comprises the following steps: determining links to be accessed of each page to be backed up, generating subtasks to be backed up based on the links to be accessed, and generating the backup tasks based on the subtasks to be backed up.
3. The method according to claim 2, wherein the timing information includes a task interval duration for executing the backup task, and the generating an access instruction according to the timing information preset in the backup task includes:
determining the historical moment of executing the backup task at the previous time;
and if the actual interval time between the current time and the historical time reaches the task interval time, generating an access instruction for executing the backup task.
4. The method according to claim 1, wherein the sending the access instruction to a target browser to cause the target browser to execute each sub-task to be backed up based on the access instruction and feed back a sub-task processing result corresponding to each sub-task to be backed up comprises:
and sending an access instruction to a headless browser so that the headless browser accesses the to-be-accessed links corresponding to the subtasks to be backed up according to the access instruction, and taking the to-be-backed up pages corresponding to the to-be-accessed links as subtask processing results corresponding to the subtasks to be backed up.
5. The method according to claim 1, wherein the subtask processing result includes a page to be backed up corresponding to the subtask to be processed, and the receiving the subtask processing result, sending the subtask processing result to a cloud storage space, and receiving a subtask link corresponding to the subtask processing result and fed back by the cloud storage space includes:
and sending each page to be backed up to a cloud storage space, and receiving a subtask link which is fed back by the cloud storage space and corresponds to the page to be backed up.
6. The method according to claim 1, wherein the taking each subtask link and the corresponding subtask state as a backup result corresponding to the backup task and updating and storing the backup result in a target database to obtain a subtask processing result based on the task link comprises:
for each subtask to be backed up, if a subtask processing result corresponding to the subtask to be backed up is received, marking the task state of the subtask to be backed up as a completed state, and binding the task state of the subtask to be backed up with the identification information of the subtask to be backed up;
and taking the subtask link, the identification information and the task state corresponding to each subtask to be backed up as a backup result of the backup task, and updating and storing the backup result into a target database.
7. The method of claim 1, further comprising:
when a target task link is detected to be triggered, a target backup page corresponding to the target task link is obtained from a cloud storage space, and a display page corresponding to the target task link is updated based on the target backup page.
8. An apparatus for backing up pages, configured in a server, comprising:
the access instruction generating module is used for generating an access instruction according to the preset timing information in the backup task; the backup task comprises at least one subtask to be backed up;
the subtask processing result determining module is used for sending the access instruction to a target browser so that the target browser can simultaneously execute the subtasks to be backed up based on the access instruction, or sequentially execute the subtasks to be backed up and feed back the subtask processing result corresponding to each subtask to be backed up; the subtask processing result comprises a backup page corresponding to the backup subtask;
the subtask link determining module is used for receiving each subtask processing result, sending the subtask processing result to the cloud storage space, and receiving a subtask link corresponding to each subtask processing result and fed back by the cloud storage space;
the backup result generation module is used for taking each subtask link and the corresponding subtask state as a backup result corresponding to the backup task, updating and storing the backup result into a target database, and acquiring a subtask processing result based on the task link; and the subtask state corresponds to a subtask processing result.
9. A server, characterized in that the server comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of backing up pages as recited in any of claims 1-7.
10. A storage medium containing computer-executable instructions for performing a method of backing up pages as recited in any one of claims 1-7 when executed by a computer processor.
CN202011231702.2A 2020-11-06 2020-11-06 Method, device, server and storage medium for page backup Active CN112257004B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011231702.2A CN112257004B (en) 2020-11-06 2020-11-06 Method, device, server and storage medium for page backup

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011231702.2A CN112257004B (en) 2020-11-06 2020-11-06 Method, device, server and storage medium for page backup

Publications (2)

Publication Number Publication Date
CN112257004A CN112257004A (en) 2021-01-22
CN112257004B true CN112257004B (en) 2023-03-14

Family

ID=74266440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011231702.2A Active CN112257004B (en) 2020-11-06 2020-11-06 Method, device, server and storage medium for page backup

Country Status (1)

Country Link
CN (1) CN112257004B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102737116A (en) * 2012-05-29 2012-10-17 深圳市同洲电子股份有限公司 Method and device for storing webpage resources
CN103685514A (en) * 2013-12-13 2014-03-26 北京奇虎科技有限公司 Method for storing page in webpage favorite and browser
CN109491744A (en) * 2018-11-06 2019-03-19 成都知道创宇信息技术有限公司 A kind of webpage capture system and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102737116A (en) * 2012-05-29 2012-10-17 深圳市同洲电子股份有限公司 Method and device for storing webpage resources
CN103685514A (en) * 2013-12-13 2014-03-26 北京奇虎科技有限公司 Method for storing page in webpage favorite and browser
CN109491744A (en) * 2018-11-06 2019-03-19 成都知道创宇信息技术有限公司 A kind of webpage capture system and method

Also Published As

Publication number Publication date
CN112257004A (en) 2021-01-22

Similar Documents

Publication Publication Date Title
US11392461B2 (en) Method and apparatus for processing information
WO2019148727A1 (en) Electronic device, redis-based exception warning method and storage medium
WO2014190806A1 (en) Application backup and restore
CN110555150B (en) Data monitoring method, device, equipment and storage medium
CN113254445B (en) Real-time data storage method, device, computer equipment and storage medium
CN110908837A (en) Application program exception handling method and device, electronic equipment and storage medium
CN111818145B (en) File transmission method, device, system, equipment and storage medium
CN112559140A (en) Transaction control method, system, equipment and storage medium for data consistency
CN115455058A (en) Cache data processing method and device, computer equipment and storage medium
CN109165372B (en) Webpage loading method, device, equipment and storage medium
CN110716804A (en) Method and device for automatically deleting useless resources, storage medium and electronic equipment
CN112257004B (en) Method, device, server and storage medium for page backup
CN111475388A (en) Data push test method and device, computer equipment and storage medium
CN112818204B (en) Service processing method, device, equipment and storage medium
CN110365763B (en) Data synchronization method, device, equipment and storage medium
CN113781154A (en) Information rollback method, system, electronic equipment and storage medium
CN112364268A (en) Resource acquisition method and device, electronic equipment and storage medium
CN112596824A (en) Information interaction method and device, electronic equipment and storage medium
CN110958243A (en) Network vulnerability submitting method and device, storage medium and electronic equipment
CN110389862B (en) Data storage method, device, equipment and storage medium
CN112650814B (en) Data storage method, device, equipment and storage medium based on message middleware
CN114036420A (en) Page rollback method, device, equipment and storage medium
CN114218191A (en) System function migration method and device, computer equipment and storage medium
CN114968983A (en) Data processing method, device, equipment and storage medium
CN115222545A (en) Message modular processing method and device, computer equipment and storage medium

Legal Events

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