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

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

Info

Publication number
CN113590564B
CN113590564B CN202110864457.7A CN202110864457A CN113590564B CN 113590564 B CN113590564 B CN 113590564B CN 202110864457 A CN202110864457 A CN 202110864457A CN 113590564 B CN113590564 B CN 113590564B
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.)
Active
Application number
CN202110864457.7A
Other languages
Chinese (zh)
Other versions
CN113590564A (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

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 device, electronic equipment and a storage medium, wherein the method comprises the following steps: when an uploading request for uploading the screenshot is received, determining screenshot associated information corresponding to the current page; the screenshot associated information comprises at least one page to be screenshot corresponding to the hyperlink of the current page and/or target content edited in a screenshot information editing control; generating an uploading identifier corresponding to the uploading request according to the screenshot associated information; and if the uploading identification does not exist in the cache database, determining a target screenshot based on the screenshot association information and storing the target screenshot. According to the technical scheme provided by the embodiment of the invention, the server automatically intercepts the required part of the specific page in the state of no perception of the user, and automatically stores the screenshot, so that the use experience of the user is improved.

Description

Data storage method, 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, a data storage device, electronic equipment and a storage medium.
Background
With the continuous development of the digital service level of enterprises, electronic files are gradually replacing paper materials, so that the situation of submitting screenshot and other proving materials based on the internet is more and more increased.
In the prior art, when a server side notifies a user to submit a screenshot in a certain page, two processing modes selectable by the user are usually adopted. The first mode is that a user opens a specified page according to the requirement of a server, manually intercepts an image of a specific part by using a screenshot tool, stores the image locally and returns to the original page to execute operations such as uploading, submitting and the like, and the problem of the mode is that the mode of manually screenshot and submitting again by the user is excessively complicated, so that the screenshot uploading wish and the use experience of the user are reduced; the second way is to make the server automatically access the appointed page and use the corresponding API interface to screen capture, however, this way can only realize the full page screen capture, and can not capture the image of the specific part of the page according to the actual need.
Therefore, in the scheme provided by the related technology, the process of uploading the screenshot by the user is complicated, and the server cannot automatically help the user to finish 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 a required part of a specific page in a state of no perception of a user, automatically stores a screenshot and improves the use experience of the user.
In a first aspect, an embodiment of the present invention provides a data storage method, including:
when an uploading request for uploading the screenshot is received, determining screenshot associated information corresponding to the current page; the screenshot associated information comprises at least one page to be screenshot corresponding to the hyperlink of the current page and/or target content edited in a screenshot information editing control;
generating an uploading identifier corresponding to the uploading request according to the screenshot associated information;
and if the uploading identification does not exist in the cache database, determining a target screenshot based on the screenshot association information and storing the target screenshot.
In a second aspect, an embodiment of the present invention further provides a data storage device, including:
the screenshot associated information determining module is used for determining screenshot associated information corresponding to a current page when an uploading request for uploading the screenshot is received; the screenshot associated information comprises at least one page to be screenshot corresponding to the hyperlink of the current page and/or target content edited in a 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 associated information;
and the target screenshot storage module is used for determining a target screenshot based on the screenshot association information and storing the target screenshot if the uploading identification does not exist in the cache database.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a data storage method as described in any of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions which, when executed by a computer processor, are used to perform a data storage method according to any of the embodiments of the present invention.
According to the technical scheme, when an uploading request for uploading the screenshot is received, screenshot related information corresponding to the current page is determined, the screenshot related information comprises at least one page to be screenshot corresponding to the hyperlink of the current page and/or target content edited in the screenshot information editing control, so that positioning of the content required by the server is achieved, uploading identification corresponding to the uploading request is generated according to the screenshot related information, if the uploading identification does not exist in the cache database, the target screenshot is determined and stored based on the screenshot related information, so that the server can automatically intercept the part required by the specific page in a state that a user does not feel, the problems that the manual screenshot process of the user is complicated and the whole screenshot does not meet the requirements of the server are avoided, meanwhile, the screen can be automatically stored after the screenshot is completed, and the use experience of the user is improved.
Drawings
In order to more clearly illustrate the technical solution of the exemplary embodiments of the present invention, a brief description is given below of the drawings required for describing the embodiments. It is obvious that the drawings presented are only drawings of some of the embodiments of the invention to be described, and not all the drawings, and that other drawings can be made according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a data storage method according to an embodiment of the invention;
FIG. 2 is a flow chart of a data storage method according to a second embodiment of the present invention;
fig. 3 is a flow chart of a data storage method according to a third embodiment of the present invention;
FIG. 4 is a block diagram illustrating 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 invention is described in further detail below 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 thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a schematic flow chart of a data storage method provided by an embodiment of the present invention, where the embodiment is applicable to a case that a server performs a screenshot on a specific page according to needs, and particularly needs to be explained, if a user wants to upload the screenshot to which server, the corresponding server executes the scheme of the embodiment, and the method may be executed by a data storage device, where the device may be implemented in software and/or hardware, and the hardware may be an electronic device, such as a mobile terminal, a PC or a server.
As shown in fig. 1, the method specifically includes the following steps:
s110, when an uploading request for uploading the screenshot is received, screenshot related information corresponding to the current page is determined.
The request for uploading the screenshot can be a request sent to the server by clicking an uploading screenshot control in the current page by a user, which indicates that the current page needs to acquire one or more shots due to the requirement of a specific service, and the request for uploading the screenshot is at least used for triggering the automatic screenshot operation of the server. Meanwhile, for the control for uploading the screenshot, connection can be established between the control and screenshot related information in the development process of the control, wherein the screenshot related information can reflect the related information of the screenshot required by the server, such as address information of a webpage required to be screenshot. Based on the above, when an uploading request for uploading the screenshot is received, corresponding screenshot related information can be determined.
Specifically, the screenshot related information comprises at least one page to be screenshot corresponding to the current page hyperlink and/or target content edited in the screenshot information editing control. In this embodiment, on the one hand, the hyperlink belongs to a part of the current page, and is an element that allows the current web page to be connected with another target, where the other target may be a web page, a different location of the same web page, a picture, a file, or even an application program. It will be appreciated that when the hyperlinks in the current page are determined, the web page on which the screenshot is to be performed (i.e., the web page to be 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, the color and the like of the screenshot required by the server are edited, and further, the edited content in the control is the target content. It can be understood that when an uploading request for uploading the screenshot is received, the server reads the content in the screenshot information editing control, and when the content in the screenshot information editing control is determined not to be empty, the target content edited in the control is used as screenshot related information.
The screenshot associated 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 processed in a targeted manner in a subsequent process.
S120, generating an uploading identifier corresponding to the uploading request according to the screenshot associated information.
The uploading identification is adaptively generated based on screenshot association information and is at least used for being associated with a specific reusable element in the server, and meanwhile, the reusable element is taken as an object, can be actually stored in the server at present, and can only exist in an abstract mode in a conceptual mode. For example, in this embodiment, the generated uploading 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 yet generated 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, serializing processing is performed on the screenshot related information according to a certain preset rule, and it should be understood by those skilled in the art that the serializing 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, the key value of the screenshot required by the server for the current page can be obtained.
After generating the uploading identifier corresponding to the uploading request, the server may search in the cache database, and determine whether the subsequent screenshot operation needs to be executed by comparing the generated uploading identifier with the existing screenshot identifier.
S130, if the uploading identification does not exist in the cache database, determining a target screenshot based on screenshot association information and storing the target screenshot.
The cache database is at least used for storing identifiers corresponding to the various screenshots, such as key values corresponding to the various screenshots, and after the server side searches in the cache database, if the uploading identifier is determined to be absent, it is proved that the server side does not have the screenshots currently required by the server side, and therefore subsequent screenshot operation needs to be executed.
In this embodiment, the target screenshot is the 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 when it is determined that the target screenshot does not exist in the current cache database, the screenshot operation can be performed based on the screenshot related information.
Specifically, the server side can extract the page address in the screenshot related information, access the webpage to be screenshot in the simulated environment based on the address, execute screenshot operation according to the 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 in a binary form at a specific position of the server, 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 uploading identifier, the subsequent screenshot operation is not required to be executed, and the current page directly calls the screenshot based on the identifier.
According to the technical scheme, when an uploading request for uploading the screenshot is received, screenshot related information corresponding to the current page is determined, the screenshot related information comprises at least one page to be screenshot corresponding to the hyperlink of the current page and/or target content edited in screenshot information editing controls, so that positioning of the content required by the server is achieved, uploading identification corresponding to the uploading request is generated according to the screenshot related information, if the uploading identification does not exist in a cache database, the target screenshot is determined and stored based on the screenshot related information, therefore, the server can automatically intercept the required part of the specific page in a state that a user does not feel, the problems that the manual screenshot process of the user is complicated and the whole page screenshot does not meet the requirements of the server are avoided, meanwhile, the screen can be automatically stored after the screenshot is completed, and the use experience of the user is improved.
Example two
Fig. 2 is a flow chart of a data storage method provided by a second embodiment of the present invention, on the basis of the foregoing embodiment, a correspondence between each screenshot page identifier and a screenshot page identifier is pre-established, and when an upload request is received, target content in a screenshot information mark control is detected, screenshot related information is determined, so that the intercepted image is further refined; the screenshot operation is executed by using the headless browser and the custom script, so that the server side can simulate the 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 fetched by the current page, and when the screenshot with the same content as the current intercepted content is needed later, the stored target screenshot is directly determined through comparison of the uploading identification, and the screenshot operation is not required to be repeatedly executed; the storage link is fed back for the user, so that the user can conveniently confirm and store the image intercepted by the server, and the intelligent degree of the automatic screenshot function is further enhanced. The specific implementation manner can be seen in the technical scheme of the embodiment. Wherein, the technical terms identical to or corresponding to the above embodiments are not repeated herein.
As shown in fig. 2, the method specifically includes the following steps:
s210, determining a screenshot page identifier of each uploading screenshot page, at least one to-be-screenshot page associated with each uploading screenshot page and a screenshot page identifier 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.
Specifically, the page capable of uploading the screenshot refers to a page which needs to upload one or more shots due to specific service requirements, and the corresponding identification of the page is the screenshot page identification, for example, a character string A1 is set for the current page as the screenshot page identification. Meanwhile, for the page to be screened, a character string can be set as a screen-screened page identifier, such as a1, in the same manner, and the identifier can at least represent a specific part in the page to be screened, such as a text box part or a picture part in the page to be screened.
When the screenshot page identifier and the screenshot page identifier are determined, a mapping table representing the one-to-one correspondence between the screenshot page identifier and the screenshot page identifier can be established, for example, a correspondence between A1 and A1 in the above example is established, and further, the mapping table can be stored in a database. It should be noted that, when the uploads of the screenshot pages need multiple screenshots, the screenshot page identifiers may correspond to multiple screenshot page identifiers, and similarly, when different uploads of the screenshot pages need to screenshot specific portions of the screenshot pages, a single screenshot page identifier may also correspond to multiple screenshot page identifiers, and those skilled in the art should understand that specific correspondence should be set according to actual situations, and embodiments of the disclosure are not limited specifically herein.
Based on the above, after the screenshot page identification is determined, the screenshot page identification can be determined in a table look-up mode, and the process can be understood as that the screenshot required by the current page can be determined after the current page is determined.
And S220, when an uploading request for uploading the screenshot is received, if the text information exists in the screenshot information mark control, acquiring the text information and taking the text information as target content in screenshot associated information.
In this embodiment, when an upload request for uploading a screenshot is received, the content in the screenshot information mark control may also be detected, where the screenshot information mark control is used to edit or set related parameter information of the screenshot required by the current page, so when it is detected that the control is not empty, the text information in the control 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 time length 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 by acquiring the page address corresponding to the target screenshot, namely determining the web address of the webpage containing the screenshot content required by the server; acquiring a screenshot size corresponding to the target screenshot, namely determining the width and height of the intercepted image when the server side executes the screenshot operation subsequently; the loading waiting time corresponding to the page address is obtained, so that the server side executes the screenshot operation after the waiting time after accessing the page to be screenshot, and the condition that the screenshot is incomplete due to the fact that the page is not loaded completely is avoided; by acquiring the model information of the terminal equipment, the server can enable the intercepted image to correspond to the display interface of the current equipment of the user (namely simulate the style of the equipment) after the subsequent screenshot operation is performed, for example, when the acquired information indicates that the terminal used by the user is a certain Android equipment, the intercepted image can be enabled to be adaptive to the display interface of the corresponding Android equipment, and when the acquired information indicates that the terminal used by the user is an iOS flat equipment, the intercepted image can be enabled to be adaptive to the display interface of the corresponding iOS flat equipment; the watermark content to be added on the intercepted image can be determined by acquiring the watermark information to be added; by obtaining color information of the target screenshot, the color of the captured image can be determined.
It should be noted that, the above information may be edited or set in advance before receiving the request for uploading the screenshot, or the content of 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 receiving the uploading request. For example, when the model information of the terminal device in the target content is empty and an upload request for uploading a screenshot is received, the server side can automatically call the software and hardware information of the device currently used by the user by using an application programming interface (API, application Programming Interface), and determine the model information of the device.
S230, processing the target content and/or the page to be screen-captured in the screen capture associated information by adopting a serial number generation algorithm to obtain an uploading identifier corresponding to the uploading request.
The sequence number generation algorithm may be a hash algorithm or a BASE64 algorithm, and is configured to generate a sequence number corresponding to the target content and/or the page to be captured in the relevant screenshot information, and after obtaining the corresponding sequence number, use the sequence number as an uploading identifier, that is, the obtained uploading identifier is matched with the relevant screenshot information, and meanwhile, the uploading identifier may be used as a digitalized feature of the screenshot required by the current page.
The hash character string is also used as an uploading identifier, and it can be understood that the hash character string is very sensitive to the input content, and when the target content and/or the page to be captured 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 a page address in screenshot related information through a headless browser; and intercepting a target screen to-be-intercepted page according to the screenshot size and/or the model information of the terminal equipment to obtain a target screenshot.
In this embodiment, when it is determined that the upload identifier does not exist in the cache database, it is proved that the server does not have the screenshot currently required by the server, so that the screenshot operation needs to be performed, and at this time, a headless browser may be awakened by using node.js, so as to create an environment for the server to automatically perform the screenshot under the condition that the user does not feel the same. The node. Js refers to JavaScript running on a server, is a platform built based on Chrome JavaScript running, and can be understood as a web browser without a graphical user interface (GUI, graphical User Interface), which is usually controlled through programming or command line interfaces, and can be used for web crawlers and automated testing.
In this embodiment, after the headless browser is awakened, the target page to be captured may be accessed according to the page address in the related information of the capturing, and meanwhile, the width and height of the headless browser when the page is accessed, the style of the simulation device, and the like may be determined according to the capturing size in the related information of the capturing and/or the model information of the terminal device.
Further, after the target page to be screenshot is completely loaded according to the loading waiting time, a custom script can be called, and it can be understood that the custom script is an executable file which is pre-written by a worker according to a certain format 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 screenshot when long screenshot or dynamic screenshot is executed) and simulating the operation of adding the watermark to the page by the user. And after the script is executed, the screenshot operation can be executed, and the obtained binary picture is the target screenshot. Note that the captured picture may be a still picture or a moving picture.
S250, storing the target screenshot and an uploading identifier corresponding to the target screenshot in a cache database correspondingly.
In this embodiment, after the target screenshot in the binary form is obtained, the screenshot may be uploaded to the cache database, and specifically, the target screenshot may be uploaded to the cloud disk, so that the server side completes the operation of automatically capturing the screenshot under the condition that the user does not feel the target screenshot.
Meanwhile, the uploading identifier corresponding to the target screenshot is required to be stored in the cache, so that the current page can be directly called in the cloud disk, and repeated screenshot operation is not executed when the uploading identifier is successfully matched with the uploading identifier stored at this time after the uploading identifier is regenerated when the uploading request of the uploading screenshot is received again.
By storing the corresponding uploading identifier while storing the target screenshot, the current page can effectively call the target screenshot, and when the server needs the screenshot with the same content as the current screenshot, the stored target screenshot can be directly determined through comparison of the uploading identifier without repeatedly executing the screenshot operation.
S260, determining a storage link corresponding to the target screenshot, and feeding back the storage link to the target client so that a user corresponding to the target client can call the target screenshot based on the storage link.
In this embodiment, after storing the target screenshot and the corresponding upload identifier in the cache database, the corresponding storage link may be determined, and specifically, may be an accessible uniform resource locator (URL, uniform Resource Locator). It will be appreciated by those skilled in the art that the 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. The storage link is fed back for the user, so that the user can conveniently confirm and store the image intercepted by the server, and the intelligent degree of the automatic screenshot function is further enhanced.
According to the technical scheme, the corresponding relation between each screenshot page identifier and the screenshot page identifier is established in advance, and when an uploading request is received, target content in the screenshot information mark control is detected, screenshot related information is determined, and the intercepted image is further refined; the screenshot operation is executed by using the headless browser and the custom script, so that the server side can simulate the 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 fetched by the current page, and when the screenshot with the same content as the current intercepted content is needed later, the stored target screenshot is directly determined through comparison of the uploading identification, and the screenshot operation is not required to be repeatedly executed; the storage link is fed back for the user, so that the user can conveniently confirm and store the image intercepted by the server, and the intelligent degree of the automatic screenshot function is further enhanced.
Example III
As an alternative embodiment of the foregoing embodiment, fig. 3 is a schematic flow chart of a data storage method according to a third embodiment of the present invention. For the sake of clearly describing the technical solution of this embodiment, the application scenario may be described by taking a case that the current page needs a certain screen or a plurality of screen shots due to service requirements as an example, but the application scenario is not limited to the above scenario, and the application scenario may also be applicable to various complex scenarios that need to perform 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 the configuration information are screenshot related information in the above embodiment, including 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 target content and/or a page to be screen-captured in the screen capture associated information, and a cache key, namely an uploading identifier corresponding to the uploading request, can be obtained.
With continued reference to fig. 3, after determining the uploading identifier, the stored identifier of the screenshot can be retrieved in the cache database, so as to determine whether the screenshot required by the current page exists in the database currently, if the detection result indicates that the screenshot corresponding to the uploading identifier exists in the cache database, the screenshot operation is not required to be executed, and the storage link of the existing screenshot in the cache database is directly called; if the detection result shows that the screenshot corresponding to the uploading identifier does not exist in the cache database, the server is required to execute automatic screenshot operation.
With continued reference to fig. 3, in order to enable the server to complete the automatic screenshot operation under the condition that the user does not feel, node.js may be used to wake up a headless browser, and according to the screenshot related information, the width and height of the browser page access and the style of the simulation device are set. Further, according to the page address of the page to be captured, the page to be captured can be jumped to in the headless browser, after the page is loaded based on the loading waiting time, a pre-written custom script is called to modify the page, for example, sliding operation of a user is simulated, watermarks and the like are added to the page, and the capturing operation can be executed after the execution of the custom script is completed, so that a binary-form picture is generated.
With continued reference to fig. 3, after the server side automatically captures a screenshot, the captured image may be uploaded to the cloud disk for storage, and a storage link of the image may be returned, so that the user may view or download the target screenshot using the link. Meanwhile, the uploading identifiers are stored in the cache database, so that when the server receives the uploading identifiers of the uploading screenshot again, the two uploading identifiers are matched, and the screenshot operation is prevented from being repeatedly executed.
The beneficial effects of the technical scheme are as follows: the server automatically intercepts the required part of the specific page in a state that the user does not feel, avoids the problems that the manual screenshot process of the user is complicated and the whole page screenshot does not meet the requirements of the server, can automatically store the screenshot after the screenshot is finished, and improves the use experience of the user.
Example IV
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 the 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: the screenshot association information determination module 310, the upload identification generation module 320, and the target screenshot storage module 330.
The screenshot associated information determining module 310 is configured to determine screenshot associated 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 page to be screenshot corresponding to the hyperlink of the current page and/or target content edited in the screenshot information editing control.
And the upload identifier generating module 320 is 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.
Based on the above technical solutions, the data storage device further includes a mapping relationship establishment module.
The mapping relation establishing module is used for determining a screenshot page identifier of each uploading screenshot page, at least one to-be-screenshot page associated with each uploading screenshot page and a screenshot page identifier 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.
Optionally, the screenshot association information determining module 310 is further configured to, when receiving an upload request for uploading a screenshot, obtain text information and use the text information as target content in the screenshot association information if text information exists in the screenshot information mark control; the target content comprises at least one of a page address corresponding to a target screenshot, a screenshot size, loading waiting time corresponding to the page address, model information of 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, by using a sequence number generating algorithm, the target content and/or the page to be screen-captured in the screenshot related information, to obtain an upload identifier corresponding to the upload request; and the uploading identification is matched with the screenshot association information.
Based on the above technical solutions, the target screenshot storage module 330 includes a target screenshot generating unit and a target screenshot storage unit.
The target screenshot generating unit is used for accessing a target webpage to be screenshot corresponding to the webpage address in the screenshot related information through the headless browser; and intercepting the target page to be intercepted 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 storing the target screenshot and the uploading identification corresponding to the target screenshot into a cache database correspondingly.
On the basis of the technical schemes, the data storage device further comprises 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 the uploading request for uploading the screenshot is received, screenshot related information corresponding to the current page is determined, wherein the screenshot related information comprises at least one page to be screenshot corresponding to the hyperlink of the current page and/or target content edited in the screenshot information editing control, so that positioning of the content required by the server is realized, an uploading identifier corresponding to the uploading request is generated according to the screenshot related information, if the uploading identifier does not exist in the cache database, the target screenshot is determined and stored based on the screenshot related information, so that the server can automatically intercept a part required in a specific page in a state that a user does not feel, the problems that the manual screenshot process of the user is complicated and the whole page screenshot does not meet the requirements of the server are avoided, meanwhile, the screenshot can be automatically stored after the screenshot is completed, and 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 the corresponding functional modules and beneficial effects of the execution method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present 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 shows a block diagram of an exemplary electronic device 40 suitable for use in implementing the embodiments of the present invention. The electronic device 40 shown in fig. 5 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 5, the electronic device 40 is in the form of a general purpose computing device. Components of electronic device 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, a bus 403 that connects the various system components (including the system memory 402 and the processing units 401).
Bus 403 represents one or more 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, and not limitation, such architectures include 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 can be any available media that is accessible by electronic device 40 and includes both volatile and non-volatile 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. 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 non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 403 through one or more data medium interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules 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 in, for example, 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 or some combination of which may include 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.), one or more devices that enable a user to interact with the electronic device 40, and/or 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 occur through an input/output (I/O) interface 411. Also, electronic device 40 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 412. As shown, network adapter 412 communicates with other modules of electronic device 40 over bus 403. It should be appreciated that although not shown in fig. 5, other hardware and/or software modules may be used in connection with electronic device 40, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 401 executes various functional applications and data processing by running programs stored in the system memory 402, for example, implements the data storage method provided by the embodiment of the present invention.
Example six
A sixth embodiment of the present invention also provides a storage medium containing computer-executable instructions for performing a data storage method when executed by a computer processor.
The method comprises the following steps:
when an uploading request for uploading the screenshot is received, determining screenshot associated information corresponding to the current page; the screenshot associated information comprises at least one page to be screenshot corresponding to the hyperlink of the current page and/or target content edited in a screenshot information editing control;
generating an uploading identifier corresponding to the uploading request according to the screenshot associated information;
and if the uploading identification does not exist in the cache database, determining a target screenshot based on the screenshot association information and storing the target screenshot.
The computer storage media of embodiments of the 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. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 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.
The 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 any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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, wire, fiber optic 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 ++ 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (8)

1. A method of data storage, comprising:
when an uploading request for uploading the screenshot is received, determining screenshot associated information corresponding to the current page; the screenshot associated information comprises at least one page to be screenshot corresponding to the hyperlink of the current page and target content edited in the screenshot information editing control;
generating an uploading identifier corresponding to the uploading request according to the screenshot associated information;
if the uploading identification does not exist in the cache database, determining a target screenshot based on the screenshot association information and storing the target screenshot;
The determining screenshot associated information corresponding to the current page comprises the following steps:
if the text information exists in the screenshot information editing control, acquiring the text information and taking the text information as target content in the screenshot related information; the target content comprises at least one of a page address, a screenshot size, loading waiting time length, model information of terminal equipment, watermark information to be added and color information of the target screenshot, wherein the page address corresponds to the target screenshot;
before determining the screenshot associated information corresponding to the current page, the method further comprises the following steps:
determining a screenshot page identifier of each uploadable screenshot page, at least one to-be-screenshot page associated with each uploadable screenshot page and a screenshot page identifier of the at least one to-be-screenshot page;
establishing a mapping relation between each screenshot page identifier and the corresponding at least one screenshot page identifier, so as to determine screenshot associated information according to the mapping relation and the page identifier of the current page;
when the content of the screenshot information editing control is empty and an uploading request for uploading the screenshot is received, at least one target content in the screenshot associated information is automatically generated.
2. The method of claim 1, wherein generating an upload identifier corresponding to the upload request according to the screenshot-associated information comprises:
processing target content and/or a page to be screen captured in the screen capture associated information by adopting a serial number generation algorithm to obtain an uploading identifier corresponding to the uploading request; and the uploading identification is matched with the screenshot association information.
3. The method of claim 1, wherein the screenshot association information includes target content, and wherein the determining a target screenshot based on the screenshot association information includes:
accessing a target page to be screenshot corresponding to a page address in the screenshot related information through a headless browser;
and intercepting the target page to be screened according to the screen capturing size and/or the model information of the terminal equipment to obtain a target screen capturing.
4. The method of claim 1, wherein the storing the target screenshot comprises:
and storing the target screenshot and an uploading identifier corresponding to the target screenshot into a cache database.
5. The method of claim 1, further comprising, after the determining a target screenshot based on the screenshot-associated information and storing the target screenshot:
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.
6. A data storage device, comprising:
the screenshot associated information determining module is used for determining screenshot associated information corresponding to a current page when an uploading request for uploading the screenshot is received; the screenshot associated information comprises at least one page to be screenshot corresponding to the hyperlink of the current page and 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 associated information;
the target screenshot storage module is used for determining a target screenshot based on the screenshot association information and storing the target screenshot if the uploading identification does not exist in the cache database;
the screenshot associated information determining module is further configured to:
when an uploading request for uploading a screenshot is received, if text information exists in the screenshot information editing control, the text information is obtained and is used as target content in the screenshot related information; the target content comprises at least one of a page address, a screenshot size, loading waiting time length, model information of terminal equipment, watermark information to be added and color information of the target screenshot, wherein the page address corresponds to the target screenshot;
The data storage device also comprises a mapping relation establishment module;
the mapping relation establishing module is used for determining a screenshot page identifier of each uploading screenshot page, at least one to-be-screenshot page associated with each uploading screenshot page and the screenshot page identifier of the at least one to-be-screenshot page; establishing a mapping relation between each screenshot page identifier and the corresponding at least one screenshot page identifier, so as to determine screenshot associated information according to the mapping relation and the page identifier of the current page;
the screenshot associated information determining module is further configured to:
when the content of the screenshot information editing control is empty and an uploading request for uploading the screenshot is received, at least one target content in the screenshot associated information is automatically generated.
7. An electronic device, the electronic device comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the data storage method of any of claims 1-5.
8. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the data storage method of any of claims 1-5.
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 CN113590564A (en) 2021-11-02
CN113590564B true 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)

Families Citing this family (1)

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

Citations (16)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10339199B2 (en) * 2015-04-10 2019-07-02 Oracle International Corporation Methods, systems, and computer readable media for capturing and storing a web page screenshot

Patent Citations (16)

* 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
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

Also Published As

Publication number Publication date
CN113590564A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
US10705942B1 (en) Simulated testing of API
US10289275B2 (en) Standard commands for native commands
CN112068824B (en) Webpage development preview method and device and electronic equipment
US20100211865A1 (en) Cross-browser page visualization generation
CN112817817B (en) Buried point information query method, buried point information query device, computer equipment and storage medium
CN113704590B (en) Webpage data acquisition method and device, electronic equipment and storage medium
CN107276842B (en) Interface test method and device and electronic equipment
CN113382083B (en) Webpage screenshot method and device
CN109558331B (en) Application program defect detection method, device, equipment and storage medium
CN113076499B (en) Page interaction method, device, equipment, medium and program product
CN113158619A (en) Document processing method and device, computer readable storage medium and computer equipment
US9158657B2 (en) Architecture for remote access to content state
CN110365776B (en) Picture batch downloading method and device, electronic equipment and storage medium
CN113590564B (en) Data storage method, device, electronic equipment and storage medium
CN110874216B (en) Complete code generation method, device, equipment and storage medium
CN107862035B (en) Network reading method and device for conference record, intelligent tablet and storage medium
EP4055797A1 (en) Web application component migration to a cloud computing system
US20210334113A1 (en) Method and device for lazy loading of js scripts
CN113268232B (en) Page skin generation method and device and computer readable storage medium
CN109101429B (en) Method and device for debugging browser page of set top box
CN111966931A (en) Rendering method and device of control
CN116112457A (en) Method, device, computer equipment and storage medium for notifying message
CN114490320A (en) Automatic testing method and device, electronic equipment and storage medium
CN111026466A (en) File processing method and device, computer readable storage medium and electronic equipment
KR20160132854A (en) Asset collection service through capture of content

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