CN115687815A - Page information display method, device, equipment and medium - Google Patents

Page information display method, device, equipment and medium Download PDF

Info

Publication number
CN115687815A
CN115687815A CN202110867384.7A CN202110867384A CN115687815A CN 115687815 A CN115687815 A CN 115687815A CN 202110867384 A CN202110867384 A CN 202110867384A CN 115687815 A CN115687815 A CN 115687815A
Authority
CN
China
Prior art keywords
node
target
return value
page
target page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110867384.7A
Other languages
Chinese (zh)
Inventor
苟亚明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110867384.7A priority Critical patent/CN115687815A/en
Publication of CN115687815A publication Critical patent/CN115687815A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a method, a device, equipment and a medium for displaying page information, wherein the method comprises the following steps: when a loading request of a target page is received, identifying that the resources of the target page meet a preset condition; analyzing each node in the target page based on a preset rule to obtain a return value corresponding to each node; determining a target node to be modified in the target page according to the return value corresponding to the node, and acquiring a modification strategy corresponding to the target node according to the return value corresponding to the target node; and modifying the target page based on the modification strategy to obtain a modified target page, and displaying the modified target page, thereby effectively modifying the H5 page provided by the third party.

Description

Page information display method, device, equipment and medium
Technical Field
The present disclosure relates generally to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for displaying page information.
Background
The H5 page is a mark specification containing HTML5, can realize various dynamic effects and audio-visual gull-European crowns, can utilize various functions of a back end and a front end, and is a mobile webpage which is mainly spread in an intelligent mobile terminal and can be browsed on a PC (personal computer) and a tablet computer in a cross-platform mode.
In the related art, if the currently loaded H5 page is provided by a third party, the currently loaded H5 page cannot be modified, which seriously affects the reliability of the native App.
Disclosure of Invention
In view of the foregoing defects or shortcomings in the prior art, it is desirable to provide a method, an apparatus, a device, and a medium for modifying page information, which effectively implement modification of an H5 page provided by a third party.
In a first aspect, an embodiment of the present application provides a method for displaying page information, where the method includes:
when a loading request of a target page is received, identifying that the resource of the target page meets a preset condition;
analyzing each node in the target page based on a preset rule to obtain a return value corresponding to each node;
determining a target node needing to be modified in the target page according to the return value corresponding to the node, and acquiring a modification strategy corresponding to the target node according to the return value corresponding to the target node;
and modifying the target page based on the modification strategy to obtain a modified target page, and displaying the modified target page.
In a second aspect, an embodiment of the present application provides a device for displaying page information, where the device includes:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for identifying that the resources of a target page meet preset conditions when a loading request of the target page is received;
the analysis module is used for analyzing each node in the target page based on a preset rule to obtain a return value corresponding to each node;
the determining module is used for determining a target node needing to be modified in the target page according to the return value corresponding to the node, and acquiring a modification strategy corresponding to the target node according to the return value corresponding to the target node;
and the loading module is used for modifying the target page based on the modification strategy to obtain a modified target page and displaying the modified target page.
In some embodiments, the receiving module is further configured to:
extracting the resource locator in the loading request;
and when the resource locator is not matched with the internal resource list, determining that the target page meets a preset condition.
In some embodiments, the parsing module is further configured to:
inputting the nodes in the target page into a template function corresponding to the nodes one by one, wherein the template function is used for returning the condition that the nodes have unfavorable information;
and acquiring a return value corresponding to the node according to whether the node has unfavorable information.
In some embodiments, the parsing module is further configured to:
acquiring the target attribute of the root node;
acquiring all nodes with the same type as the root node in the target page according to the target attribute, and generating a node data set;
and inputting the node data set into a template function corresponding to the target attribute.
In some embodiments, the determining module is further configured to:
and when the type of the return value is identified not to be a preset type, determining the node corresponding to the return value to be the target node, wherein the preset type is an object type with a null value.
In some embodiments, the determining module is further configured to:
sending the return value to a server, wherein the server is used for determining a modification strategy corresponding to the target node according to the return value;
and receiving a modification strategy determined by the server according to the return value.
In some embodiments, the determining module, based on the native interface communicating with the server, is further configured to:
converting the return value into a data type corresponding to the native interface to obtain an intermediate return value;
performing function coding on the intermediate return value to obtain a character string corresponding to the return value;
and sending the character string to the server, wherein the server is used for determining a modification strategy corresponding to the target node based on the character string.
In some embodiments, the modification policy includes replacement and deletion, and when the modification policy is deletion, the loading module is further configured to:
acquiring a target distance between the target node and a previous node;
and modifying the distance between the previous node and the next node of the target node into the target distance.
In a third aspect, embodiments of the present application provide an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor executes the computer program to implement the method described in the embodiments of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the method as described in the embodiments of the present application.
When a loading request of a target page is received and an external page of the target page is determined, analyzing nodes in the target page based on a preset rule to obtain a target node needing to be modified, and then modifying the target node in the target page, so that only unfavorable information can be modified when the unfavorable information exists in the target page, partial integrity of the target page is reserved, and the whole page is prevented from being loaded in a shielding mode.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1a is a schematic view of an application scenario according to an embodiment of the present application;
FIG. 1b is a schematic diagram of another application scenario according to an embodiment of the present application;
fig. 2 is a flowchart of a method for displaying page information according to an embodiment of the present disclosure;
fig. 3 is a flowchart of another method for displaying page information according to an embodiment of the present application;
fig. 4 is a flowchart of another method for displaying page information according to an embodiment of the present application;
fig. 5 is a flowchart of another method for displaying page information according to an embodiment of the present application;
fig. 6 is a schematic block diagram of another apparatus for displaying page information according to an embodiment of the present disclosure;
fig. 7 shows a schematic structural diagram of a computer system suitable for implementing the electronic device or the server according to the embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that, in the present application, the embodiments and features of the embodiments may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Along with the popularization of mobile intelligent mobile terminals, people more and more commonly use the intelligent mobile terminals to browse webpages. When a user browses a web page, the browsed information is sometimes an H5 page provided by the native App, and sometimes an H5 page provided by a third-party server. For example, after the user opens the H5 page corresponding to the kyoto shopping in the WeChat for the first time by using the kyoto applet provided by the WeChat, the user continues to click the recommended goods icon, and the H5 page jumps to the H5 page provided by the kyoto (third-party server).
Because the H5 page provided by the third party is usually provided with the diversion advertisement beneficial to the third party, if the diversion advertisement is normally displayed, the flow loss of the native App (such as WeChat) is easily caused; moreover, the management and control of network information is becoming more strict in China, and in order to avoid that some H5 pages provided by third parties contain information violating laws and regulations, illegal data in the H5 pages provided by the third parties need to be shielded or replaced.
Based on the method, the device, the equipment and the medium, the page information display method, the device, the equipment and the medium are provided.
Fig. 1a and 1b are schematic diagrams of application scenarios according to an embodiment of the present application. As shown in fig. 1a and 1b, the application scenario at least includes a terminal 1, a server 2 corresponding to a native App, and a third party server 3.
The server 2 and the third-party server 3 may be independent physical servers, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and big data and artificial intelligence platforms. The terminal 1 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
When a user opens an H5 page by using a client of a native App installed in the terminal 1, the H5 page provided by a server of the native App is usually firstly opened, for example, a shopping page developed by a team of the native App in fig. 1b, (a) the user jumps to a shopping page of a specific product provided by a third party by continuously clicking jump according to information provided by the initial H5 page when browsing the initial H5 page, as shown in fig. 1b, (b) at this time, although information of the shopping page is provided by a third party server (shopping platform), the user still performs page browsing by using the client of the native App, and a case of user diversion is not generated, but, since a jump control such as "open App xxexists in fig. 1b, if the user clicks the jump control when browsing the page, the user is diverted to an application program provided by the third party, and thus traffic loss of the native App is caused.
Therefore, in the application, the terminal 1 receives a target page (an H5 page to be displayed) sent by the third-party server 3, then performs modification requirement detection on each node in the target page, after the node to be modified is identified, sends a return value of the node to be modified to the server 2 to obtain a modification strategy for the target node, modifies the target page according to the modification strategy, and displays the modified target page after modification, for example, in fig. 1b (c), so that the finally displayed target page has no diversion control, and user traffic loss of the native App is effectively avoided.
Fig. 2 is a flowchart of a method for displaying page information according to an embodiment of the present disclosure.
It should be noted that the main execution body of the method for displaying page information in this embodiment is a device for modifying page information, the device for modifying page information may be implemented in a software and/or hardware manner, and the device for modifying page information in this embodiment is configured in a native App installed in a terminal.
Step 101, when a loading request of a target page is received, identifying that resources of the target page meet a preset condition.
It should be noted that, in this embodiment of the application, the target page is an H5 page, a client of the native App is installed in the terminal, the client of the native App creates an H5 processing center H5handle when starting, and the H5handle is used for processing data interacted with the server (including the server and the third-party server) when the H5 page is loaded and processing callback information of the loading. The H5handle can monitor callback information of starting loading, completing loading, failing loading, redirecting and the like of the H5 page.
After a client of the native App is started, a server issues an internal connection and a template function to the client of the native App, the internal connection is stored in a permit set to form an internal resource list, the template function is a section of JavaScript function script and is used for generating an execution environment by utilizing JSContext in jscore, and when a target node is modified, the template function is executed through the JSContext to realize the modification of the target node.
In the process of loading the target page, a url (Uniform Resource Locator) corresponding to the target page may be obtained, where the url is used to identify a Resource location and an access method of the target page.
In one or more embodiments, identifying that the resources of the target page satisfy a preset condition includes: and extracting the resource locator in the loading request, and determining that the target page meets the preset condition when the resource locator is not matched with the internal resource list.
Specifically, when a loading request of a target page is received, matching a url corresponding to the loaded target page with an internal resource list issued by a server, if a resource position recorded by the url corresponding to the target page can be matched with corresponding information in the internal resource list, determining that the target page is the internal page, and if the resource position recorded by the url corresponding to the target page cannot be matched with corresponding information in the internal resource list, determining that the target page meets a preset condition. Wherein, whether the url matches with the internal resource list can be determined according to whether the internal resource list has the same name of resource information as in the url or the same resource path.
And 102, analyzing each node in the target page based on a preset rule to obtain a return value corresponding to each node.
The detected node in the target page is a Dom node, and the Dom node is information corresponding to an element or an element group in the H5 page, where the element may be a button, a tag, a picture, or the like in the H5 page. It should be understood that the Dom nodes are developed and provided by the vendors, i.e., they are developed and provided by the vendors of the native App when the target page is internally connected and by the vendors of the third party servers when the target page is externally connected. The Dom nodes are upgraded along with the continuous evolution of development tools, and the types, attributes and contents of the nodes are upgraded and changed accordingly.
The preset rules are dynamically edited by developers according to the latest Dom nodes, and one Dom node can correspond to at least one preset rule, for example, when the Dom node is a background picture, the preset rules can at least comprise a color audit rule for the background picture and an audit rule for the content of the background picture, and the color audit rule for the background picture and the audit rule for the content of the background picture can also be written in the same preset rule system.
The return value is data information for expressing a node, may be at least a part of the data information corresponding to the node, or may be a specified value returned for desensitization or the like according to a set rule from the data information corresponding to the node.
Step 103, determining a target node to be modified in the target page according to the return value corresponding to the node, and acquiring a modification strategy corresponding to the target node according to the return value corresponding to the target node.
Optionally, the target node to be modified in the target page may be determined according to a data type to which a return value corresponding to the node belongs, where the type of the return value includes, but is not limited to, a null object type, an object type whose value is null, a string type, a number type, a dictionary object type, a binary object type, a time object type, and the like.
For example, a node corresponding to a return value belonging to a certain type may be used as a target node, for example, a node corresponding to a null object type may be used as a target node, and it may also be set that a return value belonging to a certain type is not a target node, and correspondingly, return values belonging to other types are target nodes, for example, nodes of other attribute types except for an object type whose value is null are all determined as target nodes.
It should be noted that, in this embodiment of the present application, when a node does not include unfavorable information, a return value corresponding to the node is null, for example, no data is returned, and when the node includes unfavorable information, a return value corresponding to the node is not null, for example, data is returned, and then the node is determined as a target node. The adverse information includes, but is not limited to, diversion advertisement, information violating laws and regulations, and abnormal data.
Specifically, the type of the return value of each node is identified, and if the type of the return value is "value null", it is determined that the node is not the target node, and if the type of the return value is other than "value null", it is determined that the node is the target node.
Since the return value can express the data information of the node, the modification policy of the target node can be further determined according to the return value corresponding to the target node, wherein the modification policy can include modification and deletion, and the modification can include partial modification and total modification.
For example, when the node is an advertisement picture, the return value may only include the type of the node, that is, the advertisement picture, and at this time, the modification policy may be to replace the advertisement picture with the advertisement picture in the original application program, so as to reduce the advertisement diversion of the third-party server, or only modify the color tone of the advertisement picture, for example, adjust the advertisement pictures to gray pictures at a special memorial day, or delete the advertisement picture when there is illegal sensitive information in the advertisement picture.
And 104, modifying the target page based on the modification strategy to obtain a modified target page, and displaying the modified target page.
Specifically, when a loading request of a target page is received, it is recognized that resources of the target page meet a preset condition, each node in the target page from the outside is analyzed based on a preset rule to obtain a return value corresponding to each node, then a target node to be modified in the target page and a modification strategy of the target node are determined according to the return value corresponding to the node, the target page is modified based on the modification strategy to obtain a modified target page, and the modified target page is displayed, so that the target page is called.
Therefore, when a loading request of a target page is received and an external page of the target page is determined, the nodes in the target page are analyzed based on the preset rules to obtain the target nodes needing to be modified, and then the target nodes in the target page are modified, so that only the adverse information can be modified when the adverse information exists in the target page, the partial integrity of the target page is reserved, and the shielded loading of the whole page is avoided.
In one or more embodiments, as shown in fig. 3, in step 102, analyzing each node in the target page based on a preset rule to obtain a return value corresponding to each node, includes:
step 1021, the nodes in the target page are input into the template functions corresponding to the nodes one by one, and the template functions are used for returning the condition that the nodes have unfavorable information.
Step 1022, obtain a return value corresponding to the node according to whether the node has unfavorable information.
It should be noted that, when the native App is started, the function template issued by the server is a JavaScript function script, and when the function script executes a search function, the function script can query data of the Dom node according to the rule of the template function. Wherein, when the JSCContext in jscor is initialized, the evaluateScript function is called to make the template function have the searching function. It should be understood that the template function for finding the target node may also be an independently set template function.
Specifically, when the native App is started, a template function issued by a server is received, a searching function of the template function is configured, and when a loading request of a target page is received and the target page meets a preset condition, data of each Dom node in the target page is respectively input into the template function, so that the template function feeds back a return value corresponding to the node according to whether the node has adverse information.
For example, the nodes in the target page are input into the corresponding template functions one by one, the template functions query each node, when the node does not contain the unfavorable information, the template functions return an object mark with a null value, and when the node contains the unfavorable information, the template functions return the data information corresponding to the node. The data information corresponding to the node may include, but is not limited to, one or more of a coordinate position, content of the adverse information, and attribute of the adverse information of the node.
In one or more embodiments, the target page includes a root node, the correspondence is a target attribute, and the step of inputting the nodes in the target page one by one into the template function corresponding to the target page includes: acquiring a target attribute of a root node; acquiring all nodes with the same type as the root node in a target page according to the target attribute, and generating a node data set; the node data set is input into a template function corresponding to the target attribute.
Wherein the target attribute is determined according to the type of the node.
That is to say, the nodes in the target page can be classified according to the attributes, and then the return value query is performed for the nodes with the same attributes at one time, so that the efficiency of the return value query is effectively improved, and the overall speed of loading the target page is improved.
Specifically, a plurality of root nodes can be determined from a target page, then, for each root node, a target attribute of the root node is obtained, all nodes belonging to the attribute in the target page are combined into a node data set by using a corresponding calling function, and finally, the node data set is input into a template function corresponding to the target attribute, so that each node in the node data set is processed by a search function of the template function, target data corresponding to the whole node data set is obtained, and the target data is used as a return value corresponding to the whole node data set.
For example, when the template function queries the entire node data set, the object mark of "null value" returned by the node without adverse information is marked, and the returned value of the node with adverse information is not null, which may be the data information corresponding to the node, so as to determine the target node to be replaced in the node data set according to the returned value at a later stage.
Optionally, the query may be completed sequentially for a plurality of root nodes, that is, after the query for all the nodes of one target attribute is completed, the query for all the nodes of the next target attribute is executed.
As a specific example of the implementation of the method,
Figure BDA0003185207160000101
specifically, an element named "preview-content" in the class attribute name is acquired and added. And dividing the data to obtain an array, and if the first element in the obtained array is not empty, returning the first element in the array as a return value. That is, data information of a node containing disadvantageous information among all nodes of the class attribute name "preview-content" can be divided to form the first element in the array through the dividing operation.
As a possible embodiment, as shown in fig. 4, step 103, obtaining a modification policy corresponding to a target node according to a return value corresponding to the target node, includes:
and step 1031, sending the return value to a server, wherein the server is used for determining a modification strategy corresponding to the target node according to the return value.
Step 1032, receiving the modification strategy determined by the server according to the return value.
That is to say, after the native App client finishes node detection on the target page, the native App client needs to send a return value of the target node to be modified to the server, so that the server determines the modification policy of each target node, and therefore, the data processing amount of the native App client can be effectively reduced.
Specifically, after a return value corresponding to the Dom node is obtained by using a template function, the return value with the return value not being empty is sent to the server, the server obtains a modification strategy corresponding to the return value based on a stored preset rule according to information recorded by the return value, and the modification strategy is returned to the client. When the modification strategy is deletion, the server only returns the modification indication of deletion, and when the modification strategy is replacement, the server returns the modification indication of replacement and the node data information after replacement, so that the client performs node replacement when loading the target page according to the received node data information after replacement.
In one or more embodiments, the communication with the server is based on a native interface, and before sending the return value to the server, the method further includes: converting the return value into a data type corresponding to a native interface to obtain an intermediate return value; performing function coding on the intermediate return value to obtain a character string corresponding to the return value; and sending the character string to a server, wherein the server is used for determining a modification strategy corresponding to the target node based on the character string.
The corresponding relation between the JavaScript data type and the Native interface data type is as follows
Figure BDA0003185207160000111
Figure BDA0003185207160000121
That is to say, the return value can be converted into data corresponding to the Native interface according to the data type of the return value in the JavaScript language and the mapping relationship between the JavaScript data type and the Native data type, so as to obtain an intermediate return value.
Optionally, when the return value does not define the JavaScript data type, for example, when the data content of the target node itself is directly returned, the returned data needs to be classified. Specifically, a method or classification may be added to the data, and if the data matches the type provided by the added method or classification, the data is determined to be of that type, and if not, the types of other methods or classifications are added again until the type to which the data belongs is determined. It should be understood that when adding methods or classifications, native data types can be added directly to the data in order to save data processing.
Further, after the return value is converted into the data type corresponding to the native interface, the intermediate return value is further subjected to function coding, so that the safety of sending the return value to the server is improved. Specifically, the return value may be converted into a 32-bit string by using an f (x) function, then the string is sent to the server, the server decodes the string to obtain a return value capable of expressing the data information of the target node, and determines the modification policy corresponding to the target node according to the return value.
Therefore, the encoded character string is sent to the server by using the native interface, and the safety and the reliability of sending the return value are effectively ensured.
In one or more embodiments, the modifying policy includes replacing and deleting, and when the modifying policy is deleting, modifying the target page based on the modifying policy to obtain a modified target page, including: and acquiring a target distance between the target node and the previous node, and modifying the distance between the next node and the previous node of the target node into the target distance.
That is, when the target node needs to be deleted, the distance between two nodes before and after the node is actually reduced, for example, when the distance between a and B is a, the distance between B and C is B, and the distance between a and C is a + B in the node sequences a, B, and C, the distance between a and C may be modified to a when B is the target node and the corresponding modification policy is deletion.
It should be understood that, when the modification policy corresponding to the target node is modification, the receiving server returns data information for replacing the target node, and when the target page is rendered, the replaced data information is directly executed.
As a specific embodiment, as shown in fig. 5, the method for displaying page information of this embodiment includes the following steps:
step 201, starting a client of the native App.
Step 202, initialize the H5handle.
Step 203, receiving and saving the internal link and the template function sent by the server.
Step 204, receiving the target page.
The target page is an H5 page, and is acquired by triggering operations such as loading, refreshing, redirecting and jumping.
Step 205, determine whether url of the target page matches the internal link.
If the page is matched with the H5 page, loading the H5 page; if not, step 206 is performed.
Step 206, initializing the JSContext object, and transmitting a search function to the template function.
And step 207, traversing the Dom nodes in the target page by using the template function.
Step 208, a return value for executing the template function is obtained.
Step 209 determines whether the return value is null.
If yes, loading an H5 page; if not, step 210 is performed.
Step 210, the return value is sent to the server.
And step 211, receiving the modification strategy returned by the server.
At step 212, the H5 page is loaded.
To sum up, when a loading request of a target page is received and an external page of the target page is determined, the nodes in the target page are analyzed based on a preset rule to obtain the target nodes needing to be modified, and then the target nodes in the target page are modified, so that only the adverse information can be modified when the adverse information exists in the target page, the partial integrity of the target page is reserved, and the shielded loading of the whole page is avoided.
It should be noted that while the operations of the methods of the present invention are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, in order to achieve desirable results.
Fig. 6 is a schematic block diagram of another apparatus for displaying page information according to an embodiment of the present application, and as shown in fig. 6, an apparatus 10 for displaying page information includes:
the receiving module 11 is configured to, when a loading request of a target page is received, identify that a resource of the target page meets a preset condition;
the analysis module 12 is configured to analyze each node in the target page based on a preset rule to obtain a return value corresponding to each node;
the determining module 13 is configured to determine a target node to be modified in the target page according to the return value corresponding to the node, and acquire a modification policy corresponding to the target node according to the return value corresponding to the target node;
and the loading module 14 is configured to modify the target page based on the modification policy to obtain a modified target page, and display the modified target page.
In some embodiments, the receiving module 11 is further configured to:
extracting the resource locator in the loading request;
and when the resource locator is not matched with the internal resource list, determining that the target page meets the preset condition.
In some embodiments, the parsing module 12 is further configured to:
inputting the nodes in the target page into corresponding template functions one by one, wherein the template functions are used for returning the condition that the nodes have unfavorable information;
and acquiring a return value corresponding to the node according to whether the node has unfavorable information.
In some embodiments, the parsing module 12 is further configured to:
acquiring a target attribute of a root node;
acquiring all nodes with the same type as the root node in a target page according to the target attribute, and generating a node data set;
the node data set is input into a template function corresponding to the target attribute.
In some embodiments, the determining module 13 is further configured to:
and when the type of the return value is not identified to be a preset type, determining that the node corresponding to the return value is a target node, wherein the preset type is an object type with a null value.
In some embodiments, the determining module 13 is further configured to:
sending the return value to a server, wherein the server is used for determining a modification strategy corresponding to the target node according to the return value;
and receiving the modification strategy determined by the server according to the return value.
In some embodiments, the determining module 13 is further configured to, based on the native interface communicating with the server:
converting the return value into a data type corresponding to a native interface to obtain an intermediate return value;
performing function coding on the intermediate return value to obtain a character string corresponding to the return value;
and sending the character string to a server, wherein the server is used for determining a modification strategy corresponding to the target node based on the character string.
In some embodiments, the modification policy includes replace and delete, and when the modification policy is delete, the loading module 14 is further configured to:
acquiring a target distance between a target node and a previous node;
and modifying the distance between the next node and the previous node of the target node into the target distance.
To sum up, when a loading request of a target page is received and an external page of the target page is determined, the nodes in the target page are analyzed based on a preset rule to obtain the target nodes needing to be modified, and then the target nodes in the target page are modified, so that only the adverse information can be modified when the adverse information exists in the target page, the partial integrity of the target page is reserved, and the shielded loading of the whole page is avoided.
It should be understood that the units or modules recited in the modification apparatus 10 of page information correspond to the respective steps in the method described with reference to fig. 2. Thus, the operations and features described above for the method are also applicable to the page information modification apparatus 10 and the units included therein, and are not described herein again. The page information modification apparatus 10 may be implemented in a browser or other security applications of the electronic device in advance, or may be loaded into the browser or other security applications of the electronic device by downloading or the like. The corresponding units in the modification device 10 of page information can cooperate with units in the electronic equipment to implement the solution of the embodiment of the present application.
The division into several modules or units mentioned in the above detailed description is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
It should be noted that, please refer to the details disclosed in the above embodiments of the present application for details not disclosed in the modification apparatus of the page information in the embodiment of the present application, which are not described herein again.
Referring now to fig. 7, fig. 7 illustrates a schematic diagram of a computer system suitable for use in implementing an electronic device or server of an embodiment of the present application,
as shown in fig. 7, the computer system includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for operation instructions of the system are also stored. The CPU701, ROM702, and RAM703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705; an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present application, the process described above with reference to the flowchart fig. 2 may be implemented as a computer software program. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program comprises program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program executes the above-described functions defined in the system of the present application when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operational instructions of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, and may be described as: a processor includes a receiving module, a parsing module, a determining module, and a loading module. The names of these units or modules do not form a limitation on the units or modules themselves in some cases, for example, the receiving module may also be described as "when a load request of a target page is received, a resource of the target page is identified to meet a preset condition".
As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment, or may exist separately without being assembled into the electronic device. The computer-readable storage medium stores one or more programs, and when the programs are used by one or more processors to execute the method for presenting page information described in the present application.
The foregoing description is only exemplary of the preferred embodiments of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other combinations of features described above or their equivalents without departing from the spirit of the disclosure. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (15)

1. A method for displaying page information is characterized by comprising the following steps:
when a loading request of a target page is received, identifying that the resource of the target page meets a preset condition;
analyzing each node in the target page based on a preset rule to obtain a return value corresponding to each node;
determining a target node needing to be modified in the target page according to the return value corresponding to the node, and acquiring a modification strategy corresponding to the target node according to the return value corresponding to the target node;
and modifying the target page based on the modification strategy to obtain a modified target page, and displaying the modified target page.
2. The method according to claim 1, wherein the identifying that the resource of the target page satisfies a preset condition comprises:
extracting the resource locator in the loading request;
and when the resource locator is not matched with the internal resource list, determining that the target page meets a preset condition.
3. The method according to claim 1, wherein the analyzing each node in the target page based on a preset rule to obtain a return value corresponding to each node comprises:
inputting the nodes in the target page into a template function corresponding to the nodes one by one, wherein the template function is used for returning the condition that the nodes have unfavorable information;
and acquiring a return value corresponding to the node according to whether the node has unfavorable information.
4. The method according to claim 3, wherein the target page includes a root node, a correspondence relationship is a target attribute, and the step of inputting the nodes in the target page one by one into a template function corresponding to the nodes includes:
acquiring the target attribute of the root node;
acquiring all nodes with the same type as the root node in the target page according to the target attribute, and generating a node data set;
and inputting the node data set into a template function corresponding to the target attribute.
5. The method of claim 1, wherein the return value comprises a data type, and determining a target node to be modified in a target page according to the return value corresponding to the node comprises:
and when the type of the return value is identified not to be a preset type, determining the node corresponding to the return value to be the target node, wherein the preset type is an object type with a null value.
6. The method according to claim 1, wherein the obtaining the modification policy corresponding to the target node according to the return value corresponding to the target node comprises:
sending the return value to a server, wherein the server is used for determining a modification strategy corresponding to the target node according to the return value;
and receiving a modification strategy determined by the server according to the return value.
7. The method according to claim 6, wherein communicating with the server based on a native interface, further comprises, prior to the sending the return value to the server:
converting the return value into a data type corresponding to the native interface to obtain an intermediate return value;
performing function coding on the intermediate return value to obtain a character string corresponding to the return value;
and sending the character string to the server, wherein the server is used for determining a modification strategy corresponding to the target node based on the character string.
8. The method of claim 1, wherein the modification policy includes replacement and deletion, and when the modification policy is deletion, modifying the target page based on the modification policy to obtain a modified target page comprises:
acquiring a target distance between the target node and a previous node;
and modifying the distance between the previous node and the next node of the target node into the target distance.
9. An apparatus for displaying page information, the apparatus comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for identifying that the resources of a target page meet preset conditions when a loading request of the target page is received;
the analysis module is used for analyzing each node in the target page based on a preset rule to obtain a return value corresponding to each node;
the determining module is used for determining a target node needing to be modified in the target page according to the return value corresponding to the node, and acquiring a modification strategy corresponding to the target node according to the return value corresponding to the target node;
and the loading module is used for modifying the target page based on the modification strategy to obtain a modified target page and displaying the modified target page.
10. The apparatus of claim 9, wherein the receiving module is configured to:
extracting the resource locator in the loading request;
and when the resource locator is not matched with the internal resource list, determining that the target page meets a preset condition.
11. The apparatus of claim 9, wherein the determining module is configured to:
inputting the nodes in the target page into a template function corresponding to the nodes one by one, wherein the template function is used for returning the condition that the nodes have unfavorable information;
and acquiring a return value corresponding to the node according to whether the node has unfavorable information.
12. The apparatus of claim 11, wherein the destination page includes a root node, and the correspondence is a destination attribute, and the determining module is further configured to:
acquiring the target attribute of the root node;
acquiring all nodes with the same type as the root node in the target page according to the target attribute, and generating a node data set;
and inputting the node data set into a template function corresponding to the target attribute.
13. The apparatus of claim 9, wherein the return value comprises a data type, and wherein the determining module is further configured to:
and when the type of the return value is identified not to be a preset type, determining the node corresponding to the return value to be the target node, wherein the preset type is an object type with a null value.
14. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for presenting page information according to any one of claims 1 to 8 when executing the program.
15. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of presenting page information according to any one of claims 1 to 8.
CN202110867384.7A 2021-07-28 2021-07-28 Page information display method, device, equipment and medium Pending CN115687815A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110867384.7A CN115687815A (en) 2021-07-28 2021-07-28 Page information display method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110867384.7A CN115687815A (en) 2021-07-28 2021-07-28 Page information display method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115687815A true CN115687815A (en) 2023-02-03

Family

ID=85059470

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110867384.7A Pending CN115687815A (en) 2021-07-28 2021-07-28 Page information display method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115687815A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117150484A (en) * 2023-10-30 2023-12-01 信智慧通科技(北京)有限公司 Page information processing method, device and equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117150484A (en) * 2023-10-30 2023-12-01 信智慧通科技(北京)有限公司 Page information processing method, device and equipment
CN117150484B (en) * 2023-10-30 2024-02-13 信智慧通科技(北京)有限公司 Page information processing method, device and equipment

Similar Documents

Publication Publication Date Title
US7970944B2 (en) System and method for platform and language-independent development and delivery of page-based content
US8443346B2 (en) Server evaluation of client-side script
CN113419740B (en) Program data stream analysis method and device, electronic equipment and readable storage medium
CN112035092A (en) Form processing method, device, equipment and readable medium
CN110109983B (en) Method and device for operating Redis database
US20150205767A1 (en) Link appearance formatting based on target content
US10291492B2 (en) Systems and methods for discovering sources of online content
CN115982491A (en) Page updating method and device, electronic equipment and computer readable storage medium
JP2023024365A (en) Detection of api lower compatibility between software versions
CN113656737B (en) Webpage content display method and device, electronic equipment and storage medium
CN113625998B (en) Request processing method and device
CN115687815A (en) Page information display method, device, equipment and medium
CN108694172B (en) Information output method and device
US10649740B2 (en) Predicting and using utility of script execution in functional web crawling and other crawling
CN116739845A (en) Contract generation method and device, electronic equipment and storage medium
CN111767498A (en) Method and device for realizing file information sharing
CN114461909A (en) Information processing method, information processing apparatus, electronic device, and storage medium
CN114357331A (en) Webpage information display method and device, electronic equipment, storage medium and product
CN113392311A (en) Field searching method, field searching device, electronic equipment and storage medium
CN113312053A (en) Data processing method and device
US11334563B1 (en) System and method for automatic evaluation of project management tickets
US11847477B1 (en) Techniques for natively interpreting logic across disparate platforms
US20240205265A1 (en) Multi-layer browser-based context emulation detection
CN111104626B (en) Information storage method and device
CN115687090A (en) Test case generation method, device, equipment and medium

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