Data access method and device, client, and server
By dynamically changing the tag elements between the client and the server and obfuscating encryption using timestamps and encryption keys, the problem of poor data access security in the prior art is solved, and efficient network security protection is achieved.
Patent Information
- Application Number
- CN202310601681.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-25
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2043-05-25
AI Technical Summary
When existing data is accessed, the network security is poor, and the complete business project needs to be modified to encrypt the protection URL, which increases the protection cost and the server cannot perceive attack behavior.
When the client detects the target access event, it querys the label element replaced by loop, obtains the element content and encrypts it and sends it to the server. The server decrypts and feedbacks the target access web page, dynamically changes the label element to interfere with crawling, and obfuscating encryption is combined with timestamps and encryption keys.
It reduces the operational cumbersomeness and security protection costs of business project changes, improves network protection effects, and enhances the security of data access.
Smart Images

Figure CN116566707B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to a data access method and device, a client, and a server. Background Art
[0002] With the advent of the big data era, data acquisition through the internet has become the mainstream method for obtaining resource data. When users access the internet, they may be targeted by malicious programs that crawl their behavior and use it as a target for malicious operations. Therefore, security protection is necessary for crawling data such as user access behavior.
[0003] Currently, when accessing existing data, the website address URL is usually packaged into the compiled language JS, and the corresponding URL mapping relationship is matched through the additional tags packaged in JS, so that the URL is found according to this additional tag to access the corresponding website. However, because JS is a compiled language embedded in the client, when the URL packaged in JS needs to be encrypted and protected, the entire business project needs to be modified and the technical process needs to be restructured, which greatly increases the cost of network security protection. In addition, the server cannot perceive the attack behavior on the client, which greatly reduces the network protection effect of the website and thus reduces the security of data access. Summary of the Invention
[0004] In view of this, the present invention provides a data access method and device, a client, and a server, the main purpose of which is to solve the problem of poor security of existing data access.
[0005] According to one aspect of the present invention, a data access method is provided, comprising:
[0006] When it is detected that a user triggers a target access event, querying for a tag element that matches the target access event, wherein the tag element is cyclically replaced at a preset time interval;
[0007] Obtaining the element content corresponding to the tag element, and encrypting the element content according to the encryption key obtained from the server to obtain an encrypted object of the element content, and sending the encrypted object to the server;
[0008] When the target access webpage fed back by the server based on the encrypted object is received, data access is performed based on the target access webpage.
[0009] Furthermore, before searching for a tag element matching the target access event, the method further includes:
[0010] Parsing the webpage timer in the webpage system file and configuring the webpage timer according to the preset time interval;
[0011] When the webpage timer reaches a timing node, all tag elements in the webpage data are obtained;
[0012] The tag element is replaced according to the preset loop object in the web page system file, and the target access event is configured for the replaced tag element based on the preset access event correspondence, so as to trigger a query on the tag element based on the configured target access event.
[0013] Furthermore, encrypting the element content according to the encryption key obtained from the server to obtain an encrypted object of the element content and sending the encrypted object to the server includes:
[0014] Determining a timestamp that triggers the target access event, and encrypting the element content according to the timestamp and the encryption key to obtain an obfuscated object;
[0015] Generate the encrypted object including the timestamp and the obfuscated object, and send the encrypted object to the server.
[0016] Furthermore, the method further comprises:
[0017] Loading the preset access event correspondence from the server; or,
[0018] Receive the device access event correspondence updated by the user;
[0019] The preset access event correspondence relationship is configured with different target access events corresponding to different tag elements.
[0020] According to one aspect of the present invention, another data access method is provided, comprising:
[0021] Determine the tag elements and element contents in the target visited web page, and configure a preset time interval for cyclic replacement of the tag elements;
[0022] Sending an encryption key for encrypting different element contents and the preset time interval to the client, so that the client encrypts the element contents according to the encryption key, and the preset time interval is used to indicate cyclic replacement of the tag elements;
[0023] When receiving the encrypted object obtained by encrypting the element content by the client based on the encryption key, the encrypted object is decrypted, and the target access webpage corresponding to the decrypted object is fed back to the client.
[0024] Furthermore, before sending the encryption key for encrypting different element contents and the preset time interval to the client, the method further includes:
[0025] Generate a web page timer and configure a preset time interval for all tag elements in the web page data;
[0026] Updating the preset loop object of the tag element, and writing the webpage timer and the preset loop object into a webpage system file;
[0027] The webpage system file and the preset time interval are sent to the client, so that the client configures the webpage timer based on the preset time interval after loading the webpage system file.
[0028] Furthermore, decrypting the encrypted object includes:
[0029] parsing the timestamp and the obfuscated object in the encrypted object based on the encryption key;
[0030] Decrypting the obfuscated object according to the timestamp to obtain element content;
[0031] The target access web page is retrieved based on the element content and fed back to the client.
[0032] Furthermore, the method further comprises:
[0033] Performing DOM parsing conversion on the web page data, and performing semantic analysis processing on the converted web page data to obtain a structure tree of the web page data, wherein the structure tree includes data corresponding to nodes marked with different response bodies;
[0034] Perform tag matching on the response body node to determine all tag elements in the web page data.
[0035] Furthermore, the method further comprises:
[0036] Generate a preset access event correspondence and send it to the client. The preset access event correspondence is configured with different target access events corresponding to different label elements, so that the client configures the triggering method of the replaced label element based on the preset access event correspondence.
[0037] According to another aspect of the present invention, there is provided a data access device, comprising:
[0038] A query module, configured to query a tag element that matches a target access event when a user triggers the target access event, wherein the tag element is cyclically replaced at a preset time interval;
[0039] an acquisition module, configured to acquire the element content corresponding to the tag element, encrypt the element content according to the encryption key acquired from the server, obtain an encrypted object of the element content, and send the encrypted object to the server;
[0040] The access module is configured to, when receiving a target access webpage fed back by the server based on the encrypted object, perform data access based on the target access webpage.
[0041] Furthermore, the device further comprises: an analysis module, a configuration module,
[0042] The parsing module is used to parse the webpage timer in the webpage system file and configure the webpage timer according to the preset time interval;
[0043] The acquisition module is further configured to acquire all tag elements in the web page data when the web page timer reaches a timing node;
[0044] The configuration module is used to replace the label element according to the preset loop object in the web page system file, and configure the target access event for the replaced label element based on the preset access event correspondence, so as to trigger a query on the label element based on the configured target access event.
[0045] Furthermore, the acquisition module is specifically used to determine the timestamp that triggers the target access event, and encrypt the element content according to the timestamp and the encryption key to obtain an obfuscated object; generate the encrypted object containing the timestamp and the obfuscated object, and send the encrypted object to the server.
[0046] Furthermore, the device further comprises:
[0047] A loading module, configured to load a preset access event correspondence from the server; or
[0048] A receiving module, configured to receive the device access event correspondence updated by the user;
[0049] The preset access event correspondence relationship is configured with different target access events corresponding to different tag elements.
[0050] According to another aspect of the present invention, another data access device is provided, comprising:
[0051] A configuration module, configured to determine the tag elements and element contents in the target visited web page, and configure a preset time interval for cyclic replacement of the tag elements;
[0052] a sending module, configured to send an encryption key for encrypting different element contents and the preset time interval to a client, so that the client encrypts the element contents according to the encryption key, wherein the preset time interval is used to indicate cyclic replacement of the tag elements;
[0053] The feedback module is configured to decrypt the encrypted object when receiving the encrypted object obtained by the client using the encryption key to encrypt the element content, and feed back the decrypted target access web page to the client.
[0054] Furthermore, the device further comprises: a generating module, an updating module,
[0055] The generating module is used to generate a web page timer and configure a preset time interval for all tag elements in the web page data;
[0056] The updating module is used to update the preset loop object of the tag element and write the webpage timer and the preset loop object into the webpage system file;
[0057] The sending module is further configured to send the webpage system file and the preset time interval to the client, so that the client configures the webpage timer based on the preset time interval after loading the webpage system file.
[0058] Furthermore, the feedback module is specifically used to parse the timestamp and obfuscated object in the encrypted object based on the encryption key; decrypt the obfuscated object according to the timestamp to obtain element content; retrieve the target access web page based on the element content and feed it back to the client.
[0059] Furthermore, the device further comprises:
[0060] a processing module for performing DOM parsing conversion on the web page data and performing semantic analysis on the converted web page data to obtain a structure tree of the web page data, wherein the structure tree includes data corresponding to nodes marked with different response bodies;
[0061] The determination module is used to perform tag matching on the response body node to determine all tag elements in the web page data.
[0062] Furthermore, the sending module is specifically used to generate a preset access event correspondence and send it to the client. The preset access event correspondence is configured with different target access events corresponding to different label elements, so that the client configures the triggering method of the replaced label element based on the preset access event correspondence.
[0063] According to one aspect of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to execute an operation corresponding to the above-mentioned data access method.
[0064] According to one aspect of the present invention, there is provided a client, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;
[0065] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the above-mentioned data access method.
[0066] According to one aspect of the present invention, another storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to execute an operation corresponding to the above-mentioned data access method.
[0067] According to one aspect of the present invention, there is provided a server, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;
[0068] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the above-mentioned data access method.
[0069] By means of the above technical solution, the technical solution provided by the embodiment of the present invention has at least the following advantages:
[0070] The present invention provides a data access method and device, a client, and a server. Compared with the prior art, an embodiment of the present invention determines the tag element and element content in the target access web page through the server, and configures a preset time interval for cyclic replacement of the tag element, and sends an encryption key and a preset time interval for encrypting different element contents to the client. When the client detects that a user triggers a target access event, it queries the tag element that matches the target access event, and the tag element is cyclically replaced according to the preset time interval; obtains the element content corresponding to the tag element, and encrypts the element content according to the encryption key obtained from the server, obtains an encrypted object of the element content, and sends it to the server; the server decrypts the encrypted object and feeds back the decrypted corresponding target access web page to the client, so that the client accesses data based on the target access web page, thereby achieving the purpose of interfering with web page crawling by dynamically changing the tag element, greatly reducing the tediousness of operations and security protection costs when changing business projects, and improving the effectiveness of network security protection by obfuscating and encrypting the element content, thereby effectively improving the network protection effect and effectively meeting the security requirements of data access.
[0071] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0073] Figure 1 A flow chart of a data access method provided by an embodiment of the present invention is shown;
[0074] Figure 2 shows a flow chart of another data access method provided by an embodiment of the present invention;
[0075] Figure 3 A block diagram of a data access device provided by an embodiment of the present invention is shown;
[0076] Figure 4 A block diagram showing another data access device according to an embodiment of the present invention is shown;
[0077] Figure 5 A schematic diagram of the structure of a client provided by an embodiment of the present invention is shown;
[0078] Figure 6 A schematic structural diagram of a server provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0079] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0080] The embodiment of the present invention provides a data access method, such as Figure 1 As shown, the method includes:
[0081] 101. When it is detected that a user triggers a target access event, query for a tag element that matches the target access event.
[0082] In an embodiment of the present invention, the current execution end is a client that performs data access. The user can perform data access to the target access web page by triggering the target access event in the web page. However, in order to improve the protection against malicious programs crawling user behaviors (such as the target access web page clicked), the current execution end first queries the tag element that matches this target access event when detecting that the user triggers the target access event. The tag element is used to represent the element that identifies the website address, such as the tag element of the href attribute, and the tag element is cyclically replaced at a preset time interval. The target access event is configured by binding with different tag elements. The target access event includes but is not limited to click events, sliding events, entry confirmation events, etc., which are not specifically limited in the embodiment of the present invention.
[0083] It should be noted that since the tag element is represented by the element name, for example, the tag element with the href attribute can be represented by The element name is represented. In order to show the changing effect of the label element and thus avoid crawling and positioning by malicious programs, in an embodiment of the present invention, the label element is cyclically replaced at a preset time interval. Preferably, the element name is replaced. The embodiment of the present invention does not make any specific limitation.
[0084] 102. Obtain element content corresponding to the tag element, and encrypt the element content according to the encryption key obtained from the server to obtain an encrypted object of the element content, and send the encrypted object to the server.
[0085] In an embodiment of the present invention, after determining the tag element, the current execution end obtains the element content corresponding to the tag element. If the tag element is an href attribute, the element content is the URL content of the target access webpage. At this time, in order to ensure secure access between the current execution end and the server, the current execution end will pre-request an encryption key from the server to encrypt the element content, thereby obtaining an encrypted object and sending it to the server. The server then decrypts the encrypted element content and retrieves the matching target access webpage for feedback. The encryption method corresponding to the encryption key may include, but is not limited to, algorithms such as AES / SM4 for encryption.
[0086] It should be noted that, in an embodiment of the present invention, in order to protect the source code of the web page address and avoid obtaining the accurate web page address after direct decryption, the element content in the current execution end will be subjected to an obfuscated transformation after the user triggers the target access event, that is, the URL will be obfuscated according to the time when the target access event is triggered and according to this time to obtain a new element content, and then this element content will be encrypted according to the encryption key.
[0087] 103. When receiving the target access webpage fed back by the server based on the encrypted object, perform data access based on the target access webpage.
[0088] In an embodiment of the present invention, the current execution end, acting as a client, sends an encrypted object to a server, then waits for the server to respond with a target webpage obtained by decrypting the encrypted object, thereby accessing data based on the responded target webpage. Upon receiving the encrypted object, the server decrypts it using a pre-stored encryption key. If the decrypted element content is obfuscated, a reverse engineering method based on the obfuscation is required to decrypt it, thereby obtaining the actual URL content corresponding to the original element content, and then determining the target webpage based on this URL.
[0089] In another embodiment of the present invention, for further definition and explanation, before the step of querying the tag element matching the target access event, the method further includes:
[0090] Parsing the webpage timer in the webpage system file and configuring the webpage timer according to the preset time interval;
[0091] When the webpage timer reaches a timing node, all tag elements in the webpage data are obtained;
[0092] The tag element is replaced according to the preset loop object in the web page system file, and the target access event is configured for the replaced tag element based on the preset access event correspondence, so as to trigger a query on the tag element based on the configured target access event.
[0093] In order to effectively prevent malicious programs from crawling the user's real website content and improve the security of user behavior, the current execution end as the client first receives the web page system file loaded from the server to parse the web page timer configured in the web page system file. Among them, the web page system file records all the program or script content for the user to access the web page. At this time, the web page timer in the web page system file is configured in the server, and the web page timer is started based on the preset time interval configured in the server, so that when the preset time interval is reached, the tag element is obtained for replacement. At the same time, since the web page system file records all the program or script content, all the tag elements in the web page data (that is, all the basic codes, scripts, and program data that display the web page content) can be searched by element name, and the embodiment of the present invention does not make specific limitations.
[0094] It should be noted that in order to accurately replace the tag elements, the webpage system file also carries a preset loop object, that is, a different element name for looping the replacement of the tag elements, so that the replacement is performed at a preset time interval. For example, the tag elements are replaced once every minute, and all the tag elements found are replaced according to the element name configured in the preset loop object, such as tag element 1 is replaced from the original element name a to b. The embodiment of the present invention does not specifically limit this. After all the tag elements in the webpage system file (for example, each tag element is used to mark an accessible hyperlink in the webpage) are replaced, the tag elements are configured according to the preset access event correspondence. Among them, the preset access event correspondence records the configuration relationship between different access events and different tag elements. It can be configured by the user's triggering access request method (single click, double click, slide), device type (tablet, mobile phone, desktop computer, etc.). The embodiment of the present invention does not specifically limit this. Based on the configuration of the target access event trigger, the tag element is queried to determine whether the element content is encrypted and sent to the server for decryption.
[0095] In another embodiment of the present invention, for further definition and explanation, the step of encrypting the element content according to the encryption key obtained from the server to obtain an encrypted object of the element content and sending it to the server includes:
[0096] Determining a timestamp that triggers the target access event, and encrypting the element content according to the timestamp and the encryption key to obtain an obfuscated object;
[0097] Generate the encrypted object including the timestamp and the obfuscated object, and send the encrypted object to the server.
[0098] To meet the security protection requirements for element content, when encrypting element content, the current execution end first determines the timestamp of the user triggering the target access event and encrypts the element content according to the timestamp. When encrypting element content based on the timestamp, the current execution end can obtain an obfuscated object by combining the timestamp with the data content obfuscated according to the timestamp. For example, if the current timestamp is 2023-04-26 18:35:20, the encrypted 1682505320 + 123456 is the obfuscated object. Methods for obfuscating element content based on the timestamp include, but are not limited to, directly inserting the timestamp into the element content, converting the timestamp and element content into other languages and then adding or subtracting them, or performing a fixed operation on the timestamp and element content. This is not limited to the embodiments of the present invention. After obtaining the obfuscated object, the current execution end further encrypts it based on the encryption key, thereby sending the encrypted object to the server end, so that the server end decrypts the obfuscated object and restores it to the original element content to match the target access web page.
[0099] In another embodiment of the present invention, for further definition and explanation, the steps further include:
[0100] Loading the preset access event correspondence from the server; or,
[0101] Receive the device access event correspondence updated by the user;
[0102] In order to flexibly meet the configuration requirements for target access events, in a specific implementation scenario, the current execution end as the client can load based on the preset access event correspondence configured in the server, so as to configure the label element after obtaining the preset access event correspondence from the server. In a specific implementation scenario, the current execution end as the client can also directly configure the label element based on the preset access event correspondence entered and updated by the user in the client, so as to configure the label element after obtaining the preset access event correspondence from the user. Wherein, different target access events corresponding to different label elements are configured in the preset access event correspondence, including but not limited to the label element herf configured with a mouse click event, which is not specifically limited in the embodiment of the present invention.
[0103] An embodiment of the present invention provides a data access method. Compared with the prior art, the embodiment of the present invention queries the tag element that matches the target access event when a user triggers a target access event through the client, and encrypts the element content according to the encryption key obtained from the server to obtain an encrypted object of the element content, and sends it to the server; when the target access web page fed back by the server based on the encrypted object is received, data access is performed based on the target access web page, thereby achieving the purpose of interfering with web page crawling by dynamically changing the tag element, greatly reducing the operational complexity and security protection cost when changing business projects, and improving the effectiveness of network security protection by obfuscating and encrypting the element content, thereby effectively improving the network protection effect and effectively meeting the security requirements of data access.
[0104] The embodiment of the present invention provides another data access method, such as Figure 2 As shown, the method includes:
[0105] 201. Determine the tag elements and element contents in the target visited web page, and configure a preset time interval for cyclic replacement of the tag elements.
[0106] In an embodiment of the present invention, the current execution end is a server end that executes data access, and can provide feedback to the client end by calling the target access web page in the business server to realize reverse proxy. In order to improve the protection against malicious programs crawling user behaviors (such as clicked target access web pages), the current execution end first determines the label elements and element contents in the target access web page. Among them, the label element is used to represent the element that identifies the website address, such as the label element of the href attribute, and the label element is cyclically replaced in the client end according to a preset time interval, and can be bound to the target access event, such as the user's click event, so as to determine the label element that is continuously cyclically replaced in the client end. In addition, since the label element is represented by the element name, for example, the label element of the href attribute, it can be obtained by The element name is used to represent the element content corresponding to the tag element. At this time, if the tag element is an href attribute, the element content is the URL content of the target web page, which is not specifically limited in the embodiment of the present invention.
[0107] It should be noted that the current execution end serves as a processing server when a user requests to access a web page. In order to display the changing effects of the label elements on the client side, thereby avoiding crawling and positioning by malicious programs, the preset time intervals for cyclic replacement of the label elements are pre-configured, including but not limited to 1 minute, 2 minutes, 3 minutes, etc., which are not specifically limited in the embodiment of the present invention.
[0108] 202. Send an encryption key for encrypting different element contents and the preset time interval to the client.
[0109] In an embodiment of the present invention, the current execution end sends the configured preset time interval and the encryption key used to encrypt the content of different elements to the client, so that the current server can decrypt the content according to the matching encryption key and implement cyclic replacement of the tag elements. The cyclic replacement of the tag elements at the client according to the preset time interval refers to replacing all corresponding tag elements in the web page system file on the client one by one at the preset time interval, and after all replacements are completed, the replacement is repeated again in a cyclic manner, thereby improving the security protection of the target visited web page.
[0110] It should be noted that the encryption method corresponding to the encryption key may include but is not limited to algorithms such as AES / SM4 for encryption, and the embodiment of the present invention does not make specific limitations.
[0111] 203. When receiving the encrypted object obtained by encrypting the element content by the client based on the encryption key, decrypt the encrypted object and feed back the target access webpage corresponding to the decrypted object to the client.
[0112] In an embodiment of the present invention, the current execution end encrypts the encrypted element content in the client to obtain an encrypted object. The current execution end, which serves as a processing server, decrypts the encrypted object based on the saved matching encryption key. Based on the decrypted real URL content, the business service end first sends a request to retrieve the target access web page and feeds it back to the client, thereby greatly improving the access security of the URL content corresponding to the target access web page.
[0113] In another embodiment of the present invention, for further definition and explanation, before the step of sending the encryption key for encrypting different element contents and the preset time interval to the client, the method further includes:
[0114] Generate a web page timer and configure a preset time interval for all tag elements in the web page data;
[0115] Updating the preset loop object of the tag element, and writing the webpage timer and the preset loop object into a webpage system file;
[0116] The webpage system file and the preset time interval are sent to the client, so that the client configures the webpage timer based on the preset time interval after loading the webpage system file.
[0117] To achieve dynamic replacement of tag elements and improve security for users accessing web pages, the current execution end, acting as a server, pre-generates a webpage timer and configures preset time intervals for all tag elements in the webpage data. The preset time intervals for each tag element during the cyclic replacement process can be the same or different. For example, the preset time interval for replacing text hyperlink tag elements on a webpage can be 1 minute, while the preset time interval for replacing image hyperlink tag elements on a webpage can be 2 minutes, though this is not specifically limited in this embodiment of the present invention. Furthermore, when configuring the webpage timer, a timer can be set based on the loadload in the script to count according to the preset time interval, though this is not specifically limited in this embodiment of the present invention. Furthermore, to ensure that the client can safely and reliably replace tag elements, the current execution end pre-updates the preset loop object for the tag element, thereby writing the webpage timer and the preset loop object into the webpage system file. This allows the client to use the webpage timer to count and replace the tag element when the preset time interval is reached. The preset loop object can be a different element name used to cyclically replace the tag element, and can be configured based on security considerations, though this is not specifically limited in this embodiment of the present invention. Replacement is performed at the preset time interval.
[0118] It should be noted that, in the embodiment of the present invention, all tag elements in the web page data (ie, all basic codes, scripts, and program data for displaying the web page content) can be searched and determined by constructing a structure tree.
[0119] In another embodiment of the present invention, for further definition and illustration, the step of decrypting the encrypted object includes:
[0120] parsing the timestamp and the obfuscated object in the encrypted object based on the encryption key;
[0121] Decrypting the obfuscated object according to the timestamp to obtain element content;
[0122] The target access web page is retrieved based on the element content and fed back to the client.
[0123] In order to restore the encrypted object and achieve the purpose of interfering with the crawling user behavior, the current execution end decrypts the encrypted object after receiving the encrypted object returned by the client. At this time, since the obfuscated object is encrypted by the encryption key in the client, the encrypted object is first interpreted according to the encryption key to obtain the timestamp and the obfuscated object, and then the obfuscated object is decrypted based on the timestamp to restore it to the original element content. Among them, the current execution end pre-stores a method for obfuscating the element content. Therefore, when decrypting, the obfuscated object is directly reverse-parsed according to the corresponding method for obfuscating the element content based on the timestamp (including but not limited to directly inserting the timestamp into the element content, adding or subtracting the timestamp and the element content after converting them into other languages, performing fixed operations on the timestamp and the element content, etc.), thereby obtaining the element content. The embodiment of the present invention does not make specific limitations.
[0124] It should be noted that the current execution end acts as a proxy server, and when it is restored to element content, it sends a request to the business server based on the URL matched by the element content to retrieve the target visited web page and feed it back to the client. The embodiment of the present invention does not make specific limitations, thereby achieving the purpose of obfuscating and keeping confidential the URL corresponding to the target daily visited web page.
[0125] In another embodiment of the present invention, for further definition and illustration, the method further includes:
[0126] Performing DOM parsing conversion on the web page data, and performing semantic analysis processing on the converted web page data to obtain a structure tree of the web page data;
[0127] Perform tag matching on the response body node to determine all tag elements in the web page data.
[0128] In a specific implementation scenario, in order to accurately determine all the label elements that need to be replaced, the current execution end can be implemented based on the method of constructing a structure tree. Among them, the structure tree includes data corresponding to different response body nodes, that is, different response body nodes correspond to a request body, that is, by triggering a request body, the response body corresponding to this request body can be searched. For example, if request body a is a request to access a map, then response body a is a hyperlink to access the map. At this time, the hyperlink to access the map is the label element of the herf attribute, and the corresponding element content is the specific website content of the hyperlink to access the map. The embodiment of the present invention does not make specific limitations. Therefore, after the current execution end performs DOM parsing conversion and semantic analysis on the web page data, it can obtain multiple response body nodes of a tree structure marked according to different types. At this time, all response body nodes can be matched by label marking or manually to determine all label elements. The embodiment of the present invention does not make specific limitations.
[0129] In another embodiment of the present invention, for further definition and illustration, the method further includes:
[0130] Generate a preset access event correspondence and send it to the client.
[0131] To flexibly meet the configuration requirements for target access events, in a specific implementation scenario, the current execution end, acting as the server, can pre-configure a preset access event correspondence and send it to the client for loading. The preset access event correspondence is configured with different target access events corresponding to different tag elements, so that the client can configure the triggering method of the replaced tag element based on the preset access event correspondence. This is not specifically limited in the embodiments of the present invention.
[0132] An embodiment of the present invention provides another data access method. Compared with the prior art, the embodiment of the present invention determines the tag elements and element contents in the target access web page through the server, and configures a preset time interval for cyclic replacement of the tag elements; sends an encryption key for encrypting different element contents and the preset time interval to the client, so that the client encrypts the element content according to the encryption key; when receiving an encrypted object that the client encrypts the element content based on the encryption key, the encrypted object is decrypted, and the target access web page corresponding to the decrypted object is fed back to the client, thereby achieving the purpose of interfering with web page crawling by dynamically changing tag elements, greatly reducing the tediousness of operations and security protection costs when changing business projects, and improving the effectiveness of network security protection by obfuscating and encrypting the element content, thereby effectively improving the network protection effect and effectively meeting the security requirements of data access.
[0133] Furthermore, as a response to the above Figure 1 The embodiment of the present invention provides a data access device, such as Figure 3 As shown, the device includes:
[0134] A query module 31 is configured to query a tag element that matches a target access event when a user triggers the target access event, wherein the tag element is cyclically replaced at a preset time interval;
[0135] An acquisition module 32 is configured to acquire the element content corresponding to the tag element, encrypt the element content according to the encryption key obtained from the server, obtain an encrypted object of the element content, and send the encrypted object to the server;
[0136] The access module 33 is configured to, upon receiving a target access webpage fed back by the server based on the encrypted object, perform data access based on the target access webpage.
[0137] Furthermore, the device further comprises: an analysis module, a configuration module,
[0138] The parsing module is used to parse the webpage timer in the webpage system file and configure the webpage timer according to the preset time interval;
[0139] The acquisition module is further configured to acquire all tag elements in the web page data when the web page timer reaches a timing node;
[0140] The configuration module is used to replace the label element according to the preset loop object in the web page system file, and configure the target access event for the replaced label element based on the preset access event correspondence, so as to trigger a query on the label element based on the configured target access event.
[0141] Furthermore, the acquisition module is specifically used to determine the timestamp that triggers the target access event, and encrypt the element content according to the timestamp and the encryption key to obtain an obfuscated object; generate the encrypted object containing the timestamp and the obfuscated object, and send the encrypted object to the server.
[0142] Furthermore, the device further comprises:
[0143] A loading module, configured to load a preset access event correspondence from the server; or
[0144] A receiving module, configured to receive the device access event correspondence updated by the user;
[0145] The preset access event correspondence relationship is configured with different target access events corresponding to different tag elements.
[0146] An embodiment of the present invention provides a data access device. Compared with the prior art, the embodiment of the present invention queries the tag element that matches the target access event when a user triggers a target access event through the client, and encrypts the element content according to the encryption key obtained from the server to obtain an encrypted object of the element content, and sends it to the server; when the target access web page fed back by the server based on the encrypted object is received, data access is performed based on the target access web page, thereby achieving the purpose of interfering with web page crawling by dynamically changing the tag element, greatly reducing the tediousness of operations and security protection costs when changing business projects, and improving the effectiveness of network security protection by obfuscating and encrypting the element content, thereby effectively improving the network protection effect and effectively meeting the security requirements of data access.
[0147] Furthermore, as a response to the above Figure 2 In order to realize the method shown in FIG, an embodiment of the present invention provides another data access device, such as Figure 4 As shown, the device includes:
[0148] Configuration module 41, used to determine the tag elements and element contents in the target visited web page, and configure the preset time interval for cyclic replacement of the tag elements;
[0149] A sending module 42 is configured to send an encryption key for encrypting different element contents and the preset time interval to a client, so that the client encrypts the element contents according to the encryption key, and the preset time interval is used to indicate cyclic replacement of the tag elements;
[0150] The feedback module 43 is configured to decrypt the encrypted object obtained by encrypting the element content by the client based on the encryption key upon receiving the encrypted object, and feed back the decrypted corresponding target access web page to the client.
[0151] Furthermore, the device further comprises: a generating module, an updating module,
[0152] The generating module is used to generate a web page timer and configure a preset time interval for all tag elements in the web page data;
[0153] The updating module is used to update the preset loop object of the tag element and write the webpage timer and the preset loop object into the webpage system file;
[0154] The sending module is further configured to send the webpage system file and the preset time interval to the client, so that the client configures the webpage timer based on the preset time interval after loading the webpage system file.
[0155] Furthermore, the feedback module is specifically used to parse the timestamp and obfuscated object in the encrypted object based on the encryption key; decrypt the obfuscated object according to the timestamp to obtain element content; retrieve the target access web page based on the element content and feed it back to the client.
[0156] Furthermore, the device further comprises:
[0157] a processing module for performing DOM parsing conversion on the web page data and performing semantic analysis on the converted web page data to obtain a structure tree of the web page data, wherein the structure tree includes data corresponding to nodes marked with different response bodies;
[0158] The determination module is used to perform tag matching on the response body node to determine all tag elements in the web page data.
[0159] Furthermore, the sending module is specifically used to generate a preset access event correspondence and send it to the client. The preset access event correspondence is configured with different target access events corresponding to different label elements, so that the client configures the triggering method of the replaced label element based on the preset access event correspondence.
[0160] An embodiment of the present invention provides another data access device. Compared with the prior art, the embodiment of the present invention determines the tag elements and element contents in the target access web page through the server, and configures a preset time interval for cyclic replacement of the tag elements; sends an encryption key for encrypting different element contents and the preset time interval to the client, so that the client encrypts the element content according to the encryption key; when receiving an encrypted object encrypted by the client based on the encryption key for the element content, the encrypted object is decrypted, and the corresponding target access web page after decryption is fed back to the client, thereby achieving the purpose of interfering with web page crawling by dynamically changing tag elements, greatly reducing the tediousness of operations and security protection costs when changing business projects, and improving the effectiveness of network security protection by obfuscating and encrypting the element content, thereby effectively improving the network protection effect and effectively meeting the security requirements of data access.
[0161] According to one embodiment of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, and the computer executable instruction can execute the data access method in any of the above method embodiments.
[0162] Figure 5 A schematic diagram of the structure of a client provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the terminal.
[0163] like Figure 5 As shown, the terminal may include: a processor (processor) 502 , a communications interface (Communications Interface) 504 , a memory (memory) 506 , and a communication bus 508 .
[0164] The processor 502 , the communication interface 504 , and the memory 506 communicate with each other via a communication bus 508 .
[0165] The communication interface 504 is used to communicate with other devices such as a server or other server network elements.
[0166] The processor 502 is configured to execute the program 510 , and specifically may execute the relevant steps in the above data access method embodiment.
[0167] Specifically, the program 510 may include program codes, which include computer operation instructions.
[0168] Processor 502 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the terminal may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.
[0169] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0170] The program 510 may be specifically configured to enable the processor 502 to perform the following operations:
[0171] When it is detected that a user triggers a target access event, querying for a tag element that matches the target access event, wherein the tag element is cyclically replaced at a preset time interval;
[0172] Obtaining the element content corresponding to the tag element, and encrypting the element content according to the encryption key obtained from the server to obtain an encrypted object of the element content, and sending the encrypted object to the server;
[0173] When the target access webpage fed back by the server based on the encrypted object is received, data access is performed based on the target access webpage.
[0174] According to one embodiment of the present invention, another storage medium is provided, wherein the storage medium stores at least one executable instruction, and the computer executable instruction can execute the data access method in any of the above method embodiments.
[0175] Figure 6 A schematic diagram of the structure of a server provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the terminal.
[0176] like Figure 6 As shown, the terminal may include: a processor (processor) 602 , a communications interface (Communications Interface) 604 , a memory (memory) 606 , and a communication bus 608 .
[0177] The processor 602 , the communication interface 604 , and the memory 606 communicate with each other via a communication bus 608 .
[0178] The communication interface 604 is used to communicate with other devices such as clients or other servers.
[0179] The processor 602 is configured to execute the program 610 , and specifically may execute the relevant steps in the above data access method embodiment.
[0180] Specifically, the program 610 may include program codes, which include computer operation instructions.
[0181] Processor 602 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the terminal may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.
[0182] The memory 606 is used to store the program 610. The memory 606 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0183] The program 610 may be specifically configured to enable the processor 602 to perform the following operations:
[0184] Determine the tag elements and element contents in the target visited web page, and configure a preset time interval for cyclic replacement of the tag elements;
[0185] Sending an encryption key for encrypting different element contents and the preset time interval to the client, so that the client encrypts the element contents according to the encryption key, and the preset time interval is used to indicate cyclic replacement of the tag elements;
[0186] When receiving the encrypted object obtained by encrypting the element content by the client based on the encryption key, the encrypted object is decrypted, and the target access webpage corresponding to the decrypted object is fed back to the client.
[0187] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, centralized on a single computing device, or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0188] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A data access method, characterized in that: include: When it is detected that a user triggers a target access event, querying for a tag element that matches the target access event, wherein the tag element is cyclically replaced at a preset time interval; Obtaining the element content corresponding to the tag element, and encrypting the element content according to the encryption key obtained from the server to obtain an encrypted object of the element content, and sending the encrypted object to the server; When receiving a target access webpage fed back by the server based on the encrypted object, accessing data based on the target access webpage; Before searching for a tag element matching the target access event, the method further includes: Parsing the webpage timer in the webpage system file and configuring the webpage timer according to the preset time interval; When the webpage timer reaches a timing node, all tag elements in the webpage data are obtained; The tag element is replaced according to the preset loop object in the web page system file, and the target access event is configured for the replaced tag element based on the preset access event correspondence, so as to trigger a query on the tag element based on the configured target access event.
2. The method according to claim 1, characterized in that The step of encrypting the element content according to the encryption key obtained from the server to obtain an encrypted object of the element content and sending the encrypted object to the server includes: Determining a timestamp that triggers the target access event, and encrypting the element content according to the timestamp and the encryption key to obtain an obfuscated object; Generate the encrypted object including the timestamp and the obfuscated object, and send the encrypted object to the server.
3. The method according to claim 1, characterized in that The method further comprises: Loading the preset access event correspondence from the server; or, Receive the device access event correspondence updated by the user; The preset access event correspondence relationship is configured with different target access events corresponding to different tag elements.
4. A data access method, characterized in that: include: Determine the tag elements and element contents in the target visited web page, and configure a preset time interval for cyclic replacement of the tag elements; Sending an encryption key for encrypting different element contents and the preset time interval to the client, so that the client encrypts the element contents according to the encryption key, and the preset time interval is used to indicate cyclic replacement of the tag elements; When receiving the encrypted object encrypted by the client using the encryption key to encrypt the element content, decrypting the encrypted object and feeding back the decrypted target access webpage to the client; Before sending the encryption key for encrypting different element contents and the preset time interval to the client, the method further includes: Generate a web page timer and configure a preset time interval for all tag elements in the web page data; Updating the preset loop object of the tag element, and writing the webpage timer and the preset loop object into a webpage system file; The webpage system file and the preset time interval are sent to the client, so that the client configures the webpage timer based on the preset time interval after loading the webpage system file.
5. The method according to claim 4, characterized in that Decrypting the encrypted object comprises: parsing the timestamp and the obfuscated object in the encrypted object based on the encryption key; Decrypting the obfuscated object according to the timestamp to obtain element content; The target access web page is retrieved based on the element content and fed back to the client.
6. The method according to claim 5, characterized in that The method further comprises: Performing DOM parsing conversion on the web page data, and performing semantic analysis processing on the converted web page data to obtain a structure tree of the web page data, wherein the structure tree includes data corresponding to nodes marked with different response bodies; Perform tag matching on the response body node to determine all tag elements in the web page data.
7. The method according to claim 4, characterized in that The method further comprises: Generate a preset access event correspondence and send it to the client. The preset access event correspondence is configured with different target access events corresponding to different label elements, so that the client configures the triggering method of the replaced label element based on the preset access event correspondence.
8. A data access device, characterized in that: include: A query module, configured to query a tag element that matches a target access event when a user triggers the target access event, wherein the tag element is cyclically replaced at a preset time interval; an acquisition module, configured to acquire the element content corresponding to the tag element, encrypt the element content according to the encryption key acquired from the server, obtain an encrypted object of the element content, and send the encrypted object to the server; An access module, configured to, upon receiving a target access webpage fed back by the server based on the encrypted object, access data based on the target access webpage; The device further comprises: an analysis module, a configuration module, The parsing module is used to parse the webpage timer in the webpage system file and configure the webpage timer according to the preset time interval; The acquisition module is further configured to acquire all tag elements in the web page data when the web page timer reaches a timing node; The configuration module is used to replace the label element according to the preset loop object in the web page system file, and configure the target access event for the replaced label element based on the preset access event correspondence, so as to trigger a query on the label element based on the configured target access event.
9. A data access device, characterized in that: include: A configuration module, configured to determine the tag elements and element contents in the target visited web page, and configure a preset time interval for cyclic replacement of the tag elements; a sending module, configured to send an encryption key for encrypting different element contents and the preset time interval to a client, so that the client encrypts the element contents according to the encryption key, wherein the preset time interval is used to indicate cyclic replacement of the tag elements; a feedback module configured to, upon receiving an encrypted object encrypted by the client using the encryption key to encrypt the element content, decrypt the encrypted object and feed back the decrypted target access webpage to the client; The device further comprises: a generating module, an updating module, The generating module is used to generate a web page timer and configure a preset time interval for all tag elements in the web page data; The updating module is used to update the preset loop object of the tag element and write the webpage timer and the preset loop object into the webpage system file; The sending module is further configured to send the webpage system file and the preset time interval to the client, so that the client configures the webpage timer based on the preset time interval after loading the webpage system file.
10. A storage medium storing at least one executable instruction, wherein the executable instruction enables a processor to execute an operation corresponding to the data access method according to any one of claims 1 to 3.
11. A client, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the data access method according to any one of claims 1 to 3.
12. A storage medium storing at least one executable instruction, wherein the executable instruction enables a processor to execute an operation corresponding to the data access method according to any one of claims 4 to 7.
13. A server comprising: A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the data access method according to any one of claims 4 to 7.
Citation Information
Patent Citations
System and method for realizing URL dynamic transformation
CN110808955A