CN117193769A - Page rendering method and device, electronic equipment and computer readable storage medium - Google Patents
Page rendering method and device, electronic equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN117193769A CN117193769A CN202311188463.0A CN202311188463A CN117193769A CN 117193769 A CN117193769 A CN 117193769A CN 202311188463 A CN202311188463 A CN 202311188463A CN 117193769 A CN117193769 A CN 117193769A
- Authority
- CN
- China
- Prior art keywords
- information
- event
- attribute
- analysis result
- page
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000009877 rendering Methods 0.000 title claims abstract description 178
- 238000000034 method Methods 0.000 title claims abstract description 93
- 238000004458 analytical method Methods 0.000 claims abstract description 209
- 238000012545 processing Methods 0.000 claims description 103
- 230000006870 function Effects 0.000 claims description 53
- 238000013515 script Methods 0.000 claims description 39
- 238000004590 computer program Methods 0.000 claims description 25
- 230000014509 gene expression Effects 0.000 claims description 16
- 230000004044 response Effects 0.000 claims description 16
- 230000015654 memory Effects 0.000 claims description 11
- 238000005516 engineering process Methods 0.000 abstract description 10
- 230000010365 information processing Effects 0.000 abstract description 3
- 239000000306 component Substances 0.000 description 101
- 230000008569 process Effects 0.000 description 27
- 238000010586 diagram Methods 0.000 description 22
- 239000008186 active pharmaceutical agent Substances 0.000 description 14
- 238000004891 communication Methods 0.000 description 10
- 238000002347 injection Methods 0.000 description 5
- 239000007924 injection Substances 0.000 description 5
- 230000003993 interaction Effects 0.000 description 5
- 238000002360 preparation method Methods 0.000 description 5
- 108010001267 Protein Subunits Proteins 0.000 description 4
- 230000009471 action Effects 0.000 description 4
- 230000006978 adaptation Effects 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 238000013507 mapping Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000003068 static effect Effects 0.000 description 3
- 230000006399 behavior Effects 0.000 description 2
- 238000012512 characterization method Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000008846 dynamic interplay Effects 0.000 description 2
- 239000000758 substrate Substances 0.000 description 2
- 241000282672 Ateles sp. Species 0.000 description 1
- 235000014570 Stauntonia hexaphylla Nutrition 0.000 description 1
- 240000001490 Stauntonia hexaphylla Species 0.000 description 1
- 238000004873 anchoring Methods 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 239000008358 core component Substances 0.000 description 1
- 238000013503 de-identification Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000000243 solution Substances 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
The disclosure provides a page rendering method and device, electronic equipment and a computer readable storage medium, which can be applied to the technical fields of computer technology, network technology and information processing technology. The page rendering method comprises the following steps: responding to the received page rendering request, and analyzing a preset rendering template corresponding to the service identifier according to the service identifier in the page rendering request to obtain a template analysis result, wherein the page rendering request further comprises service configuration information; analyzing the service configuration information according to the template analysis result to obtain an attribute analysis result and an event analysis result; determining information to be rendered corresponding to the service identifier according to the attribute analysis result and the event analysis result; and rendering according to the information to be rendered to obtain a target page corresponding to the service identifier.
Description
Technical Field
The present disclosure relates to the fields of computer technology, network technology, and information processing technology, and more particularly, to a page rendering method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
With the development of computer technology, various applications (i.e., application) are capable of realizing more and more business functions. An application may refer to a computer program that performs some particular task or tasks.
The application may include a graphical user interface (Graphical User Interface, GUI) and an Engine (i.e., engine). The graphical user interface may refer to a computer-operated user interface that is displayed in a graphical manner. An engine may refer to a core component of a development program or system on an electronic platform.
In the process of implementing the disclosed concept, the inventor finds that at least the following problems exist in the related art: as the service functions expected to be implemented are more and more complex, the efficiency and accuracy of the graphical user interface generation of the application cannot be guaranteed.
Disclosure of Invention
In view of this, the present disclosure provides a page rendering method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
According to one aspect of the present disclosure, there is provided a page rendering method including: responding to a received page rendering request, and analyzing a preset rendering template corresponding to a service identifier according to the service identifier in the page rendering request to obtain a template analysis result, wherein the page rendering request further comprises service configuration information; analyzing the service configuration information according to the template analysis result to obtain an attribute analysis result and an event analysis result; determining information to be rendered corresponding to the service identifier according to the attribute analysis result and the event analysis result; and rendering to obtain a target page corresponding to the service identifier according to the information to be rendered.
According to an embodiment of the present disclosure, the template parsing result includes M template file identifiers and file types corresponding to the M template file identifiers, where M is a positive integer.
According to an embodiment of the present disclosure, the analyzing the service configuration information according to the template analysis result to obtain an attribute analysis result and an event analysis result includes: responding to that the file types corresponding to the M template file identifications do not comprise the target file type, and carrying out attribute analysis processing on the service configuration information to obtain the attribute analysis result; and carrying out event analysis processing on the service configuration information to obtain the event analysis result.
According to an embodiment of the present disclosure, the service configuration information includes P attribute information and attribute type identifiers corresponding to the P attribute information, where P is a positive integer.
According to an embodiment of the present disclosure, the performing, in response to none of file types corresponding to the M template file identifiers includes a target file type, attribute analysis processing on the service configuration information, where obtaining the attribute analysis result includes: for each of the P attribute information, invoking an attribute analysis script corresponding to a target attribute type when an attribute type identifier corresponding to the attribute information characterizes that the attribute information belongs to the target attribute type; performing attribute analysis processing on the attribute information by using the attribute analysis script to obtain a first attribute analysis result; and determining a second attribute analysis result according to the attribute information when the attribute type identifier corresponding to the attribute information indicates that the attribute information does not belong to the target attribute type.
According to an embodiment of the present disclosure, the service configuration information includes Q pieces of event information and event type identifiers corresponding to the Q pieces of event information, and Q is a positive integer.
According to an embodiment of the present disclosure, the performing an event parsing process on the service configuration information to obtain the event parsing result includes: for each of the Q event information, invoking an event analysis script corresponding to a target event type when an event type identifier corresponding to the event information indicates that the event information belongs to the target event type; performing event analysis processing on the event information by using the event analysis script to obtain a first event analysis result; and determining a second event analysis result according to the event information under the condition that the event type identifier corresponding to the event information indicates that the event information does not belong to the target event type.
According to an embodiment of the present disclosure, the determining, according to the attribute analysis result and the event analysis result, information to be rendered corresponding to the service identifier includes: processing the first attribute analysis result and the first event analysis result by using a target engine to obtain first number of page component information; processing the second attribute analysis result and the second event analysis result by using an expression engine to obtain second number of page component information; determining position information corresponding to each of S page component identifiers according to the first number of page component information and the second number of page component information, wherein S is equal to the sum of the first number and the second number, and S is a positive integer; and determining the information to be rendered according to the S page component information and the position information corresponding to the S page component identifiers.
According to an embodiment of the present disclosure, the page component information includes a function type identifier.
According to an embodiment of the present disclosure, determining the location information corresponding to each of the S page component identifications according to the first number of page component information and the second number of page component information includes: determining a target application programming interface corresponding to the function type identifier according to the function type identifier corresponding to the page component identifier for each page component identifier in the S page component identifiers; and processing the page component information corresponding to the page component identifier by using the target application programming interface to obtain position information corresponding to the page component identifier.
According to an embodiment of the present disclosure, the page rendering request further includes an application system identifier.
According to an embodiment of the present disclosure, rendering the target page corresponding to the service identifier according to the information to be rendered includes: invoking a rendering engine corresponding to the application system identifier; and rendering the S page components according to the position information corresponding to each of the S page components by using the rendering engine to obtain the target page.
According to an embodiment of the present disclosure, the page rendering request further includes a load library identification.
According to an embodiment of the present disclosure, in response to receiving a page rendering request, according to a service identifier in the page rendering request, performing parsing processing on a predetermined rendering template corresponding to the service identifier, where obtaining a template parsing result includes: responding to the received page rendering request, and acquiring a preset rendering template corresponding to the service identifier; loading a predetermined dynamic link library in response to the load library identification characterizing license loading; according to the preset dynamic link library, carrying out file type analysis processing on the preset rendering template to obtain M template file identifications, file types corresponding to the M template file identifications and file association relations among the M template file identifications; and determining the template analysis result according to the M template file identifications, the file types corresponding to the M template file identifications and the file association relation.
According to another aspect of the present disclosure, there is provided a page rendering apparatus including: the first analysis processing module is used for responding to a received page rendering request, analyzing a preset rendering template corresponding to the service identifier according to the service identifier in the page rendering request to obtain a template analysis result, wherein the page rendering request further comprises service configuration information; the second analysis processing module is used for analyzing the service configuration information according to the template analysis result to obtain an attribute analysis result and an event analysis result; the determining module is used for determining the information to be rendered corresponding to the service identifier according to the attribute analysis result and the event analysis result; and the rendering module is used for rendering to obtain a target page corresponding to the service identifier according to the information to be rendered.
According to another aspect of the present disclosure, there is provided an electronic device including: one or more processors; and a memory for storing one or more instructions that, when executed by the one or more processors, cause the one or more processors to implement a method as described in the present disclosure.
According to another aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to implement a method as described in the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising computer executable instructions which, when executed, are adapted to carry out the method as described in the present disclosure.
According to the embodiment of the disclosure, since the attribute analysis result and the event analysis result are obtained by analyzing the service configuration information according to the template analysis result, and the template analysis result is obtained by analyzing the predetermined rendering template corresponding to the service identifier according to the service identifier in the page rendering request, the attribute analysis result can be used for characterizing the attribute information and the attribute type corresponding to the service configuration information, and the event analysis result can be used for characterizing the event information and the event type corresponding to the service configuration information. On the basis, as the information to be rendered is determined according to the attribute analysis result and the event analysis result, the target page is automatically rendered according to the information to be rendered, so that the technical problem that the efficiency and the accuracy of generating the graphical user interface of the application program cannot be guaranteed due to the fact that the service function expected to be realized is more and more complex in the related art can be at least partially overcome, the capability of determining the information to be rendered is improved, and the efficiency and the accuracy of page rendering are further improved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments thereof with reference to the accompanying drawings in which:
FIG. 1 schematically illustrates a system architecture to which a page rendering method may be applied, according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a page rendering method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates an example schematic diagram of a target engine suitable for page rendering in accordance with an embodiment of the present disclosure;
FIG. 4 schematically illustrates an example schematic diagram of a class structure suitable for page rendering in accordance with an embodiment of the present disclosure;
fig. 5 schematically illustrates an example schematic diagram of a process of parsing a predetermined rendering template corresponding to a service identifier according to the service identifier in a page rendering request in response to receiving the page rendering request, to obtain a template parsing result according to an embodiment of the present disclosure;
fig. 6 schematically illustrates a flowchart of a method for resolving service configuration information according to a template resolving result to obtain an attribute resolving result and an event resolving result according to an embodiment of the present disclosure;
fig. 7A schematically illustrates an example schematic diagram of a process of resolving service configuration information according to a template resolving result to obtain an attribute resolving result and an event resolving result according to an embodiment of the present disclosure;
Fig. 7B schematically illustrates an example schematic diagram of a process of resolving service configuration information according to a template resolution result to obtain an attribute resolution result and an event resolution result according to another embodiment of the present disclosure;
FIG. 8A schematically illustrates an example schematic diagram of an application programming interface in accordance with an embodiment of the present disclosure;
fig. 8B schematically illustrates an example schematic diagram of a process of determining information to be rendered corresponding to a service identifier according to an attribute resolution result and an event resolution result according to an embodiment of the present disclosure;
FIG. 9 schematically illustrates a block diagram of a page rendering apparatus according to an embodiment of the disclosure; and
fig. 10 schematically illustrates a block diagram of an electronic device adapted to implement a page rendering method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc., of the data involved (including, but not limited to, user personal information) all comply with relevant legal regulations, are used for legal purposes, and do not violate well-known. In particular, necessary measures are taken for personal information of the user, illegal access to personal information data of the user is prevented, and personal information security, network security and national security of the user are maintained.
In embodiments of the present disclosure, the user's authorization or consent is obtained before the user's personal information is obtained or collected.
For example, after obtaining the service configuration information, the information of you can be desensitized by adopting a de-identification or anonymization processing mode to protect the information of you.
The application framework for dynamic presentation of pages may include an engine layer, a view layer, an event layer, and a template layer. The event layer can be used for processing the event set by the user, for example, the event can be analyzed to obtain the event type, and then the binding of the service data is carried out according to the event type. Based on this, specific event processing can be performed in response to user-initiated event actions.
However, the current event layer has the following problems:
because the event layer is typically implemented in a custom JSON (JavaScript Object Notation, JS object numbered musical notation) format, it is difficult to support hints during business writing events. Because the events supported by the event layer are limited, under the condition of processing more practical services, a plurality of events are matched with each other to realize the processing, so that the processing of events with high complexity cannot be supported. In addition, since the event layer only supports data acquisition through expressions, it cannot support services having data processing requirements.
In summary, as the service functions expected to be implemented are more and more complex, the efficiency and accuracy of the generation of the graphical user interface of the application program cannot be ensured.
In order to at least partially solve the technical problems in the related art, the present disclosure provides a page rendering method and apparatus, an electronic device, and a computer-readable storage medium, which can be applied to the fields of computer technology, network technology, and information processing technology. The page rendering method comprises the following steps: responding to the received page rendering request, and analyzing a preset rendering template corresponding to the service identifier according to the service identifier in the page rendering request to obtain a template analysis result, wherein the page rendering request further comprises service configuration information; analyzing the service configuration information according to the template analysis result to obtain an attribute analysis result and an event analysis result; determining information to be rendered corresponding to the service identifier according to the attribute analysis result and the event analysis result; and rendering according to the information to be rendered to obtain a target page corresponding to the service identifier.
Fig. 1 schematically illustrates a system architecture to which a page rendering method may be applied according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which embodiments of the present disclosure may be applied to assist those skilled in the art in understanding the technical content of the present disclosure, but does not mean that embodiments of the present disclosure may not be used in other devices, systems, environments, or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is a medium used to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 through the network 104 using at least one of the first terminal device 101, the second terminal device 102, the third terminal device 103, to receive or send messages, etc. Various communication client applications, such as a shopping class application, a web browser application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc. (only examples) may be installed on the first terminal device 101, the second terminal device 102, the third terminal device 103.
The first terminal device 101, the second terminal device 102, the third terminal device 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that, the page rendering method provided by the embodiments of the present disclosure may be generally performed by the server 105. Accordingly, the page rendering apparatus provided by the embodiments of the present disclosure may be generally provided in the server 105. The page rendering method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105. Accordingly, the page rendering apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105.
Alternatively, the page rendering method provided by the embodiment of the present disclosure may also be performed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may also be performed by other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Accordingly, the page rendering apparatus provided by the embodiments of the present disclosure may also be provided in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or in other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
It should be noted that the sequence numbers of the respective operations in the following methods are merely representative of the operations for the purpose of description, and should not be construed as representing the order of execution of the respective operations. The method need not be performed in the exact order shown unless explicitly stated.
Fig. 2 schematically illustrates a flow chart of a page rendering method according to an embodiment of the disclosure.
As shown in fig. 2, the page rendering method includes operations S210 to S240.
In operation S210, in response to receiving the page rendering request, according to the service identifier in the page rendering request, a predetermined rendering template corresponding to the service identifier is parsed, so as to obtain a template parsing result, where the page rendering request further includes service configuration information.
In operation S220, according to the template analysis result, the service configuration information is analyzed to obtain an attribute analysis result and an event analysis result.
In operation S230, the information to be rendered corresponding to the service identifier is determined according to the attribute resolution result and the event resolution result.
In operation S240, according to the information to be rendered, a target page corresponding to the service identifier is rendered.
According to embodiments of the present disclosure, the page rendering method may be applied in a native dynamic scheme (i.e., MCube). The MCube dynamic can provide a complete technical solution for dynamic presentation of the cross-end page, so that the business can realize the effects of one-time development, online at any time and multi-end multiplexing based on the Mube. The end-side container architecture of Mcube may include an engine layer, a view layer, an event layer, and a template layer.
According to embodiments of the present disclosure, the engine layer may provide underlying support, for example, the engine layer may include a layout engine capable of parsing the encoded presentation file into a view tree. The view layer can analyze the abstract general view into a view corresponding to the original view and support the business party to register the custom view for display, for example, the view layer can analyze and assign the view attribute so as to realize the purpose of multiplexing the existing view capability.
According to the embodiment of the disclosure, the event layer can process the event set by the user, for example, the event layer can analyze the event in the digital subscriber line (Digital Subscriber Line, DSL), bind according to the event type after analyzing, and respond to the event action initiated by the user to process the event. Template layers may be used for management and use of templates, for example, the template layer may enable template downloading, template caching, template parsing, template spam, and the like.
According to the embodiment of the disclosure, the code for generating the page rendering request can be written in the script in advance, and when the page rendering is required, the user can input the service identification and the service configuration information through the terminal equipment, initiate the page rendering operation and run the script to generate the page rendering request message. After obtaining the page rendering request message, the terminal device can send the page rendering request message to the server, so that the server can render and obtain a target page corresponding to the service identifier according to the service identifier in the page rendering request message. Page rendering may refer to the process of combining page data and page layout to generate a visual user interface.
According to embodiments of the present disclosure, the page rendering request may include a service identification. The service identity may be used to characterize different services, e.g. the service identity may comprise service a, service B. After the page rendering request is obtained, a predetermined rendering template corresponding to the service identifier may be obtained according to the service identifier in the page rendering request. After the predetermined rendering template is obtained, the predetermined rendering template can be subjected to analysis processing, and a template analysis result is obtained. The template analysis result can be used for representing the template file identification, the file type corresponding to the template file identification and the file association relation.
According to embodiments of the present disclosure, the page rendering request may also include service configuration information. The service configuration information may be used to characterize a service configuration corresponding to the service identity, e.g., the service configuration information may include at least one of: attribute information, attribute type identification corresponding to the attribute information, event type identification corresponding to the event information, and the like.
Alternatively, the service configuration information may further include at least one of: layout configuration information, style configuration information, data binding configuration information, rights configuration information, dynamic interaction configuration information, extension configuration information, and the like. Layout configuration information may be used to characterize the location, size, and arrangement of individual elements in a page. Style configuration information may be used to characterize the appearance style of individual elements in a page, such as fonts, colors, backgrounds, borders, shadows, and the like. The data binding configuration information can be used for representing the association relationship between each element in the page and the back-end data. The permission configuration information may be used to characterize access permissions for the page. The dynamic interaction configuration information may be used to characterize the relationship between the interaction behavior of the user and the various elements in the page. The extension configuration information may be used to characterize the extension that is customized to specific business needs, e.g., adding specific business logic, introducing third party components or plug-ins, configuring specific event handling, etc.
According to embodiments of the present disclosure, the template parsing result may be used to characterize a template file identifier, a file type corresponding to the template file identifier, and a file association relationship. After the template analysis result is obtained, the service configuration information can be subjected to attribute analysis processing under the condition that the attribute type identification characterization attribute information corresponding to the attribute information is determined to belong to the target attribute type, so that the attribute analysis result is obtained. Alternatively, event analysis processing may be performed on the service configuration information to obtain an event analysis result when it is determined that the event type identifier corresponding to the event information indicates that the event information belongs to the target event type.
According to the embodiment of the disclosure, after the attribute analysis result and the event analysis result are obtained, the attribute analysis result and the event analysis result may be processed by an engine, respectively, so as to determine page component information and location information corresponding to the page component identifier. On this basis, the information to be rendered can be determined according to the page component information and the position information respectively corresponding to each page component identifier. After the information to be rendered is obtained, the target page can be rendered according to the page component information and the position information which are respectively corresponding to each page component identifier in the information to be rendered.
According to the embodiment of the disclosure, since the attribute analysis result and the event analysis result are obtained by analyzing the service configuration information according to the template analysis result, and the template analysis result is obtained by analyzing the predetermined rendering template corresponding to the service identifier according to the service identifier in the page rendering request, the attribute analysis result can be used for characterizing the attribute information and the attribute type corresponding to the service configuration information, and the event analysis result can be used for characterizing the event information and the event type corresponding to the service configuration information. On the basis, as the information to be rendered is determined according to the attribute analysis result and the event analysis result, the target page is automatically rendered according to the information to be rendered, so that the technical problem that the efficiency and the accuracy of generating the graphical user interface of the application program cannot be guaranteed due to the fact that the service function expected to be realized is more and more complex in the related art can be at least partially overcome, the capability of determining the information to be rendered is improved, and the efficiency and the accuracy of page rendering are further improved.
The page rendering method 200 according to an embodiment of the present invention is further described below with reference to fig. 3, 4, 5, 6, 7A, 7B, 8A, and 8B.
FIG. 3 schematically illustrates an example schematic diagram of a target engine suitable for page rendering in accordance with an embodiment of the disclosure.
As shown in fig. 3, in graph 300, a target engine suitable for page rendering may refer to a MCube-based custom JS processing engine. The MCube-based custom JS processing engine may include a Java layer 310, a JNI layer 320, an initialization injection script anchor processing layer 330, and a JS engine adaptation layer 340.
At Java layer 310, a MCubeJSINIT component 311, a MCubeJSprocessor component 312, a MCubeJSFuncHandler component 313 may be included. The MCubeJSInit component 311 may be used to perform initialization functions, the mcubejsprocessor component 312 may be used to perform data processing functions, and the mcubejsfuncnhandler component 313 may be used to perform data receiving functions.
At the JNI layer 320, MCubeJNI component 321, MCubeJSEngine component 322, MCubeJSConverter component 323, and mcubejsulis component 324 may be included. The JNI layer 320 may be used to process Java calls. The various components in JNI layer 320 can use the APIs provided by the JS engine to complete encapsulation, invocation, and combination of services, etc.
At the initialization injection script anchoring processing layer 330, an InitProcessDate component 331, an initConsole component 332, and an InitDeviceInfo component 333 may be included. The InitProcessDate component 331 can be configured to execute an injection-initialized script via the JS engine and declare an anchored process data method storage area in the script. The initConsole component 332 may be used to enable scripts to provide confsole log and like functionality to facilitate debugging when a business is written to a template. The InitDeviceInfo component 333 may be configured to enable a script to provide Device-related functionality to facilitate a service to obtain Device-related information.
At the JS engine adaptation layer 340, MCubeJSValue component 341, MCubeJSApi component 342, and MCubeJSBase component 343 may be included. The JS engine adaptation layer 340 can be used to encapsulate and adapt the JS engine. Each component in the JS engine adaptation layer 340 can encapsulate a commonly used data structure, APIs provided by the JS engine, and the like, so as to implement differential trowelling of different APIs provided by different JS engines, thereby enabling seamless switching of the JS engines according to different services or requirements.
MCube's current add JS capability can be used for business logic processing and event processing, in accordance with an embodiment of the present disclosure. The JS loading and use procedure can include: JS initialization, JS use, and JS release.
The JS initialization may include JS environment initialization, such as initialization of the MCube SDK and JS environment preparation, in accordance with an embodiment of the present disclosure. In the process of initializing the MCube SDK, a dynamic link library which encapsulates JS Engine core codes can be loaded through a system providing API, so that the core CPP library containing JS engines can be conveniently loaded into a program, and preparation is carried out for subsequent use.
In the process of JS environment preparation, JS Context can be used to prepare Context information for a JS execution environment, in accordance with an embodiment of the present disclosure. The JS Bridge can be used for providing the interaction of the JS environment in the JNI CPP layer, and the method for calling the JSEngine in the Java layer through the JS Bridge.
In order to accommodate the usage scenario of MCube, JS Container may save the corresponding Container information by creating JS Class for mapping the UI existing at the Java layer, according to an embodiment of the present disclosure. In addition, the JS controller can implement more functional settings by continuing to create an instance of JS Class for hoo of JS Engine. For example, the DeviceInfo may be called when Device information needs to be obtained in the JS script, and is used for providing current Device information, APP information, and the like, where the calling method is to register a method in a hook mode into the JS Engine object, and notify the Java layer to obtain Device related information through a JNI mode after the calling.
Alternatively, the Events can be used as the basis of event interaction, so as to be compatible with the feature of supporting the interaction of Events in Mcube, hook injection of the corresponding function and creation of a JS Class instance can be completed in a JS environment to realize the function change through CPP, and the calling mode is that the injection object parameter is used for indicating caller information.
Alternatively, data can be used as a Data condition for conveniently acquiring corresponding upper-layer UI information in a JS transaction, so that a service can conveniently further process and process Data through JS, and after the Data is processed, the service can conveniently carry out a view local refreshing or complete view refreshing function through JS bridging of a primary event.
The JS-uses may include JS properties and function settings, JS communicates with JS engines via JNI CPP, in accordance with an embodiment of the present disclosure. Because the JS Bridge is used for carrying communication bridging between the JS Engine and Java, the purpose of the interaction between the Java and the JS Engine through the JNI can be achieved through the use of the JS Bridge. For example, a method call from the JNI may be received by defining a method at the Java layer, an instance of JS Bridge at the Java layer may be introduced during initialization, an object of this instance may be held at the JNI to facilitate the call of the JNI in a subsequent flow, and an interface for Java to call the JS Engine may be provided, through which an API related to the JS Engine may be called at the Java layer.
The JS releases may include a JS Engine resource release and a JS Bridge release, in accordance with an embodiment of the present disclosure. Mcube can release JS Context and JS Bridge after receiving a view destroysignal provided by the system. In the releasing process, the above examples of various JS classes injected into the JS Context through the hook may be released first, meanwhile, the JS Engine information stored in the JNI may be released, and then the resources stored in association with the JS Bridge may be released, for example, the Bridge examples for communication in the Java layer described above.
FIG. 4 schematically illustrates an example schematic diagram of a class structure suitable for page rendering in accordance with an embodiment of the disclosure.
As shown in fig. 4, in 400, class structures suitable for page rendering may include a MCubeJSBridge class 401, a mcubedeviceinvader class 402, a mcubedatainvarior class 403, a mcubenativeinvarior class 404, a MCubeJSContext class 405, a jnijjscontext class 406, a jnijjsbridge class 407, and a jnijjsulils class 408.
The MCubeJSBridge class 401 may be understood as an implementation of Bridge at the Java layer. The MCubeJSBridge class 401 facilitates JNI layer completion calls by holding different types of invokers. For example, the MCubeJSBridge class 401 may provide JS with JNI layers to invoke Java layers by defining callJavaMethod; the Java layer finishes the JS call by using the JNI layer by defining a callJSSmethod; initialization of bridge is provided by defining init method.
The mcubedeviceinvoke class 402 can be responsible for providing the provision of Device related information by making certain system API calls at the Java layer. Such as the screen width height, app version, and the type of system to which it belongs.
The mcubedatainvoke class 403 provides data information contained in the corresponding templates by performing data acquisition and update operations at the Java layer. For example, the data corresponding to the template is acquired through the API and returned to the JS layer, so that operations can be performed on the JS layer using the template data.
The mcubeNativeInvoker class 404 performs data call by calling the JS through the JNI method after the Java layer obtains the corresponding data, so as to realize bridging the native capability to the JS layer for use. For example, the JS layer can call native to obtain a task prompt, so that the problem that an event layer added with an event cannot be prompted is solved; or may use native to make network requests.
The MCubeJSContext class 405 can be understood as an implementation of JSContext at the Java layer. The MCubeJSContext class 405 may call CPP code in JNI to complete the creation and preparation of JSContext using JS engines at JNI layer.
The jnijpcontext class 406 can be understood as an implementation of JSContext at the JNI layer. The jnijpcontext class 406 can use the JS engine to obtain the corresponding JSContext and prepare the environment for that JSContext. For example, the corresponding JSContext may be created by createJSContext, and the mapping of the function call is completed internally by prepareContainer, prepareTimeout, prepareData or the like. preprelicontainer can be used to prepare container related functions such as hook and prepare of device, data-plus-active etc. methods. prepreTimeout may be used to provide setTimeout functionality for JS environment, e.g., a method mapping may be performed at Java level and a function of invoking a method with delay according to the provided method and delay completion. prepareData can be used to prepare data-related functions in order to finally obtain data of a corresponding template in a JS environment through the invocation of data in a hook JS script.
The JNIJSBridge class 407 can be understood as an implementation of bridge at the JNI layer. The JNIJSBridge class 407 may initialize the environment of a bridge in JNI, for example, holding of Java layer bridge objects, callback preparation of callback methods, and the like.
The jnijseulils class 408 can be understood as a JS in JNI tool class. The jnijsetils class 408 can complete the transformation of Java JS data at JNI.
According to an embodiment of the present disclosure, operation S210 may include the following operations.
And responding to the received page rendering request, and acquiring a preset rendering template corresponding to the service identifier. A predetermined dynamic link library is loaded in response to the load library identification characterizing the license load. And according to the preset dynamic link library, carrying out file type analysis processing on the preset rendering template to obtain M template file identifications, file types corresponding to the M template file identifications and file association relations among the M template file identifications. And determining a template analysis result according to the M template file identifications, the file types and the file association relations corresponding to the M template file identifications.
According to embodiments of the present disclosure, the page rendering request may also include a load library identification.
According to embodiments of the present disclosure, candidate rendering templates corresponding to at least one candidate service identifier may be created in advance according to the at least one candidate service identifier. The candidate rendering templates may combine static page templates with dynamic data to generate a user interface for viewing by a user.
According to the embodiment of the disclosure, after receiving the page rendering request, the service identifier in the page rendering request and at least one candidate service identifier can be respectively matched to obtain the target service identifier. The candidate rendering templates corresponding to the target service identification may be determined as predetermined rendering templates.
According to embodiments of the present disclosure, the page rendering request may also include a load library identification. The load library identification may be used to characterize whether the loading of the predefined dynamic link library (Dynamic Link Library, DLL) is permitted. The predefined dynamic link library may include functions, classes, variables, etc. that may be called by other programs and data for sharing code and resources in the operating system.
For example, under the condition that the load library identification characterizes the load, the analysis processing can be directly performed on the preset rendering template to obtain a template analysis result. Alternatively, under the condition that the loading library identification characterizes license loading, a preset dynamic link can be loaded, and file type analysis processing is performed on a preset rendering template according to the preset dynamic link library, so that a template analysis result is obtained.
Fig. 5 schematically illustrates an example schematic diagram of a process of parsing a predetermined rendering template corresponding to a service identifier according to the service identifier in a page rendering request in response to receiving the page rendering request, to obtain a template parsing result according to an embodiment of the present disclosure.
As shown in fig. 5, in 500, a page rendering request 501 may include a load library identification 501_1 and a service identification 501_2. In response to receiving the page rendering request 501, a predetermined rendering template 503 corresponding to the service identifier 501_2 may be acquired according to the service identifier 501_2 in the page rendering request 501. In response to the load library identification 501_1 characterizing a license load, a predetermined dynamic link library 502 may be loaded.
After the predetermined dynamic link library 502 and the predetermined rendering template 503 are obtained, file type analysis processing may be performed on the predetermined rendering template 503 according to the predetermined dynamic link library 502, so as to obtain M template file identifiers 504_1, file types 504_2 corresponding to the M template file identifiers 504_1, and file association relations 504_3 between the M template file identifiers 504_1.
On this basis, the template analysis result 505 can be determined from the M template file identifications 504_1, the file types 504_2 corresponding to the M template file identifications 504_1, and the file association relationship 504_3 between the M template file identifications 504_1.
Fig. 6 schematically illustrates a flowchart of a method for resolving service configuration information according to a template resolving result to obtain an attribute resolving result and an event resolving result according to an embodiment of the present disclosure.
As shown in fig. 6, operation S220 includes operations S621 to S622.
In operation S621, in response to none of the file types corresponding to the M template file identifications including the target file type, attribute analysis processing is performed on the service configuration information, so as to obtain an attribute analysis result.
In operation S622, the event analysis processing is performed on the service configuration information, so as to obtain an event analysis result.
According to an embodiment of the present disclosure, the template parsing result includes M template file identifications and file types corresponding to the M template file identifications, respectively, where M is a positive integer.
According to embodiments of the present disclosure, file types may include static file types and dynamic file types. The static file types may include at least one of: HTML (Hyper Text Markup Language), hypertext markup language (JS) (i.e., javaScript) files, CSS (Cascading Style Sheets), cascading style sheet) files, TXT (i.e., text document) files, picture files, and video files. The dynamic file types may include at least one of: servlet (Servlet Applet, service connector) files and JSP (Java Server Pages, java server page) files.
According to the embodiment of the disclosure, the target file type may be configured according to actual service requirements, which is not limited herein. For example, the target file type may be a JS file, in which case, file types corresponding to the M template file identifiers may be respectively matched with the JS file types, to obtain a file type matching result. And responding to the file type matching result to represent that the file types corresponding to the M template file identifications do not comprise the target file types, and respectively carrying out attribute analysis processing and event analysis processing on the service configuration information to obtain an attribute analysis result and an event analysis result.
According to an embodiment of the present disclosure, operation S621 may include the following operations.
For each of the P attribute information, invoking an attribute resolution script corresponding to the target attribute type if the attribute type identifier corresponding to the attribute information characterizes the attribute information as belonging to the target attribute type. And carrying out attribute analysis processing on the attribute information by utilizing the attribute analysis script to obtain a first attribute analysis result. And determining a second attribute analysis result according to the attribute information under the condition that the attribute type identifier corresponding to the attribute information characterizes the attribute information not belonging to the target attribute type.
According to an embodiment of the present disclosure, the service configuration information may include P attribute information and attribute type identifiers corresponding to the P attribute information, respectively, where P is a positive integer.
The attribute type identifier may be used to characterize the type of attribute information, for example, the attribute type identifier may include a JS (i.e., javaScript) attribute type and a non-JS attribute type, in accordance with an embodiment of the present disclosure. The attribute information may include at least one of: file path, file name, file size, file type, last modification time, rights, reference dependencies, version number, and encoding format, etc.
The target attribute type may be, for example, a JS attribute type, in accordance with an embodiment of the present disclosure. And matching the attribute type identifiers corresponding to the P attribute information with the target attribute types respectively to obtain an attribute type identifier matching result.
For example, in a case where the attribute type identification matching result characterizes attribute information as belonging to a target attribute type, an attribute resolution script corresponding to the target attribute type may be invoked. And carrying out attribute analysis processing on the attribute information by utilizing the attribute analysis script to obtain a first attribute analysis result corresponding to the JS attribute type. The attribute parsing script may refer to a script for parsing the JS attribute.
Alternatively, in the case where the attribute type identifier matching result characterizes that the attribute information does not belong to the target attribute type, the second attribute resolution result corresponding to the non-JS attribute type may be determined according to the attribute information.
Fig. 7A schematically illustrates an example schematic diagram of a process of resolving service configuration information according to a template resolving result to obtain an attribute resolving result and an event resolving result according to an embodiment of the present disclosure.
As shown in fig. 7A, in 700A, service configuration information 701 may include P pieces of attribute information 701_1 and attribute type identifications 701_2 corresponding to the P pieces of attribute information 701_1, respectively.
Operation S710 may be performed for each attribute information 701_1 of the P attribute information 701_1. In operation S710, it is determined whether the attribute type identification corresponding to the attribute information characterizes the attribute information as belonging to the target attribute type?
If so, an attribute resolution script 702 corresponding to the target attribute type may be invoked. The attribute information 701_1 is subjected to attribute analysis processing by the attribute analysis script 702, and a first attribute analysis result 703 is obtained. If not, a second attribute analysis result 704 may be determined according to the attribute information 701_1.
According to an embodiment of the present disclosure, operation S622 may include the following operations.
For each of the Q event information, invoking an event parsing script corresponding to a target event type if the event type identification characterizing event information corresponding to the event information belongs to the target event type. And carrying out event analysis processing on the event information by utilizing the event analysis script to obtain a first event analysis result. And determining a second event analysis result according to the event information under the condition that the event type identification corresponding to the event information indicates that the event information does not belong to the target event type.
According to an embodiment of the present disclosure, the service configuration information may include Q event information and event type identifications corresponding to the Q event information, respectively, Q being a positive integer.
The event type identification may be used to characterize the type of event information, for example, the event type identification may include a JS event type and a non-JS event type, in accordance with an embodiment of the present disclosure. The event information may include at least one of: event targets, event handlers, event objects, blocking default behavior, event propagation, and event listeners, etc.
The target event type may be, for example, a JS event type, in accordance with an embodiment of the present disclosure. The event type identifiers corresponding to the Q event information can be respectively matched with the target event types, and event type identifier matching results are obtained.
For example, in the case where the event type identification matching result characterizes that the event information belongs to the target event type, an event parsing script corresponding to the target event type may be invoked. And carrying out event analysis processing on the event information by utilizing the event analysis script to obtain a first event analysis result corresponding to the JS event type. The event parsing script may refer to a script for parsing a JS event.
Alternatively, in the case where the event type identifier matching result indicates that the event information does not belong to the target event type, the second event analysis result corresponding to the non-JS event type may be determined according to the event information.
Fig. 7B schematically illustrates an example schematic diagram of a process of resolving service configuration information according to a template resolution result to obtain an attribute resolution result and an event resolution result according to another embodiment of the present disclosure.
As shown in fig. 7B, in 700B, the service configuration information 705 may include Q event information 705_1 and event type identifications 705_2 corresponding to the Q event information 705_1, respectively.
For each event information 705_1 of the Q event information 705_1, operation S720 may be performed. In operation S720, it is determined whether the event type identification corresponding to the event information characterizes the event information as belonging to the target event type?
If so, an event parsing script 706 corresponding to the target event type may be invoked. The event information 705_1 is subjected to attribute analysis processing by the event analysis script 706, and a first event analysis result 707 is obtained. If not, a second event analysis result 708 may be determined from the event information 705_1.
According to an embodiment of the present disclosure, operation S230 may include the following operations.
And processing the first attribute analysis result and the first event analysis result by using the target engine to obtain the first number of page component information. And processing the second attribute analysis result and the second event analysis result by using the expression engine to obtain second number of page component information. And determining position information corresponding to each of the S page component identifiers according to the first number of page component information and the second number of page component information, wherein S is equal to the sum of the first number and the second number, and S is a positive integer. And determining the information to be rendered according to the S page component information and the position information corresponding to the S page component identifiers.
According to embodiments of the present disclosure, the target engine may refer to a JS engine, which may refer to a software component capable of parsing, executing, and optimizing JavaScript code. The JS engine can include at least one of: v8 engine, spiderMonkey engine, javascript core engine, chakra engine, and Rhino engine, among others.
According to the embodiment of the disclosure, since the first attribute analysis result can represent the attribute analysis result corresponding to the JS attribute type and the first event analysis result can represent the event analysis result corresponding to the JS event type, the target engine can be utilized to process the first attribute analysis result and the first event analysis result to obtain the first number of page component information corresponding to the JS type.
In accordance with embodiments of the present disclosure, an expression engine may refer to a software component for parsing and calculating mathematical, logical, or other types of expressions. The expression engine may include at least one of: JEP (Java Expression Parser) engine, MVEL (MVFLEX Expression Language) engine, spEL (Spring Expression Language) engine, EL (Expression Language), etc.
According to the embodiment of the disclosure, since the second attribute analysis result can represent the attribute analysis result corresponding to the non-JS attribute type and the second event analysis result can represent the event analysis result corresponding to the non-JS event type, the expression engine can be utilized to process the second attribute analysis result and the second event analysis result to obtain the second number of page component information corresponding to the non-JS type.
According to an embodiment of the present disclosure, determining location information corresponding to each of the S page component identifications according to the first number of page component information and the second number of page component information may include the following operations.
And determining a target application programming interface corresponding to the function type identifier according to the function type identifier corresponding to the page component identifier aiming at each page component identifier in the S page component identifiers. And processing the page component information corresponding to the page component identifier by using the target application programming interface to obtain the position information corresponding to the page component identifier.
According to embodiments of the present disclosure, the page component information may include a function type identification.
According to embodiments of the present disclosure, the function type identifier may be used to characterize a function that a page component corresponding to the page component identifier is capable of implementing. An application programming interface may be constructed corresponding to each of the at least one candidate function type identifier based on the at least one candidate function type identifier. Because the application programming interfaces have different levels, binding of attributes and objects is required by using the Binding API provided by the JS engine, so as to realize correct identification and information acquisition through the custom API in the process of executing the script. The application programming interface may include a content class, native class, console class, getLayOutId class, setTimeout class, and the like.
According to an embodiment of the present disclosure, the content class may be mapped to a corresponding card, and all information related to the card may be acquired through the content class. For example, the screen width may be acquired by content. The current App version is obtained by the content. And acquiring service data corresponding to the current card through the content. And obtaining a cache value of which the key corresponds to the current card through the content. The card may be notified via a content.
According to embodiments of the present disclosure, native classes may provide auxiliary functions related to the card. For example, the native network request may pass the result to the JS engine via the JNI after the network request data is returned, so that the JS engine may use the result for further processing. Native. Native.
According to the embodiment of the disclosure, the Console class can support output of log information so as to facilitate debugging of services, and can mask the function in a release version so as to improve performance and safety. The GetLayoutId class may obtain sub-elements of the card according to the layoutId, and operate on the corresponding sub-elements, such as data acquisition, data update, view update, and the like of the element. The SetTimeout class may provide a timeout function to facilitate certain operations by the service after a certain period of time.
According to the embodiment of the disclosure, the function type identifier and at least one candidate function type identifier can be respectively matched, so that a function type identifier matching result is obtained. In response to the function type identifier matching result characterizing that the function type identifier and the candidate function type identifier are successfully matched, an application programming interface corresponding to the candidate function type identifier successfully matched can be determined as a target application programming interface.
Since layout information of Mcube is all implemented in binary, JS usage of Mcube is mainly focused on logic processing and data processing aspects, according to embodiments of the present disclosure. While the JS engine may exist to build a virtual DOM tree as a map of the card UI. In the process of using the JS engine to realize Mcre, a plurality of C APIs provided by the engine are used, namely JS objects are created through the C APIs, JS attributes are created through the C APIs, the injection of the objects or the attributes is completed through the C APIs, and then the hook in the JS engine execution flow is carried out through the C APIs to complete the processing or the storage of the intermediate value.
According to the embodiment of the disclosure, on the structure provided by the JS engine, mcbe can encapsulate and convert the object through the private protocol, and because the core code is completely written by the CPP, only simple protocol translation is needed in the Java layer to directly interact with the JS engine, the security of the MCube can be increased, the use burden of the Java layer can be reduced through the operation, so that the use of the JS engine by the MCube expands more capacity to support the continuous and complex business demands, and the performance of the MCube in the use of the JS engine is improved.
FIG. 8A schematically illustrates an example schematic diagram of an application programming interface according to an embodiment of the disclosure.
As shown in fig. 8A, at 800, the application programming interfaces of the Container class 820, native class 830, and Global class 840 are schematically shown.
In the Container class 820, a temporary object presence only JS interface 821, a data modification interface 822, a data cache interface 823, and an application information interface 824 may be included.
In Native class 830, tool related interface 831, view related 832 interface, and network related interface 833 may be included.
In Global class 840, a Console related interface 841, a View object acquisition interface 842, and a set timing task interface 843 may be included.
Fig. 8B schematically illustrates an example schematic diagram of a process of determining information to be rendered corresponding to a service identifier according to an attribute resolution result and an event resolution result according to an embodiment of the present disclosure.
As shown in fig. 8B, in 800B, a first attribute resolution 802 and a first event resolution 803 may be processed using a target engine 801 to obtain a first number of page component information 804. The second attribute resolution 806 and the second event resolution 807 are processed using the expression engine 805 to obtain a second number of page component information 808.
For each of the S page component information, a function type identification 809 corresponding to the page component information may be determined.
The target application programming interface 810 corresponding to the function type identifier may be determined from the function type identifier 809 corresponding to the page component identifier. The page component information corresponding to the page component identifications is processed using the target application programming interface 810 to obtain location information 811 corresponding to each of the S page component identifications. On this basis, the information 812 to be rendered may be determined according to the position information 81l corresponding to each of the S page component identifications.
According to an embodiment of the present disclosure, operation S240 may include the following operations.
A rendering engine corresponding to the application system identification is invoked. And rendering the S page components by using a rendering engine according to the position information corresponding to each of the S page components to obtain a target page.
According to embodiments of the present disclosure, the page rendering request may also include an application system identification.
According to embodiments of the present disclosure, application system identification may be used to characterize different application systems. The application system may comprise at least one of: android system, iOS system, windows operating system, mac system, web application system and Linux system.
According to embodiments of the present disclosure, a rendering engine may refer to a software component or library for converting the structure, style, and content of a page or interface into a visualized image or layout. For example, the rendering engine may parse markup language (e.g., HTML, XML, etc.), apply style sheets (e.g., CSS), and convert them into end results that the user can see and interact with.
According to the embodiment of the disclosure, after obtaining the position information corresponding to each of the S page components, a rendering engine corresponding to the application system identifier may be invoked, and the rendering engine is utilized to process the page component information and the position information corresponding to each of the S page components, so as to obtain the target page.
The above is only an exemplary embodiment, but is not limited thereto, and other page rendering methods known in the art may be included as long as the efficiency and accuracy of page rendering can be improved.
Fig. 9 schematically illustrates a block diagram of a page rendering apparatus according to an embodiment of the present disclosure.
As shown in fig. 9, the page rendering apparatus 900 may include a first parsing processing module 910, a second parsing processing module 920, a determining module 930, and a rendering module 940.
The first parsing module 910 is configured to parse a predetermined rendering template corresponding to a service identifier according to the service identifier in the page rendering request in response to receiving the page rendering request, so as to obtain a template parsing result, where the page rendering request further includes service configuration information.
The second parsing module 920 is configured to parse the service configuration information according to the template parsing result to obtain an attribute parsing result and an event parsing result.
And the determining module 930 is configured to determine information to be rendered corresponding to the service identifier according to the attribute analysis result and the event analysis result.
And the rendering module 940 is used for rendering to obtain a target page corresponding to the service identifier according to the information to be rendered.
According to an embodiment of the present disclosure, the template parsing result includes M template file identifications and file types corresponding to the M template file identifications, respectively, where M is a positive integer.
According to an embodiment of the present disclosure, the second parsing processing module 920 may include an attribute parsing processing unit and an event parsing processing unit.
And the attribute analysis processing unit is used for responding that the file types corresponding to the M template file identifications do not comprise the target file type, and carrying out attribute analysis processing on the service configuration information to obtain an attribute analysis result.
The event analysis processing unit is used for carrying out event analysis processing on the service configuration information to obtain an event analysis result.
According to an embodiment of the present disclosure, service configuration information includes P attribute information and attribute type identifiers corresponding to the P attribute information, respectively, where P is a positive integer.
According to an embodiment of the present disclosure, the attribute resolution processing unit may include a first calling subunit, an attribute resolution processing subunit, and a first determining subunit.
The first calling subunit is configured to call, for each attribute information in the P attribute information, an attribute analysis script corresponding to the target attribute type when the attribute type identifier corresponding to the attribute information characterizes that the attribute information belongs to the target attribute type.
And the attribute analysis processing subunit is used for carrying out attribute analysis processing on the attribute information by utilizing the attribute analysis script to obtain a first attribute analysis result.
The first determining subunit is configured to determine, according to the attribute information, a second attribute analysis result when the attribute type identifier corresponding to the attribute information indicates that the attribute information does not belong to the target attribute type.
According to an embodiment of the present disclosure, service configuration information includes Q event information and event type identifications corresponding to the Q event information, respectively, Q being a positive integer.
According to an embodiment of the present disclosure, the event parsing processing unit may include a second calling sub-unit, an event parsing processing sub-unit, and a second determining sub-unit.
And the second calling subunit is used for calling the event analysis script corresponding to the target event type for each event information in the Q event information under the condition that the event type identifier corresponding to the event information indicates that the event information belongs to the target event type.
And the event analysis processing subunit is used for carrying out event analysis processing on the event information by utilizing the event analysis script to obtain a first event analysis result.
And the second determining subunit is configured to determine a second event analysis result according to the event information when the event type identifier corresponding to the event information indicates that the event information does not belong to the target event type.
According to an embodiment of the present disclosure, the determining module 930 may include a first processing subunit, a second processing subunit, a first determining unit, and a second determining unit.
And the first processing subunit is used for processing the first attribute analysis result and the first event analysis result by utilizing the target engine to obtain the first number of page component information.
And the second processing subunit is used for processing the second attribute analysis result and the second event analysis result by using the expression engine to obtain second number of page component information.
And the first determining unit is used for determining the position information corresponding to each of the S page component identifiers according to the first number of page component information and the second number of page component information, wherein S is equal to the sum of the first number and the second number, and S is a positive integer.
And the second determining unit is used for determining the information to be rendered according to the S page component information and the position information corresponding to the S page component identifiers.
According to an embodiment of the present disclosure, the page component information includes a function type identification.
According to an embodiment of the present disclosure, the first determining unit may comprise a third determining subunit and a processing subunit.
And the third determining subunit is used for determining the target application programming interface corresponding to the function type identifier according to the function type identifier corresponding to the page component identifier aiming at each page component identifier in the S page component identifiers.
And the processing subunit is used for processing the page component information corresponding to the page component identifier by utilizing the target application programming interface to obtain the position information corresponding to the page component identifier.
According to an embodiment of the present disclosure, the page rendering request further includes an application system identification.
According to an embodiment of the present disclosure, the rendering module 940 may include a calling unit and a rendering unit.
And the calling unit is used for calling the rendering engine corresponding to the application system identifier.
And the rendering unit is used for rendering the S page components by utilizing a rendering engine according to the position information corresponding to each of the S page components to obtain a target page.
According to an embodiment of the present disclosure, the page rendering request further includes a load library identification.
According to an embodiment of the present disclosure, the first parsing processing module 910 may include an acquisition unit, a loading unit, a file type parsing processing unit, and a third determining unit.
And the acquisition unit is used for acquiring a preset rendering template corresponding to the service identifier in response to receiving the page rendering request.
And the loading unit is used for loading the preset dynamic link library in response to the loading library identification characterization license loading.
The file type analysis processing unit is used for carrying out file type analysis processing on the preset rendering template according to the preset dynamic link library to obtain M template file identifications, file types corresponding to the M template file identifications and file association relations among the M template file identifications.
And the third determining unit is used for determining a template analysis result according to the M template file identifications and the file types and the file association relations corresponding to the M template file identifications.
Any number of modules, sub-modules, units, sub-units, or at least some of the functionality of any number of the sub-units according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented as split into multiple modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system-on-chip, a system-on-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or in any other reasonable manner of hardware or firmware that integrates or encapsulates the circuit, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be at least partially implemented as computer program modules, which when executed, may perform the corresponding functions.
For example, any of the first parsing processing module 910, the second parsing processing module 920, the determining module 930, and the rendering module 940 may be combined in one module/unit/sub-unit, or any of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least some of the functionality of one or more of these modules/units/sub-units may be combined with at least some of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to embodiments of the present disclosure, at least one of the first parsing processing module 910, the second parsing processing module 920, the determining module 930, and the rendering module 940 may be implemented at least partially as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or in hardware or firmware, such as any other reasonable way of integrating or packaging the circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, at least one of the first parsing processing module 910, the second parsing processing module 920, the determining module 930, and the rendering module 940 may be at least partially implemented as computer program modules, which when executed, may perform the corresponding functions.
It should be noted that, in the embodiment of the present disclosure, the page rendering device portion corresponds to the page rendering method portion in the embodiment of the present disclosure, and the description of the page rendering device portion specifically refers to the page rendering method portion and is not described herein again.
Fig. 10 schematically illustrates a block diagram of an electronic device adapted to implement a page rendering method according to an embodiment of the disclosure. The electronic device shown in fig. 10 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 10, a computer electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1002 or a program loaded from a storage section 1009 into a Random Access Memory (RAM) 1003. The processor 1001 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 1001 may also include on-board memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flows according to embodiments of the present disclosure.
In the RAM 1003, various programs and data necessary for the operation of the electronic apparatus 1000 are stored. The processor 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. The processor 1001 performs various operations of the method flow according to the embodiment of the present disclosure by executing programs in the ROM 1002 and/or the RAM 1003. Note that the program may be stored in one or more memories other than the ROM 1002 and the RAM 1003. The processor 1001 may also perform various operations of the method flow according to the embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the disclosure, the electronic device 1000 may also include an input/output (I/O) interface 1005, the input/output (I/O) interface 1005 also being connected to the bus 1004. The electronic device 1000 may also include one or more of the following components connected to an input/output (I/O) interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output portion 1007 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage portion 1008 including a hard disk or the like; and a communication section 1009 including a network interface card such as a LAN card, a modem, or the like. The communication section 1009 performs communication processing via a network such as the internet. The drive 1010 is also connected to an input/output (I/O) interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed as needed in the drive 1010, so that a computer program read out therefrom is installed as needed in the storage section 1008.
According to embodiments of the present disclosure, the method flow according to embodiments of the present disclosure may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 1009, and/or installed from the removable medium 1011. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 1001. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 1002 and/or RAM 1003 and/or one or more memories other than ROM 1002 and RAM 1003 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program comprising program code for performing the methods provided by the embodiments of the present disclosure, the program code for causing an electronic device to implement the page rendering methods provided by the embodiments of the present disclosure when the computer program product is run on the electronic device.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 1001. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted in the form of signals on a network medium, distributed, and downloaded and installed via the communication section 1009, and/or installed from the removable medium 1011. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be combined in various combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.
Claims (12)
1. A method of page rendering, comprising:
responding to a received page rendering request, and analyzing a preset rendering template corresponding to a service identifier according to the service identifier in the page rendering request to obtain a template analysis result, wherein the page rendering request further comprises service configuration information;
analyzing the service configuration information according to the template analysis result to obtain an attribute analysis result and an event analysis result;
determining information to be rendered corresponding to the service identifier according to the attribute analysis result and the event analysis result; and
And rendering to obtain a target page corresponding to the service identifier according to the information to be rendered.
2. The method of claim 1, wherein the template parsing result includes M template file identifications and file types corresponding to the M template file identifications, M being a positive integer;
and analyzing the service configuration information according to the template analysis result to obtain an attribute analysis result and an event analysis result, wherein the steps of:
responding to that the file types corresponding to the M template file identifications do not comprise the target file type, and carrying out attribute analysis processing on the service configuration information to obtain an attribute analysis result; and
and carrying out event analysis processing on the service configuration information to obtain the event analysis result.
3. The method of claim 2, wherein the service configuration information includes P attribute information and attribute type identifiers corresponding to the P attribute information, and P is a positive integer;
and responding that the file types corresponding to the M template file identifications do not comprise the target file type, performing attribute analysis processing on the service configuration information, and obtaining an attribute analysis result comprises the following steps:
For each of the P attribute information,
calling an attribute analysis script corresponding to a target attribute type under the condition that an attribute type identifier corresponding to the attribute information characterizes that the attribute information belongs to the target attribute type;
performing attribute analysis processing on the attribute information by using the attribute analysis script to obtain a first attribute analysis result; and
and under the condition that the attribute type identification corresponding to the attribute information characterizes that the attribute information does not belong to the target attribute type, determining a second attribute analysis result according to the attribute information.
4. The method of claim 2, wherein the service configuration information includes Q event information and event type identifications corresponding to the Q event information, respectively, Q being a positive integer;
the event analysis processing is carried out on the service configuration information, and the event analysis result is obtained, which comprises the following steps:
for each of the Q event information,
invoking an event analysis script corresponding to a target event type under the condition that an event type identifier corresponding to the event information characterizes that the event information belongs to the target event type;
Carrying out event analysis processing on the event information by utilizing the event analysis script to obtain a first event analysis result; and
and under the condition that the event type identification corresponding to the event information indicates that the event information does not belong to the target event type, determining a second event analysis result according to the event information.
5. The method according to any one of claims 1 to 4, wherein the determining, according to the attribute resolution result and the event resolution result, information to be rendered corresponding to the service identifier includes:
processing the first attribute analysis result and the first event analysis result by using a target engine to obtain first number of page component information;
processing the second attribute analysis result and the second event analysis result by using an expression engine to obtain second number of page component information;
determining position information corresponding to each of S page component identifiers according to the first number of page component information and the second number of page component information, wherein S is equal to the sum of the first number and the second number, and S is a positive integer; and
and determining the information to be rendered according to the S page component information and the position information corresponding to the S page component identifiers.
6. The method of claim 5, wherein the page component information includes a function type identification;
the determining, according to the first number of page component information and the second number of page component information, location information corresponding to each of the S page component identifiers includes:
for each of the S page component identifications,
determining a target application programming interface corresponding to the function type identifier according to the function type identifier corresponding to the page component identifier; and
and processing the page component information corresponding to the page component identifier by using the target application programming interface to obtain the position information corresponding to the page component identifier.
7. The method of any of claims 1-4, wherein the page rendering request further comprises an application system identification;
the rendering according to the information to be rendered to obtain the target page corresponding to the service identifier comprises the following steps:
invoking a rendering engine corresponding to the application system identifier; and
and rendering the S page components by using the rendering engine according to the position information corresponding to each of the S page components to obtain the target page.
8. The method of any of claims 1-4, wherein the page rendering request further comprises a load library identification;
responding to the received page rendering request, analyzing a preset rendering template corresponding to the service identifier according to the service identifier in the page rendering request, and obtaining a template analysis result comprises the following steps:
responding to the received page rendering request, and acquiring a preset rendering template corresponding to the service identifier;
loading a predetermined dynamic link library in response to the load library identification characterizing a license load;
according to the preset dynamic link library, carrying out file type analysis processing on the preset rendering template to obtain M template file identifications, file types corresponding to the M template file identifications and file association relations among the M template file identifications; and
and determining the template analysis result according to the M template file identifications, the file types corresponding to the M template file identifications and the file association relation.
9. A page rendering apparatus comprising:
the first analysis processing module is used for responding to a received page rendering request, analyzing a preset rendering template corresponding to a service identifier according to the service identifier in the page rendering request to obtain a template analysis result, wherein the page rendering request further comprises service configuration information;
The second analysis processing module is used for analyzing the service configuration information according to the template analysis result to obtain an attribute analysis result and an event analysis result;
the determining module is used for determining information to be rendered corresponding to the service identifier according to the attribute analysis result and the event analysis result; and
and the rendering module is used for rendering and obtaining a target page corresponding to the service identifier according to the information to be rendered.
10. An electronic device, comprising:
one or more processors;
a memory for storing one or more instructions,
wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1 to 8.
11. A computer readable storage medium having stored thereon executable instructions which when executed by a processor cause the processor to implement the method of any of claims 1 to 8.
12. A computer program product comprising computer executable instructions for implementing the method of any one of claims 1 to 8 when executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311188463.0A CN117193769A (en) | 2023-09-14 | 2023-09-14 | Page rendering method and device, electronic equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311188463.0A CN117193769A (en) | 2023-09-14 | 2023-09-14 | Page rendering method and device, electronic equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117193769A true CN117193769A (en) | 2023-12-08 |
Family
ID=88990280
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311188463.0A Pending CN117193769A (en) | 2023-09-14 | 2023-09-14 | Page rendering method and device, electronic equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117193769A (en) |
-
2023
- 2023-09-14 CN CN202311188463.0A patent/CN117193769A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20230036980A1 (en) | Micro-frontend system, sub-application loading method, electronic device, computer program product, and computer-readable storage medium | |
US11119812B2 (en) | Method and device for processing application program page according to a common interface container | |
US11550599B2 (en) | Method and apparatus for running applet | |
Holla et al. | Android based mobile application development and its security | |
EP2307977B1 (en) | System and method for dynamic partitioning of applications in client-server environments | |
CN106295255B (en) | Application program reinforcing method and device | |
WO2017206626A1 (en) | Network resource access apparatus, mixed apparatus, and method | |
US20120227032A1 (en) | Method, apparatus, and system for invoking widget | |
CN111767052B (en) | Interaction method, device and storage medium between H5 page and native APP | |
CN109725887B (en) | Data interaction method and device based on message research and development framework and terminal equipment | |
CN115982491A (en) | Page updating method and device, electronic equipment and computer readable storage medium | |
CN113760252A (en) | Data visualization method, device, computer system and readable storage medium | |
CN113420268A (en) | Watermark adding method, device, equipment and storage medium | |
CN113360377A (en) | Test method and device | |
CN113377376A (en) | Data packet generation method, data packet generation device, electronic device, and storage medium | |
CN113176907A (en) | Interface data calling method and device, computer system and readable storage medium | |
CN113778393A (en) | Component generation method, device, computer system and computer-readable storage medium | |
CN114816385B (en) | Integration method, device and equipment of heterogeneous system and storage medium | |
CN113535565B (en) | Interface use case generation method, device, equipment and medium | |
CN117193769A (en) | Page rendering method and device, electronic equipment and computer readable storage medium | |
CN113626001B (en) | API dynamic arrangement method and device based on script | |
CN116594613A (en) | Application development method and device | |
CN115408177A (en) | Aggregation editing method, device, equipment and storage medium | |
CN114138245A (en) | Data processing method and device based on pipeline communication | |
CN113051090A (en) | Interface processing method and device, interface calling method and device, system and 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 |