CN116860286A - Page dynamic update method, device, electronic equipment and computer readable medium - Google Patents

Page dynamic update method, device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN116860286A
CN116860286A CN202310700288.2A CN202310700288A CN116860286A CN 116860286 A CN116860286 A CN 116860286A CN 202310700288 A CN202310700288 A CN 202310700288A CN 116860286 A CN116860286 A CN 116860286A
Authority
CN
China
Prior art keywords
node
target
page
component
tree
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
CN202310700288.2A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202310700288.2A priority Critical patent/CN116860286A/en
Publication of CN116860286A publication Critical patent/CN116860286A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the disclosure discloses a page dynamic updating method, a page dynamic updating device, electronic equipment and a computer readable medium. One embodiment of the method comprises the following steps: acquiring page coding information of a target page; analyzing the page coding information to obtain a node tree, wherein each node in the node tree comprises a node attribute information group; and dynamically updating the target page based on the node tree. The implementation mode is related to interface visualization, and can dynamically update the page of the client application in real time, so that the page update efficiency is improved.

Description

Page dynamic update method, device, electronic equipment and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method, an apparatus, an electronic device, and a computer readable medium for dynamically updating a page.
Background
Page updating is a technique for updating an interface of an application. Currently, when updating a page, the following methods are generally adopted: firstly, a developer compiles, packages and publishes page codes based on the hong Monte system at a server side. Then, the code version of the application is downloaded and updated by the client, thereby completing the updating of the page.
However, the inventors have found that when updating a page in the above manner, there are often the following technical problems:
after the client application is released, the page can be updated only by compiling, packaging and releasing the new version at the server, so that the page of the client application cannot be dynamically updated in real time, and the page updating efficiency is reduced.
The above information disclosed in this background section is only for enhancement of understanding of the background of the inventive concept and, therefore, may contain information that does not form the prior art that is already known to those of ordinary skill in the art in this country.
Disclosure of Invention
The disclosure is in part intended to introduce concepts in a simplified form that are further described below in the detailed description. The disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose a page dynamic update method, apparatus, electronic device, and computer readable medium to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a method for dynamically updating a page, the method comprising: acquiring page coding information of a target page; analyzing the page coding information to obtain a node tree, wherein each node in the node tree comprises a node attribute information group; and dynamically updating the target page based on the node tree.
Optionally, the dynamically updating the target page based on the node tree includes: determining a component tree corresponding to the node tree; adding the component tree to a preset layout container component to obtain an updated layout container component; and adding the updated layout container component to the target page.
Optionally, the determining the component tree corresponding to the node tree includes: determining a node meeting the preset root node condition in the node tree as a target node; based on the target node, the following component tree creation steps are performed: in response to determining that the cache data identifier matched with the target node does not exist in the preset cache data identifier set, detecting the target node to obtain a node type identifier; in response to determining that the node type identifier satisfies a preset container type node condition, a component tree is created.
Optionally, the target node includes a parent node identifier; the method further comprises the following steps: responsive to determining that the node type identifier does not satisfy the preset container type node condition, creating an interface sub-component; adding the interface sub-component into a parent container interface component corresponding to a parent node identifier included in the target node; and in response to determining that the node type identifier meets a preset sibling node condition, updating the target node, and executing the component tree creation step again based on the updated target node.
Optionally, the method further comprises: in response to determining that the cache data identifier set has cache data identifiers matched with the target node, dynamically updating the target page based on the node attribute information set included by the target node; selecting one interface component corresponding to the target node from the interface components corresponding to the target page as a target interface component; adding a target interface component corresponding to the target node into a parent node interface component corresponding to the target node; detecting a target node to obtain a node type identifier; and creating a component tree corresponding to the target node based on the target interface component corresponding to the target node and the node type identifier.
Optionally, the creating the component tree includes: creating a parent container interface component corresponding to the target node; adding a parent container interface component corresponding to the target node into a parent node interface component corresponding to the target node; updating the target node, and executing the component tree creation step again based on the updated target node.
In a second aspect, some embodiments of the present disclosure provide a page dynamic updating apparatus, including: an acquisition unit configured to acquire page coding information of a target page; the analysis unit is configured to analyze the page coding information to obtain a node tree, wherein each node in the node tree comprises a node attribute information group; and the dynamic updating unit is configured to dynamically update the target page based on the node tree.
Optionally, the dynamic update unit is further configured to: determining a component tree corresponding to the node tree; adding the component tree to a preset layout container component to obtain an updated layout container component; and adding the updated layout container component to the target page.
Optionally, the dynamic update unit is still further configured to: determining a node meeting the preset root node condition in the node tree as a target node; based on the target node, the following component tree creation steps are performed: in response to determining that the cache data identifier matched with the target node does not exist in the preset cache data identifier set, detecting the target node to obtain a node type identifier; in response to determining that the node type identifier satisfies a preset container type node condition, a component tree is created.
Optionally, the target node includes a parent node identifier; and the dynamic update unit is further configured to: responsive to determining that the node type identifier does not satisfy the preset container type node condition, creating an interface sub-component; adding the interface sub-component into a parent container interface component corresponding to a parent node identifier included in the target node; and in response to determining that the node type identifier meets a preset sibling node condition, updating the target node, and executing the component tree creation step again based on the updated target node.
Optionally, the dynamic update unit is still further configured to: in response to determining that the cache data identifier set has cache data identifiers matched with the target node, dynamically updating the target page based on the node attribute information set included by the target node; selecting one interface component corresponding to the target node from the interface components corresponding to the target page as a target interface component; adding a target interface component corresponding to the target node into a parent node interface component corresponding to the target node; detecting a target node to obtain a node type identifier; and creating a component tree corresponding to the target node based on the target interface component corresponding to the target node and the node type identifier.
Optionally, the dynamic update unit is still further configured to: creating a parent container interface component corresponding to the target node; adding a parent container interface component corresponding to the target node into a parent node interface component corresponding to the target node; updating the target node, and executing the component tree creation step again based on the updated target node.
In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors causes the one or more processors to implement the method described in any of the implementations of the first aspect above.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
In a fifth aspect, some embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
The above embodiments of the present disclosure have the following advantageous effects: by the page dynamic updating method of some embodiments of the present disclosure, the page of the client application can be dynamically updated in real time, and the efficiency of page updating is improved. Specifically, the page of the client application cannot be dynamically updated in real time, and the reason for reducing the efficiency of page update is that: after the client application is released, the page can be updated only by compiling, packaging and releasing the new version at the server, so that the page of the client application cannot be dynamically updated in real time, and the page updating efficiency is reduced. Based on this, the page dynamic update method of some embodiments of the present disclosure first obtains the page coding information of the target page. Thus, a page-coded file that can be directly parsed at the client can be obtained. And then, analyzing the page coding information to obtain a node tree. Wherein each node in the node tree includes a node attribute information set. Thus, the page structure and the related attribute information can be obtained. And finally, dynamically updating the target page based on the node tree. Therefore, the page dynamic updating method of some embodiments of the present disclosure can analyze the page coding file by directly obtaining the page coding file to obtain the page structure and attribute information, so that the method can be directly used for dynamically updating the target page in real time. And because, when the page needs to be updated, the server is not required to compile, package and release the new version of the client application, and only the page coding file is required to be directly released for the client to download. Furthermore, the efficiency of page update can be improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a schematic illustration of one application scenario of a page dynamic update method according to some embodiments of the present disclosure;
FIG. 2 is a system architecture diagram of a page dynamic update method or page dynamic update apparatus according to some embodiments of the present disclosure;
FIG. 3 is a flow chart of some embodiments of a page dynamic update method according to the present disclosure;
FIG. 4 is a flow chart of other embodiments of a page dynamic update method according to the present disclosure;
FIG. 5 is a schematic diagram of the structure of some embodiments of a page dynamic update device according to the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of an application scenario of a page dynamic update method according to some embodiments of the present disclosure.
In the application scenario of fig. 1, first, the electronic device 101 may acquire page coding information 103 of the target page 102. Then, the page code information 103 is analyzed to obtain a node tree 104. Wherein each node in the node tree 104 includes a node attribute information set. For example, the node tree 104 may include node 1, node 2, node 3, and node 4. The above node 1 is the root node of the node tree 104. The node 1 is connected with 2 child nodes. The child node may be a child node. The child nodes of the node 1 may include a node 2 and a node 3. The node 4 may be a child node of the node 2. Finally, the target page 102 is dynamically updated based on the node tree 104.
The electronic device 101 may be hardware or software. When the electronic device is hardware, the electronic device may be implemented as a distributed cluster formed by a plurality of servers or terminal devices, or may be implemented as a single server or a single terminal device. When the electronic device is embodied as software, it may be installed in the above-listed hardware device. It may be implemented as a plurality of software or software modules, for example, for providing distributed services, or as a single software or software module. The present invention is not particularly limited herein.
It should be understood that the number of terminal devices in fig. 1 is merely illustrative. There may be any number of electronic devices as desired for an implementation.
Fig. 2 illustrates an exemplary system architecture 200 of a page dynamic update method or page dynamic update apparatus of some embodiments of the present disclosure.
As shown in fig. 2, the system architecture 200 may include a UI (User Interface) description 201, a server 202, and a terminal device 203. The UI description file 201 may be a file describing a UI component to be updated or created. The developer may upload and publish the UI description file 201 to the server 202. The terminal device 203 downloads the UI description file 201 from the server 202, parses the UI description file 201, and assembles the respective UI components.
The terminal device 203 may be hardware or software. When the terminal device 203 is hardware, it may be various electronic devices having a display screen and supporting a hong system, including but not limited to a smart phone, a tablet computer, an electronic book reader, and the like. When the terminal device 203 is software, it can be installed in the above-listed electronic devices. It may be implemented as a plurality of software or software modules, for example, for providing distributed services, or as a single software or software module. The present invention is not particularly limited herein.
With continued reference to fig. 3, a flow 300 of some embodiments of a page dynamic update method according to the present disclosure is shown. The page dynamic updating method comprises the following steps:
step 301, obtaining page coding information of a target page.
In some embodiments, the execution body of the page dynamic update method (for example, the electronic device 101 shown in fig. 1) may acquire the page coding information of the target page from the server through a wired connection manner or a wireless connection manner. The target page may be a page of a user interface to be updated in the client application program. The client may be a hong-and-Monte system based terminal. The page may include various components. The above page-coded information may be a DSL (Domain Specific Language, domain-specific language) file describing the individual UI components to be updated or created in the target page. For example, the UI components described above may include, but are not limited to, at least one of: text component, form component, button component, picture component. The DSL file may be a file written using a preset format. The preset format may be a preset format. For example, the above formats may include, but are not limited to, at least one of: XML (Extensible Markup Language), JSON (JavaScript Object Notation, JS object representation) format, protocol buffer (Protocol Buffers) format. It should be noted that the wireless connection may include, but is not limited to, 3G/4G connections, wiFi connections, bluetooth connections, wiMAX connections, zigbee connections, UWB (ultra wideband) connections, and other now known or later developed wireless connection means.
And step 302, analyzing the page coding information to obtain a node tree.
In some embodiments, the execution body may parse the page coding information to obtain a node tree. The node tree may be a tree structure composed of nodes. The above-described node tree may characterize the structural relationships between the various nodes. The above structural relationships may include, but are not limited to, at least one of: parent-child node relationships, sibling node relationships. The parent-child node relationship may characterize that one node is the parent node of another node. The sibling relationship may characterize that two nodes correspond to the same parent node and are siblings of each other. Each node in the above-described node tree may include a node attribute information set. Each node in the above-described node tree may represent a UI component. The node attribute information set may characterize respective attributes of the corresponding UI component. For example, the various attributes described above may include, but are not limited to, at least one of: font, font size, color, width, height, etc. The node attribute information in the node attribute information group may be a value of one attribute corresponding to the UI component. Each node in the above-described node tree may also include a node identification, a component type identification, a child node identification, and an adjacent sibling node identification. The node identifier may be an identifier of a node. The node identifiers are in one-to-one correspondence with the nodes. For example, the node identifier may be an ID (IDentity) code of the node. The component type identifier may be an identifier of a type to which the UI component corresponding to the node belongs. The component type identifiers are in one-to-one correspondence with the types to which the components belong. For example, the types described above may include, but are not limited to, at least one of: text type, form type, button type. The text types described above may characterize the UI component as a text component. The form types described above may characterize the UI component as a form component. The button type characterization UI component is a button component. The child node identifier may be an identifier of a first child node of the corresponding node from the left side in the tree structure. The child node identifiers are in one-to-one correspondence with the child nodes of the corresponding nodes. The adjacent sibling node identifier may be a node identifier included in the adjacent sibling node. The adjacent brother node identifiers are in one-to-one correspondence with the adjacent brother nodes. The adjacent sibling node may be the first node to the right of the node, which has the same parent node as the node in the tree structure. The execution main body can analyze the page coding information according to the format of the page coding information by a preset analysis method to obtain a node tree.
As an example, if the format of the page coding information is XML format, the parsing method may include, but is not limited to, at least one of the following: DOM (Document Object Model ) parsing, elementTree parsing, jrom (Java Document Object Model, document object model of Java) parsing.
It should be noted that if there is no sibling node to the right of the node, the node does not include the adjacent sibling node identification. If the node is not connected with a child node, the node does not include a child node identification.
Step 303, dynamically updating the target page based on the node tree.
In some embodiments, the execution body may traverse the node tree through a preset rendering method, so as to generate each UI component corresponding to each node, and render each UI component to the target page one by one.
As an example, the preset rendering method may include, but is not limited to, at least one of: the renderer, angular component of the Vue framework creates the instructions.
The above embodiments of the present disclosure have the following advantageous effects: by the page dynamic updating method of some embodiments of the present disclosure, the page of the client application can be dynamically updated in real time, and the efficiency of page updating is improved. Specifically, the page of the client application cannot be dynamically updated in real time, and the reason for reducing the efficiency of page update is that: after the client application is released, the page can be updated only by compiling, packaging and releasing the new version at the server, so that the page of the client application cannot be dynamically updated in real time, and the page updating efficiency is reduced. Based on this, the page dynamic update method of some embodiments of the present disclosure first obtains the page coding information of the target page. Thus, a page-coded file that can be directly parsed at the client can be obtained. And then, analyzing the page coding information to obtain a node tree. Wherein each node in the node tree includes a node attribute information set. Thus, the page structure and the related attribute information can be obtained. And finally, dynamically updating the target page based on the node tree. Therefore, the page dynamic updating method of some embodiments of the present disclosure can analyze the page coding file by directly obtaining the page coding file to obtain the page structure and attribute information, so that the method can be directly used for dynamically updating the target page in real time. And because, when the page needs to be updated, the server is not required to compile, package and release the new version of the client application, and only the page coding file is required to be directly released for the client to download. Furthermore, the efficiency of page update can be improved.
With further reference to FIG. 4, a flow 400 of further embodiments of a page dynamic update method is shown. The flow 400 of the page dynamic update method includes the following steps:
step 401, acquiring page coding information of a target page.
And step 402, analyzing the page coding information to obtain a node tree.
In some embodiments, the specific implementation of steps 401 to 402 and the technical effects thereof may refer to steps 301 to 302 in the corresponding embodiment of fig. 3, which are not described herein.
Step 403, determining a component tree corresponding to the node tree.
In some embodiments, the execution body may determine a component tree corresponding to the node tree. The component tree may be a tree-like code block formed by the UI components. UI components in the component tree are in one-to-one correspondence with nodes in the node tree. The execution main body can traverse the node tree through a preset traversing method to generate a corresponding component tree. It should be noted that, in the traversal process, one node is traversed each time, and a corresponding UI component is created.
As an example, the above traversal method may include, but is not limited to, at least one of: hierarchical traversal, medium-order traversal.
In some optional implementations of some embodiments, the executing entity may determine the component tree corresponding to the node tree by:
and determining the node meeting the preset root node condition in the node tree as a target node. The preset root node condition may be that a node is a node at the top of the node tree, and is not connected with a parent node. The parent node may be a parent node of the target node.
Second, based on the target node, the following component tree creation step is performed:
and a first sub-step, in response to determining that the cache data identifier matched with the target node does not exist in the preset cache data identifier set, detecting the target node to obtain the node type identifier. The cache data identifier in the preset cache data identifier set may be an identifier corresponding to one UI component, which is stored in the cache area in advance. The matching with the target node may be that the cached data identity is the same as the node identity comprised by the target node. The node type identifier may be an identifier of a node type. The node type may characterize whether a node is connected with children and whether there are adjacent sibling nodes to the right of the node. First, the execution body may determine, in response to determining that the child node identifier and the adjacent sibling node identifier exist in the target node, a preset first type identifier as the node type identifier. The preset first type identifier may be a preset identifier. The first type of identification may characterize that the target node is connected with a child node and that there is a neighboring sibling node to the right. Then, in response to determining that the child node identity exists in the target node and no adjacent sibling node identities exist, a preset second type identity is determined to be the node type identity. The preset second type identifier may be a preset identifier. The second type of identification may characterize that the target node is connected with a child node and no adjacent sibling node exists on the right side. And finally, in response to determining that the adjacent brother node identification exists in the target node and the child node identification does not exist, determining the preset third type identification as the node type identification. The preset third type identifier may be a preset identifier. The third type identifier may indicate that the target node is not connected with a child node and that there is a neighboring sibling node to the right.
And a second sub-step of creating a component tree in response to determining that the node type identifier satisfies a preset container type node condition. The preset container type node condition may be that the node type identifier is the same as the first type identifier, or that the node type identifier is the same as the second type identifier. The execution body can traverse the node tree taking the target node as the root node through the traversing method so as to generate a corresponding component tree.
In some alternative implementations of some embodiments, the above-described execution bodies may further create the component tree by:
step one, a parent container interface component corresponding to a target node is created. Wherein, the parent container interface component can be a container component capable of accommodating and placing other UI components. The container assembly may be an interface assembly. For example, the container assembly described above may include, but is not limited to, at least one of: form component, list component, tab component, horizontal layout component, vertical layout component. Text components and button components may be added to the form components described above. Firstly, the execution body may select, from a preset set of resolvers, a resolver that matches the component type identifier according to the component type identifier included in the target node. The resolvers in the preset resolvers set may be UI resolvers corresponding to the UI components. Matching the component type identifier may be that the UI component corresponding to the UI resolver is the same as the UI component corresponding to the component type identifier. And then, analyzing the target node through the selected UI analyzer to obtain a parent container interface component. And finally, assigning each attribute of the parent container interface component according to the node attribute information group included by the target node.
And step two, adding the parent container interface component corresponding to the target node into the parent node interface component corresponding to the target node. The parent node interface component may be an interface component corresponding to a parent node of the target node. The parent container interface component corresponding to the target node can be added to the interface component corresponding to the parent node of the target node through the UI parser corresponding to the parent container interface component.
And step three, updating the target node, and executing the component tree creation step again based on the updated target node. The child node corresponding to the child node identifier included in the target node may be determined as the target node, and the above component tree creation step may be performed again.
Optionally, the executing body may further update the target node in response to determining that the node type identifier satisfies a preset sibling condition, and execute the component tree creating step again based on the updated target node. First, the execution body may determine a node corresponding to the adjacent sibling node identifier included in the target node as a sibling update node. The target node is then updated with sibling update nodes. And finally, executing the component tree creation step again according to the updated target node.
Alternatively, the target node may include a parent node identification. Wherein, the parent node identification may be the identification of the parent node of the target node. The father node identifiers are in one-to-one correspondence with the father nodes of the target node. The parent nodes are in one-to-one correspondence with the parent container interface components. The execution body may further execute the steps of:
first, in response to determining that the node type identifier does not satisfy the preset container type node condition, an interface sub-component is created. The interface sub-component may be an interface component that is different from the parent container interface component and cannot accommodate and place other UI components. First, the execution body may select one UI parser matching the component type identifier from the UI parser set according to the component type identifier included in the target node. And then, analyzing the target node through the selected UI analyzer to obtain an interface sub-component. And finally, assigning each attribute of the interface sub-assembly according to the node attribute information group included by the target node.
And secondly, adding the interface sub-component into a parent container interface component corresponding to a parent node identifier included in the target node. The interface sub-component can be added into a parent container interface component corresponding to a parent node identifier included in the target node through a UI parser corresponding to the interface sub-component.
And thirdly, updating the target node in response to determining that the node type identifier meets the preset brother node condition, and executing the component tree creation step again based on the updated target node. The preset sibling node condition may be that the node type identifier is the same as the first type identifier, or that the node type identifier is the same as the third type identifier. First, a node corresponding to the adjacent sibling node identifier included in the target node may be determined as the target node, and the above component tree creation step may be performed again.
Optionally, the above execution body may further execute the following steps:
and a first step of dynamically updating the target page based on the node attribute information group included in the target node in response to determining that the cache data identifier matched with the target node exists in the cache data identifier set. First, the execution body may select one UI parser matching the component type identifier from a preset UI parser set according to a node identifier included in the target node. And then, searching the target page through the selected UI parser to determine the UI component corresponding to the target node. And finally, assigning values to the searched attributes of the UI components according to the node attribute information group included in the target node.
And step two, selecting one interface component corresponding to the target node from the interface components corresponding to the target page as a target interface component corresponding to the target node. The cache data identifier corresponding to the UI component on the target page, which corresponds to the target node, is the same as the node identifier included in the target node.
And thirdly, adding the target interface component corresponding to the target node into the parent node interface component corresponding to the target node.
Fourth, detecting the target node to obtain the node type identification. First, the execution body may determine the first type identifier as a node type identifier in response to determining that a child node identifier and a neighboring sibling node identifier exist in the target node. Then, in response to determining that there is a child node identity in the target node and no adjacent sibling node identity is present, the above-described second type identity is determined to be a node type identity. Finally, in response to determining that there is a neighboring sibling node identity and no child node identity in the target node, determining the third type identity as a node type identity.
And fifthly, creating a component tree corresponding to the target node based on the target interface component corresponding to the target node and the node type identifier. The execution body may create the component tree corresponding to the target node by:
A first sub-step of creating a component tree in response to determining that the node type identifier satisfies a preset target container type node condition. The preset target container type node condition may be that the node type identifier is the same as the first type identifier, or that the node type identifier is the same as the second type identifier. The execution subject may create the component tree by:
and step one, determining the node corresponding to the child node identification included in the target node as the target node, and executing the component tree creation step again.
Optionally, the executing body may further update the target node in response to determining that the node type identifier satisfies a preset target type node condition, and execute the component tree creating step again based on the updated target node. The preset target type node condition may be that the node type identifier is the same as the third type identifier. The node corresponding to the adjacent sibling node identification included in the target node may be determined as the target node, and the above component tree creation step may be performed again.
Step 404, adding the component tree to a preset layout container component to obtain an updated layout container component.
In some embodiments, the execution body may add the component tree to a preset layout container component to obtain an updated layout container component. The preset layout container assembly may be a preset container assembly for interface layout. The layout container assembly described above may include, but is not limited to, at least one of: row component, column component, flex (layout model) component. The updated layout container component may be a layout container component after adding a component tree.
At step 405, the updated layout container component is added to the target page.
In some embodiments, the execution body may add the updated layout container component to the target page through a preset page script. The preset page script may be a preset JavaScript script.
As can be seen in FIG. 4, flow 400 of the page dynamic update method in some embodiments corresponding to FIG. 4 embodies the step of dynamically updating the target page according to the node tree, as compared to the description of some embodiments corresponding to FIG. 3. Therefore, the schemes described in these embodiments can determine the corresponding component tree according to the node tree, and then add the component tree to the corresponding position on the page through the layout container component, so as to complete the quick dynamic update of the page. In addition, in the process of determining the component tree, the repeated creation is not needed for the components of which the pages already exist, and only the attribute values of the components are updated. Thus, the update speed of the target page can be increased.
With further reference to fig. 5, as an implementation of the method shown in the foregoing figures, the present disclosure provides some embodiments of a page dynamic updating apparatus, which correspond to those method embodiments shown in fig. 3, and which are particularly applicable to various electronic devices.
As shown in fig. 5, a page dynamic update apparatus 500 includes: an acquisition unit 501, a parsing unit 502 and a dynamic updating unit 503. Wherein, the acquiring unit 501 is configured to acquire page coding information of a target page; a parsing unit 502 configured to parse the page coding information to obtain a node tree, where each node in the node tree includes a node attribute information group; the dynamic updating unit 503 is configured to dynamically update the target page based on the node tree.
In some alternative implementations of some embodiments, the dynamic update unit 503 may be further configured to: determining a component tree corresponding to the node tree; adding the component tree to a preset layout container component to obtain an updated layout container component; and adding the updated layout container component to the target page.
In some alternative implementations of some embodiments, the dynamic update unit 503 may be further configured to: determining a node meeting the preset root node condition in the node tree as a target node; based on the target node, the following component tree creation steps are performed: in response to determining that the cache data identifier matched with the target node does not exist in the preset cache data identifier set, detecting the target node to obtain a node type identifier; in response to determining that the node type identifier satisfies a preset container type node condition, a component tree is created.
In some optional implementations of some embodiments, the target node includes a parent node identification; and the dynamic update unit 503 may be further configured to: responsive to determining that the node type identifier does not satisfy the preset container type node condition, creating an interface sub-component; adding the interface sub-component into a parent container interface component corresponding to a parent node identifier included in the target node; and in response to determining that the node type identifier meets a preset sibling node condition, updating the target node, and executing the component tree creation step again based on the updated target node.
In some alternative implementations of some embodiments, the dynamic update unit 503 may be still further configured to: in response to determining that the cache data identifier set has cache data identifiers matched with the target node, dynamically updating the target page based on the node attribute information set included by the target node; selecting one interface component corresponding to the target node from the interface components corresponding to the target page as a target interface component; adding a target interface component corresponding to the target node into a parent node interface component corresponding to the target node; detecting a target node to obtain a node type identifier; and creating a component tree corresponding to the target node based on the target interface component corresponding to the target node and the node type identifier.
In some alternative implementations of some embodiments, the dynamic update unit 503 may be further configured to: creating a parent container interface component corresponding to the target node; adding a parent container interface component corresponding to the target node into a parent node interface component corresponding to the target node; updating the target node, and executing the component tree creation step again based on the updated target node.
It will be appreciated that the elements described in the page dynamic updating apparatus 500 correspond to the various steps in the method described with reference to fig. 3. Thus, the operations, features and resulting benefits described above with respect to the method are equally applicable to the apparatus 500 and the units contained therein, and are not described in detail herein.
Referring now to fig. 6, a schematic diagram of an electronic device 600 (e.g., electronic device 101 of fig. 1) suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is merely an example and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 6 may represent one device or a plurality of devices as needed.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure 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 shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via communications device 609, or from storage device 608, or from ROM 602. The above-described functions defined in the methods of some embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that, in some embodiments of the present disclosure, the computer readable medium may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 some embodiments of the present disclosure, 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 some embodiments of the present disclosure, however, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. 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 of the foregoing. A computer readable signal medium may also be any computer readable medium that is not 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: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: determining a component tree corresponding to the node tree; adding the component tree to a preset layout container component to obtain an updated layout container component; and adding the updated layout container component to the target page.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. 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 described in some embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor includes an acquisition unit, a parsing unit, and a dynamic update unit. The names of these units do not constitute a limitation on the unit itself in some cases, and for example, the acquisition unit may also be described as "a unit that acquires page code information of a target page".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
Some embodiments of the present disclosure also provide a computer program product comprising a computer program which, when executed by a processor, implements any of the page dynamic update methods described above.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.

Claims (10)

1. A method for dynamically updating a page, comprising:
acquiring page coding information of a target page;
analyzing the page coding information to obtain a node tree, wherein each node in the node tree comprises a node attribute information group;
and dynamically updating the target page based on the node tree.
2. The method of claim 1, wherein the dynamically updating the target page based on the node tree comprises:
determining a component tree corresponding to the node tree;
adding the component tree to a preset layout container component to obtain an updated layout container component;
and adding the updated layout container component to the target page.
3. The method of claim 2, wherein the determining the component tree to which the node tree corresponds comprises:
determining a node meeting the preset root node condition in the node tree as a target node;
based on the target node, the following component tree creation steps are performed:
in response to determining that the cache data identifier matched with the target node does not exist in the preset cache data identifier set, detecting the target node to obtain a node type identifier;
In response to determining that the node type identifier satisfies a preset container type node condition, a component tree is created.
4. A method according to claim 3, wherein the target node comprises a parent node identification; and
the method further comprises the steps of:
responsive to determining that the node type identifier does not satisfy the preset container type node condition, creating an interface sub-component;
adding the interface sub-component into a parent container interface component corresponding to a parent node identifier included in the target node;
and in response to determining that the node type identifier meets a preset sibling node condition, updating the target node, and executing the component tree creation step again based on the updated target node.
5. A method according to claim 3, wherein the method further comprises:
in response to determining that the cache data identifier set has cache data identifiers matched with the target node, dynamically updating the target page based on the node attribute information set included by the target node;
selecting one interface component corresponding to the target node from the interface components corresponding to the target page as a target interface component;
adding a target interface component corresponding to the target node into a parent node interface component corresponding to the target node;
Detecting a target node to obtain a node type identifier;
and creating a component tree corresponding to the target node based on the target interface component corresponding to the target node and the node type identifier.
6. The method of claim 5, wherein the creating a component tree comprises:
creating a parent container interface component corresponding to the target node;
adding a parent container interface component corresponding to the target node into a parent node interface component corresponding to the target node;
updating the target node, and executing the component tree creation step again based on the updated target node.
7. A page dynamic updating apparatus comprising:
an acquisition unit configured to acquire page coding information of a target page;
the analysis unit is configured to analyze the page coding information to obtain a node tree, wherein each node in the node tree comprises a node attribute information group;
and the dynamic updating unit is configured to dynamically update the target page based on the node tree.
8. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
9. A computer readable medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the method of any of claims 1-6.
10. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-6.
CN202310700288.2A 2023-06-13 2023-06-13 Page dynamic update method, device, electronic equipment and computer readable medium Pending CN116860286A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310700288.2A CN116860286A (en) 2023-06-13 2023-06-13 Page dynamic update method, device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310700288.2A CN116860286A (en) 2023-06-13 2023-06-13 Page dynamic update method, device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN116860286A true CN116860286A (en) 2023-10-10

Family

ID=88231257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310700288.2A Pending CN116860286A (en) 2023-06-13 2023-06-13 Page dynamic update method, device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN116860286A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117093218A (en) * 2023-10-19 2023-11-21 浪潮通用软件有限公司 Front-end interface rendering method, device and medium based on interface description

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117093218A (en) * 2023-10-19 2023-11-21 浪潮通用软件有限公司 Front-end interface rendering method, device and medium based on interface description
CN117093218B (en) * 2023-10-19 2024-01-26 浪潮通用软件有限公司 Front-end interface rendering method, device and medium based on interface description

Similar Documents

Publication Publication Date Title
CN111274760B (en) Rich text data processing method and device, electronic equipment and computer storage medium
CN109814866B (en) Processing method and device for converting page application into native application
CN110457144B (en) Method, device, medium and equipment for realizing front-end application
CN111324342B (en) Method, device, medium and electronic equipment for generating interface layer code
CN110780874B (en) Method and device for generating information
CN111930534A (en) Data calling method and device and electronic equipment
CN112684968A (en) Page display method and device, electronic equipment and computer readable medium
CN112631590B (en) Component library generation method, device, electronic equipment and computer readable medium
CN111338944B (en) Remote Procedure Call (RPC) interface testing method, device, medium and equipment
CN116860286A (en) Page dynamic update method, device, electronic equipment and computer readable medium
CN111857719A (en) Data processing method, device, electronic equipment and medium
CN111600920B (en) JS-based data request proxy method, device, equipment and readable storage medium
CN113721910A (en) Interface code generation method and device, electronic equipment and computer readable medium
CN111191225B (en) Method, device, medium and electronic equipment for switching isolated objects
CN111787041B (en) Method and device for processing data
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN112558933A (en) Component rendering method and device, readable medium and electronic equipment
CN111124541A (en) Configuration file generation method, device, equipment and medium
CN113468342B (en) Knowledge graph-based data model construction method, device, equipment and medium
CN112199094B (en) Information display method, information display device, electronic equipment and computer readable medium
CN109669720B (en) Chain type asynchronous request processing method and device based on Promise and electronic equipment
CN111008178A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN112445517B (en) Inlet file generation method, device, electronic equipment and computer readable medium
CN116880901B (en) Application page analysis method, device, electronic equipment and computer readable medium
CN111241538B (en) Method, device, medium and electronic equipment for protecting node object variable

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