CN117150484B - Page information processing method, device and equipment - Google Patents

Page information processing method, device and equipment Download PDF

Info

Publication number
CN117150484B
CN117150484B CN202311416625.1A CN202311416625A CN117150484B CN 117150484 B CN117150484 B CN 117150484B CN 202311416625 A CN202311416625 A CN 202311416625A CN 117150484 B CN117150484 B CN 117150484B
Authority
CN
China
Prior art keywords
target
information
accessed
response information
user information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311416625.1A
Other languages
Chinese (zh)
Other versions
CN117150484A (en
Inventor
侯家林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xinzhihuitong Technologies Beijing Co ltd
Original Assignee
Xinzhihuitong Technologies Beijing 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 Xinzhihuitong Technologies Beijing Co ltd filed Critical Xinzhihuitong Technologies Beijing Co ltd
Priority to CN202311416625.1A priority Critical patent/CN117150484B/en
Publication of CN117150484A publication Critical patent/CN117150484A/en
Application granted granted Critical
Publication of CN117150484B publication Critical patent/CN117150484B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/554Detecting local intrusion or implementing counter-measures involving event detection and direct action
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a method, a device and equipment for processing page information, wherein the method comprises the following steps: calling a preset interceptor to intercept response information sent by the target server; analyzing and processing the response information, and implanting a preset modification strategy analysis library into the response information in the target format to obtain analyzed response information; determining target user information of a current login client according to the analyzed response information and a user information script pre-stored in a preset modification strategy server; according to the target user information, a preset modification strategy analysis library is called to acquire a target modification strategy corresponding to the target user information from a preset modification strategy server; and modifying the data information of the target webpage to be accessed in the analyzed response information according to the target modification strategy to obtain the modified data information of the target webpage to be accessed. The scheme provided by the invention can reduce the processing cost and complexity of the page data information of the webpage.

Description

Page information processing method, device and equipment
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method, an apparatus, and a device for processing page information.
Background
With the rapid development of information technologies such as cloud computing, big data and artificial intelligence, and the comprehensive popularization of system platforms such as e-government internal networks, mobile interconnection and collaborative office, an on-line office system becomes a main tool for realizing collection and processing, flowing and sharing of office information between departments at all levels and between the inside and the outside of enterprises and institutions and realizing scientific decisions. Typical office automation applications include, for example, receipts and publications approval management, document transfer, information collection and distribution, internal invitation report management, archive management, conference management, campaign management, policy and regulation library, internal forum, and the like. The office staff in the enterprise can work on the internet only through the browser, so that the running of staff to work and leave is reduced, the office efficiency is improved, and the office place can be saved for the enterprise.
With the increase of the variety of online office systems, many new demands are made on web page data content acquisition. For example, special font display at the server end is needed for specific webpage data, and the font URL address in the HTML page data needs to be modified at the moment to realize the display; in order to protect sensitive data content, the watermark warning information such as user name, work number, time and the like is required to be displayed on a browser page of a login user terminal in real time; according to the actual demands of users, additional information such as two-dimensional codes, picture Logo and the like are required to be inserted into the user browsing page, or part of page contents are required to be dynamically modified. The functions can be realized by custom development with a business system, and data exchange and information sharing between an online system and a third party service are performed by utilizing a special network service interface. However, this method requires additional custom development effort, and especially for large-scale units, a collaborative office platform is generally built, and a plurality of online business office systems are integrated on the collaborative office platform by a single sign-on method. If one-to-one custom development is performed with different service systems of different manufacturers, the workload is extremely large, and the user units are generally unacceptable.
Disclosure of Invention
The invention aims to solve the technical problems of complex page information modification process, large quantity of custom development tasks and high deployment and implementation cost of a webpage in the prior art by providing a processing method, a device and equipment for page information.
In order to solve the technical problems, the technical scheme of the invention is as follows:
a processing method of page information comprises the following steps:
calling a preset interceptor to intercept response information sent by a target server, wherein the response information is fed back by the target server after receiving a request message sent by a client;
analyzing the response information, and implanting a preset modification strategy analysis library into the response information in a target format to obtain analyzed response information;
determining target user information of the current login client according to the analyzed response information and a user information script pre-stored in a preset modification strategy server;
according to the target user information, calling the preset modification strategy analysis library to acquire a target modification strategy corresponding to the target user information from the preset modification strategy server;
and modifying the data information of the target webpage to be accessed in the analyzed response information according to the target modification strategy to obtain the modified data information of the target webpage to be accessed.
Optionally, analyzing the response information, implanting a preset modification strategy analysis library into the response information in the target format to obtain analyzed response information, including:
calling the preset interceptor to analyze and process the response information, and determining the response information of a target format in the response information;
and implanting the preset modification strategy analysis library into the response information in the target format to obtain the analyzed response information.
Optionally, determining, according to the analyzed response information and a user information script pre-stored in a preset modification policy server, the target user information of the current login to the client includes:
generating a user information analysis request according to the analyzed response information;
receiving a target user information script corresponding to the target webpage to be accessed, which is fed back by the preset modification strategy server, wherein the target user information script is obtained from a pre-stored user information script according to the identification information of the target webpage to be accessed in the user information analysis request after the user information analysis request sent by the client is received by the preset modification strategy server;
And calling the preset modification strategy analysis library to execute the target user information script to obtain the target user information.
Optionally, generating a user information analysis request according to the analyzed response information includes:
determining identification information of a target webpage to be accessed in the response information according to the analyzed response information;
and generating a user information analysis request according to the identification information of the target webpage to be accessed.
Optionally, modifying the data information of the target webpage to be accessed in the analyzed response information according to the target modification policy to obtain modified data information of the target webpage to be accessed, including:
obtaining a document object model tree of the target webpage to be accessed according to the data information of the target webpage to be accessed;
calling the preset modification strategy analysis library to analyze the target modification strategy to obtain modification content;
traversing all nodes in the document object model tree according to the modification content, and determining a target node corresponding to the modification content in the document object model tree;
and adding the modification content to the attribute information of the target node to obtain the modified data information of the target webpage to be accessed.
Optionally, according to the data information of the target webpage to be accessed, a document object model tree of the target webpage to be accessed is obtained, including:
analyzing the data information of the target webpage to be accessed to obtain an element set of the data information of the target webpage to be accessed;
determining father nodes and child nodes in a document object model tree of the target webpage to be accessed according to the relation of elements in the element set, wherein the father nodes and the child nodes are in one-to-one correspondence with the elements in the element set, and each node corresponds to at least one type of style file;
and acquiring the document object model tree according to the father node and the child node.
Optionally, traversing all nodes in the document object model tree according to the modification content, and determining a target node corresponding to the modification content in the document object model tree, including:
traversing in the document object model tree according to the attribute information corresponding to the modification content, and determining a first node set;
and determining a target node in the first node set according to the type of the modified content and the type of each first node in the first node set.
A processing apparatus of page information, comprising:
the acquisition module is used for calling a preset interceptor to intercept response information sent by a target server, wherein the response information is fed back by the target server after receiving a request message sent by a client;
the processing module is used for analyzing and processing the response information, and implanting a preset modification strategy analysis library into the response information in the target format to obtain analyzed response information; determining target user information of the current login client according to the analyzed response information and a user information script pre-stored in a preset modification strategy server; according to the target user information, calling the preset modification strategy analysis library to acquire a target modification strategy corresponding to the target user information from the preset modification strategy server; and modifying the data information of the target webpage to be accessed in the analyzed response information according to the target modification strategy to obtain the modified data information of the target webpage to be accessed.
A communication device, comprising: a processor, a memory storing a computer program which, when executed by the processor, performs the method as described above.
A computer readable storage medium storing instructions that when executed on a computer cause the computer to perform a method as described above.
The scheme of the invention at least comprises the following beneficial effects:
intercepting response information sent by a target server by calling a preset interceptor; analyzing and processing the response information, and implanting a preset modification strategy analysis library into the response information in the target format to obtain analyzed response information; determining target user information of a current login client according to the analyzed response information and a user information script pre-stored in a preset modification strategy server; according to the target user information, a preset modification strategy analysis library is called to acquire a target modification strategy corresponding to the target user information from a preset modification strategy server; and modifying the data information of the target webpage to be accessed in the analyzed response information according to the target modification strategy to obtain the modified data information of the target webpage to be accessed, so that the processing cost and complexity of the page data information of the webpage are reduced, and the safety of the page information of the webpage is improved.
Drawings
FIG. 1 is a flow chart of a method for processing page information according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a process for request and response interaction between a client and a server according to an alternative embodiment of the present invention;
fig. 3 is a block diagram of a processing apparatus for page information according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, an embodiment of the present invention provides a method for processing page information, including:
step 11, calling a preset interceptor to intercept response information sent by a target server, wherein the response information is fed back by the target server after receiving a request message sent by a client;
step 12, analyzing and processing the response information, and implanting a preset modification strategy analysis library into the response information in a target format to obtain analyzed response information;
Step 13, determining the target user information of the current login client according to the analyzed response information and a user information script pre-stored in a preset modification strategy server;
step 14, according to the target user information, calling the preset modification strategy analysis library to acquire a target modification strategy corresponding to the target user information from the preset modification strategy server;
step 15, modifying the data information of the target webpage to be accessed in the analyzed response information according to the target modification strategy to obtain the modified data information of the target webpage to be accessed
In this embodiment, the response information is a processing result that the target server receives a request message sent by a client, implements corresponding service processing logic according to a request content in the request message, and returns the processing result; the response information comprises related data information of the target webpage to be accessed, such as names, identification information, content to be accessed and the like; the request message may be an HTTP request, where the request message includes a destination address of the destination server; here, the client may be a preset browser, and the server may be a corresponding Web application; the response information comprises response information in multiple formats, and the response information in one target format corresponds to one preset modification strategy analysis library;
It should be noted that, when the user logs in and passes through the client and accesses the corresponding target server, the storage and the display modes of the user information corresponding to different target servers are different in the client, for example: session, cookie and web page internal elements can both store user information; the storage mode of the target user information, the corresponding analysis scheme and the corresponding target server can be preconfigured in the preset modification strategy server; when a user accesses a corresponding target server through a client, the response information fed back by the target server carries the identification information of the current user, and the identification information of the current user corresponds to the identification information of the target webpage to be accessed currently one by one;
after the client receives the response information, determining a storage mode and a corresponding analysis scheme of target user information corresponding to a target server according to corresponding information of the target server in the response information, and analyzing and obtaining the target user information according to the analysis scheme; it should be noted that each piece of determined target user information corresponds to information of a target web page to be accessed;
Further, the preset modification strategy analysis library is called to determine a preset target modification strategy corresponding to the target user information in the preset modification strategy server so as to facilitate modification of the target webpage to be accessed subsequently and ensure the safety of the data information of the target webpage to be accessed;
here, the preset modification policy analysis library may be implemented through a preset web page programming language, where the preset web page programming language may be JavaScript, and when a client (such as a browser) is used to load a web page, a mechanism capable of automatically executing JavaScript may be used, that is, the preset modification policy analysis library may automatically run when the web page is loaded; when the target server feeds back the application information to the client, the application information can be intercepted by the preset interceptor, the preset modification strategy analysis library is implanted in the application information in a target format in the application information, response information is obtained, and the response information is fed back to the client; here, the preset modification policy parsing library may be regarded as a calling engine, and all the webpage content protection mechanisms are scheduled and implemented by the preset modification policy parsing library;
The target modification strategy is a method for strengthening and protecting the page content of the webpage, is configured in the preset modification strategy server according to user information and server related information of the Web application to be accessed corresponding to the user, and is further loaded to a client for execution so as to modify the page of the target webpage to be accessed;
the preset modification policy server is preset with all possible webpage content protection modification policies of the webpage, including but not limited to a content copy protection modification policy, a webpage plaintext watermark modification policy, a webpage color block watermark modification policy, a webpage lattice watermark modification policy, a webpage text steganography watermark modification policy and the like; each modification strategy corresponds to a server of a Web application; the preset modification strategy server provides management functions of modification strategy configuration, issuing and the like, and can be adjusted and managed quickly and conveniently; here, the preset modification policy server exists independently, so that content modification protection requirements of a plurality of servers can be supported simultaneously; meanwhile, a specific modification strategy can be quickly started and stopped for a specific one or a plurality of servers, so that the method is very flexible; preferably, the preset modification strategy server can also provide a detailed audit log to record the use condition of modification strategies when each user accesses various servers through the client, so that detailed statistics and abnormal conditions, trend result reports and the like of the webpage content protection condition can be conveniently obtained in various business application scenes of the whole enterprise;
Further, modifying the data information of the target webpage to be accessed according to the target modification strategy, and combining the target modification strategy with the data information of the current target webpage to be accessed to obtain modified data information of the target webpage to be accessed; the data information of the target webpage to be accessed is obtained after the response information of at least one target format in the response information is analyzed by the preset modification strategy analysis library; furthermore, the client loads the modified data information of the target webpage to be accessed, finishes rendering of the target webpage to be accessed, and presents the final result, and the webpage content presented at the moment is reinforced by the decoration strategy, so that the safety of the webpage data information of the webpage is further ensured.
In an alternative embodiment of the present invention, the step 12 may include:
step 121, calling the preset interceptor to analyze and process the response information, and determining the response information of a target format in the response information;
and step 122, implanting the preset modification strategy analysis library into the response information in the target format to obtain the analyzed response information.
In this embodiment, as shown in fig. 2, in the process of performing request and response interaction between the client and the server, a preset interceptor may be invoked to intercept and analyze the request message, obtain a target address in the request message, and further forward the request message to the target server according to the target address; here, the preset interceptor may be implemented based on a proxy server technology;
further, when the server feeds back the response information, the preset interceptor also intercepts the response information and performs analysis processing to obtain analyzed response information, and forwards response information in a target format in the analyzed response information to the client, so that the client calls the preset modification strategy analysis library according to the response information in the target format to obtain a target modification strategy from the preset modification strategy server;
here, the response information may include: a response row, a response header, and a response body; wherein:
the Response line (Response line) is generally composed of protocol version, status code and its description, for example: "HTTP/1.1 200 OK", where HTTP/1.1 represents a version of the server HTTP protocol, 200 represents a response status code sent back by the server, OK represents a textual description of the status code;
The Response header (Response Headers) is used for describing basic information of the server and description of data, and the server can inform the client how to process the data returned by the server after a while through the description information of the data; common response header fields have the following meanings:
Content-Encoding represents the type of Encoding used by the response resource; content-type indicates the format of the current response information; date represents the Date of the response; server means a Web Server used; transfer-Encoding means block Transfer Encoding, which is a data Transfer mechanism in HTTP;
preferably, the format of the response information includes, but is not limited to: 1. text/HTML, HTML format; 2. text/plain, plain text format; 3. application/json, json format; 4. text/XML, XML format; 5. image/gif, gif picture format; 6. image/jpeg, jpg picture format; 7. image/png, png picture format; 8. application/pdf, pdf format; 9. application/msword, word document format; 10. application/octet-stream, binary stream data (such as a common file download); here, the response information of the target format in the response information can be determined according to the requirement in actual processing, further, a preset modification strategy analysis library corresponding to the response information of the target format is determined according to the response information of the target format, and the preset modification strategy analysis library is implanted in the response information of the target format so as to facilitate the acquisition and analysis of the target modification strategy subsequently;
The Response Body (Response Body) is a part of data used for transmitting the server Response to the client in the HTTP protocol, and is a core component in the HTTP Response, and includes actual Response content returned by the server.
In an optional embodiment of the present invention, the step 13 may include:
step 131, generating a user information analysis request according to the analyzed response information;
step 132, receiving a target user information script corresponding to the target webpage to be accessed, which is fed back by the preset modification policy server, wherein the target user information script is obtained from a pre-stored user information script according to the identification information of the target webpage to be accessed in the user information analysis request after the preset modification policy server receives the user information analysis request sent by the client;
and step 133, calling the preset modification strategy analysis library to execute the target user information script to obtain the target user information.
In this embodiment, after the client receives the analyzed response information, the root generates a user information analysis request according to the analyzed response information, and sends the user information analysis request to the preset modification policy server; after receiving the user analysis request, the preset modification strategy server acquires a target user information script from a pre-stored user information script and sends the target user information script to the client;
The user information script is a section of preset character string, the client calls the preset modification strategy analysis library to execute the target user information script (the preset character string is converted into a JS function to be executed), and corresponding target user information is obtained after execution is completed, so that a target strategy corresponding to the target user information is obtained according to the target user information, the accuracy of modification of a target webpage to be accessed is ensured, and the safety of data information of the target webpage to be accessed is further ensured.
Further, the step 131 may include:
step 1311, determining identification information of a target webpage to be accessed in the response information according to the analyzed response information;
step 1312, generating a user information analysis request according to the identification information of the target webpage to be accessed.
In the embodiment, the preset modification strategy analysis library is called to analyze the response information, and the response information in a target format is selected and determined according to the requirement of actual modification; the response information of the target format can be text/HTML, and a file of an HTML format; when a user accesses the server through the client, the corresponding file in the HTML format keeps the identification information of the user;
Further, according to the identification information of the user in the response information of the target format, a user information analysis request can be generated, and the target user information is obtained through analysis of subsequent user information, so that accuracy of obtaining the target modification strategy is guaranteed.
The obtained target user information script is created in a preset modification strategy server in advance; because the ways of each application server obtaining the user information are different, a set of user information script corresponding to each application server needs to be maintained in the preset modification strategy server. When creating the user information script, it is necessary to analyze how to acquire the user information in the preset modification policy server, and besides the method described above, the method may further include: calling a user information interface mode of a preset modification strategy server; or the local database of the localStorage locally cached at the client is obtained;
the method for calling the user information interface mode of the preset modification strategy server specifically comprises the following steps: checking all interface request lists of the preset modification strategy server, finding out whether interfaces for acquiring user information exist or not, and if so, acquiring target user information in a user information script by using the same request mode as the preset modification strategy server; the method comprises the steps of obtaining from a localStorage local database of a client local cache, wherein the localStorage local database comprises the following specific steps: checking whether a preset modification strategy server stores user information in a local cache of a client, wherein the user information is generally in localStorage, sessionStorage or Cookies; if present, the cached data structure is analyzed and useful user information may be extracted.
In an optional embodiment of the present invention, the step 15 may include:
step 151, obtaining a document object model tree of the target webpage to be accessed according to the data information of the target webpage to be accessed;
step 152, calling the preset modification strategy analysis library to analyze the target modification strategy to obtain modification content;
step 153, traversing all nodes in the document object model tree according to the modification content, and determining a target node corresponding to the modification content in the document object model tree;
and 154, adding the modified content to the attribute information of the target node to obtain the modified data information of the target webpage to be accessed.
In the embodiment, the preset modification strategy analysis library is called to analyze the target modification strategy to obtain modification content; combining the modification content with the data information of the current target webpage to be accessed so as to realize modification of the data information of the target webpage to be accessed by the target modification strategy; here, the data information of the target webpage to be accessed may be regarded as response information in a target format obtained after the response information is parsed; preferably, the data information of the target webpage to be accessed may be an HTML format file, which represents a complete webpage;
Further, determining a document object model tree DOM of the webpage to be accessed according to the file in the HTML format, wherein the document object model tree DOM is a tree structure representation of the file in the HTML format, and node relations of all elements in the file in the HTML format are stored in corresponding tree structures; in the document object model tree DOM, elements, attributes, texts and the like corresponding to each node can be used as operation objects of the node to provide interfaces for modifying and decorating webpage contents;
analyzing the modification content obtained by the target modification strategy according to the preset modification strategy analysis library, traversing all nodes of the document object model tree DOM, and determining a target node matched with the modification content;
further, the modification content is added to the attribute information corresponding to the target node to obtain a document object model tree DOM to which the modification content is added, and further, modified data information of the target webpage to be accessed is obtained, so that the security of the data information of the target webpage to be accessed is ensured.
In an optional embodiment of the present invention, the step 151 may include:
step 1511, analyzing the data information of the target webpage to be accessed to obtain an element set of the data information of the target webpage to be accessed;
Step 1512, determining father nodes and child nodes in a document object model tree of the target webpage to be accessed according to the relation of elements in the element set, wherein the father nodes and the child nodes are in one-to-one correspondence with the elements in the element set, and each node corresponds to at least one type of style file;
and step 1513, obtaining the document object model tree according to the father node and the child node.
In this embodiment, the preset modification policy parsing library is called to parse the HTM format file corresponding to the data information of the target webpage to be accessed according to the sequence, and parse the code corresponding to the HTML format file into a series of marked elements, such as the start and end tags of < HTML >, </HTML >, and the like, to form a marked element set;
preferably, in the process of code analysis, if the external css cascading style sheet file and the text file containing js code are analyzed, the client initiates a request for downloading resources to the server, if the css cascading style sheet file is downloaded, the file in the subsequent HTML format is continuously analyzed while downloading to construct a document object model tree DOM, if the text file of js code is downloaded, when the text file of js code is downloaded and the file is executed, the analysis of the file in the HTML format is stopped, and the analysis process is ended;
Taking each marked element in the element set as a node in the document object model tree DOM, determining a father node and a child node according to the nesting relationship among the marked elements, and forming a father-child relationship linked list among the nodes; further, generating the document object model tree DOM according to the father-son relation linked list and the code structure corresponding to the file in the HTML format, and setting attribute information corresponding to each node on a corresponding node in the document object model tree DOM so as to facilitate the subsequent addition of modified content;
the document object model tree DOM can be automatically constructed and generated when the HTML format file is analyzed by the preset modification strategy analysis library, dynamic operation of the HTML format file can be realized based on the document object model tree DOM, namely, corresponding modification content is added to nodes in the document object model tree DOM, modification and enhancement of the content in the HTML format file corresponding to the document object model tree DOM can be realized, and on the premise of not changing the original webpage structure, only the HTML format file in the returned response information is modified and enhanced, so that the effect of dynamically modifying and protecting the webpage page data information of the webpage can be achieved, and the complexity and cost of modifying and adjusting the webpage page data information of the webpage are reduced.
In an alternative embodiment of the present invention, the step 153 may include:
step 1531, traversing in the document object model tree according to the attribute information corresponding to the modified content, and determining a first node set;
step 1532, determining a target node in the first node set according to the type of the modified content and the type of each first node in the first node set.
In this embodiment, attribute information of each first node in the first node set is the same as or similar to attribute information of the modification content, and screening is performed among all nodes in the document object model tree DOM according to the attribute information of the modification content to obtain the first node set;
further, screening the first nodes in the first node set according to the type of the modification content, and obtaining a target node with the same type as the modification content, and further adding the modification content on the target node to modify page data information of a corresponding webpage;
furthermore, the client loads the data information of the target webpage to be accessed corresponding to the document object model tree DOM added with the decoration content, continues to finish rendering of the target webpage to be accessed, and presents the final rendering result, and the webpage content presented at the moment is reinforced by the target decoration strategy, so that the safety of the webpage data information of the webpage is enhanced.
The following will take the target modification policy as an example of a steganography modification policy of a web page text, and describe the above embodiment, and the specific steps are as follows:
step 21, receiving a steganography modification strategy returned by a preset modification strategy server, wherein the steganography modification strategy comprises a steganography library bound with a current user, and the steganography library comprises unique information of the current user;
step 22, calling the preset modification strategy analysis library to analyze the received hidden word library in the obtained hidden word modification strategy, creating a custom hidden word at the client, and adding the custom hidden word into a word list in a document object model tree DOM;
step 23, traversing all css cascading style sheet files in the DOM of the document object model tree, and searching elements corresponding to the nodes, wherein the elements comprise font-family font attributes;
and step 24, after the font-family font attribute is acquired, reading the default preferred font type information, and judging whether the font type is the watermark font type. If yes, inserting a corresponding watermark font name into the head of the attribute information; this alternative may still correctly display page text style information when the client lacks the watermark font, for example, 'Microsoft YaHei', simSun, simHei, 'STHeiti Light,' STHeiti, 'Lucida Grande,' Tahoma, arial, helvetica, sans-service may be replaced by:
font-family: 'WM_FontName', 'Microsoft YaHei', SimSun,SimHei, "STHeiti Light",STHeiti, "Lucida Grande", Tahoma,Arial, Helvetica, sans-serif;
Step 25, the client calculates the specific position information (size and position) of each rendering object in the visible area, draws the calculated information of each pixel point on the screen, and displays the page on the client window;
it should be noted that other target modification strategies are similar in mode, modification processing is performed around the document object model tree DOM of the HTML format file in the response information fed back by the server through analyzing the Web page structure, and the modified content and the content returned by the original Web application are combined and presented together, so that the purpose of protecting the Web page content is achieved; meanwhile, the target modification strategy is implanted into the document object model tree DOM in an external mode, the association and the butt joint with the Web application corresponding to the original server are avoided, modification and reinforcement are only carried out on the file content in the HTML format in response information fed back by the returned server, secondary development is not needed for the existing Web application, the effect of dynamically modifying and protecting the webpage content data can be achieved, the overall applicability is good, the flexibility is high, and the deployment implementation cost is low.
As shown in fig. 3, an embodiment of the present invention further provides a processing apparatus 30 for page information, including:
The obtaining module 31 is configured to invoke a preset interceptor to intercept response information sent by a target server, where the response information is fed back by the target server after receiving a request message sent by a client;
the processing module 32 is configured to analyze the response information, and implant a preset modification strategy analysis library into the response information in the target format to obtain analyzed response information; determining target user information of the current login client according to the analyzed response information and a user information script pre-stored in a preset modification strategy server; according to the target user information, calling the preset modification strategy analysis library to acquire a target modification strategy corresponding to the target user information from the preset modification strategy server; and modifying the data information of the target webpage to be accessed in the analyzed response information according to the target modification strategy to obtain the modified data information of the target webpage to be accessed.
Optionally, the processing module 32 analyzes the response information, implants a preset modification strategy analysis library into the response information in the target format, and obtains the analyzed response information, which is specifically used for:
Calling the preset interceptor to analyze and process the response information, and determining the response information of a target format in the response information;
and implanting the preset modification strategy analysis library into the response information in the target format to obtain the analyzed response information.
Optionally, the processing module 32 determines, according to the analyzed response information and a user information script pre-stored in a preset modification policy server, target user information of the client currently logged in, and is specifically configured to:
generating a user information analysis request according to the analyzed response information;
receiving a target user information script corresponding to the target webpage to be accessed, which is fed back by the preset modification strategy server, wherein the target user information script is obtained from a pre-stored user information script according to the identification information of the target webpage to be accessed in the user information analysis request after the user information analysis request sent by the client is received by the preset modification strategy server;
and calling the preset modification strategy analysis library to execute the target user information script to obtain the target user information.
Optionally, the processing module 32 generates a user information analysis request according to the analyzed response information, which is specifically configured to:
Determining identification information of a target webpage to be accessed in the response information according to the analyzed response information;
and generating a user information analysis request according to the identification information of the target webpage to be accessed.
Optionally, the processing module 32 performs modification processing on the data information of the target webpage to be accessed in the analyzed response information according to the target modification policy, so as to obtain modified data information of the target webpage to be accessed, which is specifically configured to:
obtaining a document object model tree of the target webpage to be accessed according to the data information of the target webpage to be accessed;
calling the preset modification strategy analysis library to analyze the target modification strategy to obtain modification content;
traversing all nodes in the document object model tree according to the modification content, and determining a target node corresponding to the modification content in the document object model tree;
and adding the modification content to the attribute information of the target node to obtain the modified data information of the target webpage to be accessed.
Optionally, the processing module 32 obtains a document object model tree of the target webpage to be accessed according to the data information of the target webpage to be accessed, which is specifically configured to:
Analyzing the data information of the target webpage to be accessed to obtain an element set of the data information of the target webpage to be accessed;
determining father nodes and child nodes in a document object model tree of the target webpage to be accessed according to the relation of elements in the element set, wherein the father nodes and the child nodes are in one-to-one correspondence with the elements in the element set, and each node corresponds to at least one type of style file;
and acquiring the document object model tree according to the father node and the child node.
Optionally, the processing module 32 traverses all nodes in the document object model tree according to the modification content, and determines a target node corresponding to the modification content in the document object model tree, which is specifically configured to:
traversing in the document object model tree according to the attribute information corresponding to the modification content, and determining a first node set;
and determining a target node in the first node set according to the type of the modified content and the type of each first node in the first node set.
It should be noted that, the device is a device corresponding to the processing method of the page information, and all implementation manners in the above method embodiments are applicable to the embodiment of the device, so that the same technical effects can be achieved.
The embodiment of the invention also provides a communication device, which comprises: a processor, a memory storing a computer program which, when executed by the processor, performs the method as described above. All the implementation manners in the method embodiment are applicable to the embodiment, and the same technical effect can be achieved.
Embodiments of the present invention also provide a computer-readable storage medium comprising instructions which, when run on a computer, cause the computer to perform a method as described above. All the implementation manners in the method embodiment are applicable to the embodiment, and the same technical effect can be achieved.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. The coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
Furthermore, it should be noted that in the apparatus and method of the present invention, it is apparent that the components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent aspects of the present invention. Also, the steps of performing the series of processes described above may naturally be performed in chronological order in the order of description, but are not necessarily performed in chronological order, and some steps may be performed in parallel or independently of each other. It will be appreciated by those of ordinary skill in the art that all or any of the steps or components of the methods and apparatus of the present invention may be implemented in hardware, firmware, software, or a combination thereof in any computing device (including processors, storage media, etc.) or network of computing devices, as would be apparent to one of ordinary skill in the art after reading this description of the invention.
The object of the invention can thus also be achieved by running a program or a set of programs on any computing device. The computing device may be a well-known general purpose device. The object of the invention can thus also be achieved by merely providing a program product containing program code for implementing said method or apparatus. That is, such a program product also constitutes the present invention, and a storage medium storing such a program product also constitutes the present invention. It is apparent that the storage medium may be any known storage medium or any storage medium developed in the future. It should also be noted that in the apparatus and method of the present invention, it is apparent that the components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent aspects of the present invention. The steps of executing the series of processes may naturally be executed in chronological order in the order described, but are not necessarily executed in chronological order. Some steps may be performed in parallel or independently of each other.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (9)

1. A method for processing page information, comprising:
calling a preset interceptor to intercept response information sent by a target server, wherein the response information is a processing result fed back by corresponding service processing logic according to request content in a request message after the target server receives the request message sent by a client; the response information comprises data information of a target webpage to be accessed and identification information of a user logging in the current client;
analyzing the response information, and implanting a preset modification strategy analysis library into the response information in a target format to obtain analyzed response information;
determining target user information of the current login client according to the analyzed response information and a user information script pre-stored in a preset modification strategy server;
according to the target user information, calling the preset modification strategy analysis library to acquire a target modification strategy corresponding to the target user information from the preset modification strategy server; the target modification strategy is configured in the preset modification strategy server according to user information and related information of a target server to be accessed corresponding to the user;
Modifying the data information of the target webpage to be accessed in the analyzed response information according to the target modification strategy to obtain the modified data information of the target webpage to be accessed;
according to the analyzed response information and a user information script pre-stored in a preset modification strategy server, determining target user information of the current login client side comprises the following steps:
generating a user information analysis request according to the analyzed response information;
receiving a target user information script corresponding to the target webpage to be accessed, which is fed back by the preset modification strategy server, wherein the target user information script is obtained from a pre-stored user information script according to the identification information of the target webpage to be accessed in the user information analysis request after the user information analysis request sent by the client is received by the preset modification strategy server;
and calling the preset modification strategy analysis library to execute the target user information script to obtain the target user information.
2. The method for processing page information according to claim 1, wherein analyzing the response information, implanting a preset modification strategy analysis library into the response information in the target format, and obtaining the analyzed response information, comprises:
Calling the preset interceptor to analyze and process the response information, and determining the response information of a target format in the response information;
and implanting the preset modification strategy analysis library into the response information in the target format to obtain the analyzed response information.
3. The method for processing page information according to claim 1, wherein generating a user information analysis request based on the analyzed response information, comprises:
determining identification information of a target webpage to be accessed in the response information according to the analyzed response information;
and generating a user information analysis request according to the identification information of the target webpage to be accessed.
4. The method for processing page information according to claim 1, wherein modifying the data information of the target webpage to be accessed in the analyzed response information according to the target modification policy to obtain the modified data information of the target webpage to be accessed, includes:
obtaining a document object model tree of the target webpage to be accessed according to the data information of the target webpage to be accessed;
calling the preset modification strategy analysis library to analyze the target modification strategy to obtain modification content;
Traversing all nodes in the document object model tree according to the modification content, and determining a target node corresponding to the modification content in the document object model tree;
and adding the modification content to the attribute information of the target node to obtain the modified data information of the target webpage to be accessed.
5. The method for processing page information according to claim 4, wherein obtaining a document object model tree of the target web page to be accessed according to the data information of the target web page to be accessed comprises:
analyzing the data information of the target webpage to be accessed to obtain an element set of the data information of the target webpage to be accessed;
determining father nodes and child nodes in a document object model tree of the target webpage to be accessed according to the relation of elements in the element set, wherein the father nodes and the child nodes are in one-to-one correspondence with the elements in the element set, and each node corresponds to at least one type of style file;
and acquiring the document object model tree according to the father node and the child node.
6. The method according to claim 4, wherein traversing all nodes in the document object model tree according to the modified content and determining a target node corresponding to the modified content in the document object model tree comprises:
Traversing in the document object model tree according to the attribute information corresponding to the modification content, and determining a first node set;
and determining a target node in the first node set according to the type of the modified content and the type of each first node in the first node set.
7. A processing apparatus for page information, comprising:
the acquisition module is used for calling a preset interceptor to intercept response information sent by a target server, wherein the response information is a processing result fed back by corresponding service processing logic according to the request content in the request message after the target server receives the request message sent by the client; the response information comprises data information of a target webpage to be accessed and identification information of a user logging in the current client;
the processing module is used for analyzing and processing the response information, and implanting a preset modification strategy analysis library into the response information in the target format to obtain analyzed response information; determining target user information of the current login client according to the analyzed response information and a user information script pre-stored in a preset modification strategy server; according to the target user information, calling the preset modification strategy analysis library to acquire a target modification strategy corresponding to the target user information from the preset modification strategy server; the target modification strategy is configured in the preset modification strategy server according to user information and related information of a target server to be accessed corresponding to the user; modifying the data information of the target webpage to be accessed in the analyzed response information according to the target modification strategy to obtain the modified data information of the target webpage to be accessed;
According to the analyzed response information and a user information script pre-stored in a preset modification strategy server, determining target user information of the current login client side comprises the following steps:
generating a user information analysis request according to the analyzed response information;
receiving a target user information script corresponding to the target webpage to be accessed, which is fed back by the preset modification strategy server, wherein the target user information script is obtained from a pre-stored user information script according to the identification information of the target webpage to be accessed in the user information analysis request after the user information analysis request sent by the client is received by the preset modification strategy server;
and calling the preset modification strategy analysis library to execute the target user information script to obtain the target user information.
8. A computing device, comprising: a processor, a memory storing a computer program which, when executed by the processor, performs the method of any one of claims 1 to 6.
9. A computer readable storage medium storing instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 6.
CN202311416625.1A 2023-10-30 2023-10-30 Page information processing method, device and equipment Active CN117150484B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311416625.1A CN117150484B (en) 2023-10-30 2023-10-30 Page information processing method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311416625.1A CN117150484B (en) 2023-10-30 2023-10-30 Page information processing method, device and equipment

Publications (2)

Publication Number Publication Date
CN117150484A CN117150484A (en) 2023-12-01
CN117150484B true CN117150484B (en) 2024-02-13

Family

ID=88906494

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311416625.1A Active CN117150484B (en) 2023-10-30 2023-10-30 Page information processing method, device and equipment

Country Status (1)

Country Link
CN (1) CN117150484B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013074245A1 (en) * 2011-11-14 2013-05-23 Wave Systems Corp. Security systems and methods for encoding and decoding digital content
CN105808587A (en) * 2014-12-31 2016-07-27 中国电信股份有限公司 Method and system for embedding information into webpage and gateway device
CN105978933A (en) * 2016-04-25 2016-09-28 青岛海信电器股份有限公司 Webpage request method, webpage response method, terminal, server, and webpage request and response system
CN109863496A (en) * 2016-10-31 2019-06-07 易享信息技术有限公司 Access to user data is provided
CN110914824A (en) * 2017-07-17 2020-03-24 微软技术许可有限责任公司 Removing sensitive content from a document while preserving document usefulness for subsequent processing
CN115687815A (en) * 2021-07-28 2023-02-03 腾讯科技(深圳)有限公司 Page information display method, device, equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013074245A1 (en) * 2011-11-14 2013-05-23 Wave Systems Corp. Security systems and methods for encoding and decoding digital content
CN105808587A (en) * 2014-12-31 2016-07-27 中国电信股份有限公司 Method and system for embedding information into webpage and gateway device
CN105978933A (en) * 2016-04-25 2016-09-28 青岛海信电器股份有限公司 Webpage request method, webpage response method, terminal, server, and webpage request and response system
CN109863496A (en) * 2016-10-31 2019-06-07 易享信息技术有限公司 Access to user data is provided
CN110914824A (en) * 2017-07-17 2020-03-24 微软技术许可有限责任公司 Removing sensitive content from a document while preserving document usefulness for subsequent processing
CN115687815A (en) * 2021-07-28 2023-02-03 腾讯科技(深圳)有限公司 Page information display method, device, equipment and medium

Also Published As

Publication number Publication date
CN117150484A (en) 2023-12-01

Similar Documents

Publication Publication Date Title
US11093700B2 (en) Automating interrogative population of electronic forms using a real-time communication platform
US7149776B1 (en) System and method for real-time co-browsing
US7287067B2 (en) Dynamically configuring a server computer
US6892231B2 (en) Method and apparatus for verifying the contents of a global configuration file
US7406498B2 (en) Dynamic integration of web sites
US9329849B2 (en) Systems and methods for converting typed code
US20050044139A1 (en) Declarative page view and click tracking systems and methods
KR20100057922A (en) Methods, apparatus, and systems for providing local and online data services
US10642455B2 (en) User interfaces in a computer system
US8103607B2 (en) System comprising a proxy server including a rules engine, a remote application server, and an aspect server for executing aspect services remotely
US20130232424A1 (en) User operation detection system and user operation detection method
AU2014400621A1 (en) System and method for providing contextual analytics data
CN113382083A (en) Webpage screenshot method and device
CN112231711A (en) Vulnerability detection method and device, computer equipment and storage medium
US11716275B1 (en) Assistant for automatic generation of server load test scripts
DE112012004301T5 (en) Generating a predictive data structure
GB2355817A (en) Generating customised documents
US9892023B2 (en) Systems and methods of analyzing software systems having service components
CN117150484B (en) Page information processing method, device and equipment
CN103634338B (en) Method for modifying primary domain name of webpage online, data processing device and system
Jones et al. UncertWeb processing service: making models easier to access on the web
JP5393242B2 (en) Data providing method and intermediate server device
KR101228877B1 (en) Device and Method for Producing Dynamic Web Site Using Web Design
CN111367525B (en) Front end framework system
WO2018147954A1 (en) Automatic generation of interactive web page content

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant