Search

CN-122019910-A - Anticreeper method, apparatus, electronic device, storage medium, and computer program product

CN122019910ACN 122019910 ACN122019910 ACN 122019910ACN-122019910-A

Abstract

The application provides an anticreeper method, a device, electronic equipment, a storage medium and a computer program product, wherein the method comprises the steps of generating one or more website files corresponding to a first website based on source codes of the first website according to a set generation rule, and starting corresponding network services for each website file in the one or more website files, wherein the set generation rule is used for modifying a positioning path of an element in the source codes, and the network services are used for calling the corresponding website file to respond to a user request.

Inventors

  • WANG HAO
  • ZHOU XIANGYU

Assignees

  • 中移(苏州)软件技术有限公司
  • 中国移动通信集团有限公司

Dates

Publication Date
20260512
Application Date
20260414

Claims (11)

  1. 1. A method of anticreeping, the method comprising: Generating one or more website files corresponding to a first website based on source codes of the first website according to a set generation rule, and starting corresponding network service for each website file in the one or more website files, wherein the set generation rule is used for modifying a positioning path of an element in the source codes, and the network service is used for calling the corresponding website file to respond to a user request.
  2. 2. The method of claim 1, wherein the set generation rule comprises one or more of: replacing names of element attributes in the source codes with random messy codes; And randomly inserting an invalid element tag into the source code.
  3. 3. The method according to claim 1, wherein the method further comprises: receiving a user request sent by a client; Forwarding the user request to network services meeting a first setting condition in a network service list to obtain a corresponding website file; and returning the corresponding website file to the client.
  4. 4. A method according to claim 3, wherein the first setting condition comprises one or more of: The total frequency of receiving the user request is smaller than or equal to a first set threshold value; the starting time length is smaller than or equal to a second set threshold value; the number of the currently received user requests is smaller than or equal to a third set threshold; the corresponding weight is highest, wherein the weight of the network service is determined based on the total frequency of received user requests.
  5. 5. The method according to claim 3 or 4, characterized in that the method further comprises: And executing a first operation for updating the network service list under the condition that the network service meeting the second setting condition exists in the network service list.
  6. 6. The method of claim 5, wherein the second set of conditions includes one or more of: the starting time is longer than or equal to a fourth set threshold value; The total frequency of receiving the user request is greater than or equal to a fifth set threshold; The frequency of receiving the user requests sent by the same client is greater than or equal to a sixth set threshold.
  7. 7. The method of claim 5, wherein the first operation comprises one or more of: Stopping the network service meeting the second setting condition; deleting the website file corresponding to the network service meeting the second setting condition; stopping forwarding the user request to the network service meeting the second setting condition; judging whether the waiting time length of the network service meeting the second set condition is greater than or equal to a seventh set threshold value, wherein the waiting time length represents the time interval between the last time the network service receives the user request and the current time; Regenerating website files of a set number corresponding to the first website based on the source codes of the first website according to the set generation rule; And starting corresponding network service for each website file in the set number of website files.
  8. 8. An anticreeper device, comprising: the generation unit is used for generating one or more website files corresponding to the first website based on the source code of the first website according to a set generation rule; The system comprises a source code, a starting unit, a setting generation rule and a network service, wherein the source code is used for generating a source code, the starting unit is used for starting corresponding network service for each website file in the one or more website files, the setting generation rule is used for modifying the positioning path of an element in the source code, and the network service is used for calling the corresponding website file to respond to a user request.
  9. 9. An electronic device comprising a processor and a memory for storing a computer program capable of running on the processor, wherein the processor is adapted to perform the steps of the method of any of claims 1 to 7 when the computer program is run.
  10. 10. A storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1 to 7.
  11. 11. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.

Description

Anticreeper method, apparatus, electronic device, storage medium, and computer program product Technical Field The present application relates to the field of computer technology, and in particular, to an anticreeper method, an apparatus, an electronic device, a storage medium, and a computer program product. Background At present, in an anticreeper technology for adjusting the position of webpage content through a cascading style sheet (CSS, cascading Style Sheets) offset technology, a CSS offset rule is fixedly set and is easy to crack by a crawler program, so that the safety of the webpage content is threatened, and if the CSS offset rule is designed to be too complex and not easy to crack, the page rendering difficulty is increased, and the page rendering performance is affected. Disclosure of Invention To solve the related technical problems, embodiments of the present application provide an anticreeper method, an apparatus, an electronic device, a storage medium, and a computer program product. The technical scheme of the embodiment of the application is realized as follows: the embodiment of the application provides an anticreeper method, which comprises the following steps: Generating one or more website files corresponding to a first website based on source codes of the first website according to a set generation rule, and starting corresponding network service for each website file in the one or more website files, wherein the set generation rule is used for modifying a positioning path of an element in the source codes, and the network service is used for calling the corresponding website file to respond to a user request. In the above scheme, the setting generation rule includes one or more of the following: replacing names of element attributes in the source codes with random messy codes; And randomly inserting an invalid element tag into the source code. In the above scheme, the method further comprises: receiving a user request sent by a client; Forwarding the user request to network services meeting a first setting condition in a network service list to obtain a corresponding website file; and returning the corresponding website file to the client. In the above aspect, the first setting condition includes one or more of the following: The total frequency of receiving the user request is smaller than or equal to a first set threshold value; the starting time length is smaller than or equal to a second set threshold value; the number of the currently received user requests is smaller than or equal to a third set threshold; the corresponding weight is highest, wherein the weight of the network service is determined based on the total frequency of received user requests. In the above scheme, the method further comprises: And executing a first operation for updating the network service list under the condition that the network service meeting the second setting condition exists in the network service list. In the above aspect, the second setting condition includes one or more of the following: the starting time is longer than or equal to a fourth set threshold value; The total frequency of receiving the user request is greater than or equal to a fifth set threshold; The frequency of receiving the user requests sent by the same client is greater than or equal to a sixth set threshold. In the above aspect, the first operation includes one or more of: Stopping the network service meeting the second setting condition; deleting the website file corresponding to the network service meeting the second setting condition; stopping forwarding the user request to the network service meeting the second setting condition; judging whether the waiting time length of the network service meeting the second set condition is greater than or equal to a seventh set threshold value, wherein the waiting time length represents the time interval between the last time the network service receives the user request and the current time; Regenerating website files of a set number corresponding to the first website based on the source codes of the first website according to the set generation rule; And starting corresponding network service for each website file in the set number of website files. The embodiment of the application also provides an anticreeper device, which comprises: the generation unit is used for generating one or more website files corresponding to the first website based on the source code of the first website according to a set generation rule; The system comprises a source code, a starting unit, a setting generation rule and a network service, wherein the source code is used for generating a source code, the starting unit is used for starting corresponding network service for each website file in the one or more website files, the setting generation rule is used for modifying the positioning path of an element in the source code, and the network service is used for calling the corresponding website file