CN111338626B - Interface rendering method and device, electronic equipment and medium - Google Patents

Interface rendering method and device, electronic equipment and medium Download PDF

Info

Publication number
CN111338626B
CN111338626B CN202010143427.2A CN202010143427A CN111338626B CN 111338626 B CN111338626 B CN 111338626B CN 202010143427 A CN202010143427 A CN 202010143427A CN 111338626 B CN111338626 B CN 111338626B
Authority
CN
China
Prior art keywords
component
function
functions
interface
rendering
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
CN202010143427.2A
Other languages
Chinese (zh)
Other versions
CN111338626A (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 QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202010143427.2A priority Critical patent/CN111338626B/en
Publication of CN111338626A publication Critical patent/CN111338626A/en
Application granted granted Critical
Publication of CN111338626B publication Critical patent/CN111338626B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • 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/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides an interface rendering method, an interface rendering device, electronic equipment and a medium, relates to the technical field of computers, and can reduce the coupling between codes corresponding to components. The technical scheme of the embodiment of the invention comprises the following steps: when an interface display instruction is detected, analyzing codes of the interface to generate a component tree corresponding to the interface, wherein the codes corresponding to all components in the component tree are compound functions, the compound functions are functions obtained by combining functions by utilizing a combination function, and the function functions are function codes used for representing functions of the components. And then rendering the interface according to the association relation among the components included in the component tree and the return value of the composite function corresponding to each component.

Description

Interface rendering method and device, electronic equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an interface rendering method, an apparatus, an electronic device, and a medium.
Background
When a developer designs an interface, it generally abstracts a design interface into a component tree, where a component tree includes multiple components, and a parent component in the component tree may include multiple sub-components, which may also include grandchild components. When the device performs page rendering, starting from the root component of the component tree, the device traverses the component tree deeply to render the interface in a mode of transferring attributes from the parent component to the child component.
The code corresponding to the component represents a step of realizing the function of the component, when a new sub-component needs to be added in a parent component of the component tree, because the step of realizing the function of the parent component changes due to the addition of the sub-component in the parent component, the code corresponding to the parent component needs to be modified, so that the code corresponding to the parent component can refer to the new component when executing.
It can be seen that the coupling of the code corresponding to the component is high, so that adding a new component to the interface is highly complex.
Disclosure of Invention
The embodiment of the invention aims to provide a page rendering method, a page rendering device, electronic equipment and a page rendering medium, so as to reduce the coupling between codes corresponding to components. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides an interface rendering method, where the method includes:
when an interface display instruction is detected, analyzing codes of the interface to generate a component tree corresponding to the interface, wherein the codes corresponding to all components in the component tree are compound functions, the compound functions are functions obtained by combining functions by utilizing a combination function, and the function functions are function codes for representing the functions of the components;
and rendering the interface according to the association relation among the components included in the component tree and the return value of the composite function corresponding to each component.
Optionally, the rendering the interface according to the association relationship between the components included in the component tree and the return value of the composite function corresponding to each component includes:
starting from a root component in the component tree, sequentially determining a return value of a composite function corresponding to each component according to the sequence from the root component to a leaf component;
and rendering the interface according to the return value of the composite function corresponding to each component in the component tree.
Optionally, the function corresponding to each composite function includes a state function, a rendering function and a hook function;
wherein the status function is used to describe the status that the component includes; the rendering function is used to describe a mapping between states and views of the component; the hook function is used to describe operations that the component performs when created or destroyed, respectively.
Optionally, the function corresponding to each composite function further includes an event function and/or a subcomponent function;
the event function is used for informing whether the state of the component to which the father component belongs changes or not; the subassembly functions are used to describe the subassemblies that the assembly includes.
Optionally, the composite function is G (component), where component represents a mapping between states of the component to views, g=component (f 1 ,compose(f 2 ,…compose(f n-1 ,f n ))),f 1 、f 2 …f n-1 And f n And each function corresponding to one composite function is a composition (·, ·) which is the composite function.
Optionally, a mapping combination law is satisfied between the function functions corresponding to each composite function.
In a second aspect, an embodiment of the present invention provides an interface rendering apparatus, including:
the generating module is used for analyzing the codes of the interface when the interface display instruction is detected, generating a component tree corresponding to the interface, wherein the codes corresponding to all components in the component tree are compound functions, the compound functions are functions obtained by combining a plurality of function functions by utilizing the combined functions, and the function functions are function codes used for representing the functions of the components;
and the rendering module is used for rendering the interface according to the association relation among the components included in the component tree generated by the generating module and the return value of the composite function corresponding to each component.
Optionally, the rendering module is specifically configured to:
starting from a root component in the component tree, sequentially determining a return value of a composite function corresponding to each component according to the sequence from the root component to a leaf component;
and rendering the interface according to the return value of the composite function corresponding to each component in the component tree.
Optionally, the function corresponding to each composite function includes a state function, a rendering function and a hook function;
wherein the status function is used to describe the status that the component includes; the rendering function is used to describe a mapping between states and views of the component; the hook function is used to describe operations that the component performs when created or destroyed, respectively.
Optionally, the function corresponding to each composite function further includes an event function and/or a subcomponent function;
the event function is used for informing whether the state of the component to which the father component belongs changes or not; the subassembly functions are used to describe the subassemblies that the assembly includes.
Optionally, the composite function is G (component), where component represents a mapping between states of the component to views, g=component (f 1 ,compose(f 2 ,…compose(f n-1 ,f n ))),f 1 、f 2 …f n-1 And f n And each function corresponding to one composite function is a composition (·, ·) which is the composite function.
Optionally, a mapping combination law is satisfied between the function functions corresponding to each composite function.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the steps of any one of the interface rendering methods when executing the programs stored in the memory.
In a fourth aspect, embodiments of the present invention further provide a computer readable storage medium having a computer program stored therein, which when executed by a processor, implements the steps of any of the interface rendering methods described above.
In a fifth aspect, embodiments of the present invention also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the interface rendering methods described above.
According to the interface rendering method, the device, the electronic equipment and the medium, when the interface display instruction is detected, the codes of the interface can be analyzed, and the component tree corresponding to the interface can be generated. And then rendering the interface according to the association relation among the components included in the component tree and the return value of the composite function corresponding to each component. Because the codes corresponding to each component in the component tree are compound functions, when the sub-component is added to the component, a new function can be added to the component, and the new function is functionally combined with the compound function originally corresponding to the component, so that the codes originally corresponding to the component do not need to be modified for adding the function to the component. Therefore, the embodiment of the invention reduces the coupling of the codes corresponding to the components and reduces the complexity of adding new components to the interface.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a flowchart of an interface rendering method according to an embodiment of the present invention;
FIG. 2 is an exemplary schematic diagram of a functional compounding process provided by an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an interface rendering device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
In order to reduce the coupling of codes corresponding to components, the embodiment of the invention provides an interface rendering method. The interface may be a display interface of an application program or a display interface of a web page, which is not particularly limited in the embodiment of the present invention. The method can be applied to electronic equipment, wherein the electronic equipment can be equipment such as a mobile phone, a tablet computer or a computer, and the like which can render a display interface.
Referring to fig. 1, the interface rendering method provided by the embodiment of the present invention may include the following steps.
And step 101, when an interface display instruction is detected, analyzing the code of the interface to generate a component tree corresponding to the interface.
The codes corresponding to the components in the component tree are composite functions, the composite functions are functions obtained by combining functions of a plurality of function functions by utilizing the combined functions, and the function functions are functional codes used for representing the functions of the components.
And 102, rendering an interface according to the association relation among the components included in the component tree and the return value of the composite function corresponding to each component.
According to the interface rendering method provided by the embodiment of the invention, when the interface display instruction is detected, the code of the interface is analyzed, and the component tree corresponding to the interface is generated. And then rendering the interface according to the association relation among the components included in the component tree and the return value of the composite function corresponding to each component. Because the codes corresponding to each component in the component tree are compound functions, when the sub-component is added to the component, a new function can be added to the component, and the new function is functionally combined with the compound function originally corresponding to the component, so that the codes originally corresponding to the component do not need to be modified for adding the function to the component. Therefore, the embodiment of the invention reduces the coupling of the codes corresponding to the components and reduces the complexity of adding new components to the interface.
Optionally, the method of rendering the interface in step 102 may include the following two steps.
Step one, starting from a root component in the component tree, sequentially determining the return value of a composite function corresponding to each component according to the sequence from the root component to a leaf component.
Alternatively, the composite function corresponding to a component may be G (component), where component represents a mapping between the state of the component to the view.
It can be appreciated that the code corresponding to the interface can be decomposed into multiple components in a top-down manner, and an association relationship exists between the components. The component functions of each component may be abstracted into state machines (StateMachines), where a state machine represents an interaction action according to the execution of a user, exposing a view corresponding to the interaction action. For example, the interaction may be an input or click action. Equation (1) is a component, i.e., equation (1) may represent a mapping relationship between the State of the collection (State) to the View of the collection (View).
And step two, rendering the interface according to the return value of the composite function corresponding to each component in the component tree.
It can be understood that the return values corresponding to the components can describe the positions, the styles, etc. of the elements in the interface, and the return values of the component pairs are obtained, i.e. the interface can be displayed according to the positions and the styles of the elements in the interface represented by the return values.
When the functions of the components are modified in the related art, the codes corresponding to the components need to be modified, and as the modification of the codes corresponding to the components increases, the complexity of the codes corresponding to the components is high due to serious coupling between the codes corresponding to the components, and finally the codes need to be reconstructed, namely the components need to be manually split, so that the maintenance cost of the codes corresponding to the components is high.
In the embodiment of the invention, when the functions of the components are modified, the functions can be added for the components without modifying the original corresponding compound functions of the components, so that the coupling of the codes corresponding to the components is low, and the maintenance cost of the codes corresponding to the components is reduced.
It will be appreciated that the code corresponding to each component need to include descriptions of three aspects of the component, namely the state, rendering and lifecycle of the component. The corresponding function of each composite function thus comprises: state (State) functions, render (Render) functions, and Hook (Hook) functions.
Wherein the status function is used to describe the status that the component includes; rendering functions are used to describe the mapping between the states and views of the component; hook functions are used to describe operations that components perform when created or destroyed, respectively.
Alternatively, each component may include zero to a plurality of states, and the states included by the component may be considered state nodes in a state machine. The state of the component may be changed according to the operation of the user.
For example, a component corresponds to a hyperlink in the interface that displays blue when a mouse cursor is not placed over the hyperlink, and red when a user is detected to place the mouse cursor over the hyperlink. The color of the hyperlink is the state of the component.
Alternatively, each component may include two hook functions. One of the hook functions is used for operations performed by the component at the time of creation, such as describing the memory allocated by the component at the time of creation, initializing the execution environment, and the like. Another hook function is used to describe operations that the component performs at the time of destruction, such as describing memory released by the component at the time of destruction, eliminating execution environments, and so forth.
Optionally, the code corresponding to each component may also include descriptions of the event and sub-components of the component. The functional functions corresponding to each composite function may also include Event functions (Event) and/or subcomponent (Component) functions.
The event function is used for informing whether the state of the component to which the parent component belongs changes or not; the sub-component functions are used to describe the sub-components that the component comprises.
Alternatively, each component may include zero to a plurality of events. For example, the parent component of component A is component B, and the event function of component A may inform component B whether the state of component A has changed.
Alternatively, a component may not include a sub-component, and may include one or more sub-components. The views rendered by the components and sub-components are different.
Alternatively, the functionality of a component may be added, modified or deleted by adding a functional function to the component. And because the component can comprise five functional functions, when the function of the component is modified, five aspects of the component can be modified by utilizing the five functional functions respectively. The five function functions are respectively a state function (FState), a rendering function (Frender), an event function (Fevent), a hook function (Fhook), and a subcomponent (Fcomponent) function.
FState may be utilized to add, modify, or delete states comprised by the component.
The rendering functions of the components may be modified using a Frender.
Events that add, modify, or delete components may be utilized.
Fhook may be utilized to add or modify the processing of the component at the time of creation or destruction.
The Fcomponent can be utilized to add, modify, or delete sub-components included in the component.
The technical scheme of the embodiment of the invention can also bring the following beneficial effects: the embodiment of the invention can divide the functional functions into five types, so that each aspect of modification on the components can be realized by one function, and codes corresponding to the components can be more conveniently multiplexed and managed.
Alternatively, the functions of the components may be added, modified, or deleted by adding functional functions. The added function may be abstracted as a map to Component mapping, i.e., as a map to View. The composite function corresponding to a component can be expressed as formula (2).
f n (…f 2 (f 1 (Component(State)))) (2)
Wherein f 1 、f 2 …f n Representing added functionality to components.
Alternatively, the composite function may be a G (Component), and the calling G (Component) may implement the functions of the Component, where the Component includes a function stateful function, a rendering function, and a hook function, and may also include an event function and a subcomponent function, all of which may be implemented using f i And (3) representing.
Therefore, the code corresponding to the component in the embodiment of the present invention may be composed of each function, and each function may be combined by a combination (composition) function. And the composite function obtained by combining the functional functions is a formula (3).
G=compose(f 1 ,compose(f 2 ,…compose(f n-1 ,f n ))) (3)
Wherein f 1 、f 2 …f n-1 And f n For each function corresponding to a component, component (·, ·) is a combined function.
The mapping binding law is satisfied between functions combined by combining functions. For example: composition (f, g), h) =composition (f, composition (g, h)).
Therefore, the mapping combination law is satisfied among the function functions corresponding to the components, namely when the positions of the function functions included in the compound function are unchanged, the operation sequence of the function functions has no influence on the operation result. The return values of the function functions may be determined in any order when the return values of the composite function are determined in step one of the above-described step 102.
The technical scheme of the embodiment of the invention can also bring the following beneficial effects: by abstracting the function code of the component into a function, the function of the component can be added, modified or deleted on the premise of not changing the original function of the component by means of function combination, and the complexity of adding, modifying or deleting the function of the component is simplified.
By way of example, a process for functionally compounding components is shown in FIG. 2. Assume that a component has function 1, function 2, and function 3. Wherein, the function 1 comprises the following functions: state function f 1 And rendering function f 2 The method comprises the steps of carrying out a first treatment on the surface of the The function 2 includes the following functions: event function f 3 And a hook function f 4 The method comprises the steps of carrying out a first treatment on the surface of the The function 3 includes the following functions: hook function f 5 And subassembly function f 6
Functionally compounding the components, i.e. combining f 1 、f 2 、f 3 、f 4 、f 5 And f 6 G=composition (f 1 ,compose(f 2 ,compose(f 3 ,compose(f 4 ,compose(f 5 ,f 6 ))))). When rendering the component, G (component) may be called to obtain a component with a combined function.
Corresponding to the above method embodiment, an embodiment of the present invention provides an interface rendering device, as shown in fig. 3, including: a generation module 301 and a rendering module 302;
the generating module 301 is configured to parse the code of the interface when the interface display instruction is detected, generate a component tree corresponding to the interface, where the code corresponding to each component in the component tree is a composite function, the composite function is a function obtained by using the composite function to perform function combination on a plurality of function functions, and the function is a function code for representing the function of the component;
and the rendering module 302 is configured to render the interface according to the association relationship between the components included in the component tree generated by the generating module 301 and the return value of the composite function corresponding to each component.
Optionally, the rendering module 302 is specifically configured to:
starting from a root component in the component tree, sequentially determining the return value of a composite function corresponding to each component according to the sequence from the root component to a leaf component;
and rendering the interface according to the return value of the composite function corresponding to each component in the component tree.
Optionally, the function corresponding to each composite function includes a state function, a rendering function and a hook function;
wherein the status function is used to describe the status that the component includes; rendering functions are used to describe the mapping between the states and views of the component; hook functions are used to describe operations that components perform when created or destroyed, respectively.
Optionally, the function corresponding to each composite function further includes an event function and/or a subcomponent function;
the event function is used for informing whether the state of the component to which the parent component belongs changes or not; the sub-component functions are used to describe the sub-components that the component comprises.
Optionally, the composite function is G (component), where component represents a mapping between the state of the component to the view,f1、f 2 …f n-1 and f n The function is a compound function, and the compound (·, ·) is a combined function.
Optionally, a mapping combination law is satisfied between the function functions corresponding to each composite function.
The embodiment of the invention also provides an electronic device, as shown in fig. 4, which comprises a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402 and the memory 403 complete communication with each other through the communication bus 404,
a memory 403 for storing a computer program;
the processor 401 is configured to implement the steps executed by the electronic device in the above-described method embodiment when executing the program stored in the memory 403.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer readable storage medium is provided, in which instructions are stored, which when run on a computer, cause the computer to perform the interface rendering method according to any one of the above embodiments.
In yet another embodiment of the present invention, a computer program product comprising instructions, which when run on a computer, causes the computer to perform the interface rendering method of any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (14)

1. An interface rendering method, the method comprising:
when an interface display instruction is detected, analyzing codes of the interface to generate a component tree corresponding to the interface, wherein the codes corresponding to all components in the component tree are compound functions, the compound functions are functions obtained by combining functions by utilizing the combined functions, the function functions are function codes used for representing the functions of the components, each function corresponding to the compound functions comprises a state function and a rendering function, the state function is used for describing the states included by the components, and the rendering function is used for describing the mapping between the states and views of the components;
and rendering the interface according to the association relation among the components included in the component tree and the return value of the composite function corresponding to each component.
2. The method according to claim 1, wherein the rendering the interface according to the association relationship between the components included in the component tree and the return value of the composite function corresponding to each component includes:
starting from a root component in the component tree, sequentially determining a return value of a composite function corresponding to each component according to the sequence from the root component to a leaf component;
and rendering the interface according to the return value of the composite function corresponding to each component in the component tree.
3. The method of claim 2, wherein the function corresponding to each composite function further comprises a hook function;
wherein the hook function is used to describe operations that the component performs when created or destroyed, respectively.
4. A method according to claim 3, wherein the functional functions corresponding to each composite function further comprise event functions and/or subcomponent functions;
the event function is used for informing whether the state of the component to which the father component belongs changes or not; the subassembly functions are used to describe the subassemblies that the assembly includes.
5. The method of claim 1, wherein the composite function is G (component), wherein component represents a mapping between states of components to views, G = component (f 1 ,compose(f 2 ,…compose(f n-1 ,f n ))),f 1 、f 2 …f n-1 And f n And each function corresponding to one composite function is a composition (·, ·) which is the composite function.
6. The method of claim 5, wherein a mapping association law is satisfied between the respective function functions corresponding to each composite function.
7. An interface rendering apparatus, the apparatus comprising:
the generating module is used for analyzing codes of the interface when the interface display instruction is detected, generating a component tree corresponding to the interface, wherein the codes corresponding to all components in the component tree are compound functions, the compound functions are functions obtained by combining functions by utilizing the combined functions, the function functions are function codes used for representing the functions of the components, each function corresponding to the compound functions comprises a state function and a rendering function, the state function is used for describing the state included by the component, and the rendering function is used for describing the mapping between the state and the view of the component;
and the rendering module is used for rendering the interface according to the association relation among the components included in the component tree generated by the generating module and the return value of the composite function corresponding to each component.
8. The apparatus of claim 7, wherein the rendering module is specifically configured to:
starting from a root component in the component tree, sequentially determining a return value of a composite function corresponding to each component according to the sequence from the root component to a leaf component;
and rendering the interface according to the return value of the composite function corresponding to each component in the component tree.
9. The apparatus of claim 8, wherein the function corresponding to each composite function further comprises a hook function;
wherein the hook function is used to describe operations that the component performs when created or destroyed, respectively.
10. The apparatus of claim 9, wherein the functional functions corresponding to each composite function further comprise event functions and/or subcomponent functions;
the event function is used for informing whether the state of the component to which the father component belongs changes or not; the subassembly functions are used to describe the subassemblies that the assembly includes.
11. The apparatus of claim 7, wherein the composite function is G (component), wherein component represents a mapping between states of components to views, G = component (f 1 ,compose(f 2 ,…compose(f n-1 ,f n ))),f 1 、f 2 …f n-1 And f n And each function corresponding to one composite function is a composition (·, ·) which is the composite function.
12. The apparatus of claim 11, wherein a mapping association law is satisfied between the respective function functions corresponding to each composite function.
13. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-6 when executing a program stored on a memory.
14. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-6.
CN202010143427.2A 2020-03-04 2020-03-04 Interface rendering method and device, electronic equipment and medium Active CN111338626B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010143427.2A CN111338626B (en) 2020-03-04 2020-03-04 Interface rendering method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010143427.2A CN111338626B (en) 2020-03-04 2020-03-04 Interface rendering method and device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN111338626A CN111338626A (en) 2020-06-26
CN111338626B true CN111338626B (en) 2023-09-05

Family

ID=71183913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010143427.2A Active CN111338626B (en) 2020-03-04 2020-03-04 Interface rendering method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN111338626B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535169A (en) * 2021-07-13 2021-10-22 杭州安恒信息技术股份有限公司 Scene rendering method, device and equipment and readable storage medium
CN113722538B (en) * 2021-09-08 2023-09-05 北京奇艺世纪科技有限公司 Interface dynamic rendering method and device
CN115525852A (en) * 2021-10-28 2022-12-27 北京字节跳动网络技术有限公司 Webpage rendering method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101980154A (en) * 2010-11-02 2011-02-23 深圳市融创天下科技发展有限公司 Method and system for creating and drawing interface control tree and mobile terminal
CN104731584A (en) * 2015-02-26 2015-06-24 武汉爱科唯自动化科技有限公司 Human-machine interface customizable configuration design method for open type numerical control system
CN105354013A (en) * 2014-08-18 2016-02-24 阿里巴巴集团控股有限公司 Application interface rendering method and apparatus
CN106681770A (en) * 2016-12-29 2017-05-17 金蝶软件(中国)有限公司 Method and device for dynamically correcting attributes of secondary modules in composite modules
CN108897538A (en) * 2018-06-08 2018-11-27 泰康保险集团股份有限公司 Page view display methods and device, storage medium and electric terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140184618A1 (en) * 2012-12-28 2014-07-03 Scott A. Krig Generating canonical imaging functions

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101980154A (en) * 2010-11-02 2011-02-23 深圳市融创天下科技发展有限公司 Method and system for creating and drawing interface control tree and mobile terminal
CN105354013A (en) * 2014-08-18 2016-02-24 阿里巴巴集团控股有限公司 Application interface rendering method and apparatus
CN104731584A (en) * 2015-02-26 2015-06-24 武汉爱科唯自动化科技有限公司 Human-machine interface customizable configuration design method for open type numerical control system
CN106681770A (en) * 2016-12-29 2017-05-17 金蝶软件(中国)有限公司 Method and device for dynamically correcting attributes of secondary modules in composite modules
CN108897538A (en) * 2018-06-08 2018-11-27 泰康保险集团股份有限公司 Page view display methods and device, storage medium and electric terminal

Also Published As

Publication number Publication date
CN111338626A (en) 2020-06-26

Similar Documents

Publication Publication Date Title
US10990367B2 (en) Application development method, tool, and device, and storage medium
CN111338626B (en) Interface rendering method and device, electronic equipment and medium
US10216554B2 (en) API notebook tool
US10169034B2 (en) Verification of backward compatibility of software components
WO2021184725A1 (en) User interface test method and apparatus, storage medium, and computer device
CN108279882B (en) Framework generation method, device, equipment and computer readable medium
US20190005228A1 (en) Trusted and untrusted code execution in a workflow
CN112130888B (en) Method, device, equipment and computer storage medium for updating application program
US9361210B2 (en) Capturing domain validations and domain element initializations
CN113434063A (en) Information display method, device and equipment
CN113885886A (en) Method, device, system and storage medium for processing activity service
CN117055766A (en) Tree data processing method and device based on Ant Design, medium and electronic equipment
CN116578282A (en) Code generation method, device, electronic equipment and medium
CN107506299B (en) Code analysis method and terminal equipment
CN112988139B (en) Method and device for developing event processing file
CN113126982A (en) Application program generation and operation method and device
CN112948264A (en) Test task execution method, device, system, storage medium and electronic device
CN112395268A (en) Visual configuration method and device for complex condition rules
KR102651294B1 (en) Method for assisting collect information about screen component
CN116301758B (en) Rule editing method, device, equipment and medium based on event time points
KR102637045B1 (en) Method for supporting data collection
CN117215543B (en) Component development method suitable for different service scene types and corresponding system thereof
CN113434141B (en) Method and system for developing windows graphical interface management system based on domestic environment
WO2024139849A1 (en) Platform for generating vulnerability mining model, and related method
CN118093066A (en) Application page creation method and device, electronic 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