Page display method and device, program product and electronic equipment
By analyzing configuration information files and building an adaptation database, dynamically controlling the display size and position of UI design controls, solving the problem of low efficiency in the layout of window UI elements and device resolution adaptation, and achieving efficient UI adaptation.
Patent Information
- Application Number
- CN202510024617.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-05-06
AI Technical Summary
In Android or iOS native interface development, the layout of window UI elements and device resolution are less efficient, and it needs to be implemented by modifying the logical code.
By receiving page display instructions, obtaining the configuration information file of the page to be adapted, parsing the expression configuration file, building an adaptation database, and obtaining target display information based on the expression object list and the adaptation database, dynamically controlling the display size and position of the UI design control.
The efficiency of adapting window UI element layout and device resolution is improved, dynamic control is realized based on the current device window size, and the flexibility and adaptability of UI design is improved.
Smart Images

Figure CN119938199A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and more specifically, to a page display method, a page display device, a computer-readable program product, and an electronic device. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] When developing native interfaces on operating systems such as Android or iOS, they are generally created in a window (View). When the size of the View changes, the code is used to make logical judgments and choices based on the current window size to control the display position and size of different user interface (UI) design controls in the window. Summary of the invention
[0004] However, if the window needs to adapt to different resolutions of different models of different devices, it is necessary to modify the logic code to achieve the layout of the window's interface design (UI) elements and the adaptation of the device, resulting in low efficiency in adjusting the layout of the window's UI elements and the adaptation of the device.
[0005] In view of this, the present disclosure provides a page display method, a page display device, a computer-readable program product, and an electronic device to improve the efficiency of adjusting the layout of UI elements of a window and the adaptation of the device to a certain extent.
[0006] According to a first aspect of the present disclosure, a page display method is provided, the method comprising:
[0007] When receiving a page display instruction, obtaining a configuration information file of the page to be adapted;
[0008] Parsing the expression configuration file included in the configuration information file to obtain an expression object list;
[0009] Obtain basic information of the device to be adapted, and build an adaptation database based on the basic information;
[0010] According to the expression object list and the adaptation database, the target display information of the page to be adapted is obtained, and the page to be adapted is displayed based on the target display information.
[0011] In a possible implementation, obtaining basic information of a device to be adapted and constructing an adaptation database according to the basic information includes:
[0012] Determine the device hardware item name and corresponding value in the basic information;
[0013] Constructing a corresponding first key-value pair according to the obtained device hardware item name and corresponding value;
[0014] An adaptation database is constructed according to the first key-value pairs obtained.
[0015] In a possible implementation, obtaining target display information of the to-be-adapted page according to the expression object list and the adaptation database includes:
[0016] For each expression description information in the expression object list, the following operations are performed:
[0017] Selecting a target value that matches the expression description information including the input parameter identifier from the adaptation database;
[0018] Substituting the target value into the expression operation logic included in the expression description information to obtain sub-display information;
[0019] The target display information of the page to be adapted is composed according to the obtained sub-display information.
[0020] In a possible implementation manner, after obtaining the sub-display information, the method further includes:
[0021] A second key-value pair is constructed according to the sub-display information and the output parameter identifier included in the expression description information, and the second key-value pair is added to the adaptation database.
[0022] In a possible implementation, the configuration information file further includes a layout configuration file, and displaying the to-be-adapted page based on the target display information includes:
[0023] Parsing the layout configuration file to obtain a layout expression list;
[0024] If it is determined that the layout description information in the layout expression list includes dependency information, then obtaining updated page elements according to data matching the dependency information from the adaptation database;
[0025] The updated page elements are displayed in a window view according to the target display information.
[0026] In a possible implementation, displaying the to-be-adapted page based on the target display information further includes:
[0027] If it is determined that the layout description information in the layout expression list does not include dependency information, the elements in the layout description information are displayed in the window view according to the target display information.
[0028] In a possible implementation, before receiving the page display instruction, the method further includes:
[0029] When the preset adaptation condition is met, the configuration information file of the to-be-adapted page in the client is obtained from the server, and the configuration information file is saved in the local cache, so as to obtain the configuration information file from the local cache.
[0030] According to a second aspect of the present disclosure, a page display device is provided, the device comprising:
[0031] An acquisition unit, configured to acquire a configuration information file of a page to be adapted when receiving a page display instruction;
[0032] An obtaining unit, used for parsing the expression configuration file included in the configuration information file to obtain an expression object list;
[0033] A construction unit, used to obtain basic information of the device to be adapted, and to construct an adaptation database according to the basic information;
[0034] A processing unit is used to obtain target display information of the page to be adapted according to the expression object list and the adaptation database, and display the page to be adapted based on the target display information.
[0035] In a possible implementation, the construction unit is used to:
[0036] Determine the device hardware item name and corresponding value in the basic information;
[0037] Constructing a corresponding first key-value pair according to the obtained device hardware item name and corresponding value;
[0038] An adaptation database is constructed according to the first key-value pairs obtained.
[0039] In a possible implementation manner, the processing unit is configured to:
[0040] For each expression description information in the expression object list, the following operations are performed:
[0041] Selecting a target value that matches the expression description information including the input parameter identifier from the adaptation database;
[0042] Substituting the target value into the expression operation logic included in the expression description information to obtain sub-display information;
[0043] The target display information of the page to be adapted is composed according to the obtained sub-display information.
[0044] In a possible implementation, the construction unit is further used for:
[0045] A second key-value pair is constructed according to the sub-display information and the output parameter identifier included in the expression description information, and the second key-value pair is added to the adaptation database.
[0046] In a possible implementation manner, the processing unit is configured to:
[0047] Parsing the layout configuration file to obtain a layout expression list;
[0048] If it is determined that the layout description information in the layout expression list includes dependency information, then obtaining updated page elements according to data matching the dependency information from the adaptation database;
[0049] The updated page elements are displayed in a window view according to the target display information.
[0050] In a possible implementation manner, the processing unit is configured to:
[0051] If it is determined that the layout description information in the layout expression list does not include dependency information, the elements in the layout description information are displayed in the window view according to the target display information.
[0052] In a possible implementation manner, the device further includes a storage unit, configured to:
[0053] When the preset adaptation condition is met, the configuration information file of the to-be-adapted page in the client is obtained from the server, and the configuration information file is saved in the local cache, so as to obtain the configuration information file from the local cache.
[0054] According to a third aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method of the first aspect and possible implementations thereof are implemented.
[0055] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the method of the above-mentioned first aspect and its possible implementation methods by executing the executable instructions.
[0056] The technical solution disclosed in this disclosure has the following beneficial effects:
[0057] In an embodiment of the present disclosure, when a page display instruction is received, the configuration information file of the page to be adapted can be obtained; then the expression configuration file included in the configuration information file can be parsed to obtain an expression object list. Further, the basic information of the device to be adapted is obtained, and an adaptation database is constructed based on the basic information, so that the target display information of the page to be adapted is obtained based on the expression object list and the adaptation database, and the page to be adapted is displayed based on the target display information. It can be seen that in the embodiment of the present disclosure, by editing and combining expressions, it is possible to dynamically control the display size and display position of the UI design control according to the window size of the current device.
[0058] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or be understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments of the present disclosure will be briefly introduced below. Obviously, the drawings introduced below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0060] Figure 1 A schematic diagram of an application scenario in this exemplary embodiment is shown;
[0061] Figure 2 A flow chart showing a page display method in this exemplary embodiment;
[0062] Figure 3 A schematic diagram showing a process of page display in this exemplary embodiment;
[0063] Figure 4 A schematic diagram of a parameter adaptation process in this exemplary embodiment is shown;
[0064] Figure 5 A schematic diagram showing the structure of a page display device in this exemplary embodiment is shown;
[0065] Figure 6 A schematic structural diagram of an electronic device in this exemplary embodiment is shown. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure. In the absence of conflict, the embodiments in the present disclosure and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0067] The term "comprising" and any variations thereof in the specification and claims of the present disclosure are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0068] In the embodiments of the present disclosure, one or more, "many" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or plural.
[0069] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order, sequence, size, and priority. For example, the first control and the second control in the embodiment of the present disclosure are only used to distinguish different controls. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0070] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, which are schematic diagrams of the present disclosure and are not necessarily drawn to scale. Some of the block diagrams shown in the accompanying drawings may be functional entities, which do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in hardware modules or integrated circuits, or in networks, processors or microcontrollers. The implementation method can be implemented in a variety of forms and should not be understood as being limited to the examples set forth herein. The features, structures or characteristics described in the present disclosure may be combined in one or more implementations in any suitable manner. In the following description, many specific details are provided to provide a full description of the implementation methods of the present disclosure. However, those skilled in the art should be aware that one or more specific details may be omitted when implementing the technical solution of the present disclosure, or one or more specific details may be replaced by other methods, components, devices, steps, etc. It should be noted that in the embodiments of the present disclosure, the dissemination and use of data, etc., are in compliance with relevant national laws and regulations. SUMMARY OF THE INVENTION
[0072] When developing native interfaces on operating systems such as Android or iOS, they are generally created in a window (View). When the size of the View changes, the code is used to make logical judgments and choices based on the current window size to control the position and display size of different UI controls in the window.
[0073] However, if the window needs to adapt to different resolutions of different models of different devices, it is necessary to modify the logic code to achieve the layout of the window's interface design (UI) elements and the adaptation of the device, resulting in low efficiency in adjusting the layout of the window's UI elements and the adaptation of the device.
[0074] In view of this, the present disclosure provides a page display method, through which, when a page display instruction is received, the configuration information file of the page to be adapted can be obtained; then the basic information of the device to be adapted is obtained, and an adaptation database is constructed based on the basic information. Furthermore, the expression configuration file included in the configuration information file can be parsed to obtain an expression object list, thereby obtaining the target display information of the page to be adapted based on the expression object list and the adaptation database, and displaying the page to be adapted based on the target display information. It can be seen that in the embodiment of the present disclosure, through the editing combination of expressions, it is possible to dynamically control the display size and display position of the UI design control according to the window size of the current device.
[0075] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.
[0076] Application Scenario Overview
[0077] In order to better understand the technical solutions provided by the embodiments of the present disclosure, the following briefly introduces the application scenarios to which the technical solutions provided by the embodiments of the present disclosure are applicable. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present disclosure and are not intended to limit the present disclosure. In specific implementation, the technical solutions provided by the embodiments of the present disclosure can be flexibly applied according to actual needs.
[0078] In order to more clearly introduce the contents of the embodiments of the present disclosure, some key terms are introduced below:
[0079] Expression: A combination of numbers, operators, number grouping symbols, free variables and bound variables in a meaningful arrangement that can produce a numerical value.
[0080] Window or View (Window / View): Windows and views are the most basic classes, used to create any type of user interface. The window represents a geometric area on the screen, and the view class fills this blank with its own functions. Smaller UI controls, such as navigation bars, buttons, and text boxes, are attached to the view class, and a view is linked to a window.
[0081] JS (JavaScript) engine: A virtual machine that processes JavaScript code, responsible for parsing, compiling, and executing JavaScript code. Common JS engines include Hermes, JavaScriptCore, QuickJS, and V8.
[0082] Android: A free and open source mobile operating system based on the Linux kernel (excluding GNU components). It is mainly used in mobile devices such as smartphones and tablets.
[0083] JSON (JavaScript Object Notation): Designed based on a subset of ECMAScript, it is an open standard file format and data exchange format that is easy for humans to read and write, and easy for machines to parse and generate. JSON is independent of language design, and many programming languages support data exchange in JSON format. JSON is a commonly used data format that has many uses in electronic data exchange, including data exchange between web applications and servers. Its concise and clear hierarchical structure effectively improves network transmission efficiency, making it an ideal data exchange language. Its files usually use the extension .json.
[0084] In the embodiments of the present disclosure, the page display technology can be applied to various business scenarios that require adaptation of UI controls and windows, which is not limited in the embodiments of the present disclosure.
[0085] See also Figure 2 As shown, Figure 2 This is an application scenario to which the technical solution of the embodiment of the present disclosure can be applied. In the scenario diagram, it includes a terminal device 101 and a server device 102. Among them, the terminal device 101 can be multiple devices. Figure 1 Only one is shown.
[0086] The terminal device 101 and the server device 102 , as well as each terminal device 101 , may be directly or indirectly connected to each other through one or more networks 103 .
[0087] In the embodiment of the present disclosure, the terminal device 101 can obtain the configuration information file of the page to be adapted from the server device 102, parse the expression configuration file included in the configuration information file, obtain the expression object list, and obtain the basic information of the terminal device 101 to be adapted, and build an adaptation database based on the basic information. In this way, the target display information of the page to be adapted can be obtained according to the expression object list and the adaptation database, and the page to be adapted can be displayed based on the target display information.
[0088] in, Figure 1 The terminal device 101 may be a mobile phone, a tablet computer (PAD), a personal computer (PC), a smart TV, a smart watch, a smart speaker, a smart car device, and a wearable device, but is not limited thereto.
[0089] as well as, Figure 1 The server device 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms, or a cloud server cluster but is not limited to these.
[0090] Of course, the method provided in the embodiment of the present disclosure is not limited to Figure 1 The application scenario shown can also be used in other possible application scenarios, such as an application scenario where the page display method is implemented only by a terminal device, and the embodiments of the present disclosure are not limited thereto.
[0091] Exemplary Methods
[0092] To further illustrate the technical solution provided by the embodiments of the present disclosure, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of the present disclosure provide method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiments of the present disclosure. The method may be executed in the order of the method shown in the embodiments or drawings or in parallel during the actual processing process or when the device is executed.
[0093] See also Figure 2 , Figure 2 1 is a flow chart of a page display method in an embodiment of the present disclosure. The flow of the method can be performed by an electronic device, such as Figure 1 The terminal device 101 in the embodiment is executed, and the specific implementation process of the method is as follows:
[0094] Step 201: When a page display instruction is received, a configuration information file of the page to be adapted is obtained.
[0095] In the embodiment of the present disclosure, when a page display instruction is received, a configuration information file of the page to be adapted may be obtained, wherein the configuration information file includes a fixed layout configuration file and an expression configuration file.
[0096] In the disclosed embodiment, when the UI layout is executed for the first time, expression adaptation calculation and automatic layout of the UI can be automatically executed, that is, a page display instruction can be triggered. Alternatively, when the width and / or height of the view or window changes, expression adaptation calculation and automatic layout of the UI can be automatically executed, that is, a page display instruction can be triggered. Alternatively, when an external parameter call causes the adaptation database to be updated, expression calculation and automatic layout of the UI may also be executed, that is, a page display instruction is triggered.
[0097] Optionally, when the preset adaptation condition is met, the configuration information file of the page to be adapted in the client is obtained from the server, and the configuration information file is saved in the local cache, so as to obtain the configuration information file from the local cache. In this way, the acquisition of the configuration information file can be accelerated, thereby improving the efficiency of page display.
[0098] Step 202: Parse the expression configuration file included in the configuration information file to obtain an expression object list.
[0099] In the disclosed embodiment, the expression configuration file included in the configuration information file can be parsed to obtain an expression object list. Optionally, the expression configuration file is a json file, and the expression logic can be parsed from the json file to generate a corresponding expression object according to the parsed expression information.
[0100] Step 203: Obtain basic information of the device to be adapted, and construct an adaptation database based on the basic information.
[0101] In the disclosed embodiment, basic information of the device to be adapted can be obtained, wherein the basic information may include view / window width and height information, and other auxiliary information, and then an adaptation database can be constructed based on the basic information. The adaptation database may include multiple key-value pairs. For example, the adaptation database includes a key-value pair of "screenWidth" and "1080", and a key-value pair of "screenHeight" and "1920".
[0102] Step 204: Obtain target display information of the page to be adapted according to the expression object list and the adaptation database, and display the page to be adapted based on the target display information.
[0103] In the embodiment of the present disclosure, the following steps are performed for each expression description information in the expression object list:
[0104] Step A: Selecting a target value that matches the expression description information including the input parameter identifier from the adaptation database;
[0105] Step B: Substituting the target value into the expression operation logic included in the expression description information to obtain sub-display information;
[0106] In the embodiment of the present disclosure, after obtaining the sub-display information, a second key-value pair may be constructed according to the sub-display information and the output parameter identifier included in the expression description information, and the second key-value pair may be added to the adaptation database.
[0107] Step C: compose the target display information of the page to be adapted according to the obtained sub-display information.
[0108] In the embodiment of the present disclosure, the expression object list includes at least one expression description information, and each expression description information includes three parts, namely, an input parameter list, an output parameter, and an expression operation logic. Among them, the expression operation logic includes condition judgment and calculation logic.
[0109] In the disclosed embodiment, the input parameters may be traversed to obtain corresponding parameter values from the adaptation database, and the obtained parameter values may be substituted into the expression operation logic to obtain the output result, namely the aforementioned sub-display information.
[0110] For example, input parameter: "screenHeight", output parameter: "fontSize", expression logic: "if(screenHeigh>1920.0,172.0,108.0)", that is, determine the screen height, when the height is greater than 1920, set the font to 172, when the height is not greater than 1920, set the font to 108. If it is determined that the screen height in the adaptation database is greater than 1920, the font in the adaptation database can be set to 108, so that the font and 108 are stored in the adaptation database as a set of key-value pairs.
[0111] For another example, input parameter: "fontSize", output parameter: "textArea", expression logic: "if(fontSize>108.0,2000.0,1000.0)", that is, to determine the current font size, when the font is larger than 108.0, set the font area to 2000.0, when the font is not larger than 108.0, set the font area to 1000.0. If it is determined that the font in the adaptation database is 108, the font area is determined to be 1000.0, so that the font area and 1000.0 are stored in the adaptation database as a set of key-value pairs.
[0112] In this way, the sub-display information corresponding to each expression description information in the expression object list can be finally obtained. In other words, the latest display parameter information of each control suitable for the adaptation device can be obtained, and because the latest display parameter information is stored in the adaptation database, the latest updated latest display parameter information of each control can be obtained from the adaptation database. Optionally, the display parameter information is, for example, position information, display range information, display color information, etc.
[0113] In the disclosed embodiment, a fixed layout configuration file may also be parsed to obtain a layout expression list. If it is determined that the layout description information in the layout expression list includes dependency information, then updated page elements are obtained based on data that matches the dependency information from the adaptation database; and the updated page elements are displayed in the window view according to the target display information. If it is determined that the layout description information in the layout expression list does not include dependency information, then the elements in the layout description information are displayed in the window view according to the target display information.
[0114] It can be seen that in the embodiment of the present disclosure, after executing all the expression operation logic, the layout update process can be executed. Specifically, the layout update process will first parse the fixed layout configuration file, which is a json file, and then parse the layout information from it. At the same time, the expression dependency of the corresponding layout will be parsed. If dependent expression parameters are found, the corresponding dependent parameters can be read from the expression parameter support, i.e., the adaptation database, and then the parameter dependency update process is executed, and finally the result of the parameter dependency is updated to the final layout information. In addition, since the json configuration information can be dynamically issued, the solution based on the embodiment of the present disclosure can realize the ability to dynamically update the UI layout based on the expression.
[0115] For example, see Figure 3 , Figure 3 A schematic diagram of a page display process provided by an embodiment of the present disclosure. In an embodiment of the present disclosure, a configuration information file of a page to be adapted can be obtained. The configuration information file includes a fixed layout configuration file and an expression configuration file, and then expression adaptation is performed to obtain sub-display information, that is, Figure 3 The expression result in , and then update the page layout according to the expression result, so as to display the updated page layout to achieve the response to the page display instruction. It should be noted that Figure 3 In the above description, N and M are positive integers, which are determined based on the actual number of implementations. N and M may be the same or different, and this is not limited in the embodiments of the present disclosure.
[0116] In the disclosed embodiment, an interface may be provided for setting additional parameters by external calls, and the additional parameters may include parameter names and parameter values, wherein name may be used to represent the parameter name to be set, and value may be used to represent the parameter value to be set. It should be noted that external parameters may be set during the engine creation phase. In the disclosed embodiment, the set additional parameters may be used during UI layout.
[0117] In the disclosed embodiment, the engine rendering process can support external update of parameter values, and since the additional parameters are also stored in the adaptation database, the adaptation database is updated, and updating the parameters of the adaptation database may trigger the update logic of the expression, which requires recalculating the expression to obtain the latest data in the adaptation database, and then finally updating the UI layout based on the latest data stored in the adaptation database.
[0118] In the disclosed embodiment, a processing mechanism for the parameter setting thread and the rendering thread can also be set to solve the thread coordination problem between the rendering thread and the parameter setting thread. Optionally, the parameter update will be updated to an adaptation database. When the parameter update is determined, an update flag can be set for the updated parameter. In this way, the rendering thread can trigger the expression logic to perform the operation of the new parameter after obtaining the parameter update flag, thereby obtaining the latest parameters and updating the UI control layout based on the latest parameters. It can be seen that in the disclosed embodiment, in order to ensure performance, expression calculation and automatic layout update of the UI are not performed every time the rendering thread is rendered.
[0119] In the disclosed embodiments, the parameters used between expressions can be passed. Specifically, all parameters will be stored in a parameter pool, i.e., the aforementioned adaptation database, and the expression will take the relevant parameters from the parameter pool, perform the operation, and then add the result parameters to the parameter pool. In this way, the subsequent expression operation can also use the result parameters of the preceding expression, and the corresponding parameter information can be obtained during the UI layout, thereby realizing the data transfer from the expression operation to the final UI layout to obtain the parameter value.
[0120] For example, see Figure 4 , Figure 4 A logical diagram of the execution parameter adaptation in the embodiment of the present disclosure. In the implementation of the present disclosure, after parsing the expression configuration file, an expression list can be obtained, and the expression list can be operated, that is, Figure 4 Specifically, you can perform operations on each expression description in the expression list. Figure 4 Each sub-operation includes expression parsing, that is, obtaining the expression operation logic in the expression description information, and then selecting the target value that matches the expression description information including the input parameter identifier from the adaptation database to execute Figure 4 In addition, the target value can be substituted into the expression operation logic included in the expression description information to perform Figure 4 Based on the target value and the sub-display information obtained by the expression operation logic, the parameter saving step can be executed. Figure 4 The parameters in are saved, so that the adaptation database stores the latest sub-display information.
[0121] Please continue to see Figure 4 When the viewport / window width and height change, or when external parameter calls cause the adaptation database to be updated, layout updates may be triggered. Layout updates may include updates to various UI controls, i.e. Figure 4In this way, when updating the sub-data, the latest data can be read from the adaptation database to complete the layout operation, so as to obtain the latest parameters of various UI controls, and then display the page based on this.
[0122] It can be seen that in the embodiments of the present disclosure, by editing and combining expressions, it is possible to dynamically control the display size and position of the UI controls according to the current window size, while also supporting various layout methods such as top-bottom, left-right, and centering, thereby achieving the ability for the UI layout to be dynamically updated according to the configuration.
[0123] Exemplary Devices
[0124] The exemplary embodiment of the present disclosure also provides a page display device. Figure 5 As shown, the page display device 500 includes the following program modules:
[0125] The acquisition unit 501 is used to acquire the configuration information file of the page to be adapted when receiving the page display instruction;
[0126] An obtaining unit 502 is used to parse the expression configuration file included in the configuration information file to obtain an expression object list;
[0127] A construction unit 503 is used to obtain basic information of the device to be adapted, and to construct an adaptation database according to the basic information;
[0128] The processing unit 504 is used to obtain the target display information of the page to be adapted according to the expression object list and the adaptation database, and display the page to be adapted based on the target display information.
[0129] In a possible implementation manner, the construction unit 503 is used to:
[0130] Determine the device hardware item name and corresponding value in the basic information;
[0131] Constructing a corresponding first key-value pair according to the obtained device hardware item name and corresponding value;
[0132] An adaptation database is constructed according to the first key-value pairs obtained.
[0133] In a possible implementation, the processing unit 504 is configured to:
[0134] For each expression description information in the expression object list, the following operations are performed:
[0135] Selecting a target value that matches the expression description information including the input parameter identifier from the adaptation database;
[0136] Substituting the target value into the expression operation logic included in the expression description information to obtain sub-display information;
[0137] The target display information of the page to be adapted is composed according to the obtained sub-display information.
[0138] In a possible implementation manner, the construction unit 503 is further configured to:
[0139] A second key-value pair is constructed according to the sub-display information and the output parameter identifier included in the expression description information, and the second key-value pair is added to the adaptation database.
[0140] In a possible implementation, the processing unit 504 is configured to:
[0141] Parsing the layout configuration file to obtain a layout expression list;
[0142] If it is determined that the layout description information in the layout expression list includes dependency information, then obtaining updated page elements according to data matching the dependency information from the adaptation database;
[0143] The updated page elements are displayed in a window view according to the target display information.
[0144] In a possible implementation, the processing unit 504 is configured to:
[0145] If it is determined that the layout description information in the layout expression list does not include dependency information, the elements in the layout description information are displayed in the window view according to the target display information.
[0146] In a possible implementation manner, the device further includes a storage unit, configured to:
[0147] When the preset adaptation condition is met, the configuration information file of the to-be-adapted page in the client is obtained from the server, and the configuration information file is saved in the local cache, so as to obtain the configuration information file from the local cache.
[0148] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.
[0149] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0150] Exemplary Program Products
[0151] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above-mentioned page display method is implemented.
[0152] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0153] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0154] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0155] Computer programs can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared and other signals. Electronic devices can convert signals carrying computer programs into digital signals to run computer programs. When a computer program runs on an electronic device, its code is used to enable the electronic device to execute (more specifically, it can enable the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned page display method, which includes the following steps: Step 201: When a page display instruction is received, obtain the configuration information file of the page to be adapted; Step 202: Parse the expression configuration file included in the configuration information file to obtain an expression object list; Step 203: Obtain the basic information of the device to be adapted, and build an adaptation database based on the basic information; Step 204: According to the expression object list and the adaptation database, obtain the target display information of the page to be adapted, and display the page to be adapted based on the target display information.
[0156] The above method steps are implemented by a computer program. When a page display instruction is received, the configuration information file of the page to be adapted can be obtained; then the expression configuration file included in the configuration information file can be parsed to obtain an expression object list. Furthermore, the basic information of the device to be adapted is obtained, and an adaptation database is constructed based on the basic information, so that the target display information of the page to be adapted is obtained based on the expression object list and the adaptation database, and the page to be adapted is displayed based on the target display information. It can be seen that in the embodiment of the present disclosure, by editing and combining expressions, it is possible to dynamically control the display size and display position of the UI design control according to the window size of the current device.
[0157] Exemplary Electronic Devices
[0158] The exemplary embodiments of the present disclosure also provide an electronic device. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as a computer program. The processor executes the method steps of various exemplary embodiments of the present disclosure by executing the executable instructions.
[0159] Reference below Figure 6 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Figure 6 The electronic device 600 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0160] like Figure 6 As shown, the electronic device 600 may include: a processor 610 , a memory 620 , a bus 630 , an I / O (input / output) interface 640 , a network adapter 660 , and a display 680 .
[0161] The memory 620 may include a volatile memory, such as a RAM 621, a cache unit 622, and may also include a non-volatile memory, such as a ROM 623. The memory 620 may also include one or more program modules 624, such program modules 624 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. For example, the program module 624 may include each module in the above-mentioned device.
[0162] The processor 610 may include one or more processing units. For example, the processor 610 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.
[0163] Processor 610 can be used to execute executable instructions stored in memory 620, such as the above-mentioned page display method, which includes the following steps: Step 201: When a page display instruction is received, obtain the configuration information file of the page to be adapted; Step 202: Parse the expression configuration file included in the configuration information file to obtain an expression object list; Step 203: Obtain basic information of the device to be adapted, and build an adaptation database based on the basic information; Step 204: According to the expression object list and the adaptation database, obtain the target display information of the page to be adapted, and display the page to be adapted based on the target display information.
[0164] By executing the above method steps through the processor 610, when a page display instruction is received, the configuration information file of the page to be adapted can be obtained; then the expression configuration file included in the configuration information file can be parsed to obtain an expression object list. Further, the basic information of the device to be adapted is obtained, and an adaptation database is constructed based on the basic information, so that the target display information of the page to be adapted is obtained based on the expression object list and the adaptation database, and the page to be adapted is displayed based on the target display information. It can be seen that in the embodiment of the present disclosure, by editing and combining expressions, it is possible to dynamically control the display size and display position of the UI design control according to the window size of the current device.
[0165] The bus 630 is used to realize the connection between different controls of the electronic device 600, and may include a data bus, an address bus, and a control bus.
[0166] The electronic device 600 can communicate with one or more external devices 700 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 640 .
[0167] The electronic device 600 can communicate with one or more networks through the network adapter 650. For example, the network adapter 650 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. The network adapter 660 can communicate with other modules of the electronic device 600 through the bus 630.
[0168] The electronic device 600 may display UI controls and the like through the display 680 .
[0169] although Figure 6 Not shown, other hardware and / or software modules may also be provided in the electronic device 600, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0170] As can be seen from the above, the technical solution of the present disclosure can be implemented as a method, an apparatus, a system, a computer program product, a storage medium, an electronic device, etc. Those skilled in the art can understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, such as being respectively referred to as a "circuit", "module" or "system".
[0171] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art will easily think of other embodiments based on the specific embodiments provided by the present disclosure. Therefore, the specific embodiments provided by the present disclosure are only exemplary, and the scope and spirit of the present disclosure are indicated by the claims, and any variations, uses or adaptive changes of the present disclosure should be covered, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the present disclosure.
Claims
1. A page display method, characterized in that: The method comprises: When receiving a page display instruction, obtaining a configuration information file of the page to be adapted; Parsing the expression configuration file included in the configuration information file to obtain an expression object list; Obtain basic information of the device to be adapted, and build an adaptation database based on the basic information; According to the expression object list and the adaptation database, the target display information of the page to be adapted is obtained, and the page to be adapted is displayed based on the target display information.
2. The method according to claim 1, characterized in that Obtain basic information of the device to be adapted, and build an adaptation database based on the basic information, including: Determine the device hardware item name and corresponding value in the basic information; Constructing a corresponding first key-value pair according to the obtained device hardware item name and corresponding value; An adaptation database is constructed according to the first key-value pairs obtained.
3. The method according to claim 1, characterized in that Obtaining target display information of the to-be-adapted page according to the expression object list and the adaptation database includes: For each expression description information in the expression object list, the following operations are performed: Selecting a target value that matches the expression description information including the input parameter identifier from the adaptation database; Substituting the target value into the expression operation logic included in the expression description information to obtain sub-display information; The target display information of the page to be adapted is composed according to the obtained sub-display information.
4. The method according to claim 3, characterized in that After obtaining the sub-display information, the method further includes: A second key-value pair is constructed according to the sub-display information and the output parameter identifier included in the expression description information, and the second key-value pair is added to the adaptation database.
5. The method according to any one of claims 1 to 4, characterized in that: The configuration information file also includes a layout configuration file, and the page to be adapted is displayed based on the target display information, including: Parsing the layout configuration file to obtain a layout expression list; If it is determined that the layout description information in the layout expression list includes dependency information, then obtaining updated page elements according to data matching the dependency information from the adaptation database; The updated page elements are displayed in a window view according to the target display information.
6. The method according to claim 5, characterized in that Displaying the page to be adapted based on the target display information also includes: If it is determined that the layout description information in the layout expression list does not include dependency information, the elements in the layout description information are displayed in the window view according to the target display information.
7. The method according to claim 1, characterized in that Before receiving the page display instruction, the method further includes: When the preset adaptation condition is met, the configuration information file of the to-be-adapted page in the client is obtained from the server, and the configuration information file is saved in the local cache, so as to obtain the configuration information file from the local cache.
8. A page display device, characterized in that: The device comprises: An acquisition unit, configured to acquire a configuration information file of a page to be adapted when receiving a page display instruction; An obtaining unit, used for parsing the expression configuration file included in the configuration information file to obtain an expression object list; A construction unit, used to obtain basic information of the device to be adapted, and to construct an adaptation database according to the basic information; A processing unit is used to obtain target display information of the page to be adapted according to the expression object list and the adaptation database, and display the page to be adapted based on the target display information.
9. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.
10. A computer program product having a computer program stored thereon, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.