Page display method and device, electronic equipment, storage medium and program product
Patent Information
- Application Number
- CN202310020499.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-06
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2043-01-06
AI Technical Summary
[0005]本申请提供了一种页面显示方法、装置、电子设备、存储介质及程序产品,可以解决相关技术中页面显示效率较低的问题
本申请提供的页面显示方法,通过在编译该目标应用的启动源代码以启动目标应用过程中,采用词法分析器获取布局参数数据,以利用布局参数数据从服务器中拉取到布局规则源代码,并对其词义分析得到布局规则词序列;还通过语法分析器,对该布局规则词序列进行语法分析,以将语法分析结果与启动源代码对应的第一语法树进行融合,并基于融合后的第二语法树继续执行编译过程,得到布局规则并完成目标应用的启动过程;从而在应用启动阶段便可获取布局规则,以便于在需显示页面时,仅需利用已获取的布局规则中的布局调用函数便可实现页面元素的显示;避免了需显示页面时再由不同接口分别获取布局规则和页面数据所导致的页面加载速度较慢、页面显示效率较低的问题;尤其对于动态性要求较高的动态页面,极大的提高了电子设备中页面显示的加载速度、页面加载的性能,进而提升了页面显示效率。
Smart Images

Figure CN118312691B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical fields of computer vision, cloud technology, smart terminals, and smart transportation. This application relates to a page display method, device, electronic device, storage medium, and program product. Background Technology
[0002] With the development of network technology, the types of pages supported for display on terminals have become increasingly diverse. In this field, terminals typically display pages according to layout rules and page data.
[0003] In related technologies, during application runtime, when a specific page A needs to be displayed, the terminal can, based on the display instructions for the page to be displayed, use interface B to retrieve the layout rules corresponding to page A from the backend in real time, and use interface C to retrieve the page data corresponding to page A from the backend in real time. Then, according to the layout rules, the display position of each element in the page data is calculated to achieve the display of page A.
[0004] However, since layout rules and page data are fetched in real time using different interfaces, if interface B fails to fetch the data or the layout rules arrive at the terminal later than the page data fetched by interface C, the page loading speed will be slower, resulting in lower page display efficiency. Summary of the Invention
[0005] This application provides a page display method, apparatus, electronic device, storage medium, and program product, which can solve the problem of low page display efficiency in related technologies. The technical solution is as follows: On the one hand, a page display method is provided, the method comprising: In response to a display instruction for any page in a target application, the page is displayed based on the layout rules of the target application and the page elements to be displayed for the page, wherein the layout rules are used to indicate the page display logic of at least one page element; The methods for obtaining the layout rules include: In response to receiving a launch instruction for the target application, during the process of compiling the launch source code of the target application to launch the target application, the layout parameter data of the target application is obtained through a lexical analyzer. Based on the layout parameter data, the layout rule source code of the target application is obtained from the server, and the layout rule source code is parsed into a sequence of layout rule words; The layout rule word sequence is parsed by a parser, and the parsing result corresponding to the layout rule word sequence is fused with the first syntax tree to obtain a second syntax tree. The first syntax tree is the syntax tree obtained by parsing the word sequence corresponding to the startup source code. Based on the second syntax tree, the layout rules are generated and the startup process for the target application is executed.
[0006] On the other hand, a page display device is provided, the device comprising: The display module is configured to respond to a display instruction for any page in a target application, and display any page based on the layout rules of the target application and the page elements to be displayed for any page, wherein the layout rules are used to indicate the page display logic of at least one page element; The device, when acquiring layout rules, further includes: The layout parameter data acquisition module is used to acquire the layout parameter data of the target application through a lexical analyzer in response to receiving a startup instruction for the target application and during the process of compiling the startup source code of the target application to start the target application. The layout rule source code acquisition module is used to acquire the layout rule source code of the target application from the server based on the layout parameter data, and parse the layout rule source code into a sequence of layout rule words. The fusion module is used to perform syntactic analysis on the layout rule word sequence through a parser, and to fuse the syntactic analysis result corresponding to the layout rule word sequence with the first syntax tree to obtain a second syntax tree. The first syntax tree is the syntax tree obtained by performing syntactic analysis on the word sequence corresponding to the startup source code. The generation module is used to generate the layout rules based on the second syntax tree and execute the startup process for the target application.
[0007] In one possible implementation, the layout parameter data includes parameter data of at least one parameter object in at least one parameter class; The layout parameter data acquisition module is used for: The lexical analyzer reads at least one parameter class from the pre-configured memory space of the electronic device and obtains the parameter data of each parameter object in each parameter class based on the starting address associated with each parameter class. Each parameter class predefines at least one parameter object, and a parameter object represents a parameter name in the corresponding parameter class.
[0008] In one possible implementation, the layout parameter data is stored in binary format in the electronic device; The layout parameter data acquisition module is specifically used for: For each parameter class, when the parameter start marker of each parameter class is read by the lexical analyzer, based on the starting address after the parameter start marker, each original parameter object in each parameter class and the original parameter data of each original parameter object are read. The parameter start marker is located before the start address associated with each parameter class. The start address refers to the start address where the original parameter data of each original parameter object in each parameter class is stored. The original parameter object and the original parameter data are in binary format. The original parameter objects and their data are converted from binary format to source code format to obtain the parameter objects and their data.
[0009] In one possible implementation, the layout rule source code acquisition module is used for: The lexical analyzer encapsulates the layout parameter data in a request message to generate an acquisition request, and sends the acquisition request to the server. The acquisition request is used to request the source code of the layout rule corresponding to the layout parameter data. Receive the layout rule source code returned by the server based on the acquisition request; Lexical analysis is performed on the source code of the layout rule to obtain the word sequence of the layout rule.
[0010] In one possible implementation, the device further includes: The first grammar book acquisition module is used to perform grammatical analysis on the word sequence corresponding to the startup source code through the grammar analyzer to obtain the first grammar tree; The fusion module is used for: By employing compiler instrumentation, the syntax analysis results corresponding to the layout rule word sequence are inserted into the first syntax tree to obtain the second syntax tree.
[0011] In one possible implementation, the layout rule includes a layout call function for instructing the page display logic of at least one page element; The generation module is used for: The second syntax tree is compiled to obtain the layout call function corresponding to the layout rule and the target language code corresponding to the startup source code; The target language code corresponding to the startup source code is executed to complete the startup process of the target application.
[0012] In one possible implementation, the layout rule includes a layout call function for instructing the page display logic of at least one page element; The device further includes: By calling the dynamically added method function, the layout call function is added to the layout method class, and a layout interface is generated. The layout interface is used to call the layout call function in the layout method class. The display module is used for: By calling the layout interface, the layout method class corresponding to each page element to be displayed is invoked. Based on the layout call function in the invoked layout method class, the corresponding page elements to be displayed are displayed on any page.
[0013] In one possible implementation, the device further includes: The calling module is used to call the layout method class corresponding to the parent element of the child element using reflection if any of the pages contains a child element to be displayed. The category creation module is used to create a category for the layout method class corresponding to the parent element if the layout method class corresponding to the parent element has a subclass. The sub-element display module is used to add the method name and scope of the first level of the current call stack to the category, so as to call the layout call function in the category and display the sub-element on any page.
[0014] On the other hand, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the page display method described above.
[0015] On the other hand, a computer-readable storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the page display method described above.
[0016] On the other hand, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-described page display method.
[0017] The beneficial effects of the technical solutions provided in this application are: The page display method provided in this application obtains layout parameter data using a lexical analyzer during the compilation of the target application's startup source code to launch the target application. This layout parameter data is then used to retrieve the layout rule source code from the server, and semantic analysis is performed to obtain a sequence of layout rule words. A syntax analyzer is then used to perform syntactic analysis on this sequence of layout rule words. The syntactic analysis result is fused with the first syntax tree corresponding to the startup source code, and the compilation process continues based on the fused second syntax tree to obtain the layout rules and complete the startup process of the target application. This allows the layout rules to be obtained during the application startup phase, so that when a page needs to be displayed, only the layout call function in the obtained layout rules is needed to display the page elements. This avoids the problems of slow page loading speed and low page display efficiency caused by obtaining layout rules and page data separately from different interfaces when a page needs to be displayed. Especially for dynamic pages with high dynamic requirements, this greatly improves the page loading speed and performance of electronic devices, thereby enhancing page display efficiency. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0019] Figure 1 A schematic diagram illustrating the implementation environment of a page display method provided in this application embodiment; Figure 2 A flowchart illustrating a page display method provided in an embodiment of this application; Figure 3 This is a schematic diagram of a layout rule acquisition process provided in an embodiment of this application; Figure 4 A schematic diagram of a page provided for an embodiment of this application; Figure 5 A schematic diagram of a page provided for an embodiment of this application; Figure 6 A flowchart illustrating a page display method provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a page display device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0020] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.
[0021] Those skilled in the art will understand that, unless otherwise stated, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. The terms “comprising” and “including” as used in the embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, or operation, but do not exclude implementation as other features, information, data, steps, or operations supported by this art.
[0022] It is understood that in the specific implementation of this application, any user-related data such as user information, device information, gender, and age in the layout parameter data are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0023] Figure 1 This is a schematic diagram illustrating the implementation environment of a page display method provided in this application. For example... Figure 1 As shown, the implementation environment includes a server 101 and an electronic device, such as a terminal 102, and the server 101 can be a backend server for an application. The terminal 102 has an application installed, and the terminal 102 and the server 101 can interact with each other based on the application.
[0024] In this application, when terminal 102 receives a startup instruction for the target application, during the stage of compiling startup source code to start the target application, while implementing the compilation steps of the startup source code through a lexical analyzer and a syntax analyzer, terminal 102 also obtains layout parameter data through the syntax analyzer, and sends a request to server 101 based on the layout parameter data. This request is used to obtain the layout rule source code corresponding to the layout parameter data. Terminal 102 can parse the layout rule source code returned by the server into a sequence of layout rule words through the lexical analyzer. Then, terminal 102 also uses the syntax analyzer to fuse the syntax analysis result of the layout rule word sequence with the first syntax tree corresponding to the startup source code, and continues to execute the compilation process based on the fused second syntax tree to obtain the layout rules and complete the startup process of the target application; thus, the layout rules can be obtained during the application startup stage, and when the page needs to be displayed later, the page can be displayed simply by using the layout call function in the obtained layout rules.
[0025] It should be noted that the target application can be of any type, such as payment applications, video applications, game applications, content interaction applications, social applications, etc. Furthermore, the server 101 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The aforementioned networks can include, but are not limited to, wired networks and wireless networks. The wired network includes local area networks (LANs), metropolitan area networks (MANs), and wide area networks (WANs), and the wireless network includes Bluetooth, Wi-Fi, and other networks that enable wireless communication. Terminal 102 can be a smartphone (such as an Android phone, iOS phone, etc.), tablet computer, laptop computer, digital broadcast receiver, MID (Mobile Internet Device), PDA (Personal Digital Assistant), desktop computer, in-vehicle terminal (such as in-vehicle navigation terminal, in-vehicle computer, etc.), smart speaker, smartwatch, etc. The terminal and server can be connected directly or indirectly through wired or wireless communication, but are not limited to these. The specific connection can also be determined based on the actual application scenario requirements, and is not limited here.
[0026] Figure 2 This is a flowchart illustrating a page display method provided in an embodiment of this application. The subject executing this method can be an electronic device. Figure 2 As shown, the method includes the following steps.
[0027] Step 201: In response to receiving a launch command for the target application, the electronic device obtains the layout parameter data of the target application through a lexical analyzer during the process of compiling the launch source code of the target application to launch the target application.
[0028] In this application, the layout rules of the target application can be obtained during the startup phase of the target application. For example, in response to receiving a startup instruction for the target application, the electronic device can compile the startup source code of the target application. During the stage of compiling the startup source code to start the target application, steps 201 to 204 of this application are executed to obtain the layout rules of the target application and complete the startup process of the target application. The startup source code is the program code used to start the target application.
[0029] It should be noted that electronic devices can complete the compilation process using a compiler. The compiler takes high-level language source code as input and outputs target language code through compilation. The compilation process can include five basic steps: lexical analysis, syntax analysis, semantic analysis and intermediate code generation, optimization, and target code generation. Lexical analysis can be implemented using a lexical analyzer, and syntax analysis can be implemented using a syntax analyzer. In this application, during the lexical analysis stage, layout rule word sequences are obtained using layout parameter data; and during the syntax analysis stage, the syntax analysis results corresponding to the layout rule word sequences are integrated into the first syntax tree corresponding to the startup source code, and subsequent compilation processes are continued based on this, thereby obtaining the layout rules.
[0030] In this application, when a startup command for a target application is received, the electronic device performs lexical analysis on the startup source code using a lexical analyzer to obtain a sequence of tokens corresponding to the startup source code; and also obtains layout parameter data through the lexical analyzer.
[0031] The layout parameter data indicates the layout rules corresponding to at least one page element. This layout parameter data may include, but is not limited to, user information, device information, defined user groups, experimental / control groups, and other parameter information. Different layout parameter data may result in different layout rules for page elements. For example, the activity pages of the target application for user A and user B may be different; the homepage of the target application displayed during the day may also be different from the homepage displayed at night.
[0032] Layout rules are used to instruct the page display logic for at least one page element. A page element refers to an element in the target application's page to be displayed, such as buttons, images, and text. For example, a page element may include multiple elements belonging to a category, such as button elements, text elements, and image elements; the layout rules for a category of elements may include the display position and display style of that category of elements. For example, a page element may also include multiple pre-configured elements belonging to a page module; for example, a page module may include two image elements, three button elements, and two text elements; the layout rules for this page module may include the arrangement and hierarchical relationship between these elements within the module.
[0033] In one possible implementation, the layout parameter data includes parameter data of at least one parameter object in at least one parameter class; a parameter class represents a parameter category. Each parameter class predefines at least one parameter object, and each parameter object represents a parameter name within the corresponding parameter class. For example, the step of the electronic device obtaining the layout parameter data via a lexical analyzer may include: the electronic device reading at least one parameter class from its pre-configured memory space using the lexical analyzer, and obtaining the parameter data of each parameter object within each parameter class based on the starting address associated with each parameter class. Here, the starting address is the starting address of the parameter data corresponding to the parameters in each parameter class. For each parameter class, the electronic device can start reading the parameter data of each parameter object in that parameter class from the starting address associated with that parameter class. For example, the starting address may be an address on a disk; that is, each parameter class is associated with a storage area on the disk, and the electronic device reads the corresponding parameter data from the disk based on the parameter class.
[0034] It should be noted that, since the electronic device performs lexical analysis of the startup source code through a lexical analyzer, and executes steps 201 and 202; in this application, the execution order of the lexical analysis of the startup source code, steps 201 and 202 is not limited. For example, the lexical analysis of the startup source code can be executed first, and then steps 201-202 can be executed; or steps 201-202 can be executed first and then the startup source code can be lexically analyzed.
[0035] In one possible implementation, the layout parameter data is stored in binary format in the electronic device. The electronic device can obtain the raw data in binary format and convert it to obtain the layout parameter data. In one possible example, the electronic device reads at least one parameter class from the pre-configured memory space of the electronic device through the lexical analyzer, and obtains the parameter data of each parameter object in each parameter class based on the start address associated with each parameter class. This step may include: for each parameter class, when the parameter start marker of each parameter class is read by the lexical analyzer, the electronic device reads each original parameter object and the original parameter data of each original parameter object in each parameter class based on the start address after the parameter start marker; the electronic device converts each original parameter object and the original parameter data from binary format to source code format to obtain each parameter object and the parameter data of each parameter object. Here, the parameter start marker is located before the start address associated with each parameter class, and the start address refers to the starting address where the original parameter data of each original parameter object in each parameter class is stored. The original parameter objects and the original parameter data are in binary format.
[0036] For example, for each parameter class, when the lexical analyzer reads the parameter start marker of that parameter class, the electronic device can create a queue corresponding to that parameter class, read the starting address after the parameter start marker, and sequentially read each original parameter object and the original parameter data of each original parameter object in that parameter class; then, it performs format conversion on the read original parameter objects and original parameter data, and stores the converted parameter objects and parameter data into the queue. The queue corresponding to the parameter class can be a serial queue.
[0037] In this application, at least one parameter class included in the layout parameter data can be defined in a pre-configured memory address. For example, the electronic device can sequentially associate the parameter data with at least one parameter class by running a runtime. A parameter class can be represented as a class object, with classID as the class object identifier. The class object is essentially a structure pointer, and the parameter data fields can correspond to the structure pointer starting at the address of the first associated field and ending with '\0'. Additionally, each class object can have a corresponding parameter start tag, which can be a tag attribute representing a special character, placed before the start address. For example, within a historical startup cycle prior to this startup, the electronic device can update the layout parameter data in real time; for instance, the electronic device can periodically poll and update the layout parameter data according to a pre-configured polling cycle.
[0038] For example, a parameter class can correspond to a set of parameter data. The parameter classes in this layout parameter data can include, but are not limited to: user information, device information, defined user groups, experimental / control groups, etc. For example, the parameter objects in user information can include, but are not limited to: gender, age, region, preferences, etc. Taking age as an example, the parameter data corresponding to age, that is, the attribute value of each user in the age field, can include: 20, 30, 35, etc. For example, the parameter objects in device information can include, but are not limited to: system (iOS / Android), version, resolution, processor information, etc.
[0039] Step 202: Based on the layout parameter data, the electronic device obtains the layout rule source code of the target application from the server and parses the layout rule source code into a sequence of layout rule words.
[0040] In this step, the electronic device generates an acquisition request based on the layout parameter data through the lexical analyzer. The acquisition request is used to request the source code of the layout rule corresponding to the layout parameter data. The electronic device receives the source code of the layout rule sent by the server and performs lexical analysis on the source code of the layout rule to obtain the sequence of layout rule words.
[0041] For example, the electronic device can use the lexical analyzer to encapsulate the layout parameter data in a request message, generate an acquisition request, and send the acquisition request to the server. The server receives the acquisition request and extracts the parameter data of each parameter object from the layout parameter data. The server sends the layout rule source code to the electronic device based on the layout parameter data. The electronic device receives the layout rule source code returned by the server based on the acquisition request and performs lexical analysis on the layout rule source code using the lexical analyzer to obtain the layout rule word sequence, so that the layout rule can be subsequently converted into a layout rule using the word sequence corresponding to the layout rule. For example, the electronic device can read the parameter data of each parameter object in each parameter class from the serial queue corresponding to each parameter class, and assemble the read parameter data of each parameter object in the parameter class into parameter fields in the request message to generate the request message.
[0042] Step 203: The electronic device performs syntactic analysis on the layout rule word sequence through a syntactic analyzer, and merges the syntactic analysis result corresponding to the layout rule word sequence with the first syntax tree to obtain the second syntax tree.
[0043] The first syntax tree is obtained by performing syntactic analysis on the word sequence corresponding to the startup source code.
[0044] This application also includes a process of performing syntactic analysis on the word sequence corresponding to the startup source code. This process includes the following steps: during the compilation of the startup source code, after the electronic device obtains the word sequence corresponding to the startup source code through the lexical analyzer, it also performs syntactic analysis on the word sequence corresponding to the startup source code through the syntactic analyzer to obtain the first syntax tree.
[0045] In step 203, the electronic device can use compile instrumentation to fuse the syntax analysis results and the first syntax tree. Compile instrumentation refers to modifying existing code or generating new code during code compilation. For example, the syntax analysis results corresponding to the layout rule word sequence may include multiple source code statements. The electronic device can convert these multiple source code statements into the first syntax tree to perform instrumentation. Alternatively, multiple source code statements can be inserted at the call points of a base module, which can be a module that can be called to generate an interface. Inserting these source code statements at the call points of the base module extends the interface.
[0046] Step 204: The electronic device generates the layout rule based on the second syntax tree and executes the startup process for the target application.
[0047] The electronic device can continue the compilation process based on the second syntax tree to obtain the target code corresponding to the second syntax tree. The target code may include the target language code corresponding to the startup source code and the layout rule source code, respectively. The electronic device can execute the target language code corresponding to the startup source code to complete the startup process of the target application. For example, it can continue to execute the following steps in the compilation process: semantic analysis and intermediate code generation, optimization, and target code generation to obtain the target language code.
[0048] In one possible implementation, the layout rule includes a layout call function for instructing page display logic for at least one page element. The step of the electronic device generating the layout rule based on the second syntax tree and completing the startup process may include: the electronic device compiling the second syntax tree to obtain the layout call function corresponding to the layout rule and the target language code corresponding to the startup source code; and the electronic device executing the target language code corresponding to the startup source code to complete the startup process of the target application. For example, the target language code may be binary code. The layout call function includes display logic when displaying page elements on the page. When a page element needs to be displayed, the layout call function corresponding to that page element can be called to display the page element on the page.
[0049] Figure 3 This application provides a flowchart illustrating the process of obtaining layout rules, such as... Figure 3As shown, during the compilation and startup source code phase to launch the target application, the electronic device begins compiling the source code and, through a lexical analyzer, obtains a character sequence including a sequence of layout parameter data words. Then, when the electronic device reads a tag attribute, indicating the start marker of the parameters, followed by the starting address for storing data parameters, the parameter data needs to be converted and concatenated into request fields to generate a retrieval request. For example, the lexical analyzer can implement a function called featureScanning, which executes the following: It reads data from the electronic device's disk, including raw parameter data in binary format. After each startup cycle, the electronic device can poll and update the stored raw parameter data; for example, the currently read data is the data updated in the last startup cycle. When each tag attribute is received, the raw parameter data at the first starting address after each tag attribute is received, and a serial queue is created, declared to be scanned from the class_id object pointer to the end with '\0'. After converting the binary raw parameter data into parameter data, the parameter data corresponding to each parameter object is stored in the created serial queue. Then, based on the retrieval request, a layout rule is requested from the server. The layout rule source code returned by the server is parsed into a sequence of tokens, and the corresponding syntax analysis result is transformed into the first syntax tree to implement instrumentation. Through the subsequent compilation process, the startup process of the target application is completed, and the layout call function corresponding to the layout rule is obtained, so that when elements in the page need to be displayed, the corresponding layout call function is called to realize the display process of elements in the page.
[0050] It should be noted that during the compilation process of the startup source code, a lexical analyzer is used to obtain layout parameter data, thereby pulling the layout rule source code from the server and performing semantic analysis to obtain the layout rule word sequence. Then, a syntax analyzer performs syntactic analysis on the layout rule word sequence and merges the syntactic analysis result with the first syntax tree corresponding to the startup source code. The compilation process continues based on the merged syntax tree, so that the layout rules can be obtained at the startup stage of the target application. When the page needs to be displayed later, only the layout call function in the layout rules obtained at the startup stage needs to be called. This avoids the problems of slow page loading speed and low page display efficiency caused by obtaining layout rules and page data from different interfaces when displaying the page. Especially for dynamic pages with high dynamic requirements, this greatly improves the loading speed and performance of dynamic page display on electronic devices, thereby improving page display efficiency.
[0051] Step 205: In response to a display instruction for any page in the target application, the electronic device displays the page based on the layout rules of the target application and the page elements to be displayed for that page.
[0052] In this application, the page element to be displayed can be any page element included in any page; for example, when loading a page, elements such as images, buttons, and text to be displayed on that page. The layout rule includes a layout call function for instructing the page display logic of at least one page element; the electronic device can generate an interface for calling the layout call function so that the required layout call function can be called when displaying the page to achieve the display of the corresponding page element. For example, before displaying any page based on the layout rule of the target application and the page element to be displayed on any page, the process of the electronic device generating a layout interface may include: the electronic device adding the layout call function to the layout method class by calling a dynamically added method function, generating a layout interface, which is used to call the layout call function in the layout method class.
[0053] For example, the layout interface corresponding to the layout rule is generated by calling the `class_addMethod` function. For instance, before displaying a page in the target application, such as before displaying the homepage after startup, the layout method class is defined for the layout calling function by calling the dynamically added method function (`class_addMethod`). For example, a method class (`EmptyClass`) is created, and the following parameters are defined for this method class: class name, method name, method pointer, method type, input parameters, and return value. Here, the class name refers to the class of the class to which the new method is to be added; the method name (`SEL name`) is the name of the method to be added, which can be a layout method; the method pointer (`IMP`, `implementation`) is a pointer to a method implementation; each method has a corresponding `IMP`, which points to the function that implements the added method; `const char` types: Indicates the return value and parameters of the method to be added.
[0054] For example, the layout method class can be implemented through one or more layout call functions. The electronic device can predefine the calling permission information corresponding to the layout method class, such as restricting the class name and parameter range of the layout method call. For example, for a button class layout method, it can be restricted to button elements or child elements of button elements. For example, in a common advertisement class that includes text and images, the parameter range may include: image and text layout structure (top-bottom or left-right structure), spacing, size, etc. For example, the text size range can be no more than 4 characters.
[0055] In this step, the electronic device can call layout method classes through the layout interface to implement the display process of corresponding page elements. For example, this step may include: the electronic device calling the layout interface to invoke the layout method classes corresponding to each page element to be displayed, and displaying the corresponding page elements on any given page based on the layout call functions in the invoked layout method classes. For instance, when displaying button elements, the electronic device can call the button class layout method and execute the layout call function corresponding to the button element to be displayed within that method, displaying the button element on the page based on the button element display logic included in the layout call function. Based on this, the display steps of each page element on the page can be implemented to complete the page display process.
[0056] In some scenarios, when publishing rules on a server, due to inheritance relationships between view elements in the target application, parent view elements may affect the layout of child view elements after publishing, leading to abnormal page display. For example... Figure 4 As shown, the client uses dynamic page loading to allow different business modules in the application to display different styles, such as "carousel ads," "single image ads," and "splash ads" in the advertising module. In dynamic layouts, to maximize code reusability, inheritance is generally used to extract common parts of view controls; for example, the "carousel" view is divided into a homepage carousel, an event carousel, and a recommendation carousel. The latter two inherit from the homepage carousel. When the style of the homepage carousel needs to be modified online, its layout rules will change, affecting the latter two and causing page errors. Figure 5 As shown, the second page of the active carousel appears earlier due to the change in the size of the carousel content displayed in each frame; that is, if the subclass inherits from the parent class, adjusting the view in the parent class's layout rules may cause abnormal display of the subclass view.
[0057] In one possible implementation, to avoid the impact of modifications to the layout rules of parent elements on child elements, the child elements can be displayed by creating a category of method classes. This solves the problem of page anomalies caused by inheritance, ensuring that the inheritance relationship between parent and child elements remains unchanged while avoiding display anomalies caused by inheritance. For example, this process may include: if any page contains a child element to be displayed, the electronic device uses reflection to call the layout method class corresponding to the parent element to which the child element belongs; if the layout method class corresponding to the parent element has a subclass, the electronic device creates a category for the layout method class corresponding to the parent element and adds the method name and scope of the first-level method in the current call stack to the category to call the layout call function in the category, thus displaying the child element on any page. When a layout method class needs to be called, the parser can add the required layout method class to the call stack to execute the layout call function in the added method class; therefore, the electronic device can add the method name and scope corresponding to the layout method class to the category after creating the category to call the category. For example, when a page loads, refreshes, or its elements change, the corresponding layout method class can be invoked via reflection to calculate a new layout for display when displaying child elements. If the called layout method class does not have a subclass in the current runtime, the page is returned directly to display the child element. When the called layout method class has a subclass, the electronic device can obtain the method name and scope of the first level of the current call stack. Since the layout rules of the page elements have been processed during the compilation phase, the dynamically created and called layout method class can be determined at the time of invocation. The electronic device can create a category for this layout method class and add the obtained method name and scope to the category. It should be noted that the layout call function in the layout method class corresponding to the parent element still exists, but it is not executed. Instead, the layout call function in the category is executed to prevent the layout rules of the parent element from affecting the layout rules of the child element, thus avoiding display anomalies and ensuring normal page display.
[0058] like Figure 6As shown, during program execution, the electronic device can read multiple layout call functions generated by compilation instrumentation during the compilation phase, and generate layout interface functions by calling functions that dynamically add methods. Upon completion of reading the layout call functions, the device defines the class name, parameter range, and other restrictions for the caller. During the call process, it checks whether the layout method class corresponding to the parent element has a subclass. If not, it responds to the caller's call; if it does, it creates a branch of that layout method class, obtains the method name and scope of the first level in the call stack, and adds it to the created category. This allows the device to respond to the caller's call by calling the category, thus realizing the display process of child elements.
[0059] The page display method provided in this application obtains layout parameter data using a lexical analyzer during the compilation of the target application's startup source code to launch the target application. This layout parameter data is then used to retrieve the layout rule source code from the server, and semantic analysis is performed to obtain a sequence of layout rule words. A syntax analyzer is then used to perform syntactic analysis on this sequence of layout rule words. The syntactic analysis result is fused with the first syntax tree corresponding to the startup source code, and the compilation process continues based on the fused second syntax tree to obtain the layout rules and complete the startup process of the target application. This allows the layout rules to be obtained during the application startup phase, so that when a page needs to be displayed, only the layout call function in the obtained layout rules is needed to display the page elements. This avoids the problems of slow page loading speed and low page display efficiency caused by obtaining layout rules and page data separately from different interfaces when a page needs to be displayed. Especially for dynamic pages with high dynamic requirements, this greatly improves the page loading speed and performance of electronic devices, thereby enhancing page display efficiency.
[0060] The page display method in this application relates to technical fields such as computer vision, cloud technology, and intelligent transportation. For example, it utilizes computer vision technology to arrange and display various page elements in a target application according to certain layout rules. The server can utilize cloud technology, cloud storage, and other technologies to achieve orderly storage of a large number of layout rules.
[0061] Understandably, Computer Vision (CV) is a science that studies how to enable machines to "see." More specifically, it refers to machine vision, which uses cameras and computers to replace human eyes in recognizing and measuring targets, and then performs image processing to create images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, attempting to build artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), autonomous driving, intelligent transportation, and other technologies, as well as common biometric recognition technologies such as facial recognition and fingerprint recognition.
[0062] Cloud computing refers to the delivery and usage model of IT infrastructure, meaning obtaining necessary resources in an on-demand and easily scalable manner through a network. In a broader sense, cloud computing also refers to the delivery and usage model of services, meaning obtaining necessary services in an on-demand and easily scalable manner through a network. These services can be IT and software related, internet-related, or other services. Cloud computing is a product of the development and integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing.
[0063] With the development of the internet, real-time data streams, and the diversification of connected devices, as well as the demands for search services, social networks, mobile commerce, and open collaboration, cloud computing has rapidly developed. Unlike previous parallel distributed computing, cloud computing will fundamentally revolutionize the entire internet model and enterprise management model.
[0064] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology and distributed storage file systems to bring together a large number of storage devices of various types in the network (storage devices are also called storage nodes) to work together through application software or application interfaces to provide data storage and business access functions to the outside world.
[0065] Currently, the storage method in storage systems is as follows: Logical volumes are created, and during creation, physical storage space is allocated to each logical volume. This physical storage space may consist of a single storage device or the disks of several storage devices. Clients store data on a logical volume, which means storing the data on the file system. The file system divides the data into many parts, each part being an object. Each object contains not only the data but also additional information such as a data identifier (ID, ID entity). The file system writes each object to the physical storage space of that logical volume and records the storage location information of each object. Therefore, when a client requests access to data, the file system can allow the client to access the data based on the storage location information of each object.
[0066] Figure 7 This is a schematic diagram of the structure of a page display device provided in an embodiment of this application. Figure 7 As shown, the device includes: a display module 701, a layout parameter data acquisition module 702, a layout rule source code acquisition module 703, a fusion module 704, and a generation module 705; Display module 701 is used to respond to a display instruction for any page in a target application, and display the page based on the layout rules of the target application and the page elements to be displayed of the page, wherein the layout rules are used to indicate the page display logic of at least one page element. The device, when acquiring layout rules, also includes: The layout parameter data acquisition module 702 is used to acquire the layout parameter data of the target application through a lexical analyzer in response to receiving a startup instruction for the target application and during the process of compiling the startup source code of the target application to start the target application. The layout rule source code acquisition module 703 is used to acquire the layout rule source code of the target application from the server based on the layout parameter data, and parse the layout rule source code into a sequence of layout rule words. The fusion module 704 is used to perform syntactic analysis on the layout rule word sequence through the parser, and to fuse the syntactic analysis result corresponding to the layout rule word sequence with the first syntax tree to obtain a second syntax tree. The first syntax tree is the syntax tree obtained by performing syntactic analysis on the word sequence corresponding to the startup source code. The generation module 705 is used to generate the layout rules based on the second syntax tree and execute the startup process for the target application.
[0067] In one possible implementation, the layout parameter data includes parameter data of at least one parameter object in at least one parameter class; This layout parameter data acquisition module is used for: The lexical analyzer reads at least one parameter class from the pre-configured memory space of the electronic device and obtains the parameter data of each parameter object in each parameter class based on the starting address associated with each parameter class. Each parameter class predefines at least one parameter object, and a parameter object represents a parameter name in the corresponding parameter class.
[0068] In one possible implementation, the layout parameter data is stored in binary format in the electronic device; This layout parameter data acquisition module is specifically used for: For each parameter class, when the parameter start marker of each parameter class is read by the lexical analyzer, the original parameter objects in each parameter class and the original parameter data of each original parameter object are read based on the starting address after the parameter start marker. The parameter start marker is located before the start address associated with each parameter class. The start address refers to the starting address where the original parameter data of each original parameter object in each parameter class is stored. The original parameter object and the original parameter data are in binary format. The original parameter objects and their data are converted from binary format to source code format to obtain the parameter objects and their data.
[0069] In one possible implementation, the layout rule source code acquisition module is used for: The lexical analyzer encapsulates the layout parameter data in a request message, generates a retrieval request, and sends the retrieval request to the server. The retrieval request is used to request the source code of the layout rule corresponding to the layout parameter data. Receive the layout rule source code returned by the server based on the retrieval request; Lexical analysis was performed on the source code of the layout rule to obtain the word sequence of the layout rule.
[0070] In one possible implementation, the device further includes: The first syntax tree acquisition module is used to perform syntactic analysis on the word sequence corresponding to the startup source code through the syntax analyzer to obtain the first syntax tree. This fusion module is used for: By using compiler instrumentation, the parsing results corresponding to the sequence of words of the layout rule are inserted into the first syntax tree to obtain the second syntax tree.
[0071] In one possible implementation, the layout rule includes a layout call function that instructs the page display logic for at least one page element; This generation module is used for: The second syntax tree is compiled to obtain the layout call function corresponding to the layout rule and the target language code corresponding to the startup source code; The target language code corresponding to the startup source code is executed to complete the startup process of the target application.
[0072] In one possible implementation, the layout rule includes a layout call function that instructs the page display logic for at least one page element; The device also includes: By calling the dynamically added method function, the layout call function is added to the layout method class, and a layout interface is generated. This layout interface is used to call the layout call function in the layout method class. This display module is used for: By calling this layout interface, the layout method class corresponding to each page element to be displayed is invoked. Based on the layout call function in the invoked layout method class, the corresponding page elements to be displayed are displayed on any page.
[0073] In one possible implementation, the device further includes: The module is used to call the layout method class corresponding to the parent element of any page containing a child element to be displayed, using reflection. The category creation module is used to create a category for the layout method class corresponding to the parent element if the layout method class corresponding to the parent element has a subclass. The child element display module is used to add the method name and scope of the first level of the current call stack to the category, so as to call the layout call function in the category and display the child element on any page.
[0074] The page display device provided in this application, during the process of compiling the startup source code of the target application to start the target application, uses a lexical analyzer to obtain layout parameter data, uses the layout parameter data to pull the layout rule source code from the server, and performs semantic analysis on it to obtain the layout rule word sequence; it also uses a syntax analyzer to perform syntax analysis on the layout rule word sequence, and merges the syntax analysis result with the first syntax tree corresponding to the startup source code, and continues to execute the compilation process based on the merged second syntax tree to obtain the layout rules and complete the startup process of the target application; thus, the layout rules can be obtained at the application startup stage, so that when the page needs to be displayed, only the layout call function in the obtained layout rules needs to be used to realize the display of page elements; it avoids the problem of slow page loading speed and low page display efficiency caused by obtaining layout rules and page data separately from different interfaces when the page needs to be displayed; especially for dynamic pages with high dynamic requirements, it greatly improves the page loading speed and page loading performance in electronic devices, thereby improving page display efficiency.
[0075] The apparatus in this application embodiment can execute the method provided in this application embodiment, and the implementation principle is similar. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the apparatus, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.
[0076] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 8 As shown, the electronic device includes: a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of the page display method, which, compared with related technologies, can achieve: The page display method provided in this application, during the process of compiling the startup source code of the target application to start the target application, uses a lexical analyzer to obtain layout parameter data, uses the layout parameter data to pull the layout rule source code from the server, and performs semantic analysis on it to obtain a layout rule word sequence; it also uses a syntax analyzer to perform syntax analysis on the layout rule word sequence, merges the syntax analysis result with the first syntax tree corresponding to the startup source code, and continues the compilation process based on the merged second syntax tree to obtain the layout rules and complete the startup process of the target application; thus, the layout rules can be obtained at the application startup stage, so that when the page needs to be displayed, only the layout call function in the obtained layout rules needs to be used to realize the display of page elements; it avoids the problem of slow page loading speed and low page display efficiency caused by obtaining layout rules and page data separately from different interfaces when the page needs to be displayed; especially for dynamic pages with high dynamic requirements, it greatly improves the page loading speed and page loading performance in electronic devices, thereby improving page display efficiency.
[0077] In one alternative embodiment, an electronic device is provided, such as Figure 8 As shown, Figure 8 The illustrated electronic device 800 includes a processor 801 and a memory 803. The processor 801 and the memory 803 are connected, for example, via a bus 802. Optionally, the electronic device 800 may further include a transceiver 804, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 804 is not limited to one type, and the structure of this electronic device 800 does not constitute a limitation on the embodiments of this application.
[0078] Processor 801 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 801 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0079] Bus 802 may include a pathway for transmitting information between the aforementioned components. Bus 802 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 802 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0080] The memory 803 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.
[0081] The memory 803 is used to store computer programs that execute the embodiments of this application, and the execution is controlled by the processor 801. The processor 801 is used to execute the computer programs stored in the memory 803 to implement the steps shown in the foregoing method embodiments.
[0082] Among them, electronic devices include, but are not limited to: terminals (such as mobile phones, vehicle terminals, smart terminals, etc.), servers or cloud computing center equipment, etc.
[0083] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the steps and corresponding content of the aforementioned method embodiments.
[0084] This application also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0085] Those skilled in the art will understand that, unless otherwise stated, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. The terms “comprising” and “including” as used in the embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, or operation, but do not exclude implementation as other features, information, data, steps, or operations supported by this art.
[0086] The terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the illustrations or text descriptions.
[0087] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.
[0088] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.
Claims
1. A page display method, characterized in that, The method includes: In response to a display instruction for any page in a target application, the page is displayed based on the layout rules of the target application and the page elements to be displayed for the page, wherein the layout rules are used to indicate the page display logic of at least one page element; The methods for obtaining the layout rules include: In response to receiving a launch instruction for the target application, during the process of compiling the launch source code of the target application to launch the target application, the layout parameter data of the target application is obtained through a lexical analyzer. Based on the layout parameter data, the layout rule source code of the target application is obtained from the server, and the layout rule source code is parsed into a sequence of layout rule words; The layout rule word sequence is parsed by a parser, and the parsing result corresponding to the layout rule word sequence is inserted into the first syntax tree by compiler instrumentation to obtain the second syntax tree. The first syntax tree is obtained by parsing the word sequence corresponding to the startup source code by the parser. Based on the second syntax tree, the layout rules are generated and the startup process for the target application is executed.
2. The page display method according to claim 1, characterized in that, The layout parameter data includes parameter data of at least one parameter object in at least one parameter class; The step of obtaining the layout parameter data of the target application through a lexical analyzer includes: The lexical analyzer reads at least one parameter class from the pre-configured memory space of the electronic device and obtains the parameter data of each parameter object in each parameter class based on the starting address associated with each parameter class. Each parameter class predefines at least one parameter object, and a parameter object represents a parameter name in the corresponding parameter class.
3. The page display method according to claim 2, characterized in that, The layout parameter data is stored in binary format in the electronic device; The step of reading at least one parameter class from the pre-configured memory space of the electronic device through the lexical analyzer, and obtaining parameter data of each parameter object in each parameter class based on the starting address associated with each parameter class, includes: For each parameter class, when the parameter start marker of each parameter class is read by the lexical analyzer, based on the starting address after the parameter start marker, each original parameter object in each parameter class and the original parameter data of each original parameter object are read. The parameter start marker is located before the start address associated with each parameter class. The start address refers to the start address where the original parameter data of each original parameter object in each parameter class is stored. The original parameter object and the original parameter data are in binary format. The original parameter objects and their data are converted from binary format to source code format to obtain the parameter objects and their data.
4. The page display method according to claim 1, characterized in that, The step of obtaining the layout rule source code of the target application from the server based on the layout parameter data, and parsing the layout rule source code into a sequence of layout rule terms includes: The lexical analyzer encapsulates the layout parameter data in a request message to generate an acquisition request, and sends the acquisition request to the server. The acquisition request is used to request the source code of the layout rule corresponding to the layout parameter data. Receive the layout rule source code returned by the server based on the acquisition request; Lexical analysis is performed on the source code of the layout rule to obtain the word sequence of the layout rule.
5. The page display method according to claim 1, characterized in that, The layout rules include layout call functions that instruct the page display logic of at least one page element; The step of generating the layout rules based on the second syntax tree and executing the startup process for the target application includes: The second syntax tree is compiled to obtain the layout call function corresponding to the layout rule and the target language code corresponding to the startup source code; The target language code corresponding to the startup source code is executed to complete the startup process of the target application.
6. The page display method according to claim 1, characterized in that, The layout rules include layout call functions that instruct the page display logic of at least one page element; Before displaying any page, based on the layout rules of the target application and the page elements to be displayed on any page, the method further includes: By calling the dynamically added method function, the layout call function is added to the layout method class, and a layout interface is generated. The layout interface is used to call the layout call function in the layout method class. The step of displaying any page based on the layout rules of the target application and the page elements to be displayed on any page includes: By calling the layout interface, the layout method class corresponding to each page element to be displayed is invoked. Based on the layout call function in the invoked layout method class, the corresponding page elements to be displayed are displayed on any page.
7. The page display method according to claim 6, characterized in that, The method further includes: If any of the pages contains a child element to be displayed, the layout method class corresponding to the parent element to which the child element belongs is called using reflection; If the layout method class corresponding to the parent element has a subclass, create a category for the layout method class corresponding to the parent element, and add the method name and scope of the first level of the current call stack to the category, so as to call the layout call function in the category and display the child element on any page.
8. A page display device, characterized in that, The device includes: The display module is configured to respond to a display instruction for any page in a target application, and display any page based on the layout rules of the target application and the page elements to be displayed for any page, wherein the layout rules are used to indicate the page display logic of at least one page element; The device, when acquiring layout rules, further includes: The layout parameter data acquisition module is used to acquire the layout parameter data of the target application through a lexical analyzer in response to receiving a startup instruction for the target application and during the process of compiling the startup source code of the target application to start the target application. The layout rule source code acquisition module is used to acquire the layout rule source code of the target application from the server based on the layout parameter data, and parse the layout rule source code into a sequence of layout rule words. The fusion module is used to perform syntactic analysis on the layout rule word sequence through a parser, and insert the syntactic analysis result corresponding to the layout rule word sequence into the first syntax tree by means of compiler instrumentation to obtain the second syntax tree. The first syntax tree is the syntax tree obtained by the parser performing syntactic analysis on the word sequence corresponding to the startup source code. The generation module is used to generate the layout rules based on the second syntax tree and execute the startup process for the target application.
9. The page display device according to claim 8, characterized in that, The layout parameter data includes parameter data of at least one parameter object in at least one parameter class; The layout parameter data acquisition module is used for: The lexical analyzer reads at least one parameter class from the pre-configured memory space of the electronic device and obtains the parameter data of each parameter object in each parameter class based on the starting address associated with each parameter class. Each parameter class predefines at least one parameter object, and a parameter object represents a parameter name in the corresponding parameter class.
10. The page display device according to claim 9, characterized in that, The layout parameter data is stored in binary format in the electronic device; The layout parameter data acquisition module is specifically used for: For each parameter class, when the parameter start marker of each parameter class is read by the lexical analyzer, based on the starting address after the parameter start marker, each original parameter object in each parameter class and the original parameter data of each original parameter object are read. The parameter start marker is located before the start address associated with each parameter class. The start address refers to the start address where the original parameter data of each original parameter object in each parameter class is stored. The original parameter object and the original parameter data are in binary format. The original parameter objects and their data are converted from binary format to source code format to obtain the parameter objects and their data.
11. The page display device according to claim 8, characterized in that, The layout rule source code acquisition module is used for: The lexical analyzer encapsulates the layout parameter data in a request message to generate an acquisition request, and sends the acquisition request to the server. The acquisition request is used to request the source code of the layout rule corresponding to the layout parameter data. Receive the layout rule source code returned by the server based on the acquisition request; Lexical analysis is performed on the source code of the layout rule to obtain the word sequence of the layout rule.
12. The page display device according to claim 8, characterized in that, The layout rules include layout call functions that instruct the page display logic of at least one page element; The generation module is used for: The second syntax tree is compiled to obtain the layout call function corresponding to the layout rule and the target language code corresponding to the startup source code; The target language code corresponding to the startup source code is executed to complete the startup process of the target application.
13. The page display device according to claim 8, characterized in that, The layout rules include layout call functions that instruct the page display logic of at least one page element; The device further includes: By calling the dynamically added method function, the layout call function is added to the layout method class, and a layout interface is generated. The layout interface is used to call the layout call function in the layout method class. The display module is used for: By calling the layout interface, the layout method class corresponding to each page element to be displayed is invoked. Based on the layout call function in the invoked layout method class, the corresponding page elements to be displayed are displayed on any page.
14. The page display device according to claim 13, characterized in that, The device further includes: The calling module is used to call the layout method class corresponding to the parent element of the child element using reflection if any of the pages contains a child element to be displayed. The category creation module is used to create a category for the layout method class corresponding to the parent element if the layout method class corresponding to the parent element has a subclass. The child element display module is used to add the method name and scope of the first level of the current call stack to the category, so as to call the layout call function in the category and display the child element on any page.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the page display method according to any one of claims 1 to 7.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the page display method according to any one of claims 1 to 7.
17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the page display method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for configuring front-end UI layout through mobile Internet application
CN107632857A
Comment analysis method based on word vectors and syntactic features and visual interactive interface
CN110175325A