CN107315646B - Method and device for controlling data flow between page components - Google Patents

Method and device for controlling data flow between page components Download PDF

Info

Publication number
CN107315646B
CN107315646B CN201610270495.9A CN201610270495A CN107315646B CN 107315646 B CN107315646 B CN 107315646B CN 201610270495 A CN201610270495 A CN 201610270495A CN 107315646 B CN107315646 B CN 107315646B
Authority
CN
China
Prior art keywords
component
page
data
components
level
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610270495.9A
Other languages
Chinese (zh)
Other versions
CN107315646A (en
Inventor
曾瑞文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke 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 Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201610270495.9A priority Critical patent/CN107315646B/en
Publication of CN107315646A publication Critical patent/CN107315646A/en
Application granted granted Critical
Publication of CN107315646B publication Critical patent/CN107315646B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/543User-generated data transfer, e.g. clipboards, dynamic data exchange [DDE], object linking and embedding [OLE]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Abstract

The application discloses a method and a device for controlling data flow among page components. One embodiment of the method comprises: analyzing the structure of a page document, and acquiring a nested hierarchical relationship among page components, wherein the page components comprise data elements and callback functions, and in the nested hierarchical relationship, a lower component is nested in a higher component; and rendering each page component according to the nesting hierarchical relationship from the upper component to the lower component, wherein when the upper component is rendered, the data elements and the callback functions are transmitted to the lower component. The implementation mode can improve the effectiveness of data flow control among page components.

Description

Method and device for controlling data flow between page components
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of page display technologies, and in particular, to a method and an apparatus for controlling data flow between page components.
Background
In the field of computers, page componentization, that is, page modularization, data elements (data elements, a basic unit of data, a data element may be composed of a plurality of indivisible data items), functions, communication protocols, and other data of a page are often encapsulated to form a plurality of page components in front-end display of the page, thereby realizing page componentization. In the packaging process, the control of data flow among page components (such as configuration, rendering of data, communication among events and the like) directly influences the difficulty and efficiency of page front-end development, and even the maintainability of engineering.
The existing data flow control method between page components usually comprises two modes of event communication and proxy service. In the event communication mode, data only goes from an event trigger to an event registrar, and for a page with a complex structure, the data flow is easy to be disordered; in the proxy service mode, data is managed by the same proxy service, and because a plurality of components depend on the proxy service at the same time, the requirement of low coupling among the components cannot be met. Therefore, the existing method for controlling the data flow among the page components has the problem of low effectiveness.
Disclosure of Invention
The present application is directed to an improved method and apparatus for controlling data flow between page components, so as to solve the technical problems mentioned in the background section above.
In one aspect, the present application provides a method for controlling data flow between page components, where the method includes: analyzing the structure of a page document, and acquiring a nested hierarchical relationship among page components, wherein the page components comprise data elements and callback functions, and in the nested hierarchical relationship, a lower component is nested in a higher component; and rendering each page component according to the nesting hierarchical relationship from the upper component to the lower component, wherein when the upper component is rendered, the data elements and the callback functions are transmitted to the lower component.
In some embodiments, the rendering the page components in order from the upper level component to the lower level component according to the nested hierarchical relationship includes: caching the data types of the data elements in the lower-level assembly when the upper-level assembly is rendered; and when the lower-level assembly is rendered, taking out the required data type from the buffer for verification, and rendering if the verification is passed.
In some embodiments, the check includes at least one of a check of a data communication protocol, a check of a data type field.
In some embodiments, said passing the data element and the callback function to the lower level component while rendering the upper level component comprises: and caching the data elements and the callback functions in the lower-level components in a reference transfer mode.
In some embodiments, the method further comprises: detecting whether a document attribute value of each page component changes or not, wherein the document attribute value comprises a data element in the page component or a value of an index or a pointer of a callback function; if the document attribute value of any page component changes, sending the changed change information to a superior component of the changed page component through a callback function; and re-rendering the upper-level component of the changed page component and the changed page component according to the change information.
In a second aspect, the present application provides an apparatus for controlling data flow between page components, the apparatus comprising: the system comprises an analysis module, a page component and a page component module, wherein the analysis module is configured to analyze the structure of a page document and acquire the nesting hierarchical relationship among the page components, the page components comprise data elements and callback functions, and in the nesting hierarchical relationship, a lower component is nested in a higher component; and the rendering module is configured to render each page component according to the nesting hierarchical relationship and in the sequence from the upper component to the lower component, wherein when the upper component is rendered, the data elements and the callback functions are transmitted to the lower component.
In some embodiments, the rendering module comprises: the cache unit is configured to cache the data types of the data elements in the lower level assembly when the upper level assembly is rendered; and the verification unit is configured to take out the required data type from the buffer for verification when the lower-level component is rendered, and render the lower-level component if the verification is passed.
In some embodiments, the check includes at least one of a check of a data communication protocol, a check of a data type field.
In some embodiments, the rendering module is further configured to: and caching the data elements and the callback functions in the lower-level components in a reference transfer mode.
In some embodiments, the apparatus further comprises: the detection module is configured to detect whether a document attribute value of each page component changes, wherein the document attribute value comprises a data element in the page component or a value of an index or a pointer of a callback function; the sending module is configured to send the changed change information to a superior component of the changed page component through a callback function if the document attribute value of any page component changes; the rendering module is further configured to re-render the upper level component of the changed page component and the changed page component according to the change information.
According to the method and the device for controlling the data flow among the page components, the nested hierarchical relationship among the page components is obtained by analyzing the structure of a page document, wherein in the nested hierarchical relationship, a lower component is nested in an upper component, the page components comprise data elements and callback functions, then the page components are rendered according to the nested hierarchical relationship and the sequence from the upper component to the lower component, and when the upper component is rendered, the data elements and the callback functions are transmitted to the lower component. Because each page component is rendered according to the sequence from the upper component to the lower component, and the data elements and the callback functions are transmitted from the upper component to the lower component in the rendering process, the data flow is single, the use of proxy service is avoided, the coupling degree between the components is low, and the effectiveness of controlling the data flow between the page components can be improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, with reference to the accompanying drawings in which:
FIG. 1 is a flow diagram of one embodiment of a method for controlling data flow between page components according to the present application;
FIG. 2 is a diagram illustrating nested hierarchical relationships between page components formed by encapsulating data elements in a page;
FIG. 3 is a schematic diagram illustrating data flow control of the page components shown in FIG. 2 according to one embodiment of a method for controlling data flow between page components of the present application;
FIG. 4 is a flow diagram of yet another embodiment of a method for controlling data flow between page components according to the present application;
FIG. 5 illustrates an exemplary system architecture to which embodiments of the present application may be applied;
FIG. 6 is a block diagram illustrating one embodiment of an apparatus for controlling the flow of data between page components according to the present application;
FIG. 7 is a block diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Referring to FIG. 1, a flow 100 of one embodiment of a method for controlling data flow between page components is shown. The embodiment is mainly exemplified by applying the method to an electronic device with certain computing capability and display capability. The data flow control method among the page components comprises the following steps:
step 101, analyzing the structure of the page document to obtain the nesting hierarchical relationship among the page components.
In this embodiment, the electronic device may first parse the structure of the page document, so as to obtain a nested hierarchical relationship between page components, where the page components may include data elements and callback functions. In a nested hierarchical relationship, a lower level component is nested with an upper level component.
Here, the page document may include, but is not limited to, one of the following documents: HTML (HyperText Markup Language) documents, ASP (Active Server Pages) documents, JSP (Java Server Pages) documents, and the like. The structure of a document may be used to represent a hierarchical relationship of the content of the document. The structure of the Document may be recorded in various forms, for example, the structure of the Document may be recorded by a DOM (Document Object Model) tree. Each tree can be encapsulated into a page component through the document structure described by the DOM tree, for example, the entire DOM tree is encapsulated into the largest page component, each sub-tree of the DOM tree is encapsulated into a lower level component nested in the largest page component, sub-trees under each sub-tree can be encapsulated into lower level components nested in the page component into which the sub-tree is encapsulated, and so on.
As an example, FIG. 2 illustrates a diagram of a nested hierarchy between components that encapsulate data elements in a page to form a page. As shown in fig. 2, page 201 includes two larger tiles 2011, 2012, tile 2011 includes data elements 20111, 20112, and 20113, tile 2012 includes data elements 20121 and 20122, which are packaged into page component 202 of corresponding page 201, lower component page components 2021 and 2022 of page component 202, lower component page components 20211, 20212, and 20213 of page component 2021, and lower component page components 20221 and 20222 of page component 2022, respectively. The nested hierarchical relationship obtained by analyzing the structure of the page 201 by the electronic device is as follows: page components 2021 and 2022 are nested within page component 202, page components 20211, 20212, and 20213 are nested within page component 2021, and page components 20221 and 20222 are nested within page component 2022.
Wherein the minimum unit of each page component may include a data element and a callback function. Here, the callback function is a function called by a pointer, for example, a pointer or an address of a function a is passed as a parameter to another function B, and the function B can call the function a by the pointer or the address of the function a, and then the function a is a callback function. The data element may be, for example, bibliographic information of a book, and each item of bibliographic information (e.g., title, author name, etc.) is a data item.
And 102, rendering each page component according to the sequence from the upper component to the lower component according to the nesting hierarchical relationship.
In this embodiment, the electronic device may then render the page components in order from the upper-level component to the lower-level component according to the nesting hierarchical relationship obtained in step 101. During the rendering process of the upper-level component, the data elements and callback functions required by the lower-level component can be transferred to the lower-level component. Thus, the data flow of the data elements and the callback function in the page component is from the upper level component to the lower level component.
In the process of rendering a page developed at the front end, a rendering tree is often constructed according to data elements, position calculation, style calculation and the like are performed on each data element, and then each data element is depicted. In this embodiment, the electronic device may determine a rendering order of the page components according to the nested hierarchical relationship of the page components, and render each page component according to an order from the upper component to the lower component.
Referring to FIG. 3, the flow of data between page components when rendering the page shown in FIG. 2 is shown. As shown in fig. 3, the electronic device first parses the data element, the callback function, and the communication protocol between the page components of the page 201, and sends the parsed data element, the callback function, and the communication protocol between the page components to the page component 202, and then, when rendering the page component 202, the data type and the callback function in the page components 2021 and 2022 are respectively transferred to the page components 2021 and 2022, for example, in some implementations, the electronic device may respectively cache the data element, the callback function, and the data type of the data element in two lower components, that is, the page component 2021 and the page component 2022, and when rendering the page component 2021 and the page component 2022, the data element, the data type, and the callback function, which are required by the corresponding page component, are taken out of the cache for rendering. When the page component 2021 is rendered, the data elements, callback functions, data types of the data elements, and the like of the lower-level components, namely the page components 20211, 20212, and 20213, are cached; when the page component 2022 is rendered, the data elements, callback functions, data types of the data elements, and the like of the lower-level components, the page components 20221 and 20222, are cached; and so on. For each page component, its data elements, callback functions, and data types of the data elements may be stored in data store 301, where the data in the data store constitutes page 201. The data flow between page components shown in fig. 3 is single from an upper component to a lower component.
In some optional implementation manners of this embodiment, when the electronic device renders each page component according to the nested hierarchical relationship, the electronic device caches the data types of the data element, the callback function, and the data element in the lower component of the upper component in the rendering process of the upper component, and when the lower component is rendered, the electronic device may first take out the required data type from the cache to perform verification, and then render the lower component after the verification is passed. Optionally, the checking of the required data type by the lower level component may include, but is not limited to, at least one of checking of a data communication protocol and checking of a data type field. When the electronic device determines that the data type field of the data element in the cache is consistent with the required data type field in the checking process, it may be determined that the checking is passed, at this time, the electronic device may store the data element which conforms to the required data type in a storage area of a corresponding page component (such as a declaration state of the page component), and trigger a preset rendering method (such as a render method) to render the page component. When the electronic equipment determines that the data type field of the data element in the cache is inconsistent with the required data type field in the checking process, the data exception can be further determined, and a data exception notification can be given.
In some optional implementations of the embodiment, passing the data element and the callback function to the lower level component when rendering the upper level component includes: and caching the data elements and the callback functions in the lower-level components in a reference transfer mode. Reference passing, generally refers to passing the address of the actual parameter when the function is called. Here, the electronic device may pass an address (e.g., a value of an index or a pointer) of the data element or the callback function to the subordinate component, and the subordinate component may change the read data element or the called callback function by changing the address of the data element or the callback function when reading the data element or calling the callback function.
In this embodiment, the structure of the page document is analyzed to obtain the nesting hierarchical relationship among the page components, and then the page components are rendered according to the sequence of the nesting hierarchical relationship from the upper component to the lower component, and the upper component transfers the data element and the callback function to the lower component in the rendering process, so that the data flow is single, the proxy service is not needed, the coupling degree among the components is low, and the effectiveness of controlling the data flow among the page components can be improved.
Referring to fig. 4, fig. 4 shows a flow 400 of yet another embodiment of a method for controlling data flow between page components according to the present application. As shown in fig. 4, the process 400 includes:
step 401, analyzing the structure of the page document to obtain the nesting hierarchical relationship between the page components.
In this embodiment, the electronic device may first parse the structure of the page document, so as to obtain a nested hierarchical relationship between page components, where the page components may include data elements and callback functions. For example, the electronic device may package a page into a plurality of page components at different levels through the structure of the page document, and the minimum unit of each page component may include a data element and a callback function. The page components of different levels can have nesting relationship to form nesting hierarchical relationship between the page components. In this nested hierarchical relationship, a lower level component is nested with an upper level component.
And step 402, rendering each page component according to the sequence from the upper component to the lower component according to the nesting hierarchical relationship.
In this embodiment, the electronic device may then render the page components in order from the upper level component to the lower level component according to the nesting hierarchical relationship obtained in step 401. During the rendering process of the upper-level component, the data elements and callback functions required by the lower-level component can be transferred to the lower-level component. Thus, the data flow of the data elements and the callback function in the page component is from the upper level component to the lower level component.
In step 403, it is detected whether the document attribute value of each page component changes.
In this embodiment, the electronic device may detect whether the document attribute value of the page component changes during or after the rendering of the page component is completed. Here, the document attribute of the page component may be used to represent an attribute of each document object (e.g., HTML document object) in the page component, such as a reference type-index or pointer of a data element or callback function, and the document attribute value of the page component may be the value of the index or pointer.
It can be understood that when the document attribute value of a page component changes, it indicates that a new data element is added to the page component, or the value of the index or pointer of the data element or the callback function changes, i.e. the data element or the callback function changes.
In step 404, if the document attribute value of any page component changes, the changed change information is sent to the upper level component of the changed page component through the callback function.
In this embodiment, if the document attribute value of any page component changes, the electronic device may send the changed change information to its upper component through a callback function. Here, the change information may include a changed data element or callback function, and its changed attribute, attribute values before and after the change, and the like.
As an example, referring to fig. 3, if the electronic device detects that the document attribute value of a certain data element (e.g. a drop-down box) of the page component 20211 changes, the electronic device may send change information to the page component 2021 by calling a callback function in the page component 2021, at this time, the electronic device may continue to detect whether the document attribute value of the page component 2021 changes, if so, send the change information of the page component 2021 to the page component 202, and if not (e.g. only the state of the corresponding page component is changed), the page component 2021 receives the change information sent by the page component 20211 and adjusts the transfer logic of the data of itself or the data element of the lower component or the callback function according to the change information.
Step 405, re-rendering the upper level component of the changed page component and the changed page component according to the change information.
In this embodiment, the electronic device may re-render the upper component of the changed page component and the changed page component in the order from the upper component to the lower component according to the change information.
Referring to the example given by way of example in fig. 3 in step 404, the document attribute value of the page component 20211 changes, and further, the document attribute values of the page components 2021 and 202 change, and the electronic device may re-render the page components 202, 2021, and 20211 in sequence. Alternatively, if it is detected that the document attribute value of the page component 2021 changes, the electronic device may further detect whether the document attribute values of the page component 202 and the page component 20211 change based on the change, and if the document attribute value of the page component 202 does not change and the document attribute value of the page component 20211 changes, the electronic device may re-render the page component 2021 and the page component 20211 in sequence. The rendering process is the same as that in step 402, and the data elements and the callback functions are transferred to the lower-level component when the upper-level component is rendered, which is not described herein again.
In this embodiment, step 401 and step 402 in the above implementation flow are substantially the same as step 201 and step 202 in the foregoing embodiment, and are not described herein again.
As can be seen from fig. 4, unlike the embodiment corresponding to fig. 2, steps 403, 404, and 405 are added to the flow 400 of the data flow control method between page components in the present embodiment. Through the added steps 403, 404 and 405, the embodiment highlights the control of the data flow direction when the document attribute value of the page component is changed, the data flow direction is still from the upper-level component to the lower-level component, the data flow direction is ensured to be single, and the effectiveness of the data flow direction control among the page components is further improved.
Referring to fig. 5, fig. 5 illustrates an exemplary system architecture 500 to which embodiments of the present application may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, a network 503, and a server 504. The network 503 is the medium used to provide communication links between the terminal devices 501, 502 and the server 504. Network 503 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 501, 502 may interact with a server 504 via a network 503 to receive or send messages or the like. The terminal devices 501 and 502 may have various communication client applications installed thereon, such as a browser application, a search application, a shopping application, a financing application, a map application, a social platform application, a mailbox client, an instant messaging tool, and the like.
The terminal devices 501 and 502 may be various electronic devices supporting a browser application and the like installed thereon, including but not limited to a smart phone, a smart watch, a tablet computer, a personal digital assistant, an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III, motion Picture Experts Group Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion Picture Experts Group Audio Layer 4), a laptop portable computer, a desktop computer, and the like.
The server 504 may be a server that provides various services. For example, the server 504 may be a background server or the like that provides support for a browser application or the like of the terminal device 501, 502. The server can store, generate and the like the received data and feed back the processing result to the terminal equipment.
It should be noted that the method for controlling the data flow between page components provided in the embodiment of the present application is generally executed by the terminal devices 501 and 502, but may also be executed by the server 504 in some cases, which is not limited in the present application. Accordingly, the data flow control device between page components provided in the embodiment of the present application is generally disposed in the end devices 501 and 502, and may also be disposed in the server 504.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With further reference to fig. 6, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for controlling data flow between page components, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to electronic devices (e.g., terminal devices 501, 502, etc. shown in fig. 5).
As shown in fig. 6, the apparatus 600 for controlling data flow between page components according to this embodiment includes: a parsing module 601 and a rendering module 602. The parsing module 601 may be configured to parse a structure of a page document, and obtain a nested hierarchical relationship between page components, where a page component includes a data element and a callback function, and in the nested hierarchical relationship, a lower component is nested in a higher component; the rendering module 602 may be configured to render the page components according to the nesting hierarchical relationship in an order from the upper level component to the lower level component, where the data elements and the callback functions are transferred to the lower level component when rendering the upper level component.
In this embodiment, the parsing module 601 may first parse the structure of the page document, so as to obtain the nested hierarchical relationship between the page components, where the page components may include data elements and callback functions. In a nested hierarchical relationship, a lower level component is nested with an upper level component. Here, the page document may include, but is not limited to, one of the following documents: HTML documents, ASP documents, JSP documents, and the like.
In this embodiment, the rendering module 602 may then render the page components in order from the upper level component to the lower level component according to the nesting hierarchical relationship obtained by the parsing module 601. During the rendering process of the upper-level component, the data elements and callback functions required by the lower-level component can be transferred to the lower-level component. Thus, the data flow of the data elements and the callback function in the page component is from the upper level component to the lower level component.
In some optional implementations of the present embodiment, the rendering module 602 may include a caching unit (not shown) and a checking unit (not shown). Wherein: the cache unit may be configured to cache a data type of a data element in a lower component when rendering the upper component; the verification unit may be configured to, when rendering the lower level component, take out the required data type from the buffer for verification, and render if the verification is passed. Optionally, the checking of the checking unit includes at least one of checking of a data communication protocol and checking of a data type field.
In some optional implementations of this embodiment, the rendering module 602 may be further configured to: and caching the data elements and the callback functions in the lower-level components in a reference transfer mode. Here, the rendering module 602 may transfer an address (e.g., a value of an index or a pointer) of a data element or a callback function of the lower component to the lower component when rendering the upper component, and the lower component may change the read data element or the called callback function by changing the address of the data element or the callback function when reading the data element or calling the callback function.
In some optional implementations of this embodiment, the apparatus 600 may further include a detection module (not shown) and a transmission module (not shown). Wherein: the detection module may be configured to detect whether a document attribute value of each page component changes, where the document attribute value includes a value of an index or a pointer of a data element or a callback function in the page component; the sending module may be configured to send, if the document attribute value of any page component changes, the changed change information to the upper-level component of the changed page component through the callback function. At this time, the rendering module 602 may be further configured to re-render the upper level component of the changed page component and the changed page component according to the change information.
It is to be noted that modules or units described in the data flow control apparatus 600 among page components correspond to respective steps in the method described with reference to fig. 2. Thus, the operations and features described above for the method are also applicable to the data flow control device 600 between page components and the modules or units included therein, and are not described herein again.
Those skilled in the art will appreciate that the aforementioned flow of data between page components to the control device 600 also includes some other well-known structures, such as processors, memories, etc., which are not shown in fig. 6 in order to not unnecessarily obscure embodiments of the present disclosure.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use in implementing a server or terminal according to an embodiment of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711.
The units related in the embodiments of the present application may be implemented by software, or may be implemented by hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a parsing module and a rendering module. The names of these modules do not in some cases form a limitation on the modules themselves, for example, a grouping module may also be described as a "module configured to parse the structure of a page document to obtain nested hierarchical relationships between page components".
As another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus in the above-described embodiments; or it may be a separate computer-readable storage medium not incorporated in the terminal. The computer readable storage medium stores one or more programs that, when executed by one or more processors, cause the apparatus to: analyzing the structure of a page document, and acquiring a nested hierarchical relationship among page components, wherein the page components comprise data elements and callback functions, and in the nested hierarchical relationship, a lower component is nested in a higher component; and rendering each page component according to the nesting hierarchical relationship from the upper component to the lower component, wherein when the upper component is rendered, the data elements and the callback functions are transmitted to the lower component.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by a person skilled in the art that the scope of the invention as referred to in the present application is not limited to the embodiments with a specific combination of the above-mentioned features, but also covers other embodiments with any combination of the above-mentioned features or their equivalents without departing from the inventive concept. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A method for controlling data flow among page components is characterized by comprising the following steps:
analyzing the structure of a page document, and acquiring a nested hierarchical relationship among page components, wherein the page components comprise data elements and callback functions, and in the nested hierarchical relationship, a lower component is nested in a higher component;
and rendering each page component according to the nesting hierarchical relationship from the upper component to the lower component, wherein when the upper component is rendered, the data elements and the callback functions are transmitted to the lower component.
2. The method of claim 1, wherein rendering page components in order from an upper level component to a lower level component according to the nested hierarchical relationship comprises:
caching the data types of the data elements in the lower-level assembly when the upper-level assembly is rendered;
and when the lower-level assembly is rendered, taking out the required data type from the buffer for verification, and rendering if the verification is passed.
3. The method of claim 2, wherein the check comprises at least one of a check of a data communication protocol and a check of a data type field.
4. The method of claim 1, wherein the passing the data element and the callback function to the lower level component when rendering the upper level component comprises:
and caching the data elements and the callback functions in the lower-level components in a reference transfer mode.
5. The method according to any one of claims 1-4, further comprising:
detecting whether a document attribute value of each page component changes or not, wherein the document attribute value comprises a data element in the page component or a value of an index or a pointer of a callback function;
if the document attribute value of any page component changes, sending the changed change information to a superior component of the changed page component through a callback function;
and re-rendering the upper-level component of the changed page component and the changed page component according to the change information.
6. An apparatus for controlling data flow between page components, the apparatus comprising:
the system comprises an analysis module, a page component and a page component module, wherein the analysis module is configured to analyze the structure of a page document and acquire the nesting hierarchical relationship among the page components, the page components comprise data elements and callback functions, and in the nesting hierarchical relationship, a lower component is nested in a higher component;
and the rendering module is configured to render each page component according to the nesting hierarchical relationship and in the sequence from the upper component to the lower component, wherein when the upper component is rendered, the data elements and the callback functions are transmitted to the lower component.
7. The apparatus of claim 6, wherein the rendering module comprises:
the cache unit is configured to cache the data types of the data elements in the lower level assembly when the upper level assembly is rendered;
and the verification unit is configured to take out the required data type from the buffer for verification when the lower-level component is rendered, and render the lower-level component if the verification is passed.
8. The apparatus of claim 7, wherein the check comprises at least one of a check of a data communication protocol and a check of a data type field.
9. The apparatus of claim 6, wherein the rendering module is further configured to: and caching the data elements and the callback functions in the lower-level components in a reference transfer mode.
10. The apparatus according to any one of claims 6-9, wherein the apparatus further comprises:
the detection module is configured to detect whether a document attribute value of each page component changes, wherein the document attribute value comprises a data element in the page component or a value of an index or a pointer of a callback function;
the sending module is configured to send the changed change information to a superior component of the changed page component through a callback function if the document attribute value of any page component changes;
the rendering module is further configured to re-render the upper level component of the changed page component and the changed page component according to the change information.
11. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable storage medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-5.
CN201610270495.9A 2016-04-27 2016-04-27 Method and device for controlling data flow between page components Active CN107315646B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610270495.9A CN107315646B (en) 2016-04-27 2016-04-27 Method and device for controlling data flow between page components

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610270495.9A CN107315646B (en) 2016-04-27 2016-04-27 Method and device for controlling data flow between page components

Publications (2)

Publication Number Publication Date
CN107315646A CN107315646A (en) 2017-11-03
CN107315646B true CN107315646B (en) 2021-01-26

Family

ID=60185713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610270495.9A Active CN107315646B (en) 2016-04-27 2016-04-27 Method and device for controlling data flow between page components

Country Status (1)

Country Link
CN (1) CN107315646B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108495192B (en) * 2018-03-13 2021-04-23 武汉斗鱼网络科技有限公司 Page editing processing method and device
CN108427568B (en) * 2018-04-28 2021-04-27 北京小米移动软件有限公司 User interface updating method and device
CN110471656A (en) * 2018-05-10 2019-11-19 北京京东尚科信息技术有限公司 The method of adjustment and device of component level
CN110968310B (en) * 2018-09-30 2023-06-27 北京国双科技有限公司 Webpage component rendering method and system
CN109284470B (en) * 2018-10-25 2020-12-04 天津字节跳动科技有限公司 Page window communication method and device
CN111782311B (en) * 2020-05-11 2023-01-10 完美世界(北京)软件科技发展有限公司 Rendering method, device, equipment and readable medium
CN112068835A (en) * 2020-09-04 2020-12-11 中国平安财产保险股份有限公司 Method and device for generating page on line
CN113721908B (en) * 2021-08-30 2024-03-22 湖南快乐阳光互动娱乐传媒有限公司 Unlimited cascade component rendering method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779164A (en) * 2012-06-20 2012-11-14 深圳市远行科技有限公司 Business system and rendering method of dynamic pages of same
CN103546476A (en) * 2013-10-30 2014-01-29 北京华胜天成科技股份有限公司 Transmission method and system for information between page assemblies

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7681112B1 (en) * 2003-05-30 2010-03-16 Adobe Systems Incorporated Embedded reuse meta information
US8407576B1 (en) * 2008-09-02 2013-03-26 Sitscape, Inc. Situational web-based dashboard
CN101996073B (en) * 2009-08-31 2014-02-05 阿里巴巴集团控股有限公司 Component rendering method and device
US20110289141A1 (en) * 2010-05-20 2011-11-24 Salesforce.Com, Inc. Methods and systems for providing a user interface in a multi-tenant database environment
CN102331985B (en) * 2010-07-12 2013-09-25 阿里巴巴集团控股有限公司 Method and device for fragment nested caching of webpage
CN103136201A (en) * 2011-11-22 2013-06-05 阿里巴巴集团控股有限公司 Page information display method and page information display device
US8893014B1 (en) * 2012-06-28 2014-11-18 Google Inc. Deferred loading of a web page
CN104714980B (en) * 2013-12-17 2018-04-06 阿里巴巴集团控股有限公司 Page nesting determining method of path and device
CN103955364B (en) * 2014-04-15 2017-06-20 南威软件股份有限公司 A kind of front end assemblies method suitable for mobile phone
CN105354013B (en) * 2014-08-18 2019-07-23 阿里巴巴集团控股有限公司 Application interface rendering method and device
CN104573066B (en) * 2015-01-26 2017-11-03 中国工商银行股份有限公司 Page multiplexing method and device
CN104866534A (en) * 2015-04-28 2015-08-26 北京奇虎科技有限公司 Page demonstration method and device
CN105183760B (en) * 2015-07-24 2020-04-10 北京奇虎科技有限公司 Webpage component loading method and device
CN105095445B (en) * 2015-07-24 2019-06-04 北京奇虎科技有限公司 A kind of page generation method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779164A (en) * 2012-06-20 2012-11-14 深圳市远行科技有限公司 Business system and rendering method of dynamic pages of same
CN103546476A (en) * 2013-10-30 2014-01-29 北京华胜天成科技股份有限公司 Transmission method and system for information between page assemblies

Also Published As

Publication number Publication date
CN107315646A (en) 2017-11-03

Similar Documents

Publication Publication Date Title
CN107315646B (en) Method and device for controlling data flow between page components
US11531715B2 (en) Systems and methods for single page application server-side renderer
CN106575298B (en) Rapid presentation of web sites containing dynamic content and stale content
CN104461491B (en) The operation method and system of a kind of Hybrid components
US8935798B1 (en) Automatically enabling private browsing of a web page, and applications thereof
US7870482B2 (en) Web browser extension for simplified utilization of web services
US10015226B2 (en) Methods for making AJAX web applications bookmarkable and crawlable and devices thereof
US20070174420A1 (en) Caching of web service requests
CN106294658B (en) Webpage quick display method and device
US11677809B2 (en) Methods for transforming a server side template into a client side template and devices thereof
US20100138477A1 (en) Crunching Dynamically Generated Script Files
CN113382083B (en) Webpage screenshot method and device
US10594764B2 (en) Request cache to improve web applications performance
EP3234803A1 (en) Network based static font subset management
US20140095579A1 (en) System and method for increasing web site serving performance
CN110795649A (en) Target page display method, device and system and electronic equipment
CN110377273B (en) Data processing method, device, medium and electronic equipment
CN109284428A (en) Data processing method, device and storage medium
US9998559B2 (en) Preemptive caching of data
CN113760264A (en) Method and device for multiplexing components among multiple applications
CN115421693A (en) Method and device for realizing micro front-end architecture, computer equipment and storage medium
CN104219277A (en) Rearranging a server response
US8434000B2 (en) System and method for archiving portions of an output of a web application
CN103885988A (en) Method and device for outputting content and content outputting system
CN113704648A (en) Page data processing method, device, equipment and storage medium

Legal Events

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