CN115544554A - Page request method, device and storage medium - Google Patents

Page request method, device and storage medium Download PDF

Info

Publication number
CN115544554A
CN115544554A CN202211085416.9A CN202211085416A CN115544554A CN 115544554 A CN115544554 A CN 115544554A CN 202211085416 A CN202211085416 A CN 202211085416A CN 115544554 A CN115544554 A CN 115544554A
Authority
CN
China
Prior art keywords
data
sensitive data
page
request
webpage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211085416.9A
Other languages
Chinese (zh)
Inventor
陈博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Qunhe Information Technology Co Ltd
Original Assignee
Hangzhou Qunhe Information 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 Hangzhou Qunhe Information Technology Co Ltd filed Critical Hangzhou Qunhe Information Technology Co Ltd
Priority to CN202211085416.9A priority Critical patent/CN115544554A/en
Publication of CN115544554A publication Critical patent/CN115544554A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • G06F21/6263Protecting personal data, e.g. for financial or medical purposes during internet communication, e.g. revealing personal data from cookies

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Medical Informatics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a page request method, a page request device and a storage medium, which relate to the technical field of Internet, wherein the method comprises the following steps: receiving a page acquisition request sent by a request terminal; acquiring webpage data requested by the page acquisition request, wherein the webpage data comprises sensitive data; rendering the sensitive data into a target picture according to a preset rendering mode; and generating an HTML file according to the target picture and non-sensitive data in the webpage data, returning the HTML file to the request terminal, and displaying a page by the request terminal according to the received HTML file. The problem of probably having data leakage risk among the prior art, data security is relatively weak is solved, it can be the picture with sensitive data conversion to have reached, and then improves the degree of difficulty that is snatched by the web crawler, improves the effect of data security.

Description

Page request method, device and storage medium
Technical Field
The invention relates to a page request method, a page request device and a storage medium, and belongs to the technical field of internet.
Background
A web crawler is a program or script that automatically crawls web data according to certain rules.
In the existing scheme, in order to ensure data security and prevent data from being captured by the web crawler, various anti-crawler schemes also exist in the existing scheme, such as IP (Internet Protocol ) blocking, UA (User Agent) blocking, registration login, request header blocking, and the like, however, the above anti-crawler schemes can be cracked, that is, the above scheme still has a risk of data leakage, and the data security is weak.
Disclosure of Invention
The invention aims to provide a page request method, a page request device and a storage medium, which are used for solving the problems in the prior art.
In order to achieve the purpose, the invention provides the following technical scheme:
according to a first aspect, an embodiment of the present invention provides a page request method, which is used in a server, and the method includes:
receiving a page acquisition request sent by a request terminal;
acquiring webpage data requested by the page acquisition request, wherein the webpage data comprises sensitive data;
rendering the sensitive data into a target picture according to a preset rendering mode;
and generating a hypertext markup language (HTML) file according to the target picture and non-sensitive data in the webpage data, returning the HTML file to the request terminal, and displaying a page by the request terminal according to the received HTML file.
Optionally, the rendering the sensitive data into the target picture according to a preset rendering manner includes:
the sensitive data is populated into the canvas based on the HTML5 canvas drawing.
Optionally, the method further comprises:
filling an njk template according to the webpage data through a node.JS server, and adding a target placeholder, wherein the target placeholder corresponds to the sensitive data;
the filled njk template is sent to a world wide Web Web end through the node.JS server end;
decrypting the webpage data in the njk template through the Web end, and rendering the sensitive data in the webpage data into a target picture according to a preset rendering mode according to the target placeholder.
Optionally, the decrypting, by the Web end, the Web page data in the njk template includes:
and decrypting the webpage data in the njk template through an React frame.
Optionally, the method further comprises:
and rendering interactive components and/or visual components in the webpage data through the React frame.
Optionally, the web page data further includes non-sensitive data, and the method further includes:
and when the njk template is filled, encapsulating the non-sensitive data through the node.JS server.
Optionally, the sensitive data comprises: text data and/or picture data.
Optionally, if the webpage data includes house type data, the sensitive data includes: at least one of a house type area, a house type picture, a cell name, and a house price.
In a second aspect, there is provided a page request apparatus, the apparatus comprising a memory and a processor, the memory having at least one program instruction stored therein, the processor implementing the method according to the first aspect by loading and executing the at least one program instruction.
In a third aspect, there is provided a computer storage medium having stored therein at least one program instruction which is loaded and executed by a processor to implement the method of the first aspect.
Acquiring a request by receiving a page sent by a request end; acquiring webpage data requested by the page acquisition request, wherein the webpage data comprises sensitive data; rendering the sensitive data into a target picture according to a preset rendering mode; and generating a hypertext markup language (HTML) file according to the target picture and non-sensitive data in the webpage data, returning the HTML file to the request terminal, and displaying a page by the request terminal according to the received HTML file. The problem of probably having data leakage risk among the prior art, data security is relatively weak is solved, it can be the picture with sensitive data conversion to have reached, and then improves the degree of difficulty that is snatched by the web crawler, improves the effect of data security.
Meanwhile, the SSR is realized through the njk and the React, the hiding of a data interface is realized, and the safety of data is further improved.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical solutions of the present invention more clearly understood and to implement them in accordance with the contents of the description, the following detailed description is given with reference to the preferred embodiments of the present invention and the accompanying drawings.
Drawings
Fig. 1 is a schematic diagram of implementation scenarios according to various embodiments provided by an embodiment of the present invention;
FIG. 2 is a flowchart of a method for requesting a web page according to an embodiment of the present invention;
fig. 3 is another flowchart of a web page requesting method according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In addition, the technical features involved in the different embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
For convenience of explanation, first, a brief description is made of an implementation scenario related to the present application. As shown in fig. 1, the implementation scenario includes a request end 100 and a server 200. Wherein:
the requesting end 100 may be a terminal such as a mobile phone, a tablet computer, a desktop computer, and a notebook computer, which is not limited in this application. Alternatively, the requesting end 100 may be communicatively connected with the server 200 through a wired network or a wireless network. In practical implementation, the request end 100 may be provided with a client or a web page end, and further, the web page is accessed through the client or the web page end.
The server 200 refers to a computing center for providing background services for the requesting end 100. The server 200 described in the present application may be a single server 200, or may be a server 200 cluster composed of a plurality of servers 200, which is not limited to this.
Referring to fig. 2, a flowchart of a method of requesting a web page provided by an embodiment of the present application is shown, where the present application is exemplified by using the method in the implementation environment shown in fig. 1, and as shown in fig. 2, the method includes:
step 201, a request end sends a page acquisition request to a server;
when a user wants to browse the webpage content of the target webpage, a selection instruction for selecting the target webpage can be applied to the request terminal, and correspondingly, the request terminal can receive the selection instruction and send a page acquisition request to the server after receiving the selection instruction. The selection instruction may be a click instruction for clicking a tag of a target web page, an input instruction for inputting a URL (uniform resource locator) address in an address bar, or a click instruction for clicking a link of a web page, which is not limited in the present application.
Step 202, a server receives a page acquisition request sent by a request end;
step 203, the server acquires webpage data requested by the page acquisition request, wherein the webpage data comprises sensitive data;
after receiving the page acquisition request, the server may acquire corresponding web page data. Optionally, the web page data may include sensitive data, and when actually implemented, may also include non-sensitive data. That is, the web page data may include only sensitive data, or may include both sensitive data and non-sensitive data.
Optionally, after the server obtains the web page data, the server may analyze the web page data according to a preset rule to obtain sensitive data and non-sensitive data. The preset rule may include keyword recognition, and certainly, may also be recognized by other recognition methods, which is not limited in the present application.
In this application, the data type of the sensitive data may be at least one of text data and picture data, which is not limited thereto.
In actual implementation, the data content of the sensitive data is different according to the target webpage requested to be accessed. In one possible embodiment, when the target web page includes house type data, then the sensitive data may include at least one of house type area, house type picture, cell name and house price, wherein the target web page may be a house rental web page, a house sales web page, a floor promotion web page, a decoration design web page, and the like. In another possible embodiment, when the private data of the user is included in the target web page, then the sensitive data includes: at least one of a name, a telephone number, a home address, a bank card number, a company name, and a company address.
Of course, the web page data may also include non-sensitive data. For example, still by way of example, when the data of house type is included in the data of web page, the non-sensitive data in the data of web page may include city name, standard house type or not, house type structure, and the like, which is not limited in this application.
In order to ensure the data security of the sensitive data, in a possible embodiment, the sensitive data may be encrypted, that is, the sensitive data in the web page data is encrypted data.
Step 204, rendering the sensitive data into a target picture by the server according to a preset rendering mode;
sensitive data is populated into the canvas based on an HTML5 (Hyper Text Markup Language) canvas drawing.
In practical implementation, referring to fig. 3, the server may include a server, a node.js server, and a Web server, and after the server obtains the Web page data, the method further includes:
firstly, filling an njk template according to webpage data through a node.JS server, and adding a target placeholder, wherein the target placeholder corresponds to sensitive data;
specifically, when an njk (Numjucks) template is filled, non-sensitive data is encapsulated through a node.js server, and sensitive data is replaced through a target placeholder. The target placeholder may be a preset character for representing sensitive data, and in actual implementation, the target placeholder may be "0", "1", "01", and the like, and specific implementation thereof is not limited.
Secondly, the filled njk template is sent to a Web (World Wide, world Wide Web) end through a node.JS server end;
the Web end can be realized through the React frame, namely the node.JS server end sends the filled njk template to the React frame.
Thirdly, decrypting the webpage data in the njk template through the Web end, and executing the step according to the target placeholder.
Optionally, the webpage data in the njk template may be decrypted by the React frame. And after the encrypted webpage data are obtained, rendering the sensitive data corresponding to the target placeholder into a target picture. Similarly, the React frame may populate sensitive data to the canvas based on an HTML5 canvas drawing.
And rendering interactive components and/or visual components in the webpage data through the React frame.
Step 205, the server generates a hypertext markup language (HTML) file according to the target picture and the non-sensitive data in the webpage data;
step 206, the server returns the HTML file to the request end;
and step 207, the request terminal displays the page according to the received HTML file.
With reference to fig. 3, a complete schematic diagram of one possible implementation of the present application is shown. As shown in fig. 3, the client sends a web page acquisition request to the server, the server returns web page data to the node.js server, the node.js server fills the njk template and adds placeholders, and then sends the placeholders to the fact frame, the fact frame decrypts the received web page data, draws sensitive data corresponding to the placeholders to canvas, and then generates an HTML file for the client to display.
In summary, the request is obtained by receiving the page sent by the request end; acquiring webpage data requested by the page acquisition request, wherein the webpage data comprises sensitive data; rendering the sensitive data into a target picture according to a preset rendering mode; and generating a hypertext markup language (HTML) file according to the target picture and non-sensitive data in the webpage data, returning the HTML file to the request terminal, and displaying a page by the request terminal according to the received HTML file. The problem of probably having data leakage risk among the prior art, data security is relatively weak is solved, it can be the picture with sensitive data conversion to have reached, and then improves the degree of difficulty that is snatched by the web crawler, improves the effect of data security.
Meanwhile, the SSR is realized through the njk and the React, the hiding of a data interface is realized, and the safety of data is further improved.
The present application further provides a page request apparatus, which includes a memory and a processor, wherein the memory stores at least one program instruction, and the processor loads and executes the at least one program instruction to implement the method as described above.
The present application also provides a computer storage medium having stored therein at least one program instruction, which is loaded and executed by a processor to implement the method as described above.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A page request method is used in a server, and the method comprises the following steps:
receiving a page acquisition request sent by a request terminal;
acquiring webpage data requested by the page acquisition request, wherein the webpage data comprise sensitive data;
rendering the sensitive data into a target picture according to a preset rendering mode;
and generating a hypertext markup language (HTML) file according to the target picture and non-sensitive data in the webpage data, returning the HTML file to the request terminal, and displaying a page by the request terminal according to the received HTML file.
2. The method according to claim 1, wherein the rendering the sensitive data into the target picture according to a preset rendering mode comprises:
the sensitive data is populated into the canvas based on the HTML5 canvas drawing.
3. The method of claim 1, further comprising:
filling an njk template according to the webpage data through a node.JS server, and adding a target placeholder, wherein the target placeholder corresponds to the sensitive data;
the filled njk template is sent to a world wide Web Web end through the node.JS server end;
decrypting the webpage data in the njk template through the Web end, and rendering the sensitive data in the webpage data into a target picture according to a preset rendering mode according to the target placeholder.
4. The method of claim 3, wherein decrypting the Web page data in the njk template by the Web port comprises:
and decrypting the webpage data in the njk template through a React frame.
5. The method of claim 4, further comprising:
and rendering interactive components and/or visual components in the webpage data through the React frame.
6. The method of claim 3, wherein the web page data further comprises non-sensitive data, the method further comprising:
and when the njk template is filled, encapsulating the non-sensitive data through the node.JS server.
7. The method of any of claims 1 to 6, wherein the sensitive data comprises: text data and/or picture data.
8. The method of claim 1, wherein if the web page data includes house type data, the sensitive data comprises: at least one of a house type area, a house type picture, a cell name, and a house price.
9. A page request device, comprising a memory having at least one program instruction stored therein and a processor, wherein the processor is configured to load and execute the at least one program instruction to implement the method of any one of claims 1 to 8.
10. A computer storage medium having stored therein at least one program instruction which is loaded and executed by a processor to implement the method of any one of claims 1 to 8.
CN202211085416.9A 2022-09-06 2022-09-06 Page request method, device and storage medium Pending CN115544554A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211085416.9A CN115544554A (en) 2022-09-06 2022-09-06 Page request method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211085416.9A CN115544554A (en) 2022-09-06 2022-09-06 Page request method, device and storage medium

Publications (1)

Publication Number Publication Date
CN115544554A true CN115544554A (en) 2022-12-30

Family

ID=84725256

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211085416.9A Pending CN115544554A (en) 2022-09-06 2022-09-06 Page request method, device and storage medium

Country Status (1)

Country Link
CN (1) CN115544554A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116932854A (en) * 2023-09-14 2023-10-24 百鸟数据科技(北京)有限责任公司 Webpage information anticreeper method, device, system, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116932854A (en) * 2023-09-14 2023-10-24 百鸟数据科技(北京)有限责任公司 Webpage information anticreeper method, device, system, equipment and storage medium

Similar Documents

Publication Publication Date Title
KR101362384B1 (en) The method and system for browsing things of internet of things on ip using web platform
CN102473171B (en) Information about local machine is conveyed to browser application
US8397212B2 (en) Module hosting and content generation platform
US9497260B2 (en) Communication between two web applications
US9305297B2 (en) Secure online communication through a widget on a web page
CN102393857B (en) Method and system for local call based on web page
CN104584011B (en) Method and system for being inserted into the secure network of WEB content and WEB service
US20140095355A1 (en) Platform, Method, and Device for Managing Application
CN103268319A (en) Cloud browser based on webpages
CN104410711A (en) Cross-domain network resource request method and device for client
CN106897336A (en) Web page files sending method, webpage rendering intent and device, webpage rendering system
CN105095220B (en) A kind of browser implementation method, terminal and virtualization agent device
US8156441B1 (en) Inter-gadget communication
CA2437273C (en) Network conduit for providing access to data services
US20070055775A1 (en) Method and system for controlling information access from a website via Web or WAP access
US9071591B2 (en) Authentication method for network connection and network device and network authentication system using the same method
US20160269446A1 (en) Template representation of security resources
CN113076294A (en) Information sharing method and device
CN115544554A (en) Page request method, device and storage medium
CN113742601A (en) Content sharing method and device, computer equipment and storage medium
CN112818270B (en) Data cross-domain transfer method and device and computer equipment
US20130282859A1 (en) System and method for enabling the styling and adornment of multiple, disparate web pages through remote method calls
CN112836148A (en) Report display method and device, storage medium and electronic equipment
US20060143208A1 (en) Bitmask access for managing blog content
WO2006028419A1 (en) Method and system for controlling information access from a website via web or wap access

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