Page generation method, device, server and storage medium
By predefined component attribute information and component-associated storage, mapping relationships are established, and front-end pages are generated, the problems of inefficient front-end page development and long online cycle in the existing technology are solved, and a more efficient page development and online process is achieved.
Patent Information
- Application Number
- CN202010228830.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-27
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2040-03-27
AI Technical Summary
In the existing technology, front-end page development is inefficient and the online cycle is long, which cannot meet diversified needs.
The attribute information of predefined components is stored in association with the component, a mapping relationship is established, the target component is obtained according to the page generation instructions, the target attribute information and configuration information are determined, and the target source code file generation page is loaded and executed.
Improve the efficiency of front-end page development and shorten the page online cycle.
Smart Images

Figure CN111475162B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a page generation method, device, server and storage medium. Background Art
[0002] With the rapid development of Internet technology and the widespread application of various front-end pages, higher requirements are put forward for front-end pages, such as significant interactive effects and powerful page functions. At present, front-end pages are mainly generated through page production systems such as Sohu Quick Station and Tencent Wind Bell. However, with the continuous development of enterprises, page production systems can no longer meet diversified needs. If different pages are developed for different needs, the development efficiency of front-end pages will be low and the online cycle will be long. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a page generation method, device, server and storage medium to solve the problems of low front-end page development efficiency and long online cycle in the prior art.
[0004] A first aspect of an embodiment of the present application provides a page generation method, including:
[0005] Predefine the attribute information of all components;
[0006] The attribute information is stored in association with the respective corresponding components to obtain a first mapping relationship between the attribute information and the respective corresponding components;
[0007] After detecting the page generation instruction, all target components included in the target page to be generated are obtained according to the target component identification information included in the page generation instruction;
[0008] Determine the target attribute information of all the target components according to the first mapping relationship, where the target attribute information includes basic attribute items and special attribute items;
[0009] Determine the target configuration information corresponding to each of the target components according to the target attribute information;
[0010] The target source code files corresponding to all the target configuration information are loaded and executed to generate the target page.
[0011] In an optional implementation manner, determining the target configuration information corresponding to each of the target components according to the target attribute information includes:
[0012] According to a second mapping relationship between pre-stored attribute information and page configuration information, page configuration information corresponding to the attribute information of all target components included in the target page is determined, and the page configuration information is the target configuration information.
[0013] In an optional implementation, before loading and executing all target source code files corresponding to the target configuration information to generate the target page, the method further includes:
[0014] Traversing a preset first database based on the basic attribute items of each target component to obtain a target component file of each target component, wherein the first database pre-stores a third mapping relationship between the basic attribute items of the component and the component file, and the target component file stores a target component code corresponding to the basic attribute items of each target component;
[0015] Traversing a preset second database based on the special attribute items of each target component to obtain a target logic file of each target component, wherein a fourth mapping relationship between the special attribute items of the component and the logic file is pre-stored in the second database, and a target logic code corresponding to each target component is stored in the target logic file;
[0016] According to the target component files and the target logic files corresponding to each target component, target source code files corresponding to each target component are generated, and the target source code files of each target component correspond to the target configuration information one by one.
[0017] In an optional implementation, traversing a preset first database based on basic attribute items of each target component to obtain a target component file of each target component includes:
[0018] Traversing the first database based on basic attribute items of each target component to determine a first storage address of each target component file;
[0019] The target component file corresponding to the basic attribute item of each target component is obtained from the first database according to the first storage address.
[0020] In an optional implementation, traversing a preset second database based on the special attribute items of each target component to obtain a target logic file of each target component includes:
[0021] Traversing a preset second database based on the special attribute items of each of the target components, determining a second storage address for storing each of the target logic files;
[0022] The target logic file corresponding to the special attribute item of each target component is obtained from the second database according to the second storage address.
[0023] In an optional implementation, the special attribute item includes at least one of event information, function information and control parameter information;
[0024] The target logic file corresponding to the event information stores the event logic code required to trigger the component event;
[0025] The target logic file corresponding to the function information stores the function logic code required to trigger the component function;
[0026] The target logic file corresponding to the control parameter information stores the parameter logic code required for triggering component control parameters.
[0027] In an optional implementation, generating a target source code file corresponding to each target component according to the target component file and the target logic file corresponding to each target component includes:
[0028] The target component file is combined with the target logic file to obtain the target source code file.
[0029] A second aspect of an embodiment of the present application provides a page generation device, including:
[0030] Predefined module, used to predefine the attribute information of all components;
[0031] An obtaining module, used for associating and storing the attribute information with the respective corresponding components, and obtaining a first mapping relationship between the attribute information and the respective corresponding components;
[0032] A first acquisition module is used to acquire all target components included in a target page to be generated according to target component identification information included in the page generation instruction after detecting the page generation instruction;
[0033] A first determining module, configured to determine the target attribute information of all the target components according to the first mapping relationship;
[0034] A second determination module is used to determine the target configuration information corresponding to each of the target components according to the target attribute information;
[0035] The first generating module is used to load and execute the target source code files corresponding to all the target configuration information to generate the target page.
[0036] In an optional implementation, the determining module is specifically configured to:
[0037] According to a second mapping relationship between pre-stored attribute information and page configuration information, page configuration information corresponding to the attribute information of all target components included in the target page is determined, and the page configuration information is the target configuration information.
[0038] In an optional implementation, the method further includes:
[0039] A second acquisition module is used to traverse a preset first database based on the basic attribute items of each target component to acquire a target component file of each target component, wherein the first database pre-stores a third mapping relationship between the basic attribute items of the component and the component file, and the target component file stores a target component code corresponding to the basic attribute items of each target component;
[0040] A third acquisition module is used to traverse a preset second database based on the special attribute items of each target component to acquire a target logic file of each target component, wherein a fourth mapping relationship between the special attribute items of the component and the logic file is pre-stored in the second database, and a target logic code corresponding to each target component is stored in the target logic file;
[0041] The second generation module is used to generate a target source code file corresponding to each target component according to the target component file and the target logic file corresponding to each target component, and each target source code file corresponds to the target configuration information one by one.
[0042] In an optional implementation, the second acquisition module includes:
[0043] A first determining unit, configured to traverse the first database based on basic attribute items of each target component to determine a first storage address of each target component file;
[0044] A first acquisition unit is used to acquire the target component file corresponding to the basic attribute item of each target component from the first database according to the first storage address.
[0045] In an optional implementation, the fourth acquisition module includes:
[0046] A second determining unit, configured to traverse a preset second database based on the special attribute items of each target component to determine a second storage address for storing each target logic file;
[0047] A second acquisition unit is used to acquire the target logic file corresponding to the special attribute item of each target component from the second database according to the second storage address.
[0048] In an optional implementation, the special attribute item includes at least one of event information, function information and control parameter information;
[0049] The target logic file corresponding to the event information stores the event logic code required to trigger the component event;
[0050] The target logic file corresponding to the function information stores the function logic code required to trigger the component function;
[0051] The target logic file corresponding to the control parameter information stores the parameter logic code required for triggering component control parameters.
[0052] In an optional implementation, the second generating module is specifically configured to:
[0053] The target component file is combined with the target logic file to obtain the target source code file.
[0054] A third aspect of an embodiment of the present application provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the page generation method described in the first aspect above when executing the computer program.
[0055] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the page generation method described in the first aspect above are implemented.
[0056] The page generation method provided in the first aspect of the embodiment of the present application has the beneficial effect compared with the prior art that, by associating and storing the attribute information of all predefined components with the components corresponding to each other, a first mapping relationship between the attribute information and the components corresponding to each other is obtained, and all target components included in the target page to be generated are obtained according to the target component identification information included in the page generation instruction; further, after determining the target attribute information of all the target components according to the first mapping relationship, the target source code file corresponding to the target configuration information of each target component determined according to the target attribute information is loaded and executed to generate the target page. It can improve the efficiency of front-end page development and shorten the page online cycle.
[0057] The embodiments provided in the second to fourth aspects of the embodiments of the present application have the same beneficial effects as the embodiments provided in the first aspect of the present application compared with the prior art, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art 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 drawings can be obtained based on these drawings without paying creative labor.
[0059] Figure 1 is a flow chart of the implementation of the page generation method provided in the first embodiment of the present application;
[0060] Figure 2 is a flow chart of the implementation of the page generation method provided in the second embodiment of the present application;
[0061] Figure 3 yes Figure 2 The specific implementation flow chart of S206;
[0062] Figure 4 yes Figure 2 The specific implementation flow chart of S207;
[0063] Figure 5 is a schematic diagram of the structure of a page generating device provided in an embodiment of the present application;
[0064] Figure 6 It is a schematic diagram of the structure of the server provided in the embodiment of the present application. DETAILED DESCRIPTION
[0065] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0066] In order to illustrate the technical solution described in this application, the following is a description through specific embodiments. Figure 1 The figure is a flowchart of the implementation of the page generation method provided in the first embodiment of the present application. This embodiment can be completed by the hardware or software of the page generation device. The page generation device can be a server with data processing functions, such as a server, a signal processing device, etc. The details are as follows:
[0067] S101, predefine attribute information of all components.
[0068] It can be understood that since the attribute information of a component is usually represented by a fixed parameter value, during the component development process, the developer predefines and stores it as needed and it can be reused.
[0069] S102: Store the attribute information in association with the components corresponding to each other, and obtain a first mapping relationship between the attribute information and the components corresponding to each other.
[0070] In this embodiment, the components are represented by component identification information, and the attribute information is stored in association with the components corresponding to the components, that is, the attribute information is stored in association with the component identification information of the components corresponding to the components.
[0071] S103, after detecting the page generation instruction, all target components included in the target page to be generated are acquired according to the target component identification information included in the page generation instruction.
[0072] The page generation instruction can be triggered by a relevant staff member clicking on a pre-configured page generation interface, wherein the pre-configured page generation interface includes components and component identification information of each component; wherein the component identification information can uniquely identify the component. It can be understood that the component identification can be expressed in the form of a string, a number, or a combination of a string and a number, etc.
[0073] It should be noted that components are simple encapsulation of data and methods. Using components can achieve drag-and-drop programming, fast attribute processing, and true object-oriented design.
[0074] In an optional implementation, the components include text components, graphic components, tree components, etc.
[0075] S104: Determine target attribute information obtained by all the target components according to the first mapping relationship, where the target attribute information includes basic attribute items and special attribute items.
[0076] It should be noted that the attribute information of a component includes basic attribute items and special attribute items; wherein the basic attribute items include basic component information such as width, height, color, shadow, font and border style; the special attribute items include event information, function information, and control parameter information.
[0077] Among them, event information includes various types of events, such as change events, click events, etc.; function information can refer to the basic attribute functions of the component itself, such as the display function of the component, the hiding function of the component, etc.; control parameter information can refer to the business function control parameters of the component, for example, the control parameter information is the control parameter for transmitting the content in the input box to the back-end interface, the control parameter corresponding to the input box title, the control parameter whether the input box is required, etc.
[0078] It can be understood that the properties of each component are configurable items, which are usually pre-configured by developers during the target component development process.
[0079] In an optional implementation, a first mapping relationship between components and their corresponding component attribute information is pre-stored; it can be understood that the target attribute information of all the target components can be determined based on the first mapping relationship.
[0080] S105: Determine target configuration information corresponding to each target component according to the target attribute information.
[0081] In this embodiment, in order to make the use of components faster and more convenient, the attribute information of the preset components is associated with the configuration information of the components and stored. After the target attribute information corresponding to the target component is determined, the target configuration information associated with the target attribute information is obtained based on the association relationship between the attribute information of the component and the configuration information of the component.
[0082] As an example but not limitation, S105 includes: determining page configuration information corresponding to the attribute information of all target components included in the target page according to a second mapping relationship between pre-stored attribute information and page configuration information, the page configuration information being the target configuration information.
[0083] As an example but not limitation, the target configuration information includes architecture data of the target component in the target page, and the architecture data is determined by component identification information, target attribute information, and the relationship between the target component and other components.
[0084] S106, loading and executing all target source code files corresponding to the target configuration information to generate the target page.
[0085] In this embodiment, the target source code file may be a loadable code file developed in advance according to the target configuration information, and the target source code file is stored in association with the target configuration information.
[0086] Through the above analysis, it can be seen that the page generation method provided by the embodiment of the present application is:
[0087] By associating and storing the attribute information of all predefined components with their corresponding components, a first mapping relationship between the attribute information and the corresponding components is obtained, and all target components included in the target page to be generated are obtained according to the target component identification information included in the page generation instruction; after further determining the target attribute information of all the target components according to the first mapping relationship, the target source code file corresponding to the target configuration information of each target component determined according to the target attribute information is loaded and executed to generate the target page. The front-end page development efficiency can be improved and the page online cycle can be shortened.
[0088] like Figure 2 FIG. 1 is a flowchart of the implementation of the page generation method provided in the second embodiment of the present application. Figure 2 It can be seen that this embodiment and Figure 1 Compared with the embodiment shown, the specific implementation process of S201 to S205 is the same as S101 to S105, and S209 is the same as S106, except that S206 to S208 are included before S209. It should be noted that S206 and S205 are executed in parallel. The details are as follows:
[0089] S206, traversing a preset first database based on the basic attribute items of each of the target components to obtain a target component file of each of the target components, wherein the first database pre-stores a third mapping relationship between the basic attribute items of the components and the component files, and the target component file stores a target component code corresponding to the basic attribute items of each of the target components.
[0090] It should be noted that since the configuration information of the component is usually expressed in JSON format, and the JSON format cannot carry code files, the attribute information of the component cannot be fully displayed in the configuration information. This embodiment realizes the rapid acquisition of the target component file of the target component by pre-storing the third mapping relationship between the basic attribute items of the component and the component file in the preset first database.
[0091] As an example but not limitation, the first database is used to store component identification information and component files in association with each other to form the third mapping relationship; wherein the component files store component codes.
[0092] It should be noted that the type of the first database is not specifically limited, and it can be a database of various frameworks.
[0093] Specifically, Figure 3 As shown, Figure 2 The specific implementation flow chart of S206 is as follows: Figure 3 It can be seen that S206 includes S2061 to S2062, which are described in detail as follows:
[0094] S2061: traverse the first database based on basic attribute items of each target component to determine a first storage address of each target component file.
[0095] It can be understood that the mapping relationship between the basic attribute items of the component and the component files can specifically be a mapping relationship between the basic attribute items of the component and the storage address of the corresponding component files in the first database. Therefore, according to the third mapping relationship, the first storage address corresponding to the component file corresponding to the basic attribute items of the component can be determined, and then, the component file corresponding to the basic attribute items of the component can be obtained according to the first storage address.
[0096] S2062: Obtain the target component file corresponding to each target component from the first database according to the first storage address.
[0097] It can be understood that loading and executing the target component code in the target component file can display the basic attribute items of the target component on the target page. Through the above analysis, it can be seen that this embodiment can solve the inconvenience caused by the inability of component configuration information to carry code files by associating the component file storing the component code with the basic attribute items of the component in the preset first database, thereby improving the reuse of component code and improving component development efficiency.
[0098] S207, traverse the preset second database based on the target attribute information of each target component to obtain the target logic file of each target component, the second database pre-stores a fourth mapping relationship between attribute information and logic files, and the target logic file stores the target logic code corresponding to the target component.
[0099] When the attribute information of a component involves special attribute items of the component, such as event information, since the configuration information corresponding to the event information of the component needs to configure the event logic code executed after the specific event is triggered, and since the configuration information of the component is usually in JSON format, the configuration information in JSON format cannot carry code files, therefore, the executed event logic code cannot be directly written in the configuration information in JSON format. Based on this, a second database is preset in this embodiment. The second database stores a fourth mapping relationship between the special attribute items of the component and the logic file of the component, and the logic file of the component stores the logic code of the component.
[0100] Specifically, Figure 4 As shown, Figure 2 The specific implementation flow chart of S207 is shown in FIG. Figure 4 It can be seen that S207 includes S2071 to S2072, which are described in detail as follows:
[0101] S2071: traverse the second database based on the target attribute information corresponding to each of the target components to determine a second storage address for storing each of the target logical files.
[0102] It should be noted that the correspondence between the special attribute items of the component and the logic code pre-stored in the second database may include the correspondence between the special attribute items of the component and the second storage address of the logic code in the second database. In this way, the second storage address of the target logic file required to trigger the event of the component can be determined from the second database based on the special attribute items of the component, and then, the target logic file required to trigger the special attribute items of the target component can be obtained based on the address.
[0103] S2072: Obtain a target logic file corresponding to each target component from the second database according to the second storage address.
[0104] As an example but not limitation, assuming that the special attribute item is event information, the corresponding target logic file in the second database stores the event logic code required to trigger the event information of the target component;
[0105] Assuming that the special attribute item is function information, the corresponding target logic file in the second database stores the function logic code required to trigger the function information of the target component;
[0106] Assuming that the special attribute item is control parameter information, the corresponding target logic file in the second database stores the parameter logic code required to trigger the control parameter information of the target component.
[0107] It can be understood that loading and executing the target logic code in the target logic file can display the special attribute items of the target component on the target page.
[0108] From the above analysis, it can be seen that this embodiment can solve the inconvenience caused by the inability of component configuration information to carry code files by associating the logic files storing logic codes with the special attribute items of the components in a preset second database, thereby improving the reuse of component codes and improving component development efficiency.
[0109] S208, generating a target source code file corresponding to each target component according to the target component file and the target logic file corresponding to each target component, wherein the code file of each target component corresponds to the target configuration information one by one.
[0110] It can be understood that the target component file stores component codes corresponding to basic attribute items of the target component, and the target logic file stores logic codes required to trigger special attribute items of the target component. The target component file is combined with the target logic file to obtain the target source code file. By loading and executing the target source code file, the complete target attribute information corresponding to the target component can be displayed on the target page.
[0111] Figure 5 Schematic diagram of the structure of the page generation device provided in the embodiment of the present application. Figure 5 It can be seen that the page generating device 5 provided in this embodiment includes:
[0112] A pre-definition module 501 is used to pre-define the attribute information of all components;
[0113] An obtaining module 502 is used to associate and store the attribute information with the components corresponding to each other, and obtain a first mapping relationship between the attribute information and the components corresponding to each other;
[0114] A first acquisition module 503 is used to acquire all target components included in a target page to be generated according to target component identification information included in the page generation instruction after detecting the page generation instruction;
[0115] A first determining module 504, configured to determine the target attribute information of all the target components according to the first mapping relationship;
[0116] A second determination module 505 is used to determine the target configuration information corresponding to each of the target components according to the target attribute information;
[0117] The first generating module 506 is used to load and execute the target source code files corresponding to all the target configuration information to generate the target page.
[0118] In an optional implementation, the determining module is specifically configured to:
[0119] According to a second mapping relationship between pre-stored attribute information and page configuration information, page configuration information corresponding to the attribute information of all target components included in the target page is determined, and the page configuration information is the target configuration information.
[0120] In an optional implementation, the method further includes:
[0121] A second acquisition module is used to traverse a preset first database based on the basic attribute items of each target component to acquire a target component file of each target component, wherein the first database pre-stores a third mapping relationship between the basic attribute items of the component and the component file, and the target component file stores a target component code corresponding to the basic attribute items of each target component;
[0122] A third acquisition module is used to traverse a preset second database based on the special attribute items of each target component to acquire a target logic file of each target component, wherein a fourth mapping relationship between the special attribute items of the component and the logic file is pre-stored in the second database, and a target logic code corresponding to each target component is stored in the target logic file;
[0123] The second generation module is used to generate a target source code file corresponding to each target component according to the target component file and the target logic file corresponding to each target component, and each target source code file corresponds to the target configuration information one by one.
[0124] In an optional implementation, the second acquisition module includes:
[0125] A first determining unit, configured to traverse the first database based on basic attribute items of each target component to determine a first storage address of each target component file;
[0126] A first acquisition unit is used to acquire the target component file corresponding to the basic attribute item of each target component from the first database according to the first storage address.
[0127] In an optional implementation, the third acquisition module includes:
[0128] A second determining unit, configured to traverse a preset second database based on the special attribute items of each target component to determine a second storage address for storing each target logic file;
[0129] A second acquisition unit is used to acquire the target logic file corresponding to the special attribute item of each target component from the second database according to the second storage address.
[0130] In an optional implementation, the special attribute item includes at least one of event information, function information and control parameter information;
[0131] The target logic file corresponding to the event information stores the event logic code required to trigger the component event;
[0132] The target logic file corresponding to the function information stores the function logic code required to trigger the component function;
[0133] The target logic file corresponding to the control parameter information stores the parameter logic code required for triggering component control parameters.
[0134] In an optional implementation, the second generating module is specifically configured to:
[0135] The target component file is combined with the target logic file to obtain the target source code file.
[0136] Figure 6 Schematic diagram of the structure of the server provided in the embodiment of the present application. Figure 6 As shown, the server 6 of this embodiment includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60, such as a page generation program. When the processor 60 executes the computer program 62, the steps in the above-mentioned various page generation method embodiments are implemented, such as Figure 1 Steps 101 to 106 are shown.
[0137] Exemplarily, the computer program 62 may be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 60 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 62 in the server 6. For example, the computer program 62 may be divided into a predefined module, a get module, a first get module, a first determine module, a second determine module, and a first generate module (a module in a virtual device), and the specific functions of each module are as follows:
[0138] Predefined module, used to predefine the attribute information of all components;
[0139] An obtaining module, used for associating and storing the attribute information with the respective corresponding components, and obtaining a first mapping relationship between the attribute information and the respective corresponding components;
[0140] A first acquisition module is used to acquire all target components included in a target page to be generated according to target component identification information included in the page generation instruction after detecting the page generation instruction;
[0141] A first determining module, configured to determine the target attribute information of all the target components according to the first mapping relationship;
[0142] A second determination module is used to determine the target configuration information corresponding to each of the target components according to the target attribute information;
[0143] The first generating module is used to load and execute the target source code files corresponding to all the target configuration information to generate the target page.
[0144] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0145] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0146] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0147] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0148] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple communication units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0149] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0150] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. . Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0151] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A page generation method, characterized in that: include: Predefine the attribute information of all components; The attribute information is stored in association with the respective corresponding components to obtain a first mapping relationship between the attribute information and the respective corresponding components; After detecting the page generation instruction, all target components included in the target page to be generated are obtained according to the target component identification information included in the page generation instruction; Determine target attribute information of all the target components according to the first mapping relationship, wherein the target attribute information includes basic attribute items and special attribute items; Determine the target configuration information corresponding to each of the target components according to the target attribute information; Loading and executing all target source code files corresponding to the target configuration information to generate the target page; Wherein, determining the target configuration information corresponding to each of the target components according to the target attribute information includes: Determine, according to a second mapping relationship between pre-stored attribute information and page configuration information, page configuration information corresponding to the attribute information of all target components included in the target page, the page configuration information being the target configuration information; Before the target source code files corresponding to all the target configuration information are loaded and executed to generate the target page, the method further includes: Traversing a preset first database based on the basic attribute items of each target component to obtain a target component file of each target component, wherein the first database pre-stores a third mapping relationship between the basic attribute items of the component and the component file, and the target component file stores a target component code corresponding to the basic attribute items of each target component; Traversing a preset second database based on the special attribute items of each target component to obtain a target logic file of each target component, wherein a fourth mapping relationship between the special attribute items of the component and the logic file is pre-stored in the second database, and a target logic code corresponding to each target component is stored in the target logic file; According to the target component files and the target logic files corresponding to each target component, target source code files corresponding to each target component are generated, and the target source code files of each target component correspond to the target configuration information one by one.
2. The page generation method according to claim 1, characterized in that: The step of traversing a preset first database based on the basic attribute items of each target component to obtain a target component file of each target component includes: Traversing the first database based on basic attribute items of each target component to determine a first storage address of each target component file; The target component file corresponding to the basic attribute item of each target component is obtained from the first database according to the first storage address.
3. The page generation method according to claim 1, characterized in that: The step of traversing a preset second database based on the special attribute items of each target component to obtain a target logic file of each target component includes: Traversing the second database based on the special attribute items of each target component to determine a second storage address for storing each target logic file; The target logic file corresponding to the special attribute item of each target component is obtained from the second database according to the second storage address.
4. The page generation method according to claim 2 or 3, characterized in that: The special attribute item includes at least one of event information, function information and control parameter information; The target logic file corresponding to the event information stores the event logic code required to trigger the component event; The target logic file corresponding to the function information stores the function logic code required to trigger the component function; The target logic file corresponding to the control parameter information stores the parameter logic code required for triggering component control parameters.
5. The page generation method according to claim 4, characterized in that: The step of generating a target source code file corresponding to each target component according to the target component file and the target logic file corresponding to each target component comprises: The target component file is combined with the target logic file to obtain the target source code file.
6. A page generating device, characterized in that: include: A first acquisition module is used to acquire all target components included in a target page to be generated according to target component identification information included in the page generation instruction after detecting the page generation instruction; A second acquisition module is used to acquire target attribute information corresponding to each of the target components; A determination module, used to determine the target configuration information corresponding to each of the target components according to the target attribute information; A generation module, used for loading and executing target source code files corresponding to all the target configuration information, and generating the target page; Wherein, the determination module is specifically used for: Determine, according to a second mapping relationship between pre-stored attribute information and page configuration information, page configuration information corresponding to the attribute information of all target components included in the target page, the page configuration information being the target configuration information; The page generating device also includes: A second acquisition module is used for traversing a preset first database based on basic attribute items of each target component to acquire a target component file of each target component before loading and executing the target source code files corresponding to all the target configuration information to generate the target page, wherein a third mapping relationship between the basic attribute items of the component and the component file is pre-stored in the first database, and a target component code corresponding to the basic attribute items of each target component is stored in the target component file; A third acquisition module is used to traverse a preset second database based on the special attribute items of each target component to acquire a target logic file of each target component, wherein a fourth mapping relationship between the special attribute items of the component and the logic file is pre-stored in the second database, and a target logic code corresponding to each target component is stored in the target logic file; The second generation module is used to generate a target source code file corresponding to each target component according to the target component file and the target logic file corresponding to each target component, and the target source code file of each target component corresponds to the target configuration information one by one.
7. A server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the page generation method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the page generation method according to any one of claims 1 to 5 are implemented.