CN110750683A - Data modification method and device, computer equipment and storage medium - Google Patents

Data modification method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110750683A
CN110750683A CN201910894920.5A CN201910894920A CN110750683A CN 110750683 A CN110750683 A CN 110750683A CN 201910894920 A CN201910894920 A CN 201910894920A CN 110750683 A CN110750683 A CN 110750683A
Authority
CN
China
Prior art keywords
object model
file object
node
target
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
CN201910894920.5A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201910894920.5A priority Critical patent/CN110750683A/en
Publication of CN110750683A publication Critical patent/CN110750683A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/81Indexing, e.g. XML tags; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/83Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a data modification method, a data modification device, computer equipment and a storage medium, wherein the data modification method comprises the following steps: receiving a modification request triggered by a user and used for modifying elements in a target page, wherein the modification request comprises: element information needing to be modified in the target page; calling a target file object model which is the same as the original file object model of the target page from a memory according to the modification request; and modifying in the target file object model according to the element information so as to display the modified element information in the target page. Because the target file object model is established in the memory and is modified to change the target page element in the virtual element, the operation of the virtual element does not affect the real file object model of the target page, and the normal display of the target page can be ensured.

Description

Data modification method and device, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a data modification method, a data modification device, computer equipment and a storage medium.
Background
The Document Object Model (DOM) allows the content and structure of a Document to be accessed and modified in a platform and language independent manner. The DOM defines the objects needed to represent and modify a document, the behavior and properties of those objects, and the relationships of those objects. The DOM may cause the user's page to change dynamically, i.e., dynamically displaying or hiding an element, changing their properties or adding an element, etc. The object includes various elements displayed in the document, such as pictures, words and the like.
When collecting data of a page document in a front end, reporting the DOM of the page document, and changing the tags of elements in the page when the data of the page is required to be modified. However, after the tab is modified, the element in the DOM may not match the modified tab, resulting in an exception of the original document page, thereby affecting the display of the original page.
Disclosure of Invention
The embodiment of the invention provides a data modification method, a data modification device, computer equipment and a storage medium for solving the problems that the display of an original page is influenced due to the abnormal condition of the original document page caused by the mismatching of elements in a DOM and a modified label.
In order to solve the above technical problem, the embodiment of the present invention adopts a technical solution that: there is provided a data modification method including the steps of:
receiving a modification request triggered by a user and used for modifying elements in a target page, wherein the modification request comprises: element information needing to be modified in the target page;
calling a target file object model which is the same as the original file object model of the target page from a memory according to the modification request;
and modifying in the target file object model according to the element information so as to display the modified element information in the target page.
Optionally, before the retrieving, according to the modification request, a target file object model that is the same as the file object model of the target page from a memory, the method includes:
extracting the identification code of the target page from the modification request, and searching an original file object model of the target page according to the identification code;
traversing each node of the original file object model to obtain an element, an attribute and a label of each node;
and setting each node of a preset file object model in the memory according to the element, the attribute and the label of each node to obtain the target file object model.
Optionally, the searching for the original document object model of the target page according to the identification code includes:
searching a file object model having a mapping relation with the identification code in a preset database;
and taking the searched file object model as an original file object model of the target page.
Optionally, the original file object model includes: the first-level node, setting each node of a preset file object model in the memory according to the element, the attribute and the label of each node, comprises:
extracting attributes and labels of primary nodes from the original file object model;
and setting the attributes and the labels in the primary nodes of the preset file object model according to the attributes and the positions of the labels of the primary nodes.
Optionally, the primary node includes: each secondary node further comprises a text node, and the setting of each node of a preset file object model in a memory according to the element, the attribute and the label of each node comprises:
extracting attributes and labels of secondary nodes from each primary node, and extracting texts from text nodes corresponding to the secondary nodes;
setting attributes and labels in the secondary nodes of the preset file object model according to the attributes and the positions of the labels of the secondary nodes, and setting texts in text nodes corresponding to the secondary nodes by the extracted texts.
Optionally, the element information includes: the modifying the element tag and the identification information of the target node where the element tag is located in the target file object model according to the element information so as to display the modified element information in the target page includes:
searching a target node having a mapping relation with the identification information in each node of the target file object model according to the identification information;
replacing the label in the target node with the element label.
To solve the foregoing technical problem, an embodiment of the present invention further provides a data modification apparatus, including:
the obtaining module is used for receiving a modification request triggered by a user and used for modifying elements in a target page, wherein the modification request comprises: element information needing to be modified in the target page;
the processing module is used for calling a target file object model which is the same as the original file object model of the target page from a memory according to the modification request;
and the execution module is used for modifying in the target file object model according to the element information so as to display the modified element information in the target page.
Optionally, the method further comprises:
the first obtaining sub-module is used for extracting the identification code of the target page from the modification request and searching an original file object model of the target page according to the identification code;
the first processing submodule is used for traversing each node of the original file object model to obtain elements, attributes and labels of each node;
and the first execution submodule is used for setting each node of a preset file object model in a memory according to the element, the attribute and the label of each node so as to obtain the target file object model.
Optionally, the first obtaining sub-module includes:
the second processing submodule is used for searching a file object model which has a mapping relation with the identification code in a preset database;
and the second execution sub-module is used for taking the searched file object model as an original file object model of the target page.
Optionally, the original file object model includes: a first level node, the first execution submodule comprising:
the second obtaining submodule is used for extracting the attributes and labels of the primary nodes from the original file object model;
and the third processing submodule is used for setting the attributes and the labels in the primary nodes of the preset file object model according to the attributes and the positions of the labels of the primary nodes.
Optionally, the primary node includes: secondary nodes, wherein each secondary node further comprises a text node, and the first execution submodule comprises:
the third obtaining submodule is used for extracting attributes and labels of the secondary nodes from each primary node and extracting texts from text nodes corresponding to the secondary nodes;
and the fourth processing submodule is used for setting the attributes and the labels in the secondary nodes of the preset file object model according to the attributes and the positions of the labels of the secondary nodes, and setting the texts of the extracted texts in the text nodes corresponding to the secondary nodes.
Optionally, the element information includes: the element label and the identification information of the target node where the element label is located, the execution module comprises:
a fourth obtaining submodule, configured to search, according to the identification information, a target node having a mapping relationship with the identification information in each node of the target file object model;
and the third execution submodule is used for replacing the label in the target node with the element label.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer device, including a memory and a processor, where the memory stores computer-readable instructions, and the computer-readable instructions, when executed by the processor, cause the processor to execute the steps of the data modification method.
To solve the above technical problem, an embodiment of the present invention further provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to execute the steps of the data modification method.
The embodiment of the invention has the beneficial effects that: when the element of the target page needs to be modified, the element is modified in a target file object model which is preset in the memory and is the same as the file object model of the target page. Therefore, because the target file object model is established in the memory and is modified to change the target page element in the virtual element, the real file object model of the target page cannot be influenced by operating the virtual element, and the target page can be ensured to be normally displayed.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic basic flow chart of a data modification method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a basic flow chart of a method for creating a file object model according to an embodiment of the present invention;
fig. 3 is a schematic basic flow chart of a method for obtaining an original document object model of a target page according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a basic flow chart of a method for creating an object model of a target file according to an object model of an original file according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a basic flow of another method for creating an object model of a target file according to an object model of an original file according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a basic flow of a method for modifying in an object model of a target document according to element information, so that the modified element information is displayed in a target page according to an embodiment of the present invention;
fig. 7 is a block diagram of a basic structure of a data modification apparatus according to an embodiment of the present invention;
fig. 8 is a block diagram of a basic structure of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention.
In some of the flows described in the present specification and claims and in the above figures, a number of operations are included that occur in a particular order, but it should be clearly understood that these operations may be performed out of order or in parallel as they occur herein, with the order of the operations being indicated as 101, 102, etc. merely to distinguish between the various operations, and the order of the operations by themselves does not represent any order of performance. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Examples
As will be appreciated by those skilled in the art, "terminal" as used herein includes both devices that are wireless signal receivers, devices that have only wireless signal receivers without transmit capability, and devices that include receive and transmit hardware, devices that have receive and transmit hardware capable of performing two-way communication over a two-way communication link. Such a device may include: a cellular or other communication device having a single line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service), which may combine voice, data processing, facsimile and/or data communication capabilities; a PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, internet/intranet access, a web browser, a notepad, a calendar and/or a GPS (Global Positioning System) receiver; a conventional laptop and/or palmtop computer or other device having and/or including a radio frequency receiver. As used herein, a "terminal" or "terminal device" may be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or land-based), or situated and/or configured to operate locally and/or in a distributed fashion at any other location(s) on earth and/or in space. As used herein, a "terminal Device" may also be a communication terminal, a web terminal, a music/video playing terminal, such as a PDA, an MID (Mobile Internet Device) and/or a Mobile phone with music/video playing function, or a smart tv, a set-top box, etc.
The client terminal in this embodiment is the above terminal.
Specifically, referring to fig. 1, fig. 1 is a basic flow chart of the data modification method of the present embodiment.
As shown in fig. 1, the data modification method includes the following steps:
s1100, receiving a modification request triggered by a user and used for modifying elements in a target page, wherein the modification request comprises: element information needing to be modified in the target page;
the target page is a page displayed in the front end, for example, a browser page, a page displayed by application software, and the like, and the format of the target page may be Extensible Markup Language (XML), HyperText Markup Language (HTML).
In practical application, in the process of developing the front end, data in a page needs to be collected, and the collected data needs to be reported. Currently, the most common is the Document Object Model (DOM), which is a platform and language neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a Document, where the DOM defines the logical structure of a page, e.g., an XML or HTML page, i.e., a DOM tree, giving a way to access and process data in the page. Wherein, the DOM tree includes: and a plurality of nodes, each node being set with an attribute and a label of each node.
In some embodiments, some pages are complex, the nodes of which further include a plurality of child nodes, and each child node further includes a plurality of child nodes.
In practical applications, as the application scene changes, the change of the page display content often occurs to modify the attribute or the label of the element in the page. Therefore, the modification request in this embodiment is a request for indicating to modify an attribute or a tag of an element in a page, where the modification request includes: modified element information is required. The element information includes various elements displayed in the target page, for example, a picture, text, audio, video, and the like. For example, if it is desired to replace some element, i.e., text, in the target page with another text, the modified request includes the replaced text.
In some embodiments, if the picture element in the target page needs to be deleted, the modification request is empty. In some embodiments, if a new element needs to be added, the modification request further includes: and adding the position information of the node where the new element is positioned and the attribute and the label of the new element.
S1200, calling a target file object model which is the same as the original file object model of the target page from the memory according to the modification request;
in this embodiment, a target file object model completely consistent with an original file object model of a target page is pre-stored in a terminal or a server, that is, nodes included in the target file object model, and attributes and labels of elements in each node are consistent with texts of corresponding text nodes. The target file object model is used for modifying the element needing to be modified in the target page, namely, after receiving a modification request, the node in the target file object model searches for the element at the node needing to be modified and updates or replaces the element.
In some embodiments, since the front-end page includes a plurality of pages, a plurality of original document object models may be preset for each page or each part of the page, for example, a title, a column, and the like, where each pre-stored original document object model has an identification code, so as to facilitate searching in the later stage of building the target document object model.
In some embodiments, when the target file object model is established in advance, the original file object model corresponding to the identification code is searched in a plurality of pre-stored original file object models according to the identification code corresponding to the target page, each node of the original file object model is traversed, and each node of the preset file object model in the memory is set according to the element, the attribute and the label of the original file object model to obtain the target file object model.
S1300, modifying in the target file object model according to the element information so as to display the modified element information in the target page.
In practical application, the element information further includes an element tag and identification information of a target node where the element tag is located, so that when the element information is modified in the target file object model, the target node having a mapping relation with the identification information can be searched for in each node of the target file object model according to the identification information, and the tag in the target node is replaced by the element tag.
According to the data modification method, when the element of the target page needs to be modified, the element is modified in the target file object model which is preset in the memory and is the same as the file object model of the target page. Therefore, the target file object model is built in the memory and is modified to change the target page element in the virtual element, the operation of the virtual element does not affect the real file object model of the target page, and after the element of the target file object model is modified, the modified element is displayed in the target page, so that the normal display of the target page is ensured.
Further, as shown in fig. 2, in an embodiment, the step S1200 includes the following steps:
s1210, extracting an identification code of the target page from the modification request, and searching an original file object model of the target page according to the identification code;
in the embodiment of the invention, a terminal or a server receives a modification request triggered by a user, wherein the modification request is used for modifying elements in a target page and comprises an identification code of the target page, and therefore, the identification code of the target page is obtained by extracting the identification code of a file object model from the modification request.
In practical applications, a plurality of pages can be entered through hyperlinks in the front-end page, the data in the plurality of pages is more, and the element relationship included in the document object model of the page is more complex, so that in order to simplify the element relationship, a plurality of original document object models can be separately set for each page or each part in the page, for example, a title, a column, and the like. In this way, an original file object model having a mapping relation with the identification code can be searched for in the plurality of original file objects according to the identification code of the target file as the original file object model of the target page.
Further, as shown in fig. 3, in an embodiment, the step S1210 includes the following steps:
s1211, searching a file object model having a mapping relation with the identification code in a preset database;
and S1212, taking the searched file object model as an original file object model of the target page.
In the embodiment of the invention, the identification code is extracted from the modification request, the corresponding file object model is searched through the identification code, and the searched original file object model serving as the target page is used as the original file object model of the target page.
S1220, traversing each node of the original file object model to obtain an element, an attribute and a label of each node;
in practical applications, the original document object model includes a plurality of nodes, each node includes an element, and because the relationships existing in the respective elements in the target page are different, for example, an XML page includes a plurality of parallel headers, and each header further includes a plurality of subtitles, the respective nodes in the original document object model have a parallel or an inclusion relationship.
For example, the total nodes in the original object model are document nodes: document, which contains a first node < book >, which contains a plurality of second nodes < head >, < body >, < author >, < year >, and < price >, wherein the second node < head > contains a third node < title >, and the second node < body > contains two third nodes < h1> and < p >.
In the present embodiment, the element, attribute and label of each node in the original file object model are traversed, for example, for the first node < book >, the attribute "category" is extracted from it, and the label is the content in the bracket "< >".
And S1230, setting each node of a preset file object model in the memory according to the elements, attributes and labels of the original file object model to obtain a target file object model.
Through the embodiments, in practical applications, the elements in the target page have a multi-level relationship, that is, the original file object model includes multi-level nodes nested layer by layer, for example, the original file object model includes a plurality of first-level nodes, each first-level node includes a plurality of second-level nodes, each second-level node includes a plurality of third-level nodes, and so on. Therefore, in view of this, an embodiment of the present invention provides a method for creating a target file object model according to an original file object model, as shown in fig. 4, fig. 4 is a basic flowchart of the method for creating a target file object model according to an original file object model according to an embodiment of the present invention.
Specifically, as shown in fig. 4, step S1230 includes the steps of:
s12311, extracting attributes and labels of the primary nodes from the original file object model;
in the embodiment of the invention, the nodes are divided into a plurality of levels according to the hierarchy, wherein the level one node is a parallel total node, and the level one node can be a plurality of nodes. For example, the total node in the original object model is a root element node < book >, the primary node < book > is included below the total node, the attribute is "category", and the label is "book", in this embodiment, the terminal or the server extracts the label "book" and the attribute "category" of the node.
S12312, setting the attributes and the labels in the primary nodes of the preset file object model according to the attributes and the positions of the primary nodes.
And the terminal or the server creates a primary node in a preset file object model according to the number and the position of the primary node, and sets the created primary node according to the label and the attribute of the original file object model.
In practical applications, when a document element is included in the target page, the node in the original document object model also corresponds to the existing document node, for example, the text of the document node corresponding to the secondary node < title > is "(title)". In some embodiments, the level one node comprises: secondary nodes, wherein each secondary node further comprises a text node. In this embodiment, an embodiment of the present invention provides another method for creating an object model of a target file according to an object model of an original file, as shown in fig. 5, fig. 5 is a basic flowchart diagram of another method for creating an object model of a target file according to an object model of an original file according to an embodiment of the present invention.
Specifically, as shown in fig. 5, step S1230 includes the steps of:
s12321, extracting attributes and labels of the secondary nodes from each primary node, and extracting texts from text nodes corresponding to the secondary nodes;
for example, in the above embodiment, the first node < book > includes a plurality of secondary nodes < title >, < author >, < year > and < price >, where the text node corresponding to the < title > node is "Harry Potter", the text node corresponding to the attribute "lang" < author > node is "J k.rowling", and includes the third node < title >, < year > node is "2005", and the text node corresponding to the < price > node is "29.99".
In the embodiment of the method, the attributes and labels of the secondary nodes included in each primary node in the original document object model are traversed, for example, for the secondary node < title >, the attribute "lang" and the label, namely the content in the bracket "< >" are extracted from the secondary node.
S12322, setting the attributes and the labels in the secondary nodes of the preset file object model according to the attributes and the positions of the labels of the secondary nodes, and setting texts of the extracted texts in the text nodes corresponding to the secondary nodes.
In the embodiment of the invention, a plurality of secondary nodes are created in each primary node of a preset file object model according to the positions of the secondary nodes in the primary nodes in the original file object model, and the created secondary nodes are set according to the attributes and the labels of the secondary nodes. And setting a text node for a secondary node containing the text node, and adding a text in the text node corresponding to the original secondary node.
The element information in the embodiment of the invention comprises: an embodiment of the present invention provides a method for modifying in a target file object model according to element information to display modified element information in a target page, as shown in fig. 6, where fig. 6 is a basic flow diagram of a method for modifying in a target file object model according to element information to display modified element information in a target page provided by an embodiment of the present invention.
Specifically, as shown in fig. 6, step S1300 includes the steps of:
s1310, searching a target node having a mapping relation with the identification information in each node of the target file object model according to the identification information;
the identification information is used for representing the position of the target node in the target file object model. The target node is a node where element information that needs to be modified in this embodiment is located, for example, in the above embodiment, a text node corresponding to a secondary node < title > is "Harry Potter", an attribute is "lang", a modification request indicates that the attribute needs to be modified to "X", then the identification information is used to indicate the position of the node where X is located, that is, the secondary node labeled "title", and the modification type is "attribute".
It should be noted that the identification information may be represented by numbers, letters, or characters, for example, if the order of the secondary node < title > is 3, and the attribute is represented by a letter, the identification information may be 23A. Wherein 2 represents two stages.
S1320, replacing the label in the target node with an element label.
In this embodiment, if the attribute "lang" of the secondary node < title > needs to be modified to "X", X is replaced with lang.
According to the method, when the elements of the target page are modified, the modified content can be displayed on the target page only by replacing the elements to be modified with the target nodes of the target file object model, the target file object model where the target nodes are located is prestored in the memory and is modified to be changed in the virtual elements, the real file object model in the target page cannot be influenced, and the normal display of the target page can be ensured.
To solve the above technical problem, an embodiment of the present invention further provides a data modification apparatus. Referring to fig. 7, fig. 7 is a block diagram of a basic structure of the data modification apparatus of the present embodiment.
As shown in fig. 7, a data modification apparatus includes: an acquisition module 2100, a processing module 2200, and an execution module 2300. The obtaining module 2100 is configured to receive a modification request triggered by a user and used for modifying an element in a target page, where the modification request includes: element information needing to be modified in the target page; a processing module 2200, configured to invoke, from a memory, a target file object model that is the same as the original file object model of the target page according to the modification request; and the executing module 2300 is configured to modify the object model of the target file according to the element information, so that the modified element information is displayed in the target page.
According to the data modification device, when the element of the target page needs to be modified, the element is modified in the target file object model which is preset in the memory and is the same as the file object model of the target page. Therefore, because the target file object model is established in the memory and is modified to change the target page element in the virtual element, the real file object model of the target page cannot be influenced by operating the virtual element, and the target page can be ensured to be normally displayed.
In some embodiments, further comprising: the first obtaining sub-module is used for extracting the identification code of the target page from the modification request and searching an original file object model of the target page according to the identification code; the first processing submodule is used for traversing each node of the original file object model to obtain elements, attributes and labels of each node; and the first execution submodule is used for setting each node of a preset file object model in a memory according to the element, the attribute and the label of each node so as to obtain the target file object model.
In some embodiments, the first acquisition submodule includes: the second processing submodule is used for searching a file object model which has a mapping relation with the identification code in a preset database; and the second execution sub-module is used for taking the searched file object model as an original file object model of the target page.
In some embodiments, the original document object model comprises: a first level node, the first execution submodule comprising: the second obtaining submodule is used for extracting the attributes and labels of the primary nodes from the original file object model; and the third processing submodule is used for setting the attributes and the labels in the primary nodes of the preset file object model according to the attributes and the positions of the labels of the primary nodes.
In some embodiments, the level one node comprises: secondary nodes, wherein each secondary node further comprises a text node, and the first execution submodule comprises: the third obtaining submodule is used for extracting attributes and labels of the secondary nodes from each primary node and extracting texts from text nodes corresponding to the secondary nodes; and the fourth processing submodule is used for setting the attributes and the labels in the secondary nodes of the preset file object model according to the attributes and the positions of the labels of the secondary nodes, and setting the texts of the extracted texts in the text nodes corresponding to the secondary nodes.
In some embodiments, the element information includes: the element label and the identification information of the target node where the element label is located, the execution module comprises: a fourth obtaining submodule, configured to search, according to the identification information, a target node having a mapping relationship with the identification information in each node of the target file object model; and the third execution submodule is used for replacing the label in the target node with the element label.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer device. Referring to fig. 8, fig. 8 is a block diagram of a basic structure of a computer device according to the present embodiment.
As shown in fig. 8, the internal structure of the computer device is schematically illustrated. As shown in fig. 8, the computer apparatus includes a processor, a nonvolatile storage medium, a memory, and a network interface connected through a system bus. The non-volatile storage medium of the computer device stores an operating system, a database and computer readable instructions, the database can store control information sequences, and the computer readable instructions can enable the processor to realize a data modification method when being executed by the processor. The processor of the computer device is used for providing calculation and control capability and supporting the operation of the whole computer device. The memory of the computer device may have stored therein computer readable instructions that, when executed by the processor, may cause the processor to perform a data modification method. The network interface of the computer device is used for connecting and communicating with the terminal. Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In this embodiment, the processor is configured to execute specific contents of the obtaining module 2100, the processing module 2200, and the executing module 2300 in fig. 7, and the memory stores program codes and various data required for executing the modules. The network interface is used for data transmission to and from a user terminal or a server. The memory in this embodiment stores program codes and data required for executing all the sub-modules in the data modification method, and the server can call the program codes and data of the server to execute the functions of all the sub-modules.
According to the computer equipment, when the element of the target page needs to be modified, the element is modified in the target file object model which is preset in the memory and is the same as the file object model of the target page. Therefore, because the target file object model is established in the memory and is modified to change the target page element in the virtual element, the real file object model of the target page cannot be influenced by operating the virtual element, and the target page can be ensured to be normally displayed. .
The present invention also provides a storage medium storing computer-readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the data modification method of any of the above embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method of modifying data, comprising the steps of:
receiving a modification request triggered by a user and used for modifying elements in a target page, wherein the modification request comprises: element information needing to be modified in the target page;
calling a target file object model which is the same as the original file object model of the target page from a memory according to the modification request;
and modifying in the target file object model according to the element information so as to display the modified element information in the target page.
2. A data modification method as claimed in claim 1, wherein before said calling a target document object model identical to a document object model of said target page from a memory according to said modification request, the method comprises:
extracting the identification code of the target page from the modification request, and searching an original file object model of the target page according to the identification code;
traversing each node of the original file object model to obtain an element, an attribute and a label of each node;
and setting each node of a preset file object model in the memory according to the element, the attribute and the label of each node to obtain the target file object model.
3. The data modification method of claim 2, wherein the searching for the original document object model of the target page according to the identification code comprises:
searching a file object model having a mapping relation with the identification code in a preset database;
and taking the searched file object model as an original file object model of the target page.
4. A data modification method as claimed in claim 2, wherein the original file object model comprises: the first-level node, setting each node of a preset file object model in the memory according to the element, the attribute and the label of each node, comprises:
extracting attributes and labels of primary nodes from the original file object model;
and setting the attributes and the labels in the primary nodes of the preset file object model according to the attributes and the positions of the labels of the primary nodes.
5. The data modification method of claim 4, wherein the primary node comprises: each secondary node further comprises a text node, and the setting of each node of a preset file object model in a memory according to the element, the attribute and the label of each node comprises:
extracting attributes and labels of secondary nodes from each primary node, and extracting texts from text nodes corresponding to the secondary nodes;
setting attributes and labels in the secondary nodes of the preset file object model according to the attributes and the positions of the labels of the secondary nodes, and setting texts in text nodes corresponding to the secondary nodes by the extracted texts.
6. The data modification method according to claim 1, wherein the element information includes: the modifying the element tag and the identification information of the target node where the element tag is located in the target file object model according to the element information so as to display the modified element information in the target page includes:
searching a target node having a mapping relation with the identification information in each node of the target file object model according to the identification information;
replacing the label in the target node with the element label.
7. A data modification apparatus, comprising:
the obtaining module is used for receiving a modification request triggered by a user and used for modifying elements in a target page, wherein the modification request comprises: element information needing to be modified in the target page;
the processing module is used for calling a target file object model which is the same as the original file object model of the target page from a memory according to the modification request;
and the execution module is used for modifying in the target file object model according to the element information so as to display the modified element information in the target page.
8. The data modification apparatus of claim 7, further comprising:
the first obtaining sub-module is used for extracting the identification code of the target page from the modification request and searching an original file object model of the target page according to the identification code;
the first processing submodule is used for traversing each node of the original file object model to obtain elements, attributes and labels of each node;
and the first execution submodule is used for setting each node of a preset file object model in a memory according to the element, the attribute and the label of each node so as to obtain the target file object model.
9. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions which, when executed by the processor, cause the processor to carry out the steps of the data modification method of any one of claims 1 to 6.
10. A storage medium having stored thereon computer-readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the data modification method of any one of claims 1 to 6.
CN201910894920.5A 2019-09-20 2019-09-20 Data modification method and device, computer equipment and storage medium Pending CN110750683A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910894920.5A CN110750683A (en) 2019-09-20 2019-09-20 Data modification method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910894920.5A CN110750683A (en) 2019-09-20 2019-09-20 Data modification method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110750683A true CN110750683A (en) 2020-02-04

Family

ID=69276835

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910894920.5A Pending CN110750683A (en) 2019-09-20 2019-09-20 Data modification method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110750683A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111967229A (en) * 2020-09-01 2020-11-20 申建常 Efficient label type data analysis method and analysis system
CN113868565A (en) * 2021-09-23 2021-12-31 深圳市腾讯网域计算机网络有限公司 Skin style file editing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101169713A (en) * 2006-10-25 2008-04-30 中兴通讯股份有限公司 Model conversion frame supporting separation of conversion engine and mapping rule and the method
CN103246733A (en) * 2013-05-13 2013-08-14 浪潮集团山东通用软件有限公司 Dynamic form system based on metadata and generation method thereof
US20140359571A1 (en) * 2013-05-28 2014-12-04 Adobe Systems Incorporated Method and apparatus for dynamic document object model (dom) aware code editing
CN110069302A (en) * 2019-03-15 2019-07-30 平安普惠企业管理有限公司 Page configuration method, apparatus, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101169713A (en) * 2006-10-25 2008-04-30 中兴通讯股份有限公司 Model conversion frame supporting separation of conversion engine and mapping rule and the method
CN103246733A (en) * 2013-05-13 2013-08-14 浪潮集团山东通用软件有限公司 Dynamic form system based on metadata and generation method thereof
US20140359571A1 (en) * 2013-05-28 2014-12-04 Adobe Systems Incorporated Method and apparatus for dynamic document object model (dom) aware code editing
CN110069302A (en) * 2019-03-15 2019-07-30 平安普惠企业管理有限公司 Page configuration method, apparatus, computer equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111967229A (en) * 2020-09-01 2020-11-20 申建常 Efficient label type data analysis method and analysis system
CN113868565A (en) * 2021-09-23 2021-12-31 深圳市腾讯网域计算机网络有限公司 Skin style file editing method and device
CN113868565B (en) * 2021-09-23 2024-05-24 深圳市腾讯网域计算机网络有限公司 File editing method and device for skin styles

Similar Documents

Publication Publication Date Title
CN110362370B (en) Webpage language switching method and device and terminal equipment
Leydesdorff et al. Mapping the geography of science: Distribution patterns and networks of relations among cities and institutes
KR100849272B1 (en) Method for automatically summarizing Markup-type documents
CN100568226C (en) Be used for the method that reformatting has the zone of chaotic hyperlink
US7856601B2 (en) Dynamic service presentation
US20090144234A1 (en) Providing Suggestions During Formation of a Search Query
US20080120257A1 (en) Automatic online form filling using semantic inference
US8983965B2 (en) Document rating calculation system, document rating calculation method and program
CN104428734A (en) Input method editor application platform
GB2347329A (en) Converting electronic documents into a format suitable for a wireless device
CN111258577B (en) Page rendering method, device, electronic equipment and storage medium
US20220121668A1 (en) Method for recommending document, electronic device and storage medium
US10326858B2 (en) System and method for dynamically generating personalized websites
CN110851136A (en) Data acquisition method and device, electronic equipment and storage medium
CN110750683A (en) Data modification method and device, computer equipment and storage medium
US20080282150A1 (en) Finding important elements in pages that have changed
CN109814923B (en) Data processing method, device, computer equipment and storage medium
CN113127776A (en) Breadcrumb path generation method and device and terminal equipment
US7747628B2 (en) System and method for automated construction, retrieval and display of multiple level visual indexes
EP1204030A1 (en) Extending hypermedia documents by adding tagged attributes
CN109656942B (en) Method, device, computer equipment and storage medium for storing SQL (structured query language) sentences
Griffin Foundations of Popfly: rapid mashup development
CN116775934A (en) Three-dimensional visual data indexing method and system based on digital twinning
US8875007B2 (en) Creating and modifying an image wiki page
US20150324333A1 (en) Systems and methods for automatically generating hyperlinks

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200204

WD01 Invention patent application deemed withdrawn after publication