CN113590564A - Data storage method and device, electronic equipment and storage medium - Google Patents

Data storage method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113590564A
CN113590564A CN202110864457.7A CN202110864457A CN113590564A CN 113590564 A CN113590564 A CN 113590564A CN 202110864457 A CN202110864457 A CN 202110864457A CN 113590564 A CN113590564 A CN 113590564A
Authority
CN
China
Prior art keywords
screenshot
page
target
uploading
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110864457.7A
Other languages
Chinese (zh)
Other versions
CN113590564B (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.)
Guahao Net Hangzhou Technology Co Ltd
Original Assignee
Guahao Net Hangzhou Technology 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 Guahao Net Hangzhou Technology Co Ltd filed Critical Guahao Net Hangzhou Technology Co Ltd
Priority to CN202110864457.7A priority Critical patent/CN113590564B/en
Publication of CN113590564A publication Critical patent/CN113590564A/en
Application granted granted Critical
Publication of CN113590564B publication Critical patent/CN113590564B/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/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The embodiment of the invention discloses a data storage method, a data storage device, electronic equipment and a storage medium, wherein the method comprises the following steps: when an uploading request for uploading a screenshot is received, screenshot association information corresponding to a current page is determined; the screenshot related information comprises at least one to-be-screenshot page corresponding to the hyperlink of the current page and/or target content edited in the screenshot information editing control; generating an uploading identifier corresponding to the uploading request according to the screenshot correlation information; and if the uploading identification does not exist in the cache database, determining a target screenshot based on the screenshot correlation information and storing the target screenshot. According to the technical scheme of the embodiment of the invention, the server automatically intercepts the required part of the specific page under the condition that the user does not sense the part, and automatically stores the screenshot, so that the use experience of the user is improved.

Description

Data storage method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a data storage method and device, electronic equipment and a storage medium.
Background
With the continuous development of the enterprise digital service level, the electronic document is gradually replacing paper materials, so that more and more users submit the certification materials such as screenshots and the like based on the internet.
In the prior art, when a server notifies a user to submit a screenshot in a certain page, there are generally two processing modes that the user can select. The first mode is that a user opens a designated page according to the requirements of a server, manually intercepts images of a specific part by using a screenshot tool, stores the images locally and returns to the original page to execute operations such as uploading and submitting, and the like; the second mode is to make the server automatically access the designated page and use the corresponding API interface to perform screenshot, however, this mode can only realize full-page screenshot, and cannot intercept the image of a specific part in the page according to actual needs.
Therefore, in the scheme provided by the related art, the process of uploading the screenshot by the user is complicated, and the service end cannot automatically help the user to complete the screenshot, uploading and other operations according to specific requirements.
Disclosure of Invention
The invention provides a data storage method, a data storage device, electronic equipment and a storage medium, so that a server automatically intercepts required parts in a specific page under the condition that a user does not sense the parts, and automatically stores screenshots, and the use experience of the user is improved.
In a first aspect, an embodiment of the present invention provides a data storage method, where the method includes:
when an uploading request for uploading a screenshot is received, screenshot association information corresponding to a current page is determined; the screenshot related information comprises at least one to-be-screenshot page corresponding to the hyperlink of the current page and/or target content edited in the screenshot information editing control;
generating an uploading identifier corresponding to the uploading request according to the screenshot correlation information;
and if the uploading identification does not exist in the cache database, determining a target screenshot based on the screenshot correlation information and storing the target screenshot.
In a second aspect, an embodiment of the present invention further provides a data storage apparatus, including:
the screenshot associated information determining module is used for determining screenshot associated information corresponding to the current page when an uploading request for uploading the screenshot is received; the screenshot related information comprises at least one to-be-screenshot page corresponding to the hyperlink of the current page and/or target content edited in the screenshot information editing control;
the uploading identifier generating module is used for generating an uploading identifier corresponding to the uploading request according to the screenshot related information;
and the target screenshot storage module is used for determining a target screenshot based on the screenshot correlation information and storing the target screenshot if the uploading identifier does not exist in the cache database.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device 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 data storage method according to any one of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention further provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform the data storage method according to any one of the embodiments of the present invention.
The technical scheme of the embodiment of the invention determines the screenshot associated information corresponding to the current page when receiving the uploading request of the uploading screenshot, wherein the screenshot associated information comprises at least one page to be screenshot corresponding to the hyperlink of the current page and/or the target content edited in the screenshot information editing control, so as to realize the positioning of the content required by the server, generates the uploading identifier corresponding to the uploading request according to the screenshot associated information, determines the target screenshot based on the screenshot associated information and stores the target screenshot if the uploading identifier does not exist in the cache database, so that the server automatically intercepts the required part of the specific page under the condition that the user does not sense, avoids the complicated process of manually screenshot by the user and the problem that the screenshot of the whole page does not meet the requirement of the server, and can automatically store the screenshot after finishing the screenshot, the use experience of the user 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 data storage method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a data storage method according to a second embodiment of the present invention;
fig. 3 is a schematic flowchart of a data storage method according to a third embodiment of the present invention;
FIG. 4 is a block diagram of a data storage device according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some 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 flow chart of a data storage method according to an embodiment of the present invention, where this embodiment is applicable to a case where a server performs screenshot on a specific page as needed, and it needs to be particularly described that a corresponding server executes a scheme of this embodiment when a user wants to upload a screenshot to the server.
As shown in fig. 1, the method specifically includes the following steps:
and S110, when an uploading request for uploading the screenshot is received, determining screenshot related information corresponding to the current page.
The request for uploading the screenshots can be a request sent to the server by a user through clicking an uploading screenshot control in a current page, and the request indicates that the current page needs to obtain one or more screenshots according to the requirements of specific services, and the request for uploading the screenshots is at least used for triggering the automatic screenshot operation of the server. Meanwhile, the control for uploading the screenshot can be connected with screenshot associated information in the development process of the control, wherein the screenshot associated information can reflect the relevant information of the screenshot required by the server, such as the address information of the webpage required to be screenshot. Based on the method, when an uploading request for uploading the screenshot is received, the corresponding screenshot related information can be determined.
Specifically, the screenshot related information includes at least one to-be-screenshot page corresponding to the current page hyperlink and/or target content edited in the screenshot information editing control. In this embodiment, on one hand, the hyperlink is a part of the current page, and is an element that allows the current web page to be connected to another target, and the other target may be a web page, or a different location of the same web page, or a picture, a file, or even an application program. Therefore, it can be understood that when the hyperlink in the current page is determined, the webpage (i.e. the webpage to be screenshot) needing to be subjected to screenshot is also determined. On the other hand, the screenshot information editing control is used for editing specific parameters of the screenshot required by the server, for example, parameters such as the size and the color of the screenshot required by the server are edited, and further, the content edited in the control is the target content. It can be understood that when an upload request for uploading a screenshot is received, the server reads the content in the screenshot information editing control, and when it is determined that the content in the screenshot information editing control is not empty, the target content edited in the control is used as screenshot associated information.
The screenshot related information corresponding to the current page is determined, so that the screenshot content required by the server is positioned, and the positioned page content is conveniently subjected to targeted processing in the subsequent process.
And S120, generating an uploading identifier corresponding to the uploading request according to the screenshot related information.
The uploading identification is adaptively generated based on screenshot related information and is at least used for being associated with a specific reusable element in the server, and meanwhile, the reusable element serving as an object can be actually stored in the server at present or can exist only in a conceptual form in an abstract mode. For example, in this embodiment, the generated upload identifier may be a key value corresponding to a certain screenshot currently stored in the server, or may be a key value of a screenshot that is not generated yet by the current server, and after the screenshot is generated, operations such as searching and retrieving the screenshot may be implemented through the key value.
In this embodiment, when an upload request for uploading a screenshot is received and screenshot related information corresponding to a current page is determined, the screenshot related information may be serialized according to a certain preset rule, and it should be understood by those skilled in the art that the serialization process is a process of converting the screenshot related information into a form that can be stored or transmitted by a server. Further, through serialization processing, a key value of the screenshot needed by the server side for the current page can be obtained.
It should be noted that, after the upload identifier corresponding to the upload request is generated, the server may perform retrieval in the cache database, and by comparing the generated upload identifier with the existing screenshot identifier, it may be determined whether subsequent screenshot operations need to be performed.
And S130, if the uploading identifier does not exist in the cache database, determining the target screenshot based on the screenshot correlation information and storing the target screenshot.
The cache database is at least used for storing the identifiers corresponding to all the screenshots, for example, the key values corresponding to a plurality of screenshots, after the server retrieves the screenshots from the cache database, if the uploading identifiers do not exist, it is proved that the screenshots currently required by the server do not exist in the server, and therefore, subsequent screenshot operation needs to be executed.
In this embodiment, the target screenshot is a screenshot required by the current page, and meanwhile, the target content in the page to be screenshot and/or the target screenshot can be determined through the screenshot related information, so that the screenshot operation can be executed based on the screenshot related information when it is determined that the target screenshot does not exist in the current cache database.
Specifically, the server side can extract a page address in the screenshot related information, access the webpage to be screenshot in a simulated environment based on the address, execute screenshot operation according to screenshot size, screenshot color and other information in the screenshot related information after the webpage to be screenshot is loaded, obtain the screenshot required by the current page, further store the obtained picture at a specific position of the server in a binary system mode, and associate the picture with the generated uploading identifier, so that the screenshot is multiplexed in the server.
Based on the above process, it can be understood that if it is determined that the corresponding screenshot already exists in the server in the cache database based on the upload identifier, subsequent screenshot operation does not need to be executed, and the current page directly calls the screenshot based on the identifier.
In the technical scheme of the embodiment, when an uploading request for uploading a screenshot is received, screenshot associated information corresponding to a current page is determined, wherein the screenshot associated information comprises at least one to-be-screenshot page corresponding to a hyperlink of the current page and/or target content edited in a screenshot information editing control, so that the required content of a server is positioned, an uploading identifier corresponding to the uploading request is generated according to the screenshot associated information, if the uploading identifier does not exist in a cache database, the target screenshot is determined based on the screenshot associated information and the target screenshot is stored, so that the server automatically intercepts the required part of the specific page in a state that a user is not aware, the problems of a complicated process of manually screenshot of the user and the condition that the full-page screenshot does not meet the requirements of the server are avoided, and the screenshot can be automatically stored after the screenshot is completed, the use experience of the user is improved.
Example two
Fig. 2 is a schematic flow chart of a data storage method according to a second embodiment of the present invention, which is implemented by pre-establishing a correspondence between each screenshot page identifier and a screenshot page identifier, and detecting target content in a screenshot information mark control when an upload request is received, so as to determine screenshot related information and further refine an intercepted image; executing screenshot operation by using a headless browser and a custom script, so that a server can simulate user operation in the screenshot process; the uploading identification and the target screenshot are stored in the cache database, so that the target screenshot can be effectively called on the current page, and the stored target screenshot can be directly determined by comparing the uploading identification when the server needs the screenshot with the same content as the current screenshot in the future without repeatedly executing screenshot operation; the storage link is fed back to the user, so that the user can conveniently confirm and store the image intercepted by the server, and the intelligence of the automatic screenshot function is further enhanced. The specific implementation manner can be referred to the technical scheme of the embodiment. 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 specifically includes the following steps:
s210, determining screenshot page identification of each uploaded screenshot page, at least one to-be-screenshot page associated with each uploaded screenshot page and screenshot page identification of the at least one to-be-screenshot page; and establishing a mapping relation between each screenshot page identifier and at least one corresponding screenshot page identifier so as to determine screenshot association information according to the mapping relation and the page identifier of the current page.
Specifically, the uploaded screenshot page refers to a page on which one or more screenshots need to be uploaded due to specific service requirements, and correspondingly, the identifier of the page is the screenshot page identifier, for example, a character string a1 is set for the current page as the screenshot page identifier. Meanwhile, for the page to be screenshot, a character string can be set as a screenshot page identifier, such as a1, in the same way, and the identifier can at least represent a specific part in the page to be screenshot, such as a text box part or a picture part in the page to be screenshot.
After the screenshot page identifier and the screenshot page identifier are determined, a mapping table representing a one-to-one correspondence relationship between the screenshot page identifier and the screenshot page identifier may be established, for example, the mapping table may be stored in the database after the correspondence relationship between a1 and a1 in the above example is established. It should be noted that, when the uploadable screenshot page needs multiple screenshots, the screenshot page identifier may correspond to multiple screenshot page identifiers, and similarly, when different uploadable screenshot pages all need to screenshot a specific part in the screenshot page, a single screenshot page identifier may also correspond to multiple screenshot page identifiers.
Based on this, after the screenshot page identification is determined, the screenshot page identification can be determined in a table look-up mode, and the process can also be understood as determining the screenshot required by the current page after the current page is determined.
S220, when an uploading request for uploading the screenshot is received, if the fact that the screenshot information mark control exists is detected, the word information is obtained and is used as the target content in the screenshot related information.
In this embodiment, when an upload request for uploading a screenshot is received, the content in the screenshot information marking control used for editing or setting the relevant parameter information of the screenshot required by the current page may also be detected, so that when it is detected that the control is not empty, the text information in the screenshot may be extracted and used as the target content in the screenshot related information.
Specifically, the target content includes at least one of a page address corresponding to the target screenshot, a screenshot size, a loading waiting duration corresponding to the page address, model information of the terminal device, watermark information to be added, and color information of the target screenshot.
It can be understood that the web address of the web page containing the screenshot content required by the server is determined by acquiring the page address corresponding to the target screenshot; by obtaining the screenshot size corresponding to the target screenshot, the width and height of the intercepted image are determined when the server executes screenshot operation subsequently; by acquiring the loading waiting time corresponding to the page address, the server executes screenshot operation after accessing the page to be screenshot and the waiting time, so that the situation that screenshot is incomplete due to the fact that the screenshot is not performed completely when the page is not loaded is avoided; by acquiring the model information of the terminal device, the server can make the intercepted image correspond to the display interface of the current device of the user (i.e. simulate the device style) after performing the screenshot operation subsequently, for example, when the acquired information indicates that the terminal used by the user is a certain Android device, the intercepted image can be adapted to the corresponding display interface of the Android device, and when the acquired information indicates that the terminal used by the user is an iOS tablet device, the intercepted image can be adapted to the corresponding display interface of the iOS tablet device; by acquiring the watermark information to be added, the watermark content to be added on the intercepted image can be determined; by obtaining color information of the target screenshot, the color of the captured image may be determined.
It should be noted that the information may be edited or set in advance before the request for uploading the screenshot is received, or the control may be selected to be empty, and when the content of the control is empty, part of the target content in the screenshot related information may be automatically generated while the request for uploading is received. For example, when the model information of the terminal device in the target content is null and an upload request for uploading a screenshot is received, the server may automatically invoke software and hardware information of a device currently used by the user by using an Application Programming Interface (API), and determine the model information of the device.
And S230, processing the target content and/or the page to be screenshot in the screenshot related information by adopting a sequence number generation algorithm to obtain an uploading identifier corresponding to the uploading request.
The serial number generation algorithm may be a hash algorithm or a BASE64 algorithm, and is configured to generate a serial number corresponding to target content in the screenshot related information and/or the page to be screenshot, and after the corresponding serial number is obtained, the serial number may be used as an upload identifier, that is, the obtained upload identifier is matched with the screenshot related information, and meanwhile, the upload identifier may be used as a digital feature of the screenshot required by the current page.
Illustratively, after target content and/or a page to be screenshot in screenshot related information are processed based on a hash algorithm, a corresponding hash character string can be obtained, the hash character string is also used as an uploading identifier, it can be understood that the hash character string is very sensitive to input content, and when the target content and/or the page to be screenshot in the screenshot related information slightly changes, the corresponding generated hash character string changes.
S240, if the uploading identification does not exist in the cache database, accessing a target page to be screenshot corresponding to the page address in the screenshot related information through a headless browser; and intercepting the target page to be subjected to screenshot according to the screenshot size and/or the model information of the terminal equipment to obtain the target screenshot.
In this embodiment, when it is determined that the upload identifier does not exist in the cache database, it is verified that the server does not have the screenshot currently required by the server, and therefore the screenshot operation needs to be executed, at this time, a headless browser may be woken up by node. Js refers to JavaScript running on a server, and is a platform established based on Chrome JavaScript running, a headless browser can be understood as a web browser without a Graphical User Interface (GUI), and the headless browser is generally controlled through a programming or command line Interface and can be used for web crawlers and automatic tests.
In this embodiment, after waking up the headless browser, the target page to be screenshot may be accessed according to the page address in the screenshot-related information, and the width and height of the pages when the headless browser is accessed, the style of the simulation device, and the like may be determined according to the screenshot size in the screenshot-related information and/or the model information of the terminal device.
Further, after the target page to be captured is loaded completely according to the loading waiting duration, a user-defined script can be called, and it can be understood that the user-defined script is an executable file which is written in advance according to a certain format by a worker by using a specific descriptive language and is at least used for simulating the sliding operation of the user (for example, the sliding operation of the page to be captured when a long screenshot or a dynamic screenshot is executed) and simulating the operation of adding a watermark to the page by the user. And after the script is executed, executing screenshot operation, wherein the obtained binary picture is the target screenshot. It should be noted that the captured picture may be a static picture or a dynamic picture.
And S250, correspondingly storing the target screenshot and the uploading identification corresponding to the target screenshot into a cache database.
In this embodiment, after the target screenshot in the binary form is obtained, the screenshot may be uploaded to a cache database, and specifically, the target screenshot may be uploaded to a cloud disk, so that the server completes an operation of automatically screenshot without perception of the user.
Meanwhile, an uploading identifier corresponding to the target screenshot needs to be stored in a cache, so that the target screenshot is called by the current page through the uploading identifier, when an uploading request of the uploading screenshot is received again, the regenerated uploading identifier is compared with the uploading identifier stored this time, when matching is successful, the fact that the screenshot uploaded again is still the screenshot stored this time is shown, the current page can be directly called in the cloud disk, and repeated screenshot operation is not executed any more.
By storing the corresponding uploading identification while storing the target screenshot, the target screenshot can be effectively called on the current page, and the stored target screenshot can be directly determined by comparing the uploading identification when the server needs the screenshot with the same content as the screenshot later, without repeatedly executing the screenshot operation.
And S260, determining a storage link corresponding to the target screenshot, and feeding back the storage link to the target client so that the user corresponding to the target client can call the target screenshot based on the storage link.
In this embodiment, after the target screenshot and the corresponding upload identifier are stored in the cache database, the corresponding storage link may be determined, and specifically, the storage link may be an accessible Uniform Resource Locator (URL). As will be appreciated by those skilled in the art, the storage location of the target screenshot in the cache database can be determined by a uniform resource locator.
After the storage link of the target screenshot is determined, the storage link can be fed back to the target client, and a user corresponding to the target client can at least view or download the target screenshot by using the link. Through feeding back the storage link for the user, the user can conveniently confirm and store the image intercepted by the server side, and the intelligence of the automatic screenshot function is further enhanced.
According to the technical scheme of the embodiment, the corresponding relation between each screenshot page identification and the screenshot page identification is established in advance, when an uploading request is received, the target content in the screenshot information marking control is detected, screenshot related information is determined, and the intercepted image is further refined; executing screenshot operation by using a headless browser and a custom script, so that a server can simulate user operation in the screenshot process; the uploading identification and the target screenshot are stored in the cache database, so that the target screenshot can be effectively called on the current page, and the stored target screenshot can be directly determined by comparing the uploading identification when the server needs the screenshot with the same content as the current screenshot in the future without repeatedly executing screenshot operation; the storage link is fed back to the user, so that the user can conveniently confirm and store the image intercepted by the server, and the intelligence of the automatic screenshot function is further enhanced.
EXAMPLE III
As an alternative embodiment of the foregoing embodiment, fig. 3 is a schematic flowchart of a data storage method according to a third embodiment of the present invention. For clearly describing the technical solution of the present embodiment, the application scenario may be a situation where a current page needs one or more screenshots due to service requirements, but the application scenario is not limited to the above scenario, and may also be applicable to various complex scenarios requiring data processing.
Referring to fig. 3, when an upload request of a user is received, configuration information of some necessary parameters may be generated, and it may be understood that the necessary parameters and configuration information are screenshot related information in the above embodiment, and include at least one to-be-screenshot page corresponding to a current page hyperlink and/or target content edited in a screenshot information editing control, where the target content includes at least one of a page address corresponding to a target screenshot, a screenshot size, a loading waiting duration corresponding to the page address, model information of a terminal device, watermark information to be added, and color information of the target screenshot. Further, a sequence number generation algorithm is adopted to process the target content and/or the page to be screenshot in the screenshot related information, so that a cache key, namely an uploading identifier corresponding to the uploading request, can be obtained.
Continuing to refer to fig. 3, after the uploading identifier is determined, the identifier of the stored screenshot can be retrieved in the cache database, so as to determine whether the database has the screenshot required by the current page currently, if the detection result indicates that the screenshot corresponding to the uploading identifier exists in the cache database, the screenshot operation does not need to be executed again, and the storage link of the existing screenshot in the cache database is directly called; and if the detection result shows that the screenshot corresponding to the uploading identifier does not exist in the cache database, the server side is required to execute automatic screenshot operation.
Continuing to refer to fig. 3, in order to enable the server to complete the automatic screenshot operation without the user's perception, node.js may be used to wake up a headless browser, and the width and height of the browser page access and the model of the simulation device are set according to screenshot related information. Furthermore, according to the page address of the page to be subjected to screenshot, the page to be subjected to screenshot can be skipped to in a headless browser, a pre-programmed custom script is called to modify the page after the page is loaded on the basis of the loading waiting time, for example, sliding operation of a user is simulated, a watermark is added to the page, and the screenshot operation can be executed after the custom script is executed, so that a binary-form picture is generated.
With reference to fig. 3, after the server automatically captures the image, the captured image may be uploaded to a cloud disk for storage, and a storage link of the image is returned, so that the user views or downloads the target screenshot by using the link. Meanwhile, the uploading identification is stored in the cache database, so that when the server receives the uploading identification of the uploading screenshot again, the two uploading identifications are matched, and repeated screenshot execution is avoided.
The beneficial effects of the above technical scheme are: the server automatically intercepts the required part of the specific page in the state that the user does not sense, the complicated process of manually intercepting the screen shot by the user and the problem that the full-page screen shot does not meet the requirements of the server are avoided, and meanwhile, the screen shot can be automatically stored after being completed, so that the use experience of the user is improved.
Example four
Fig. 4 is a block diagram of a data storage device according to a fourth embodiment of the present invention, which is capable of executing a data storage method according to any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 4, the apparatus specifically includes: a screenshot association information determination module 310, an upload identifier generation module 320, and a target screenshot storage module 330.
A screenshot correlation information determining module 310, configured to determine screenshot correlation information corresponding to a current page when an upload request for uploading a screenshot is received; and the screenshot related information comprises at least one to-be-screenshot page corresponding to the hyperlink of the current page and/or target content edited in the screenshot information editing control.
And an upload identifier generating module 320, configured to generate an upload identifier corresponding to the upload request according to the screenshot related information.
And the target screenshot storage module 330 is configured to determine a target screenshot based on the screenshot association information and store the target screenshot if the uploading identifier does not exist in the cache database.
On the basis of the technical solutions, the data storage device further includes a mapping relationship establishing module.
The mapping relation establishing module is used for determining screenshot page identification of each uploaded screenshot page, at least one to-be-screenshot page associated with each uploaded screenshot page and screenshot page identification of the at least one to-be-screenshot page; and establishing a mapping relation between each screenshot page identifier and at least one corresponding screenshot page identifier so as to determine screenshot associated information according to the mapping relation and the page identifier of the current page.
Optionally, the screenshot related information determining module 310 is further configured to, when an upload request for uploading a screenshot is received, if it is detected that text information exists in the screenshot information marking control, obtain the text information and use the text information as target content in the screenshot related information; the target content comprises at least one of a page address corresponding to the target screenshot, a screenshot size, loading waiting time corresponding to the page address, model information of the terminal equipment, watermark information to be added and color information of the target screenshot.
Optionally, the upload identifier generating module 320 is further configured to process the target content and/or the page to be screenshot in the screenshot related information by using a sequence number generating algorithm, so as to obtain an upload identifier corresponding to the upload request; and the uploading identification is matched with the screenshot related information.
On the basis of the above technical solutions, the target screenshot storage module 330 includes a target screenshot generating unit and a target screenshot storing unit.
The target screenshot generating unit is used for accessing a target page to be screenshot corresponding to the page address in the screenshot related information through a headless browser; and intercepting the target page to be subjected to screenshot according to the screenshot size and/or the model information of the terminal equipment to obtain a target screenshot.
And the target screenshot storage unit is used for correspondingly storing the target screenshot and the uploading identification corresponding to the target screenshot into a cache database.
On the basis of the above technical solutions, the data storage device further includes a storage link determining module.
And the storage link determining module is used for determining a storage link corresponding to the target screenshot and feeding back the storage link to a target client so that a user corresponding to the target client can call the target screenshot based on the storage link.
According to the technical scheme provided by the embodiment, when an uploading request for uploading a screenshot is received, screenshot associated information corresponding to a current page is determined, wherein the screenshot associated information comprises at least one to-be-screenshot page corresponding to a hyperlink of the current page and/or target content edited in a screenshot information editing control, so that the positioning of service end required content is realized, an uploading identifier corresponding to the uploading request is generated according to the screenshot associated information, if the uploading identifier does not exist in a cache database, the target screenshot is determined based on the screenshot associated information and stored, so that the service end automatically intercepts required parts of a specific page in a state that a user is not aware, the complicated manual screenshot process of the user and the problem that the full-page screenshot does not meet the requirements of the service end are avoided, and the screenshot can be automatically stored after the screenshot is finished, the use experience of the user is improved.
The data storage device provided by the embodiment of the invention can execute the data storage method 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 five
Fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary electronic device 40 suitable for use in implementing embodiments of the present invention. The electronic device 40 shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 5, electronic device 40 is embodied in the form of a general purpose computing device. The components of electronic device 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 the 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, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, 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.
Electronic device 40 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 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 electronic device 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. 5, commonly referred to as a "hard drive"). Although not shown in FIG. 5, 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 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 examples or some combination thereof 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 electronic device 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 electronic device 40, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 40 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interface 411. Also, the electronic device 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 the network adapter 412. As shown, the network adapter 412 communicates with the other modules of the electronic device 40 over the bus 403. It should be appreciated that although not shown in FIG. 5, other hardware and/or software modules may be used in conjunction with electronic device 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 a data storage method provided by an embodiment of the present invention.
EXAMPLE six
An embodiment of the present invention also provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform a data storage method.
The method comprises the following steps:
when an uploading request for uploading a screenshot is received, screenshot association information corresponding to a current page is determined; the screenshot related information comprises at least one to-be-screenshot page corresponding to the hyperlink of the current page and/or target content edited in the screenshot information editing control;
generating an uploading identifier corresponding to the uploading request according to the screenshot correlation information;
and if the uploading identification does not exist in the cache database, determining a target screenshot based on the screenshot correlation information and storing the target screenshot.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable item 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.
The item code embodied on the 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 project 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 project code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method of storing data, comprising:
when an uploading request for uploading a screenshot is received, screenshot association information corresponding to a current page is determined; the screenshot related information comprises at least one to-be-screenshot page corresponding to the hyperlink of the current page and/or target content edited in the screenshot information editing control;
generating an uploading identifier corresponding to the uploading request according to the screenshot correlation information;
and if the uploading identification does not exist in the cache database, determining a target screenshot based on the screenshot correlation information and storing the target screenshot.
2. The method of claim 1, prior to determining screenshot association information corresponding to a current page, further comprising:
determining screenshot page identification of each uploadable screenshot page, at least one to-be-screenshot page associated with each uploadable screenshot page and screenshot page identification of the at least one to-be-screenshot page;
and establishing a mapping relation between each screenshot page identifier and at least one corresponding screenshot page identifier so as to determine screenshot associated information according to the mapping relation and the page identifier of the current page.
3. The method of claim 1, wherein the determining screenshot related information corresponding to the current page comprises:
if the fact that the screenshot information mark control has the text information is detected, the text information is obtained and is used as the target content in the screenshot related information; the target content comprises at least one of a page address corresponding to the target screenshot, a screenshot size, loading waiting time corresponding to the page address, model information of the terminal equipment, watermark information to be added and color information of the target screenshot.
4. The method according to claim 1, wherein the generating an upload identifier corresponding to the upload request according to the screenshot related information includes:
processing the target content and/or the page to be screenshot in the screenshot related information by adopting a sequence number generation algorithm to obtain an uploading identifier corresponding to the uploading request; and the uploading identification is matched with the screenshot related information.
5. The method of claim 1, wherein the screenshot associating information includes target content, and wherein determining a target screenshot based on the screenshot associating information includes:
accessing a target page to be captured corresponding to the page address in the screenshot related information through a headless browser;
and intercepting the target page to be subjected to screenshot according to the screenshot size and/or the model information of the terminal equipment to obtain a target screenshot.
6. The method of claim 1, wherein storing the target screenshot comprises:
and correspondingly storing the target screenshot and the uploading identification corresponding to the target screenshot into a cache database.
7. The method of claim 1, after determining a target screenshot based on the screenshot correlation information and storing the target screenshot, further comprising:
and determining a storage link corresponding to the target screenshot, and feeding back the storage link to a target client so that a user corresponding to the target client can call the target screenshot based on the storage link.
8. A data storage device, comprising:
the screenshot associated information determining module is used for determining screenshot associated information corresponding to the current page when an uploading request for uploading the screenshot is received; the screenshot related information comprises at least one to-be-screenshot page corresponding to the hyperlink of the current page and/or target content edited in the screenshot information editing control;
the uploading identifier generating module is used for generating an uploading identifier corresponding to the uploading request according to the screenshot related information;
and the target screenshot storage module is used for determining a target screenshot based on the screenshot correlation information and storing the target screenshot if the uploading identifier does not exist in the cache database.
9. An electronic device, characterized in that the electronic device 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 data storage method as claimed in any one of claims 1-7.
10. A storage medium containing computer-executable instructions for performing the data storage method of any one of claims 1-7 when executed by a computer processor.
CN202110864457.7A 2021-07-29 2021-07-29 Data storage method, device, electronic equipment and storage medium Active CN113590564B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110864457.7A CN113590564B (en) 2021-07-29 2021-07-29 Data storage method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110864457.7A CN113590564B (en) 2021-07-29 2021-07-29 Data storage method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113590564A true CN113590564A (en) 2021-11-02
CN113590564B CN113590564B (en) 2024-03-01

Family

ID=78251948

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110864457.7A Active CN113590564B (en) 2021-07-29 2021-07-29 Data storage method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113590564B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114676432A (en) * 2022-05-26 2022-06-28 河北兰科网络工程集团有限公司 APP privacy compliance checking method, terminal and system

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101441665A (en) * 2008-12-08 2009-05-27 腾讯科技(深圳)有限公司 Method, device and system for processing log captured screen
CN102521284A (en) * 2011-11-28 2012-06-27 优视科技有限公司 Page screenshot processing method and device based on mobile terminal browser
CN103473035A (en) * 2012-06-07 2013-12-25 腾讯科技(深圳)有限公司 Screen capturing method and device
US20160299988A1 (en) * 2015-04-10 2016-10-13 Oracle International Corporation Methods, systems, and computer readable media for capturing and storing a web page screenshot
WO2017166953A1 (en) * 2016-03-30 2017-10-05 努比亚技术有限公司 Method, device, mobile terminal and storage medium for realizing screenshot capturing and image display
CN108604234A (en) * 2015-07-15 2018-09-28 查比公司 System and method for screenshot capture link
CN108959605A (en) * 2018-07-13 2018-12-07 彩讯科技股份有限公司 For the screenshot method of webpage, device, computer equipment and storage medium
CN109491744A (en) * 2018-11-06 2019-03-19 成都知道创宇信息技术有限公司 A kind of webpage capture system and method
CN110180181A (en) * 2019-04-22 2019-08-30 努比亚技术有限公司 Screenshot method, device and the computer readable storage medium of Wonderful time video
CN110704784A (en) * 2019-10-10 2020-01-17 深圳前海微众银行股份有限公司 Web page screen capturing method, device, equipment and computer readable storage medium
CN110737861A (en) * 2019-10-24 2020-01-31 北京锐安科技有限公司 webpage data processing method, device, equipment and storage medium
CN111309221A (en) * 2018-12-12 2020-06-19 阿里巴巴集团控股有限公司 Page processing method, device and equipment
CN111814014A (en) * 2019-04-10 2020-10-23 阿里巴巴集团控股有限公司 Information interaction method, device and storage medium
CN112199621A (en) * 2020-12-07 2021-01-08 深圳市房多多网络科技有限公司 Method and device for quickly generating poster and computer equipment
CN112579948A (en) * 2019-09-29 2021-03-30 北京国双科技有限公司 Webpage screenshot method and device, storage medium and electronic equipment
CN112686763A (en) * 2020-12-31 2021-04-20 平安普惠企业管理有限公司 Policy verification method, client, server and storage medium
CN112948267A (en) * 2021-03-31 2021-06-11 北京房江湖科技有限公司 Webpage testing method, webpage testing system, storage medium and electronic equipment

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101441665A (en) * 2008-12-08 2009-05-27 腾讯科技(深圳)有限公司 Method, device and system for processing log captured screen
CN102521284A (en) * 2011-11-28 2012-06-27 优视科技有限公司 Page screenshot processing method and device based on mobile terminal browser
CN103473035A (en) * 2012-06-07 2013-12-25 腾讯科技(深圳)有限公司 Screen capturing method and device
US20160299988A1 (en) * 2015-04-10 2016-10-13 Oracle International Corporation Methods, systems, and computer readable media for capturing and storing a web page screenshot
CN108604234A (en) * 2015-07-15 2018-09-28 查比公司 System and method for screenshot capture link
WO2017166953A1 (en) * 2016-03-30 2017-10-05 努比亚技术有限公司 Method, device, mobile terminal and storage medium for realizing screenshot capturing and image display
CN108959605A (en) * 2018-07-13 2018-12-07 彩讯科技股份有限公司 For the screenshot method of webpage, device, computer equipment and storage medium
CN109491744A (en) * 2018-11-06 2019-03-19 成都知道创宇信息技术有限公司 A kind of webpage capture system and method
CN111309221A (en) * 2018-12-12 2020-06-19 阿里巴巴集团控股有限公司 Page processing method, device and equipment
CN111814014A (en) * 2019-04-10 2020-10-23 阿里巴巴集团控股有限公司 Information interaction method, device and storage medium
CN110180181A (en) * 2019-04-22 2019-08-30 努比亚技术有限公司 Screenshot method, device and the computer readable storage medium of Wonderful time video
CN112579948A (en) * 2019-09-29 2021-03-30 北京国双科技有限公司 Webpage screenshot method and device, storage medium and electronic equipment
CN110704784A (en) * 2019-10-10 2020-01-17 深圳前海微众银行股份有限公司 Web page screen capturing method, device, equipment and computer readable storage medium
CN110737861A (en) * 2019-10-24 2020-01-31 北京锐安科技有限公司 webpage data processing method, device, equipment and storage medium
CN112199621A (en) * 2020-12-07 2021-01-08 深圳市房多多网络科技有限公司 Method and device for quickly generating poster and computer equipment
CN112686763A (en) * 2020-12-31 2021-04-20 平安普惠企业管理有限公司 Policy verification method, client, server and storage medium
CN112948267A (en) * 2021-03-31 2021-06-11 北京房江湖科技有限公司 Webpage testing method, webpage testing system, storage medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114676432A (en) * 2022-05-26 2022-06-28 河北兰科网络工程集团有限公司 APP privacy compliance checking method, terminal and system
CN114676432B (en) * 2022-05-26 2022-09-09 河北兰科网络工程集团有限公司 APP privacy compliance checking method, terminal and system

Also Published As

Publication number Publication date
CN113590564B (en) 2024-03-01

Similar Documents

Publication Publication Date Title
CN109801347B (en) Method, device, equipment and medium for generating editable image template
CN111061526B (en) Automatic test method, device, computer equipment and storage medium
US9880989B1 (en) Document annotation service
CN108572823B (en) Front-end and back-end development management method and system based on interface engine
CN111666129B (en) Container mirror image processing method, electronic device, storage medium and system
CN108923997B (en) Cloud service node automatic testing method and device based on python
CN113382083B (en) Webpage screenshot method and device
CN112256990B (en) Image processing method and device and computer readable storage medium
CN113377653B (en) Method and device for generating test cases
CN111506300A (en) Applet generation method, device, equipment and storage medium
CN113704590A (en) Webpage data acquisition method and device, electronic equipment and storage medium
CN110365776B (en) Picture batch downloading method and device, electronic equipment and storage medium
CN114329366B (en) Network disk file control method and device, network disk and storage medium
US20220407907A1 (en) Web application component migration to a cloud computing system
CN113590564B (en) Data storage method, device, electronic equipment and storage medium
CN107862035B (en) Network reading method and device for conference record, intelligent tablet and storage medium
JP6505849B2 (en) Generation of element identifier
US20200272785A1 (en) Transformation of resource files using mapped keys for tracking content location
CN113268232B (en) Page skin generation method and device and computer readable storage medium
US10140278B2 (en) Computer-implemented methods and systems for associating files with cells of a collaborative spreadsheet
CN105739717B (en) Data inputting method and device
CN111428452A (en) Comment data storage method and device
CN113434217B (en) Vulnerability scanning method, vulnerability scanning device, computer equipment and medium
JP5526991B2 (en) Information processing apparatus, information processing method, program, information processing system
CN110196803B (en) Software defect training method and system

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