CN112015408A - Component rendering method and device, storage medium and electronic device - Google Patents

Component rendering method and device, storage medium and electronic device Download PDF

Info

Publication number
CN112015408A
CN112015408A CN202010649726.3A CN202010649726A CN112015408A CN 112015408 A CN112015408 A CN 112015408A CN 202010649726 A CN202010649726 A CN 202010649726A CN 112015408 A CN112015408 A CN 112015408A
Authority
CN
China
Prior art keywords
component
page
target
information
configuration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010649726.3A
Other languages
Chinese (zh)
Inventor
杨凯然
刘天雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Leyaoyao Information Technology Co ltd
Original Assignee
Guangzhou Leyaoyao 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 Guangzhou Leyaoyao Information Technology Co ltd filed Critical Guangzhou Leyaoyao Information Technology Co ltd
Priority to CN202010649726.3A priority Critical patent/CN112015408A/en
Publication of CN112015408A publication Critical patent/CN112015408A/en
Pending legal-status Critical Current

Links

Images

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/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

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

Abstract

The invention discloses a component rendering method, a device, a storage medium and an electronic device, wherein the method comprises the following steps: under the condition that a component rendering instruction is received, page parameter information carried by the component rendering instruction is obtained, wherein the component rendering instruction is used for indicating execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page; determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to a target page; and acquiring the target component matched with the component information from the target component library, and rendering by using the target component to generate a target page. The invention can improve the rendering efficiency.

Description

Component rendering method and device, storage medium and electronic device
Technical Field
The invention relates to the field of computers, in particular to a component rendering method, a component rendering device, a storage medium and an electronic device.
Background
At present, when a component is developed, a plurality of components corresponding to a certain function are put into a directory where a page is located, a plurality of components corresponding to the function of the page are introduced into the page, and then the plurality of components can be put at appropriate positions in the page in a hard coding manner.
In practice, it is found that by using the above component development method, if the page has many functions, the number of introduced components is huge, and further, the amount of code is large. When the functions on the page need to be modified by component rendering, development is often required in a huge amount of code. As can be seen, the current component rendering mode has the problem of low rendering efficiency.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a component rendering method, a component rendering device, a storage medium and an electronic device, and aims to at least improve rendering efficiency.
According to an aspect of an embodiment of the present invention, there is provided a component rendering method including: the method comprises the steps of acquiring page parameter information carried by a component rendering instruction under the condition that the component rendering instruction is received, wherein the component rendering instruction is used for indicating execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page; determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to the target page; and acquiring a target component matched with the component information from a target component library, and rendering by using the target component to generate the target page.
As an optional implementation manner, before the determining the page configuration information corresponding to the page parameter information, the method further includes: opening a target link corresponding to the target page according to the component rendering instruction, and loading a root component corresponding to the target page; and triggering an asynchronous updating algorithm by utilizing the root component.
As an optional implementation manner, after the triggering the asynchronous update algorithm by using the root component, the method further includes: writing the page parameter information into global state management information, and controlling a renderer to execute an updating operation according to the asynchronous updating algorithm; and acquiring the page parameter information from the global state management information, and loading the page configuration information corresponding to the page parameter information by using the renderer.
As an optional implementation manner, after the controlling the renderer to perform the update operation according to the asynchronous update algorithm, the method further includes: determining component library configuration information corresponding to the page parameter information, wherein the component library configuration information at least comprises a component library directory corresponding to the target component of the target page; and loading the target component library by using the component library directory.
As an optional implementation manner, the obtaining of the target component matching with the component information in the target component library includes: and traversing and matching the component information in the page configuration information and the component information in the target component library to obtain the target component.
As an optional implementation manner, after generating the target page, the method further includes: acquiring modification configuration information under the condition that a modification instruction for the target page is received, wherein the modification configuration information is used for indicating that the target components forming the target page are modified; adjusting the target assembly according to the modification configuration information to obtain the adjusted target assembly; and rendering by using the adjusted target assembly to generate the modified target page.
According to another aspect of the embodiments of the present invention, there is also provided a component rendering apparatus including: the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring page parameter information carried by a component rendering instruction under the condition that the component rendering instruction is received, the component rendering instruction is used for instructing to execute component rendering operation to generate a target page, and the page parameter information is parameter information of the target page; a determining unit, configured to determine page configuration information corresponding to the page parameter information, where the page configuration information at least includes component information corresponding to the target page; and the rendering unit is used for acquiring the target component matched with the component information from the target component library, and rendering by using the target component to generate the target page.
As an optional implementation, the apparatus further includes: a loading unit, configured to open a target link corresponding to the target page according to the component rendering instruction and load a root component corresponding to the target page before determining the page configuration information corresponding to the page parameter information; and the triggering unit is used for triggering the asynchronous updating algorithm by utilizing the root component.
As an optional implementation, the apparatus further includes: a writing unit, configured to write the page parameter information into global state management information after the asynchronous update algorithm is triggered by the root component, and control a renderer to perform an update operation according to the asynchronous update algorithm; and the obtaining unit is further configured to obtain the page parameter information from the global state management information, and load the page configuration information corresponding to the page parameter information by using the renderer.
As an optional implementation manner, in the apparatus, the determining unit is further configured to determine component library configuration information corresponding to the page parameter information after the control unit controls the renderer to perform an update operation according to the asynchronous update algorithm, where the component library configuration information at least includes a component library directory corresponding to the target component of the target page; the loading unit is further configured to load the target component library by using the component library directory.
As an optional implementation manner, a manner of the rendering unit being configured to obtain the target component matching the component information in a target component library specifically is: and the rendering unit is used for performing traversal matching on the component information in the page configuration information and the component information in the target component library to obtain the target component.
As an optional implementation manner, after the target page is generated, in a case where a modification instruction for the target page is received, the obtaining unit is further configured to obtain modification configuration information, where the modification configuration information is used to instruct to modify the target component constituting the target page; the above-mentioned device still includes: an adjusting unit, configured to adjust the target component according to the modified configuration information, and obtain the adjusted target component; and rendering by using the adjusted target assembly to generate the modified target page.
According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the above component rendering method when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic apparatus, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the component rendering method through the computer program.
In the embodiment of the invention, under the condition of receiving a component rendering instruction, page parameter information carried by the component rendering instruction is obtained, wherein the component rendering instruction is used for instructing execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page; determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to a target page; and acquiring the target component matched with the component information from the target component library, and rendering by using the target component to generate a target page. The process can automatically render the target assembly according to the page configuration information to generate the target page, and does not need to manually write the code of the target assembly and manually configure the target assembly, so that the rendering efficiency is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow diagram of an alternative component rendering method according to an embodiment of the invention;
FIG. 2 is a flow diagram of an alternative component rendering method according to an embodiment of the invention;
FIG. 3 is a flow diagram of an alternative component rendering method according to an embodiment of the invention;
FIG. 4 is a schematic diagram of an alternative component rendering method according to an embodiment of the invention;
FIG. 5 is a schematic structural diagram of an alternative component rendering apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
An embodiment of the present invention provides an optional module construction method, and as shown in fig. 1, the component rendering method includes:
s101, under the condition that a component rendering instruction is received, page parameter information carried by the component rendering instruction is obtained, wherein the component rendering instruction is used for indicating execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page;
s102, determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to a target page;
s103, acquiring a target component matched with the component information from the target component library, and rendering by using the target component to generate a target page.
In the embodiment of the present invention, the component rendering instruction is used to instruct a plurality of components to perform rendering operations to generate a required target page, specifically, the component rendering instruction may be triggered by performing a click operation on a link containing page parameter information, and the like, and in a case that the component rendering instruction is received, the page parameter information carried by the component rendering instruction may be acquired, where the page parameter information is parameter information of the target page generated by performing the rendering operations by using the plurality of components. The page parameter information may include, but is not limited to, component information corresponding to a page, component library directory information corresponding to the component information, and the like, and optionally, the page parameter information may further include a plurality of function information corresponding to the page, where a plurality of component information correspond to each function information, and each component information has corresponding component library directory information. The component library can store a plurality of components, and when the components in the component library are developed, nesting functions among the components and the coupling degree of the components can be reduced, so that the reusability of the components in the component library is improved, and required components can be selected from the component library to be rendered under the condition that pages corresponding to different functions are generated. Further, a configuration information management component may be used, and the configuration information may be in the form of a key-value distributed storage system, and may record key identifications of the components using key values, and may also record data values of the components using values. Under the condition of using the configuration information management component, the deletion of the component can be realized by deleting the data corresponding to the component to be deleted in the configuration information, and the addition of the component can also be realized by adding the data corresponding to the component to be added in the configuration information. The process ensures that the management and control of the assembly can be realized only by modifying the configuration information without directly modifying the code, and the modification of the assembly information is more convenient.
Further, after page parameter information carried by the component rendering instruction is acquired, page configuration information corresponding to the page parameter information may also be determined, where the page parameter information is used to describe each parameter of the target page, such as the above-mentioned function parameter and the component parameter. The page configuration information is used for describing component information forming the target page, and the page configuration information can be obtained by analyzing component parameters in the page parameter information. Specifically, the page configuration information may include the names of the components constituting the target page, and a directory of a component library in which each component is located. After the page configuration information is acquired, a target component matched with the component information can be acquired from a target component library, and the target component library is a component library corresponding to a component library directory in the component information and is used for managing a plurality of components. Target components matched with the component information can be obtained from the target component library, and the target components are used for rendering to generate a target page.
In the embodiment of the invention, under the condition of receiving a component rendering instruction, page parameter information carried by the component rendering instruction is obtained, wherein the component rendering instruction is used for instructing execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page; determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to a target page; and acquiring the target component matched with the component information from the target component library, and rendering by using the target component to generate a target page. The process can automatically render the target assembly according to the page configuration information to generate the target page, and does not need to manually write the code of the target assembly and manually configure the target assembly, so that the rendering efficiency is improved.
Further, an embodiment of the present invention provides another optional component rendering method, as shown in fig. 2, where the component rendering method includes:
s201, under the condition that an assembly rendering instruction is received, page parameter information carried by the assembly rendering instruction is obtained, wherein the assembly rendering instruction is used for indicating execution of assembly rendering operation to generate a target page, and the page parameter information is parameter information of the target page;
s202, opening a target link corresponding to a target page according to the component rendering instruction, and loading a root component corresponding to the target page;
s203, triggering an asynchronous updating algorithm by utilizing the root component;
s204, determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to a target page;
s205, writing the page parameter information into the global state management information, and controlling the renderer to execute updating operation according to an asynchronous updating algorithm;
s206, acquiring page parameter information from the global state management information, and loading page configuration information corresponding to the page parameter information by using a renderer;
and S207, acquiring a target component matched with the component information from the target component library, and rendering by using the target component to generate a target page.
As an optional implementation manner, before determining the page configuration information corresponding to the page parameter information, the following steps may be further performed:
s1, opening a target link corresponding to the target page according to the component rendering instruction, and loading a root component corresponding to the target page;
and S2, triggering an asynchronous updating algorithm by using the root component.
In the embodiment of the invention, the target link corresponding to the target page can be opened in response to the component rendering instruction, and the root component corresponding to the target page is loaded. The target link carries the page parameter information, the page parameter information can be acquired when the target page is opened, and a root component corresponding to the target page is loaded according to the page parameter information, so that the root component triggers an asynchronous update algorithm after rendering, and the asynchronous update algorithm is used for batch asynchronous execution of component update. This process can trigger an asynchronous update algorithm, which triggers the renderer to perform the update and rendering of the component until the target page is generated with the component.
As an alternative embodiment, after triggering the asynchronous update algorithm by the root component, the following steps may be further performed:
s1, writing the page parameter information into the global state management information, and controlling the renderer to execute the updating operation according to the asynchronous updating algorithm;
and S2, acquiring the page parameter information from the global state management information, and loading the page configuration information corresponding to the page parameter information by using the renderer.
In the embodiment of the invention, after the root component triggers the asynchronous update algorithm, page parameter information can be written into global state management information, the global state management information is state management information which can be accessed by each function in the code, and after the page parameter is written into the global state management information, a renderer can be triggered to execute updating, and the page parameter information in the global state management information is obtained to realize component rendering. The process realizes the global reading of the page parameter information, and is convenient for the information acquisition during the component rendering.
In the embodiment of the invention, under the condition of receiving a component rendering instruction, page parameter information carried by the component rendering instruction is obtained, wherein the component rendering instruction is used for instructing execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page; determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to a target page; and acquiring the target component matched with the component information from the target component library, and rendering by using the target component to generate a target page. The process can automatically render the target assembly according to the page configuration information to generate the target page, and does not need to manually write the code of the target assembly and manually configure the target assembly, so that the rendering efficiency is improved. In addition, the page configuration information can be obtained by utilizing an asynchronous update algorithm, so that the renderer is triggered to obtain a target component library and a target component which are appointed to be loaded by the page configuration information, different pages can be synthesized according to development requirements based on the page configuration information, and the rapid usability of the pages is improved.
Further, an embodiment of the present invention provides another optional component rendering method, as shown in fig. 3, where the component rendering method includes:
s301, under the condition that a component rendering instruction is received, page parameter information carried by the component rendering instruction is obtained, wherein the component rendering instruction is used for instructing execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page;
s302, opening a target link corresponding to a target page according to the component rendering instruction, and loading a root component corresponding to the target page;
s303, triggering an asynchronous updating algorithm by using the root component;
s304, determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to a target page;
s305, writing the page parameter information into the global state management information, and controlling the renderer to execute updating operation according to an asynchronous updating algorithm;
s306, determining component library configuration information corresponding to the page parameter information, wherein the component library configuration information at least comprises a component library directory corresponding to a target component of a target page;
s307, loading a target component library by using the component library directory;
s308, acquiring page parameter information from the global state management information, and loading page configuration information corresponding to the page parameter information by using a renderer;
s309, traversing and matching the component information in the page configuration information and the component information in the target component library to obtain a target component, and rendering by using the target component to generate a target page;
s310, acquiring modification configuration information under the condition that a modification instruction for a target page is received, wherein the modification configuration information is used for indicating that a target component forming the target page is modified;
s311, adjusting the target component according to the modified configuration information to obtain an adjusted target component;
and S312, rendering by using the adjusted target assembly to generate a modified target page.
As an alternative embodiment, after controlling the renderer to perform the update operation according to the asynchronous update algorithm, the following steps may be further performed:
s1, determining component library configuration information corresponding to the page parameter information, wherein the component library configuration information at least comprises a component library directory corresponding to a target component of the target page;
and S2, loading the target component library by using the component library directory.
In the embodiment of the present invention, after the renderer is controlled to execute the update operation according to the asynchronous update algorithm, the page parameter information in the global state management information may also be acquired, so as to acquire the page configuration information corresponding to the page parameter information, and then acquire the component library configuration information in the page configuration information, where the component library configuration information at least includes the component library directory corresponding to the target component of the target page. The target page may correspond to a plurality of target components, each target component has a corresponding component library directory, and component library directories corresponding to different target components may be the same or different. Further, a component library directory may be utilized to load the target component library under the directory. The process can determine the configuration information of the component library corresponding to the page parameter information so as to determine the catalog of the component library, thereby realizing the loading of the target component library, introducing the catalog of the component library to load the target component library and improving the loading efficiency of the component library.
As an alternative implementation, obtaining the target component matching the component information in the target component library may include:
and traversing and matching the component information in the page configuration information and the component information in the target component library to obtain the target component.
In the embodiment of the invention, the component information in the page configuration information and the component information in the target component library can be acquired, and the target components required by the page can be selected by matching the component information. Specifically, the page configuration information may be split into a plurality of pieces of sub-configuration information, for example, each piece of sub-configuration information may correspond to information such as a corresponding component name and a component attribute, the component information corresponding to each piece of sub-configuration information may be sequentially traversed and matched with the plurality of pieces of component information in the target component library, a component that is successfully matched may be added to the component object until all pieces of sub-configuration information are traversed, and then all components in the component object are rendered to generate the target page. The process can acquire the target component through matching of the component information, so that the target page is generated through component rendering.
As an optional implementation manner, after the target page is generated, the following steps may be further performed:
s1, acquiring modification configuration information under the condition of receiving a modification instruction aiming at the target page, wherein the modification configuration information is used for indicating the modification of the target components forming the target page;
s2, adjusting the target component according to the modified configuration information to obtain an adjusted target component;
and S3, rendering by using the adjusted target component, and generating a modified target page.
In the embodiment of the present invention, after the target page is generated, if the target page needs to be modified, a modification instruction for the target page may be triggered, and at this time, the modification configuration information may be obtained, where the modification configuration information is specific modification information for modifying the page configuration information of the current target page, and the modification configuration information may include, but is not limited to, information for deleting a certain component in the page configuration information, information for modifying a value of a certain component in the page configuration information, and the like. Further, the target component may be adjusted according to the modified configuration information, to obtain an adjusted target component. The target component can be adjusted by adjusting the page configuration information of the target component according to the modification configuration information. In the process, the target component can be adjusted by using the modification configuration information, the modified target component is rendered by using the adjusted target component, and the modified target page is generated, so that the page can be adjusted by only modifying the page configuration information without modifying the page source code, and the adjustment efficiency is improved.
Referring to fig. 4, fig. 4 is a diagram illustrating another optional component rendering method according to an embodiment of the present invention, and as shown in fig. 4, the following steps may be performed:
s401, opening a link with page parameters;
s402, loading a root component on a page;
s403, triggering an asynchronous updating algorithm by the root component;
s404, acquiring page parameters from the link;
s405, setting the page parameters into global state management;
s406, triggering the renderer to execute the updating operation;
s407, acquiring page parameters in global state management;
s408, loading the page configuration information through the page parameters;
s409, traversing configuration information;
s410, loading the configuration information of the component library in the page parameters;
s411, loading a component library of a specified directory;
s412, matching the configuration information with the component library;
s413, performing recursion traversal on the sub-configuration in the configuration information;
s414, adding the matched components into the component object;
s415, the renderer dyes out all the components according to a rendering method;
and S416, combining the rendered components into a complete page.
In the embodiment of the invention, a link with page parameters can be opened, the page parameters are the page parameter information, and after the link is opened, the page can load the root component according to the page parameters so that the root component triggers the asynchronous updating algorithm. After triggering the asynchronous update algorithm, the page parameter in the link may be first set into the global state management so that the renderer may read the page parameter from the global state management and may trigger the renderer to perform the update operation. The renderer can determine the component library configuration information in the page parameters, and the component library configuration information can include information such as a directory corresponding to the target component, so that loading of the component library of the specified directory is achieved. Further, page configuration information corresponding to the page parameters can be determined, and the page configuration information is used for indicating component information required to be configured by the target page. Furthermore, the configuration information can be traversed, the configuration information is matched with the component library, the self-configuration in the configuration information is subjected to recursive traversal processing, and the matched components are added to the component object until traversal is finished. The renderer may combine all the components in the component object into a target page.
In the embodiment of the invention, under the condition of receiving a component rendering instruction, page parameter information carried by the component rendering instruction is obtained, wherein the component rendering instruction is used for instructing execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page; determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to a target page; and acquiring the target component matched with the component information from the target component library, and rendering by using the target component to generate a target page. The process can automatically render the target assembly according to the page configuration information to generate the target page, and does not need to manually write the code of the target assembly and manually configure the target assembly, so that the rendering efficiency is improved. In addition, the page configuration information can be obtained by utilizing an asynchronous update algorithm, so that the renderer is triggered to obtain a target component library and a target component which are appointed to be loaded by the page configuration information, different pages can be synthesized according to development requirements based on the page configuration information, and the rapid usability of the pages is improved. In addition, by adopting the component rendering method, the corresponding component can be called in the component library by utilizing the configuration information without directly writing the code corresponding to the component into the page and only configuring the configuration information corresponding to the page, so that the multiplexing degree of the component is improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to another aspect of the embodiment of the invention, a component rendering device for implementing the component rendering method is also provided. As shown in fig. 5, the apparatus includes:
an obtaining unit 501, configured to obtain, when a component rendering instruction is received, page parameter information carried by the component rendering instruction, where the component rendering instruction is used to instruct execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page;
a determining unit 502, configured to determine page configuration information corresponding to the page parameter information, where the page configuration information at least includes component information corresponding to a target page;
the rendering unit 503 is configured to obtain a target component matched with the component information from the target component library, and perform rendering by using the target component to generate a target page.
In the embodiment of the present invention, the component rendering instruction is used to instruct a plurality of components to perform rendering operations to generate a required target page, specifically, the component rendering instruction may be triggered by performing a click operation on a link containing page parameter information, and the like, and in a case that the component rendering instruction is received, the page parameter information carried by the component rendering instruction may be acquired, where the page parameter information is parameter information of the target page generated by performing the rendering operations by using the plurality of components. The page parameter information may include, but is not limited to, component information corresponding to a page, component library directory information corresponding to the component information, and the like, and optionally, the page parameter information may further include a plurality of function information corresponding to the page, where a plurality of component information correspond to each function information, and each component information has corresponding component library directory information. The component library can store a plurality of components, and when the components in the component library are developed, nesting functions among the components and the coupling degree of the components can be reduced, so that the reusability of the components in the component library is improved, and required components can be selected from the component library to be rendered under the condition that pages corresponding to different functions are generated. Further, a configuration information management component may be used, and the configuration information may be in the form of a key-value distributed storage system, and may record key identifications of the components using key values, and may also record data values of the components using values. Under the condition of using the configuration information management component, the deletion of the component can be realized by deleting the data corresponding to the component to be deleted in the configuration information, and the addition of the component can also be realized by adding the data corresponding to the component to be added in the configuration information. The process ensures that the management and control of the assembly can be realized only by modifying the configuration information without directly modifying the code, and the modification of the assembly information is more convenient.
Further, after page parameter information carried by the component rendering instruction is acquired, page configuration information corresponding to the page parameter information may also be determined, where the page parameter information is used to describe each parameter of the target page, such as the above-mentioned function parameter and the component parameter. The page configuration information is used for describing component information forming the target page, and the page configuration information can be obtained by analyzing component parameters in the page parameter information. Specifically, the page configuration information may include the names of the components constituting the target page, and a directory of a component library in which each component is located. After the page configuration information is acquired, a target component matched with the component information can be acquired from a target component library, and the target component library is a component library corresponding to a component library directory in the component information and is used for managing a plurality of components. Target components matched with the component information can be obtained from the target component library, and the target components are used for rendering to generate a target page.
In the embodiment of the invention, under the condition of receiving a component rendering instruction, page parameter information carried by the component rendering instruction is obtained, wherein the component rendering instruction is used for instructing execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page; determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to a target page; and acquiring the target component matched with the component information from the target component library, and rendering by using the target component to generate a target page. The process can automatically render the target assembly according to the page configuration information to generate the target page, and does not need to manually write the code of the target assembly and manually configure the target assembly, so that the rendering efficiency is improved.
As an optional implementation, the apparatus further includes: a loading unit, configured to open a target link corresponding to the target page according to the component rendering instruction and load a root component corresponding to the target page before determining the page configuration information corresponding to the page parameter information; and the triggering unit is used for triggering the asynchronous updating algorithm by utilizing the root component.
In the embodiment of the invention, the target link corresponding to the target page can be opened in response to the component rendering instruction, and the root component corresponding to the target page is loaded. The target link carries the page parameter information, the page parameter information can be acquired when the target page is opened, and a root component corresponding to the target page is loaded according to the page parameter information, so that the root component triggers an asynchronous update algorithm after rendering, and the asynchronous update algorithm is used for batch asynchronous execution of component update. This process can trigger an asynchronous update algorithm, which triggers the renderer to perform the update and rendering of the component until the target page is generated with the component.
As an optional implementation, the apparatus further includes: a writing unit, configured to write the page parameter information into global state management information after the asynchronous update algorithm is triggered by the root component, and control a renderer to perform an update operation according to the asynchronous update algorithm; and the obtaining unit is further configured to obtain the page parameter information from the global state management information, and load the page configuration information corresponding to the page parameter information by using the renderer.
In the embodiment of the invention, after the root component triggers the asynchronous update algorithm, page parameter information can be written into global state management information, the global state management information is state management information which can be accessed by each function in the code, and after the page parameter is written into the global state management information, a renderer can be triggered to execute updating, and the page parameter information in the global state management information is obtained to realize component rendering. The process realizes the global reading of the page parameter information, and is convenient for the information acquisition during the component rendering.
As an optional implementation manner, in the apparatus, the determining unit is further configured to determine component library configuration information corresponding to the page parameter information after the control unit controls the renderer to perform an update operation according to the asynchronous update algorithm, where the component library configuration information at least includes a component library directory corresponding to the target component of the target page; the loading unit is further configured to load the target component library by using the component library directory.
In the embodiment of the present invention, after the renderer is controlled to execute the update operation according to the asynchronous update algorithm, the page parameter information in the global state management information may also be acquired, so as to acquire the page configuration information corresponding to the page parameter information, and then acquire the component library configuration information in the page configuration information, where the component library configuration information at least includes the component library directory corresponding to the target component of the target page. The target page may correspond to a plurality of target components, each target component has a corresponding component library directory, and component library directories corresponding to different target components may be the same or different. Further, a component library directory may be utilized to load the target component library under the directory. The process can determine the configuration information of the component library corresponding to the page parameter information so as to determine the catalog of the component library, thereby realizing the loading of the target component library, introducing the catalog of the component library to load the target component library and improving the loading efficiency of the component library.
As an optional implementation manner, a manner of the rendering unit being configured to obtain the target component matching the component information in a target component library specifically is: and the rendering unit is used for performing traversal matching on the component information in the page configuration information and the component information in the target component library to obtain the target component.
In the embodiment of the invention, the component information in the page configuration information and the component information in the target component library can be acquired, and the target components required by the page can be selected by matching the component information. Specifically, the page configuration information may be split into a plurality of pieces of sub-configuration information, for example, each piece of sub-configuration information may correspond to information such as a corresponding component name and a component attribute, the component information corresponding to each piece of sub-configuration information may be sequentially traversed and matched with the plurality of pieces of component information in the target component library, a component that is successfully matched may be added to the component object until all pieces of sub-configuration information are traversed, and then all components in the component object are rendered to generate the target page. The process can acquire the target component through matching of the component information, so that the target page is generated through component rendering.
As an optional implementation manner, after the target page is generated, in a case where a modification instruction for the target page is received, the obtaining unit is further configured to obtain modification configuration information, where the modification configuration information is used to instruct to modify the target component constituting the target page; the above-mentioned device still includes: an adjusting unit, configured to adjust the target component according to the modified configuration information, and obtain the adjusted target component; and rendering by using the adjusted target assembly to generate the modified target page.
In the embodiment of the present invention, after the target page is generated, if the target page needs to be modified, a modification instruction for the target page may be triggered, and at this time, the modification configuration information may be obtained, where the modification configuration information is specific modification information for modifying the page configuration information of the current target page, and the modification configuration information may include, but is not limited to, information for deleting a certain component in the page configuration information, information for modifying a value of a certain component in the page configuration information, and the like. Further, the target component may be adjusted according to the modified configuration information, to obtain an adjusted target component. The target component can be adjusted by adjusting the page configuration information of the target component according to the modification configuration information. In the process, the target component can be adjusted by using the modification configuration information, the modified target component is rendered by using the adjusted target component, and the modified target page is generated, so that the page can be adjusted by only modifying the page configuration information without modifying the page source code, and the adjustment efficiency is improved.
In the embodiment of the invention, under the condition of receiving a component rendering instruction, page parameter information carried by the component rendering instruction is obtained, wherein the component rendering instruction is used for instructing execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page; determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to a target page; and acquiring the target component matched with the component information from the target component library, and rendering by using the target component to generate a target page. The process can automatically render the target assembly according to the page configuration information to generate the target page, and does not need to manually write the code of the target assembly and manually configure the target assembly, so that the rendering efficiency is improved. In addition, the page configuration information can be obtained by utilizing an asynchronous update algorithm, so that the renderer is triggered to obtain a target component library and a target component which are appointed to be loaded by the page configuration information, different pages can be synthesized according to development requirements based on the page configuration information, and the rapid usability of the pages is improved. In addition, by adopting the component rendering method, the corresponding component can be called in the component library by utilizing the configuration information without directly writing the code corresponding to the component into the page and only configuring the configuration information corresponding to the page, so that the multiplexing degree of the component is improved.
According to yet another aspect of the embodiments of the present invention, there is also provided an electronic device for implementing the module building method, as shown in fig. 6, the electronic device includes a memory 602 and a processor 604, the memory 602 stores a computer program therein, and the processor 604 is configured to execute the steps in any one of the method embodiments through the computer program.
Optionally, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring page parameter information carried by the component rendering instruction under the condition that the component rendering instruction is received, wherein the component rendering instruction is used for instructing execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page;
s2, determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to the target page;
and S3, acquiring the target component matched with the component information from the target component library, and rendering by using the target component to generate a target page.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 6 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 6 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 6, or have a different configuration than shown in FIG. 6.
The memory 602 may be used to store software programs and modules, such as program instructions/modules corresponding to the module construction method and apparatus in the embodiments of the present invention, and the processor 604 executes various functional applications and data processing by running the software programs and modules stored in the memory 602, that is, implementing the module construction method described above. The memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 602 may further include memory located remotely from the processor 604, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 602 may be used to store information such as operation instructions, but is not limited thereto. As an example, as shown in fig. 6, the memory 602 may include, but is not limited to, an obtaining unit 701, a selecting unit 702, and a constructing unit 703 in the module constructing apparatus. In addition, other module units in the module construction device may also be included, but are not limited to, and are not described in detail in this example.
Optionally, the transmitting device 606 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 606 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmitting device 606 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In addition, the electronic device further includes: a display 608, configured to display the target service function modules and module configuration information of each target service function module; and a connection bus 610 for connecting the respective module parts in the above-described electronic apparatus.
According to a further aspect of embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring page parameter information carried by the component rendering instruction under the condition that the component rendering instruction is received, wherein the component rendering instruction is used for instructing execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page;
s2, determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to the target page;
and S3, acquiring the target component matched with the component information from the target component library, and rendering by using the target component to generate a target page.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be substantially or partially implemented in the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, or network devices) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that it is obvious to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and these modifications and improvements should also be considered as the protection scope of the present invention.

Claims (10)

1. A component rendering method, comprising:
under the condition that a component rendering instruction is received, acquiring page parameter information carried by the component rendering instruction, wherein the component rendering instruction is used for instructing execution of component rendering operation to generate a target page, and the page parameter information is parameter information of the target page;
determining page configuration information corresponding to the page parameter information, wherein the page configuration information at least comprises component information corresponding to the target page;
and acquiring the target component matched with the component information from a target component library, and rendering by using the target component to generate the target page.
2. The method according to claim 1, prior to said determining page configuration information corresponding to said page parameter information, further comprising:
opening a target link corresponding to the target page according to the component rendering instruction, and loading a root component corresponding to the target page;
triggering an asynchronous update algorithm with the root component.
3. The method of claim 2, further comprising, after said triggering an asynchronous update algorithm with the root component:
writing the page parameter information into global state management information, and controlling a renderer to execute an updating operation according to the asynchronous updating algorithm;
and acquiring the page parameter information from the global state management information, and loading the page configuration information corresponding to the page parameter information by using the renderer.
4. The method of claim 3, further comprising, after the controlling the renderer to perform an update operation according to the asynchronous update algorithm:
determining component library configuration information corresponding to the page parameter information, wherein the component library configuration information at least comprises a component library directory corresponding to the target component of the target page;
and loading the target component library by using the component library catalog.
5. The method of claim 4, wherein the obtaining the target component matching the component information in a target component library comprises:
and traversing and matching the component information in the page configuration information and the component information in the target component library to obtain the target component.
6. The method according to any one of claims 1 to 5, further comprising, after generating the target page:
under the condition that a modification instruction aiming at the target page is received, obtaining modification configuration information, wherein the modification configuration information is used for indicating that the target components forming the target page are modified;
adjusting the target assembly according to the modification configuration information to obtain the adjusted target assembly;
and rendering by using the adjusted target assembly to generate the modified target page.
7. A component rendering apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring page parameter information carried by a component rendering instruction under the condition that the component rendering instruction is received, the component rendering instruction is used for instructing to execute component rendering operation to generate a target page, and the page parameter information is parameter information of the target page;
a determining unit, configured to determine page configuration information corresponding to the page parameter information, where the page configuration information at least includes component information corresponding to the target page;
and the rendering unit is used for acquiring the target component matched with the component information from the target component library, and rendering by using the target component to generate the target page.
8. The apparatus of claim 7, further comprising:
a loading unit, configured to open a target link corresponding to the target page according to the component rendering instruction and load a root component corresponding to the target page before determining the page configuration information corresponding to the page parameter information;
and the triggering unit is used for triggering the asynchronous updating algorithm by utilizing the root component.
9. A computer-readable storage medium comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 6.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 6 by means of the computer program.
CN202010649726.3A 2020-07-08 2020-07-08 Component rendering method and device, storage medium and electronic device Pending CN112015408A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010649726.3A CN112015408A (en) 2020-07-08 2020-07-08 Component rendering method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010649726.3A CN112015408A (en) 2020-07-08 2020-07-08 Component rendering method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN112015408A true CN112015408A (en) 2020-12-01

Family

ID=73498466

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010649726.3A Pending CN112015408A (en) 2020-07-08 2020-07-08 Component rendering method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112015408A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800363A (en) * 2021-02-04 2021-05-14 北京字节跳动网络技术有限公司 Page display method and device, electronic equipment and computer readable medium
CN113254128A (en) * 2021-05-13 2021-08-13 武汉悦学帮网络技术有限公司 Project page loading method and device, computer equipment and storage medium
CN113434800A (en) * 2021-06-28 2021-09-24 青岛海尔科技有限公司 Data processing method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648630A (en) * 2016-12-01 2017-05-10 北京趣拿软件科技有限公司 Page obtaining method and device
CN106951221A (en) * 2015-11-02 2017-07-14 洛克威尔自动控制技术股份有限公司 For the self-described diagnostic data presented on the mobile device
CN107391114A (en) * 2017-06-27 2017-11-24 阿里巴巴集团控股有限公司 The page visualizes rendering intent and device
US20180157467A1 (en) * 2016-12-03 2018-06-07 Thomas STACHURA Spreadsheet-Based Software Application Development
CN108319474A (en) * 2017-01-16 2018-07-24 腾讯科技(深圳)有限公司 A kind of page info generation method, device and equipment
CN109358936A (en) * 2018-09-29 2019-02-19 Oppo广东移动通信有限公司 Information processing method, device, storage medium, electronic equipment and system
CN109614100A (en) * 2018-10-26 2019-04-12 阿里巴巴集团控股有限公司 Page display method, device, server, front end and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106951221A (en) * 2015-11-02 2017-07-14 洛克威尔自动控制技术股份有限公司 For the self-described diagnostic data presented on the mobile device
CN106648630A (en) * 2016-12-01 2017-05-10 北京趣拿软件科技有限公司 Page obtaining method and device
US20180157467A1 (en) * 2016-12-03 2018-06-07 Thomas STACHURA Spreadsheet-Based Software Application Development
CN108319474A (en) * 2017-01-16 2018-07-24 腾讯科技(深圳)有限公司 A kind of page info generation method, device and equipment
CN107391114A (en) * 2017-06-27 2017-11-24 阿里巴巴集团控股有限公司 The page visualizes rendering intent and device
CN109358936A (en) * 2018-09-29 2019-02-19 Oppo广东移动通信有限公司 Information processing method, device, storage medium, electronic equipment and system
CN109614100A (en) * 2018-10-26 2019-04-12 阿里巴巴集团控股有限公司 Page display method, device, server, front end and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800363A (en) * 2021-02-04 2021-05-14 北京字节跳动网络技术有限公司 Page display method and device, electronic equipment and computer readable medium
CN113254128A (en) * 2021-05-13 2021-08-13 武汉悦学帮网络技术有限公司 Project page loading method and device, computer equipment and storage medium
CN113434800A (en) * 2021-06-28 2021-09-24 青岛海尔科技有限公司 Data processing method and device
CN113434800B (en) * 2021-06-28 2023-06-09 青岛海尔科技有限公司 Data processing method and device

Similar Documents

Publication Publication Date Title
CN112015408A (en) Component rendering method and device, storage medium and electronic device
CN1288553C (en) System and method for executing renewal command on wireless communication device
US20040243993A1 (en) Electronic device supporting multiple update agents
CN109947709B (en) Data storage method and device
CN107436787B (en) Method for processing resource, device, storage medium and electronic device
EP4009162A1 (en) Code change method and device
CN109814854A (en) Project skeleton generating method, device, computer equipment and storage medium
CN111782339A (en) Container creation method and device, electronic equipment and storage medium
CN114416121A (en) Firmware burning method and device, burning equipment and firmware burning system
CN111984248A (en) Page editing method and device, storage medium and electronic device
US10503430B2 (en) Method and device for clearing data and electronic device
CN113961179A (en) Service access method, system, electronic device and storage medium of SOAR platform
CN111459376A (en) Product guiding method, device and equipment
CN104504113A (en) Method and device for processing information by mobile browser and mobile terminal
CN113656100B (en) Interface switching method, device, electronic device and computer program product
CN105119944A (en) Application starting method and related device
CN113741966A (en) Method, system, equipment and storage medium for Kickstart file conversion
KR100316584B1 (en) Flash Memory To Share With Booting And Main Operation Program In System And Upgrade Method In That Memory
US10437802B2 (en) Single IO operation integer-value database
CN112435346B (en) Multi-type scene coexistence adding method, device, terminal and storage medium
CN116302209B (en) Method for accelerating starting of application process, distributed system, node and storage medium
CN114615150B (en) Simulation network generation method and device
CN113419756A (en) File upgrading method and device and electronic equipment
CN116627340A (en) Partition access mode determining method and device, storage medium and electronic device
CN106886420A (en) A kind of program code managing device, method and program code manager

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201201