Page customization demand implementation method and device, equipment, medium and program product
By changing and compiling the page configuration file of the user interface UI interface customization requirements, the custom page program is generated, the problem of increased code maintenance costs and complexity in existing technologies has been solved, and flexible customization needs are met.
Patent Information
- Application Number
- CN202411405249.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-28
AI Technical Summary
The prior art leads to increased code maintenance costs and complexity when implementing user interface UI interface customization requirements, especially when customization requirements continue to increase.
By obtaining page custom requirements information, the configuration files in the original page program are changed according to these requirements, the target configuration file is obtained, and the original page program is compiled based on the target configuration file to generate custom page programs.
The maintenance cost and complexity of the code is reduced, and the flexible customization needs are achieved. There is no need to increase the sub -branch or modify the code on the basis of the original page program.
Smart Images

Figure CN119376726A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of page development technology, and in particular to a method, device, equipment, medium and program product for realizing page customization requirements. Background Art
[0002] In user interface UI design, different users may have different customization requirements for the theme or layout of the UI interface. Currently, the realization of user customization requirements is generally achieved by adding a new sub-branch based on the original code branch, and then modifying the code on the sub-branch to meet the user's customization requirements.
[0003] However, with this implementation, as customization requirements continue to increase, the number of sub-branches may increase, increasing the maintenance cost and complexity of the code. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, equipment, medium and program product for implementing page customization requirements that can reduce the maintenance cost and complexity of the code in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for implementing page customization requirements, the method comprising:
[0006] Get page customization requirement information;
[0007] Modify the configuration file in the original page program according to the page customization requirement information to obtain a target configuration file;
[0008] The original page program is compiled based on the target configuration file to obtain a customized page program, where the customized page program is a page program that can realize page customization requirements.
[0009] In this embodiment, first, the page customization requirement information is obtained, then, the configuration file in the original page program is modified according to the page customization requirement information to obtain the target configuration file, and finally, the original page program is compiled based on the target configuration file to obtain the customized page program, which is a page program that can realize the page customization requirement. In this way, when the user has a page customization requirement, there is no need to modify the code of the original page program, and only the target configuration file needs to be determined according to the page customization requirement to obtain the customized page program that meets the page customization requirement. For different page customization requirements, only different target configuration files need to be determined, and there is no need to add sub-branches on the basis of the original page program and modify the code to meet different page customization requirements, so the maintenance cost and complexity of the code are reduced.
[0010] In one embodiment, the page customization requirement information includes theme customization requirement information, and the configuration file in the original page program is modified according to the page customization requirement information to obtain the target configuration file, including:
[0011] Acquire a theme configuration file from a plurality of configuration files included in the original page program;
[0012] The theme configuration file is modified according to the theme customization requirement information to obtain a target theme configuration file.
[0013] In this embodiment, a target theme configuration file is obtained by acquiring a theme configuration file and modifying the theme configuration file according to theme customization requirement information.
[0014] In one embodiment, the theme configuration file includes a default theme code, and the process of modifying the theme configuration file according to the theme customization requirement information to obtain a target theme configuration file includes:
[0015] According to the required theme code in the theme customization requirement information, the default theme code in the theme configuration file is changed;
[0016] If the required theme code is a newly added theme code, a first mapping relationship between the required theme code and theme configuration is added to the theme configuration file, and the theme configuration includes a style value variable corresponding to the required theme code.
[0017] In this embodiment, the default theme configuration during page rendering can be modified by modifying the default theme code in the theme configuration file. At the same time, for newly added theme codes, the theme style can be increased by adding a first mapping relationship between the theme code and the theme configuration without modifying the original page code, making the implementation of theme customization requirements more flexible.
[0018] In one embodiment, the page customization requirement information includes layout customization requirement information, and the configuration file in the original page program is modified according to the page customization requirement information to obtain the target configuration file, including:
[0019] Acquire a layout configuration file from a plurality of configuration files included in the original page program;
[0020] The layout configuration file is modified according to the layout customization requirement information to obtain a target layout configuration file.
[0021] In this embodiment, a target layout configuration file is obtained by acquiring a layout configuration file and modifying the layout configuration file according to the layout customization requirement information.
[0022] In one embodiment, the layout configuration file includes a default layout code, and the process of modifying the theme configuration file according to the layout customization requirement information to obtain a target layout configuration file includes:
[0023] According to the required layout code in the layout customization requirement information, the default layout code in the layout configuration file is changed;
[0024] If the required layout code is a newly added layout code, a second mapping relationship between the required layout code and the layout component is added to the layout configuration file.
[0025] In this embodiment, the default layout configuration during page rendering can be modified by modifying the default layout code in the layout configuration file. At the same time, for the newly added layout code, by adding a second mapping relationship between the layout code and the layout component, the new layout can be added without modifying the original page code. The implementation of layout customization requirements is more flexible and can meet different customization requirements.
[0026] In one embodiment, compiling the original page program based on the target configuration file includes:
[0027] receiving a compile command, wherein the compile command includes a compile parameter, and the compile parameter is used to indicate a storage location for storing the target configuration file;
[0028] Reading the target configuration file from the storage location indicated by the compilation parameter;
[0029] In response to the compilation command, a compilation process is executed, and in the dependency collection phase of the compilation process, a dependency tree is generated based on the target configuration file, and subsequent compilation phases of the compilation process are executed according to the dependency tree.
[0030] In this embodiment, in the dependency collection process of the compilation flow, by obtaining the target configuration file, hot replacing the configuration file in the original page program based on the target configuration file to generate a dependency tree without directly overwriting the original page program, it is possible to generate a page customization program that meets different page customization requirements according to different compilation commands, thereby meeting the diverse needs of customization requirements.
[0031] In one embodiment, the method further comprises:
[0032] After detecting the page display instruction, calling the customized page program;
[0033] In the initialization process of the customized page program, page rendering is performed according to the target configuration file to generate a page that meets the page customization requirements.
[0034] In this embodiment, different customization requirements of the page are realized through the target configuration file, which is convenient to implement and has better scalability and maintainability.
[0035] In one embodiment, the target configuration file includes a target theme configuration file, and in the initialization process of the customized page program, performing page rendering according to the target configuration file includes:
[0036] Obtain historical subject codes;
[0037] If the historical subject code exists, use the historical subject code as the target subject code;
[0038] If the historical theme code does not exist, the default theme code in the target theme configuration file is used as the target theme code;
[0039] The page is rendered according to the theme configuration corresponding to the target theme code.
[0040] In this embodiment, the target theme code is determined in the initialization process of the page, and then the page theme is rendered according to the target theme code to achieve customization of theme requirements. At the same time, the correspondence between multiple theme codes and theme configurations can be saved through a mapping relationship, and multiple themes can coexist. Without modifying the original page code, multiple themes can be achieved by increasing the relationship between theme codes and theme configurations, and the program is more maintainable and scalable.
[0041] In one embodiment, the method further comprises:
[0042] If the user's demand for switching themes is received, the historical theme code is updated according to the theme code in the demand for switching themes, and the initialization process of the customized page program is triggered.
[0043] In this embodiment, the theme switching can be implemented according to the theme switching requirement input by the user, and the implementation of the page customization requirement is more flexible, satisfying the user's page customization requirement.
[0044] In one embodiment, the target configuration file includes a target layout configuration file, and in the initialization process of the customized page program, performing page rendering according to the target configuration file includes:
[0045] Get the historical layout code;
[0046] If the historical layout code exists, use the historical layout code as the target layout code;
[0047] If the historical layout code does not exist, using the default layout code in the target layout configuration file as the target layout code;
[0048] The page is rendered according to the layout component corresponding to the target layout code.
[0049] In this embodiment, by obtaining the target layout code and determining the layout component corresponding to the target layout code for layout display, multiple layouts can be implemented through the target configuration file without changing the original page program, and the maintenance difficulty and cost of the program are relatively low.
[0050] In one embodiment, the method further comprises:
[0051] If a layout switching requirement of the user is received, the target layout code is updated according to the layout code in the layout switching requirement, so as to perform page rendering according to the layout component corresponding to the target layout code.
[0052] In this embodiment, layout switching can be implemented according to the layout switching requirements input by the user, and the implementation of page customization requirements is more flexible, satisfying the page customization requirements of the user.
[0053] In a second aspect, the present application also provides a device for implementing page customization requirements, the device comprising:
[0054] Acquisition module, used to obtain page customization requirement information;
[0055] A modification module, used for modifying the configuration file in the original page program according to the page customization requirement information to obtain a target configuration file;
[0056] The compiling module is used to compile the original page program based on the target configuration file to obtain a customized page program, where the customized page program is a page program that can realize page customization requirements.
[0057] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method for realizing page customization requirements as described in any one of the first aspects above is implemented.
[0058] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for realizing page customization requirements as described in any one of the above-mentioned first aspects is implemented.
[0059] In a fifth aspect, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the page customization requirement implementation method described in any one of the first aspects above.
[0060] The above-mentioned method, device, equipment, medium and program product for realizing page customization requirements first obtain page customization requirement information, then modify the configuration file in the original page program according to the page customization requirement information to obtain the target configuration file, and finally compile the original page program based on the target configuration file to obtain a customized page program, which is a page program that can realize page customization requirements. In this way, when the user has a page customization requirement, there is no need to modify the code of the original page program, but only to determine the target configuration file according to the page customization requirement to obtain a customized page program that meets the page customization requirement. For different page customization requirements, only different target configuration files need to be determined, and there is no need to add sub-branches on the basis of the original page program and modify the code to meet different page customization requirements, so the maintenance cost and complexity of the code are reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0062] FIG1 is a schematic diagram of a structure for implementing customized requirements based on branch management in one embodiment;
[0063] FIG2 is a flow chart of a method for implementing page customization requirements in one embodiment;
[0064] FIG3 is a schematic flow diagram of a step of determining a target theme configuration file in one embodiment;
[0065] FIG4 is a flow chart of a method for implementing page customization requirements in another embodiment;
[0066] FIG5 is a schematic flow diagram of a step of determining a target layout configuration file in one embodiment;
[0067] FIG6 is a flow chart of a method for implementing page customization requirements in another embodiment;
[0068] FIG7 is a schematic flow chart of a compiling step in another embodiment;
[0069] FIG8 is a schematic diagram of a flow chart of an existing compiling step in another embodiment;
[0070] FIG9 is a flow chart of the compiling steps of a method for implementing page customization requirements in another embodiment;
[0071] FIG10 is a flow chart of a method for implementing page customization requirements in another embodiment;
[0072] FIG11 is a flow chart of a method for implementing page customization requirements in another embodiment;
[0073] FIG12 is a flow chart of a method for implementing page theme customization requirements in another embodiment;
[0074] FIG13 is a flow chart of a method for implementing page customization requirements in another embodiment;
[0075] FIG14 is a flow chart of a method for implementing page layout customization requirements in another embodiment;
[0076] FIG15 is a flow chart of a method for implementing page customization requirements in another embodiment;
[0077] FIG16 is a structural block diagram of a device for implementing page customization requirements in one embodiment;
[0078] FIG. 17 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0079] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0080] In user interface UI design, different users may have different customization requirements for the theme or layout of the UI interface. At present, the realization of user customization requirements is generally achieved by adding new sub-branches based on the original code branch, and then modifying the code on the sub-branch to meet the user's customization requirements. As shown in Figure 1, master is a standard product code branch. In order to meet different user customization requirements, multiple cus sub-branches are pulled out on the basis of master. After the corresponding user customization requirements are implemented, the code of each sub-branch is different from the code of other sub-branches. When the master fixes a problem or adds some new functions, it is necessary to confirm whether the corresponding cus sub-branch has the same problem and whether it is necessary to add the new functions of the master branch. When the customization requirements continue to increase, the number of sub-branches may increase, and it is difficult to determine the differences between each cus sub-branch and the master branch, which will increase the maintenance cost and complexity of the code.
[0081] In view of this, the page customization requirement implementation method of the present application does not need to modify the code of the original page program when the user has a page customization requirement. It only needs to determine the target configuration file according to the page customization requirement to obtain a customized page program that meets the page customization requirement. For different page customization requirements, it is only necessary to determine different target configuration files, and there is no need to add sub-branches and modify the code on the basis of the original page program to meet different page customization requirements. Therefore, the maintenance cost and complexity of the code are reduced.
[0082] In an exemplary embodiment, as shown in FIG2 , a method for implementing page customization requirements is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0083] Step 201, obtaining page customization requirement information.
[0084] Among them, the page customization requirement information may include the user's customization requirement for the theme or the customization requirement for the layout, that is, the customized display of the page theme or the page layout can be realized according to the user's requirements. The customization of the theme may include the customization of the color of the page, the font size of the page, and the display mode of the display box of the page. The customization of the layout may include the customization of the position or size of different controls on the page. Optionally, the page customization requirement information may be input by the user in the terminal, or received by the terminal through interaction with other terminals or servers, or found by the terminal in the local storage system. The page customization requirement may be the customization requirement of different products or different projects, that is, different products or different projects have different display requirements for the page display of an application.
[0085] Step 202: modify the configuration file in the original page program according to the page customization requirement information to obtain a target configuration file.
[0086] The original page program may be a standard product code branch, such as the master branch in FIG1. The original page program may include a configuration file, which may be used to configure the default theme and layout of the original page program. The target configuration file is a configuration file corresponding to the page customization requirements, which may include theme requirements and layout requirements corresponding to the page customization requirements.
[0087] Optionally, modifying the configuration file in the original page program may include modifying the theme configuration in the configuration file of the original page program according to the theme requirements corresponding to the page customization requirements, and may also include modifying the layout configuration in the configuration file of the original page program according to the layout requirements corresponding to the page customization requirements, and saving the modified configuration file as the target configuration file. Optionally, the target configuration file may be saved to a folder in a product directory or a project directory corresponding to the page customization requirements.
[0088] Step 203: compile the original page program based on the target configuration file to obtain a customized page program.
[0089] The customized page program is a page program that can realize page customization requirements. Optionally, the compilation process selects a target configuration file for compilation, but the target configuration file does not overwrite the configuration file in the original page program. Therefore, the generation process of the customized page program does not modify the original page program. By selecting different target configuration files during the compilation process, a customized page program that meets different page customization requirements can be generated.
[0090] In the above embodiment, first, the page customization requirement information is obtained, then, the configuration file in the original page program is modified according to the page customization requirement information to obtain the target configuration file, and finally, the original page program is compiled based on the target configuration file to obtain the customized page program, which is a page program that can realize the page customization requirement. In this way, when the user has a page customization requirement, there is no need to modify the code of the original page program, and only the target configuration file needs to be determined according to the page customization requirement to obtain the customized page program that meets the page customization requirement. For different page customization requirements, only different target configuration files need to be determined, and there is no need to add sub-branches on the basis of the original page program and modify the code to meet different page customization requirements, so the maintenance cost and complexity of the code are reduced.
[0091] In one embodiment, if the theme of the page needs to be customized, the page customization requirement information includes theme customization requirement information. The above step 202 modifies the configuration file in the original page program according to the page customization requirement information. The step of obtaining the target configuration file is shown in FIG. 3 and includes:
[0092] Step 301, obtaining a theme configuration file from a plurality of configuration files included in the original page program.
[0093] The theme configuration file may be a configuration file used to configure the page theme in the original page program. Optionally, the original page program may include multiple configuration files, and the theme configuration file used to configure the theme may be obtained according to the name or type of the configuration file.
[0094] Step 302: modify the theme configuration file according to the theme customization requirement information to obtain a target theme configuration file.
[0095] Optionally, the theme customization requirement information may include a theme code corresponding to the theme required by the user, and may also include a theme configuration corresponding to the theme required by the user, and the theme configuration may include the value of a style value variable related to the theme. The theme configuration file in the original page program is modified, and a target theme configuration file is obtained according to the modified configuration file, and the target configuration file may be saved to a folder in a product directory or a project directory corresponding to the page customization requirement.
[0096] In this embodiment, a target theme configuration file is obtained by acquiring a theme configuration file and modifying the theme configuration file according to theme customization requirement information.
[0097] Optionally, the theme configuration file includes a default theme code. Optionally, the theme configuration file may also include a mapping relationship between different theme codes and theme configurations. The above step 302 modifies the theme configuration file according to the theme customization requirement information to obtain a target theme configuration file as shown in FIG. 4, including:
[0098] Step 401, according to the required theme code in the theme customization requirement information, change the default theme code in the theme configuration file.
[0099] Among them, the default theme code is the default theme code set in the program. When rendering a page, if there is no other specified page theme, the page will be rendered according to the default theme code. The required theme code is the theme code required by the user. The default theme code in the theme configuration file is modified to the required theme code in the theme customization requirement. In this way, when the page is rendered, the required theme code can be rendered as the default theme code to achieve the theme configuration of the switching page.
[0100] Step 402: If the required subject code is a newly added subject code, a first mapping relationship between the required subject code and the subject configuration is added to the subject configuration file.
[0101] The theme configuration includes style value variables corresponding to the required theme code. Optionally, in the original page program, a css (Cascading Style Sheets) variable can be set for each theme-related style value, and a less variable can be mapped to each css variable. Less is a high-level language for Css. Different theme configurations correspond to different style value variable values. The theme configuration corresponds to the theme code one by one. By obtaining the theme code, the corresponding theme configuration can be determined. According to the theme configuration, the corresponding style value variables css variables and less variables can be initialized, so that different themes can be implemented.
[0102] Optionally, a new theme code is added, that is, the theme code and the mapping relationship between the theme code and the theme configuration did not exist before in the configuration file. Therefore, in order to implement the required theme code, a first mapping relationship between the required theme code and the theme configuration can be added to the theme configuration file. When the page is rendered, the corresponding theme configuration can be determined according to the required theme code and the first mapping relationship, and the variables are initialized according to the theme configuration to display the corresponding theme.
[0103] In the above embodiment, the default theme configuration during page rendering can be modified by modifying the default theme code in the theme configuration file. At the same time, for newly added theme codes, the theme style can be increased by adding a first mapping relationship between the theme code and the theme configuration without modifying the original page code, making the implementation of theme customization requirements more flexible.
[0104] In an embodiment of the present application, if the layout of the page needs to be customized, the page customization requirement information includes layout customization requirement information. The above step 202 modifies the configuration file in the original page program according to the page customization requirement information. The step of obtaining the target configuration file is shown in FIG. 5 and may include:
[0105] Step 501: Obtain a layout configuration file from a plurality of configuration files included in the original page program.
[0106] The layout configuration file may be a configuration file used to configure the page layout in the original page program. Optionally, the original page program may include multiple configuration files, and the layout configuration file used to configure the layout may be obtained according to the name or type of the configuration file.
[0107] Step 502: modify the layout configuration file according to the layout customization requirement information to obtain a target layout configuration file.
[0108] Optionally, the layout customization requirement information may include the layout code corresponding to the layout required by the user, and may also include the layout component corresponding to the layout code required by the user. The layout configuration file in the original page program is modified, and a target layout configuration file is obtained according to the modified configuration file, and the target configuration file can be saved to a folder in a product directory or a project directory corresponding to the page customization requirement.
[0109] In this embodiment, a target layout configuration file is obtained by acquiring a layout configuration file and modifying the layout configuration file according to the layout customization requirement information.
[0110] Optionally, the layout configuration file includes a default layout code. Optionally, the layout configuration file may also include a mapping relationship between different layout codes and layout components. The above step 502 modifies the layout configuration file according to the layout customization requirement information to obtain a target layout configuration file as shown in FIG. 6, including:
[0111] Step 601: modify the default layout code in the layout configuration file according to the required layout code in the layout customization requirement information.
[0112] Among them, the default layout code is the default layout code set in the program. When the page is rendered, if there is no other specified page layout, the page is rendered according to the default layout code. The required layout code is the layout code required by the user. The default layout code in the layout configuration file is modified to the required layout code in the layout customization requirement. In this way, when the page is rendered, the required layout code can be rendered as the default layout code to achieve the layout configuration of the switching page.
[0113] Step 602: If the required layout code is a newly added layout code, a second mapping relationship between the required layout code and the layout component is added to the layout configuration file.
[0114] Optionally, the layout configuration file may include multiple sets of mapping relationships between layout codes and layout components. If the required layout code is a newly added theme code, that is, the mapping relationship between the layout code and the layout component did not exist in the layout configuration file before, therefore, in order to implement the required layout code, a second mapping relationship between the required layout code and the layout component may be added to the layout configuration file. When the page is rendered, the corresponding layout configuration may be determined based on the required layout code and the second mapping relationship, thereby displaying the corresponding layout.
[0115] In the above embodiment, the default layout configuration during page rendering can be modified by modifying the default layout code in the layout configuration file. At the same time, for the newly added layout code, by adding a second mapping relationship between the layout code and the layout component, the new layout can be added without modifying the original page code. The implementation of layout customization requirements is more flexible and can meet different customization requirements.
[0116] Optionally, there can be only one configuration file in the original page program, which can be used for both theme configuration and layout configuration.
[0117] In one embodiment, in order to realize the page customization requirement, the original page program is compiled according to the target configuration file corresponding to the page customization requirement, as shown in FIG7 , including:
[0118] Step 701, receiving a compile command.
[0119] The compilation command includes a compilation parameter, and the compilation parameter is used to indicate a storage location for storing a target configuration file. Optionally, the compilation parameter may include at least one of a product number parameter and a project number parameter. The product number parameter may correspond to different products, and the project number parameter may correspond to different projects. Different products or different projects may have different page customization requirements. The folder of the product number parameter may include a target configuration file for page customization requirements corresponding to the product, and the folder of the project number parameter may include a target configuration file for page customization requirements corresponding to the project.
[0120] Step 702: read the target configuration file from the storage location indicated by the compilation parameter.
[0121] Optionally, if the compilation parameters only include the product number parameter, the target configuration file for page customization requirements is searched in the product folder corresponding to the product number parameter, and if so, the target configuration file is obtained. If the compilation parameters only include the project number parameter, the target configuration file for page customization requirements is searched in the project folder corresponding to the project number parameter, and if so, the target configuration file is obtained. If the compilation parameters include the product number parameter and the project number parameter, and the target configuration files exist in both the product folder corresponding to the product number parameter and the project folder corresponding to the project code parameter, the target configuration file in the project folder is obtained.
[0122] Step 703, execute the compilation process in response to the compilation command, and in the dependency collection phase of the compilation process, generate a dependency tree based on the target configuration file, and execute the subsequent compilation phase of the compilation process according to the dependency tree.
[0123] Optionally, the general compilation process is shown in Figure 8, including the compilation command acquisition stage, the code analysis stage, the dependency collection stage, the dependency tree formation stage, and the module compilation and file generation stage according to the dependency tree. In order to generate a program that meets the page customization requirements, in the dependency collection stage, as shown in Figure 9, the configuration file of the AST dependency tree is replaced according to the target configuration file obtained in the previous step, and then the dependency tree is generated based on the target configuration file, and the module compilation and file generation are performed according to the dependency book. Therefore, there is no need to overwrite the configuration file in the original page program, so that the original page program is not modified. Through different compilation commands, programs that meet different page customization requirements can be generated.
[0124] In the above embodiment, in the dependency collection process of the compilation flow, by obtaining the target configuration file, hot replacing the configuration file in the original page program based on the target configuration file to generate a dependency tree without directly overwriting the original page program, it is possible to generate a page customization program that meets different page customization requirements according to different compilation commands, thereby meeting the diverse needs of customization requirements.
[0125] In one embodiment, after the above customized page program is generated, it can meet the user's page customization requirements, including dynamic theme requirements and dynamic layout requirements. The specific implementation method is shown in Figure 10, including:
[0126] Step 1001, after detecting the page display instruction, call the customized page program.
[0127] The page display instruction may be sent by a user, or may be sent by other terminals or servers. After receiving the page display instruction, the customized page program is called to run, thereby displaying the customized page.
[0128] Step 1002, in the initialization process of the customized page program, page rendering is performed according to the target configuration file to generate a page that meets the page customization requirements.
[0129] Among them, in the initialization process of the customized page program, the theme display and layout display can be performed according to the default theme code and default layout code in the target configuration file to generate a page that meets the page customization requirements. Optionally, the theme configuration and layout configuration can be configured in one target configuration file or in different target configuration files.
[0130] In the above embodiment, different customization requirements of the page are realized through the target configuration file, which is convenient to implement and has better scalability and maintainability.
[0131] In one embodiment, the target configuration file includes a target theme configuration file. In the initialization process of the customized page program, page rendering is performed according to the target configuration file, as shown in FIG. 11 , including:
[0132] Step 1101, obtain the historical subject code.
[0133] The historical theme code may be the last used theme code stored in the local client. During the theme initialization process, the stored historical theme code will be searched for in the local storage space first.
[0134] Step 1102: If a historical theme code exists, use the historical theme code as the target theme code.
[0135] Optionally, if a historical theme code is found, the historical theme code can be used as a target theme code to render the page according to the target theme code, that is, the theme displayed on the current page is the same as the previous theme.
[0136] Step 1103: If there is no historical theme code, the default theme code in the target theme configuration file is used as the target theme code.
[0137] Optionally, if the historical theme code cannot be found, the target theme code is determined based on the default theme code configured in the target theme configuration file, so that the page is rendered according to the target theme code, and the current page display theme is set to the set default theme code, thereby modifying the page display theme according to the target configuration file.
[0138] Step 1104, rendering the page according to the theme configuration corresponding to the target theme code.
[0139] According to the target theme code determined above, query the mapping relationship between the theme code and the theme configuration, determine the theme configuration corresponding to the target theme code, initialize variables according to the theme configuration, such as css variables and less variables, set the style sheet according to the less variables, and display the page theme.
[0140] In the above embodiment, the target theme code is determined in the initialization process of the page, and then the page theme is rendered according to the target theme code to achieve customization of theme requirements. At the same time, the correspondence between multiple theme codes and theme configurations can be saved through a mapping relationship, and multiple themes can coexist. Without modifying the original page code, multiple themes can be achieved by increasing the relationship between theme codes and theme configurations, and the program is more maintainable and scalable.
[0141] In one embodiment, the user can switch the page theme by manually inputting the theme switching requirement. The method also includes: if the user's theme switching requirement is received, the historical theme code is updated according to the theme code in the theme switching requirement, and the initialization process of the customized page program is triggered.
[0142] Among them, the user's demand for switching themes may include the theme code of the theme that the user wants to switch to. The demand for switching themes may be input by the user through the page. The historical theme code saved by the client is updated according to the theme code in the demand for switching themes, and then the initialization process is triggered. In the initialization process, the target theme code is obtained, the theme configuration corresponding to the target theme code is determined, and then the page is rendered according to the theme configuration to switch to the theme the user wants to switch to.
[0143] In this embodiment, the theme switching can be implemented according to the theme switching requirement input by the user, and the implementation of the page customization requirement is more flexible, satisfying the user's page customization requirement.
[0144] In the embodiment of the present application, please refer to Figure 12, which is a schematic diagram for implementing the theme customization requirements. During the preprocessing process, the theme-related style values are preset as css variables, and each css variable is mapped to a less variable to save the mapping relationship between each theme configuration and the theme code. In the initialization process, the target theme code is determined, the theme configuration is determined according to the mapping relationship, and then the css variables and less variables are initialized for page display. In the manual switching process, the target theme code is updated according to the input switching theme requirements, and then the initialization process is triggered to switch to the required theme. Optionally, the target configuration file may also include a switch for the theme switching function, and the switch can be used to configure whether theme switching is allowed.
[0145] In one embodiment, the target configuration file includes a target layout configuration file. In the initialization process of the customized page program, the steps of rendering the page according to the target configuration file are shown in FIG. 13 and include:
[0146] Step 1301, obtaining the historical layout code.
[0147] The historical layout code may be a layout code stored in a local client. During the layout initialization process, the stored historical layout code will be searched for preferentially in the local storage space.
[0148] Step 1302: If there is a historical layout code, use the historical layout code as the target layout code.
[0149] Optionally, if a historical layout code is found, the historical layout code can be used as the target layout code.
[0150] Step 1303: If there is no historical layout code, the default layout code in the target layout configuration file is used as the target layout code.
[0151] Optionally, if the historical layout code cannot be found, the target layout code is determined according to the default layout code configured in the target layout configuration file, so that the page is rendered according to the target layout code, and the current page display layout is set to the set default layout code, thereby modifying the display layout of the page according to the target configuration file.
[0152] Step 1304: Render the page according to the layout component corresponding to the target layout code.
[0153] Optionally, after determining the target layout code, the global state of the layout code is updated according to the target layout code, and then the mapping relationship between the layout code and the layout component can be queried according to the layout code saved in the global state, and the layout rendering is performed according to the layout component.
[0154] In the above embodiment, by obtaining the target layout code and determining the layout component corresponding to the target layout code for layout display, multiple layouts can be implemented through the target configuration file without changing the original page program, and the maintenance difficulty and cost of the program are relatively low.
[0155] Optionally, if a user's layout switching requirement is received, the target layout code is updated according to the layout code in the layout switching requirement, so as to render the page according to the layout component corresponding to the target layout code.
[0156] Among them, the user's layout switching demand may include the layout code of the layout that the user wants to switch. The layout switching demand may be input by the user through the page. According to the layout code in the layout switching demand, the historical layout code saved by the client and the layout code saved in the global state are updated, and then the page is rendered according to the layout component corresponding to the layout code saved in the global state to switch to the layout that the user wants to switch.
[0157] In this embodiment, layout switching can be implemented according to the layout switching requirements input by the user, and the implementation of page customization requirements is more flexible, satisfying the page customization requirements of the user.
[0158] In an embodiment of the present application, please refer to Figure 13, which is a schematic diagram for implementing layout customization requirements. In the preprocessing stage in the figure, four page layout schemes can be preset, each layout scheme includes a corresponding layout component, and a mapping relationship between the layout component and the layout code is established. In the initialization stage, the target layout code is obtained, and the global state of the layout code is updated according to the target layout code, and then the corresponding layout component is determined according to the mapping relationship, and the page is rendered according to the layout component. During the manual switching process, the target layout code is updated according to the input switching layout requirements, as well as the layout code saved in the global state. Therefore, there is no need to trigger the initialization process, and the layout component can be determined according to the layout code saved in the global state to perform page rendering. Optionally, the target configuration file may also include a switch for the layout switching function, and the switch can be used to configure whether layout switching is allowed.
[0159] In an embodiment of the present application, a method for implementing page customization requirements is provided, as shown in FIG15 , including:
[0160] Step 1501, obtaining page customization requirement information.
[0161] Step 1502: modify the configuration file in the original page program according to the page customization requirement information to obtain a target configuration file.
[0162] Step 1503, receiving a compile command.
[0163] Step 1504, read the target configuration file from the storage location indicated by the compilation parameter.
[0164] Step 1505, execute the compilation process in response to the compilation command, and in the dependency collection stage of the compilation process, generate a dependency tree based on the target configuration file, and execute the subsequent compilation stage of the compilation process according to the dependency tree to obtain the customized page program.
[0165] Step 1506, after detecting the page display instruction, call the customized page program.
[0166] Step 1507, in the initialization process of the customized page program, page rendering is performed according to the target configuration file to generate a page that meets the page customization requirements.
[0167] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0168] Based on the same inventive concept, the embodiment of the present application also provides a device for realizing page customization requirements for realizing the method for realizing page customization requirements involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the method above, so the specific limitations in the one or more embodiments of the device for realizing page customization requirements provided below can refer to the limitations of the method for realizing page customization requirements above, and will not be repeated here.
[0169] In an exemplary embodiment, as shown in FIG. 16 , a device 1600 for implementing page customization requirements is provided, comprising: an acquisition module 1601 , a modification module 1602 , and a compilation module 1603 , wherein:
[0170] The acquisition module 1601 is used to acquire page customization requirement information;
[0171] The modification module 1602 is used to modify the configuration file in the original page program according to the page customization requirement information to obtain a target configuration file;
[0172] The compiling module 1603 is used to compile the original page program based on the target configuration file to obtain a customized page program, where the customized page program is a page program that can realize page customization requirements.
[0173] In one embodiment, the page customization requirement information includes theme customization requirement information, and the modification module 1602 is specifically used to obtain a theme configuration file from multiple configuration files included in the original page program; modify the theme configuration file according to the theme customization requirement information to obtain a target theme configuration file.
[0174] In one embodiment, the theme configuration file includes a default theme code, and the change module 1602 is specifically used to change the default theme code in the theme configuration file according to the required theme code in the theme customization requirement information; if the required theme code is a new theme code, a first mapping relationship between the required theme code and the theme configuration is added to the theme configuration file, and the theme configuration includes a style value variable corresponding to the required theme code.
[0175] In one embodiment, the page customization requirement information includes layout customization requirement information, and the modification module 1602 is specifically used to obtain a layout configuration file from multiple configuration files included in the original page program; modify the layout configuration file according to the layout customization requirement information to obtain a target layout configuration file.
[0176] In one of the embodiments, the layout configuration file includes a default layout code, and the change module 1602 is specifically used to change the default layout code in the layout configuration file according to the required layout code in the layout customization requirement information; if the required layout code is a newly added layout code, a second mapping relationship between the required layout code and the layout component is added to the layout configuration file.
[0177] In one embodiment, the compilation module 1603 is specifically used to receive a compilation command, the compilation command includes compilation parameters, and the compilation parameters are used to indicate a storage location of a target configuration file; read the target configuration file in the storage location indicated by the compilation parameters; respond to the compilation command to execute the compilation process, and in the dependency collection stage of the compilation process, generate a dependency tree based on the target configuration file, and execute subsequent compilation stages of the compilation process according to the dependency tree.
[0178] In one of the embodiments, the device also includes a rendering module, which is used to call a customized page program after detecting a page display instruction; in the initialization process of the customized page program, the page is rendered according to the target configuration file to generate a page that meets the page customization requirements.
[0179] In one of the embodiments, the target configuration file includes a target theme configuration file, and the rendering module is specifically used to obtain a historical theme code; if a historical theme code exists, the historical theme code is used as the target theme code; if a historical theme code does not exist, the default theme code in the target theme configuration file is used as the target theme code; and the page is rendered according to the theme configuration corresponding to the target theme code.
[0180] In one of the embodiments, the device further includes a first updating module, which is used to update the historical theme code according to the theme code in the theme switching requirement upon receiving the user's theme switching requirement, and trigger the initialization process of the customized page program.
[0181] In one of the embodiments, the target configuration file includes a target layout configuration file, and the rendering module is specifically used to obtain a historical layout code; if a historical layout code exists, the historical layout code is used as the target layout code; if a historical layout code does not exist, the default layout code in the target layout configuration file is used as the target layout code; and the page is rendered according to the layout component corresponding to the target layout code.
[0182] In one of the embodiments, the device further includes a second updating module, which is used to update the target layout code according to the layout code in the layout switching requirement if a user's layout switching requirement is received, so as to render the page according to the layout component corresponding to the target layout code.
[0183] Each module in the above-mentioned page customization demand realization device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0184] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG17. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for implementing page customization requirements is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0185] Those skilled in the art will understand that the structure shown in FIG. 17 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0186] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: obtaining page customization requirement information; modifying a configuration file in an original page program according to the page customization requirement information to obtain a target configuration file; and compiling the original page program based on the target configuration file to obtain a customized page program, wherein the customized page program is a page program that can realize page customization requirements.
[0187] In one embodiment, the page customization requirement information includes theme customization requirement information, and the processor further implements the following steps when executing the computer program: obtaining a theme configuration file from multiple configuration files included in the original page program; and modifying the theme configuration file according to the theme customization requirement information to obtain a target theme configuration file.
[0188] In one embodiment, the theme configuration file includes a default theme code, and the processor also implements the following steps when executing the computer program: according to the required theme code in the theme customization requirement information, the default theme code in the theme configuration file is changed; if the required theme code is a new theme code, a first mapping relationship between the required theme code and the theme configuration is added to the theme configuration file, and the theme configuration includes a style value variable corresponding to the required theme code.
[0189] In one embodiment, the page customization requirement information includes layout customization requirement information, and the processor further implements the following steps when executing the computer program: obtaining a layout configuration file from multiple configuration files included in the original page program; and modifying the layout configuration file according to the layout customization requirement information to obtain a target layout configuration file.
[0190] In one embodiment, the layout configuration file includes a default layout code, and the processor further implements the following steps when executing the computer program: according to the required layout code in the layout customization requirement information, the default layout code in the layout configuration file is changed; if the required layout code is a newly added layout code, a second mapping relationship between the required layout code and the layout component is added to the layout configuration file.
[0191] In one embodiment, when the processor executes the computer program, the processor also implements the following steps: receiving a compilation command, the compilation command includes a compilation parameter, and the compilation parameter is used to indicate a storage location for storing a target configuration file; reading the target configuration file in the storage location indicated by the compilation parameter; executing a compilation process in response to the compilation command, and in the dependency collection phase of the compilation process, generating a dependency tree based on the target configuration file, and executing subsequent compilation phases of the compilation process according to the dependency tree.
[0192] In one embodiment, when the processor executes the computer program, the following steps are also implemented: after detecting the page display instruction, calling the customized page program; in the initialization process of the customized page program, rendering the page according to the target configuration file to generate a page that meets the page customization requirements.
[0193] In one embodiment, the target configuration file includes a target theme configuration file, and the processor also implements the following steps when executing the computer program: obtaining a historical theme code; if a historical theme code exists, using the historical theme code as the target theme code; if a historical theme code does not exist, using the default theme code in the target theme configuration file as the target theme code; and rendering the page according to the theme configuration corresponding to the target theme code.
[0194] In one embodiment, when executing the computer program, the processor further implements the following steps: if a user's request to switch themes is received, the historical theme code is updated according to the theme code in the request to switch themes, and the initialization process of the customized page program is triggered.
[0195] In one embodiment, the target configuration file includes a target layout configuration file, and the processor further implements the following steps when executing the computer program: obtaining a historical layout code; if a historical layout code exists, using the historical layout code as the target layout code; if a historical layout code does not exist, using the default layout code in the target layout configuration file as the target layout code; and rendering the page according to the layout component corresponding to the target layout code.
[0196] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if a user's switching layout requirement is received, the target layout code is updated according to the layout code in the switching layout requirement, so as to render the page according to the layout component corresponding to the target layout code.
[0197] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining page customization requirement information; modifying a configuration file in an original page program according to the page customization requirement information to obtain a target configuration file; compiling the original page program based on the target configuration file to obtain a customized page program, wherein the customized page program is a page program that can realize page customization requirements.
[0198] In one embodiment, the page customization requirement information includes theme customization requirement information, and the computer program, when executed by the processor, also implements the following steps: obtaining a theme configuration file from multiple configuration files included in the original page program; modifying the theme configuration file according to the theme customization requirement information to obtain a target theme configuration file.
[0199] In one embodiment, the theme configuration file includes a default theme code, and the computer program, when executed by a processor, also implements the following steps: according to the required theme code in the theme customization requirement information, the default theme code in the theme configuration file is changed; if the required theme code is a new theme code, a first mapping relationship between the required theme code and the theme configuration is added to the theme configuration file, and the theme configuration includes a style value variable corresponding to the required theme code.
[0200] In one embodiment, the page customization requirement information includes layout customization requirement information, and when the computer program is executed by the processor, the following steps are also implemented: obtaining a layout configuration file from multiple configuration files included in the original page program; modifying the layout configuration file according to the layout customization requirement information to obtain a target layout configuration file.
[0201] In one embodiment, the layout configuration file includes a default layout code, and the computer program, when executed by the processor, further implements the following steps: according to the required layout code in the layout customization requirement information, the default layout code in the layout configuration file is changed; if the required layout code is a newly added layout code, a second mapping relationship between the required layout code and the layout component is added to the layout configuration file.
[0202] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: receiving a compilation command, the compilation command includes a compilation parameter, and the compilation parameter is used to indicate a storage location for storing a target configuration file; reading the target configuration file in the storage location indicated by the compilation parameter; executing a compilation process in response to the compilation command, and in the dependency collection phase of the compilation process, generating a dependency tree based on the target configuration file, and executing subsequent compilation phases of the compilation process according to the dependency tree.
[0203] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: after detecting the page display instruction, calling the customized page program; in the initialization process of the customized page program, rendering the page according to the target configuration file to generate a page that meets the page customization requirements.
[0204] In one embodiment, the target configuration file includes a target theme configuration file, and the computer program, when executed by the processor, also implements the following steps: obtaining a historical theme code; if a historical theme code exists, using the historical theme code as the target theme code; if a historical theme code does not exist, using the default theme code in the target theme configuration file as the target theme code; and rendering the page according to the theme configuration corresponding to the target theme code.
[0205] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if a user's request to switch themes is received, the historical theme code is updated according to the theme code in the request to switch themes, and the initialization process of the customized page program is triggered.
[0206] In one embodiment, the target configuration file includes a target layout configuration file, and the computer program, when executed by the processor, further implements the following steps: obtaining a historical layout code; if a historical layout code exists, using the historical layout code as the target layout code; if a historical layout code does not exist, using the default layout code in the target layout configuration file as the target layout code; and rendering the page according to the layout component corresponding to the target layout code.
[0207] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if a user's layout switching requirement is received, the target layout code is updated according to the layout code in the layout switching requirement, so as to render the page according to the layout component corresponding to the target layout code.
[0208] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps: obtaining page customization requirement information; modifying a configuration file in an original page program according to the page customization requirement information to obtain a target configuration file; and compiling the original page program based on the target configuration file to obtain a customized page program, wherein the customized page program is a page program that can realize page customization requirements.
[0209] In one embodiment, the page customization requirement information includes theme customization requirement information, and the computer program, when executed by the processor, also implements the following steps: obtaining a theme configuration file from multiple configuration files included in the original page program; modifying the theme configuration file according to the theme customization requirement information to obtain a target theme configuration file.
[0210] In one embodiment, the theme configuration file includes a default theme code, and the computer program, when executed by a processor, also implements the following steps: according to the required theme code in the theme customization requirement information, the default theme code in the theme configuration file is changed; if the required theme code is a new theme code, a first mapping relationship between the required theme code and the theme configuration is added to the theme configuration file, and the theme configuration includes a style value variable corresponding to the required theme code.
[0211] In one embodiment, the page customization requirement information includes layout customization requirement information, and when the computer program is executed by the processor, the following steps are also implemented: obtaining a layout configuration file from multiple configuration files included in the original page program; modifying the layout configuration file according to the layout customization requirement information to obtain a target layout configuration file.
[0212] In one embodiment, the layout configuration file includes a default layout code, and the computer program, when executed by the processor, further implements the following steps: according to the required layout code in the layout customization requirement information, the default layout code in the layout configuration file is changed; if the required layout code is a newly added layout code, a second mapping relationship between the required layout code and the layout component is added to the layout configuration file.
[0213] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: receiving a compilation command, the compilation command includes a compilation parameter, and the compilation parameter is used to indicate a storage location for storing a target configuration file; reading the target configuration file in the storage location indicated by the compilation parameter; executing a compilation process in response to the compilation command, and in the dependency collection phase of the compilation process, generating a dependency tree based on the target configuration file, and executing subsequent compilation phases of the compilation process according to the dependency tree.
[0214] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: after detecting the page display instruction, calling the customized page program; in the initialization process of the customized page program, rendering the page according to the target configuration file to generate a page that meets the page customization requirements.
[0215] In one embodiment, the target configuration file includes a target theme configuration file, and the computer program, when executed by the processor, also implements the following steps: obtaining a historical theme code; if a historical theme code exists, using the historical theme code as the target theme code; if a historical theme code does not exist, using the default theme code in the target theme configuration file as the target theme code; and rendering the page according to the theme configuration corresponding to the target theme code.
[0216] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if a user's request to switch themes is received, the historical theme code is updated according to the theme code in the request to switch themes, and the initialization process of the customized page program is triggered.
[0217] In one embodiment, the target configuration file includes a target layout configuration file, and the computer program, when executed by the processor, further implements the following steps: obtaining a historical layout code; if a historical layout code exists, using the historical layout code as the target layout code; if a historical layout code does not exist, using the default layout code in the target layout configuration file as the target layout code; and rendering the page according to the layout component corresponding to the target layout code.
[0218] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if a user's layout switching requirement is received, the target layout code is updated according to the layout code in the layout switching requirement, so as to render the page according to the layout component corresponding to the target layout code.
[0219] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0220] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0221] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for implementing page customization requirements, characterized in that: The method comprises: Get page customization requirement information; Modify the configuration file in the original page program according to the page customization requirement information to obtain a target configuration file; The original page program is compiled based on the target configuration file to obtain a customized page program, where the customized page program is a page program that can realize page customization requirements.
2. The method according to claim 1, characterized in that: The page customization requirement information includes theme customization requirement information, and the configuration file in the original page program is modified according to the page customization requirement information to obtain the target configuration file, including: Acquire a theme configuration file from a plurality of configuration files included in the original page program; Modify the theme configuration file according to the theme customization requirement information to obtain a target theme configuration file; The theme configuration file includes a default theme code, and the theme configuration file is modified according to the theme customization requirement information to obtain a target theme configuration file, including: According to the required theme code in the theme customization requirement information, the default theme code in the theme configuration file is changed; If the required theme code is a newly added theme code, a first mapping relationship between the required theme code and theme configuration is added to the theme configuration file, and the theme configuration includes a style value variable corresponding to the required theme code.
3. The method according to claim 1, characterized in that: The page customization requirement information includes layout customization requirement information, and the configuration file in the original page program is modified according to the page customization requirement information to obtain a target configuration file, including: Acquire a layout configuration file from a plurality of configuration files included in the original page program; Modify the layout configuration file according to the layout customization requirement information to obtain a target layout configuration file; The layout configuration file includes a default layout code, and the layout configuration file is modified according to the layout customization requirement information to obtain a target layout configuration file, including: According to the required layout code in the layout customization requirement information, the default layout code in the layout configuration file is changed; If the required layout code is a newly added layout code, a second mapping relationship between the required layout code and the layout component is added to the layout configuration file.
4. The method according to any one of claims 1 to 3, characterized in that: The compiling process of the original page program based on the target configuration file includes: receiving a compile command, wherein the compile command includes a compile parameter, and the compile parameter is used to indicate a storage location for storing the target configuration file; Reading the target configuration file from the storage location indicated by the compilation parameter; In response to the compilation command, a compilation process is executed, and in the dependency collection phase of the compilation process, a dependency tree is generated based on the target configuration file, and subsequent compilation phases of the compilation process are executed according to the dependency tree.
5. The method according to claim 1, characterized in that The method further comprises: After detecting the page display instruction, calling the customized page program; In the initialization process of the customized page program, page rendering is performed according to the target configuration file to generate a page that meets the page customization requirements.
6. The method according to claim 5, characterized in that The method further comprises: The target configuration file includes a target theme configuration file. In the initialization process of the customized page program, page rendering is performed according to the target configuration file, including: Obtain historical subject codes; If the historical subject code exists, use the historical subject code as the target subject code; If the historical theme code does not exist, the default theme code in the target theme configuration file is used as the target theme code; Rendering a page according to the theme configuration corresponding to the target theme code; The target configuration file includes a target layout configuration file. In the initialization process of the customized page program, page rendering is performed according to the target configuration file, including: Get the historical layout code; If the historical layout code exists, use the historical layout code as the target layout code; If the historical layout code does not exist, using the default layout code in the target layout configuration file as the target layout code; The page is rendered according to the layout component corresponding to the target layout code.
7. A device for realizing page customization requirements, characterized in that: The device comprises: Acquisition module, used to obtain page customization requirement information; A modification module, used for modifying the configuration file in the original page program according to the page customization requirement information to obtain a target configuration file; The compiling module is used to compile the original page program based on the target configuration file to obtain a customized page program, where the customized page program is a page program that can realize page customization requirements.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.