CN112506602B - Page generation method and device, electronic equipment and computer readable medium - Google Patents
Page generation method and device, electronic equipment and computer readable medium Download PDFInfo
- Publication number
- CN112506602B CN112506602B CN202011535421.6A CN202011535421A CN112506602B CN 112506602 B CN112506602 B CN 112506602B CN 202011535421 A CN202011535421 A CN 202011535421A CN 112506602 B CN112506602 B CN 112506602B
- Authority
- CN
- China
- Prior art keywords
- page
- data
- dsl
- widget
- dsl data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 230000006870 function Effects 0.000 claims description 66
- 238000012545 processing Methods 0.000 claims description 23
- 230000003993 interaction Effects 0.000 claims description 15
- 230000002452 interceptive effect Effects 0.000 claims description 14
- 238000004458 analytical method Methods 0.000 claims description 12
- 238000001514 detection method Methods 0.000 claims description 4
- 230000004044 response Effects 0.000 abstract description 6
- 230000007547 defect Effects 0.000 abstract description 4
- 230000008439 repair process Effects 0.000 abstract description 4
- 238000011161 development Methods 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 21
- 238000004590 computer program Methods 0.000 description 12
- 230000008569 process Effects 0.000 description 10
- 238000004891 communication Methods 0.000 description 8
- 238000013461 design Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000010276 construction Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Stored Programmes (AREA)
Abstract
The disclosure discloses a page generation method and device, electronic equipment and a computer readable medium, and relates to the technical field of Internet, in particular to the technical field of page development. The specific implementation scheme is as follows: in response to receiving the page generation request, DSL data of the page to be generated is acquired from a server, and the data structure of the DSL data is consistent with the widget tree structure of the page to be generated; the DSL data is parsed to generate a page. Adopting a DSL to describe the data structure of the page, wherein the data structure is consistent with the data structure of the page, the data structure of the page is stored in a server, corresponding DSL data is called from the server when the page is generated, and the page can be quickly generated by analyzing the DSL data; DSL structure is simple, and the parsing speed is fast, can be applied to the hot repair scene of the Flutter application, and can make up for the defect of the Flutter page in the aspect of dynamic release and update.
Description
Technical Field
The disclosure relates to the technical field of internet, in particular to the technical field of page development, and specifically relates to a page generation method and device, electronic equipment and a computer readable medium.
Background
Flutter is a google's mobile UI (User Interface Design, interface design) framework that can quickly build high quality native user interfaces on iOS (apple mobile device operating system) and Android (mobile operating system developed by google corporation). The Flutter application is developed by using a dart (computer programming language) language, and the current mainstream Flutter page publishing mode is to compile the dart language into machine codes, which does not support instant dynamic updating of pages and publishing of new pages.
The following three schemes are currently commonly adopted to solve the problem of dynamically generating the Flutter page:
(1) And replacing the compiled product. The scheme is a page dynamic generation scheme given by the current authorities, and the old compiling product is replaced by remotely downloading the new compiling product and integrally replacing the old compiling product. Taking an Android platform as an example, compiling can generate libapps.so, libapps.so and a router_assets file, wherein libapps.so is a file where page logic is located, and a new page can be dynamically released by replacing the file with newly developed libapps.so.
(2) The operation mode is changed from AOT (Ahead Of Time) to JIT (Just In Time). The AOT is compiled and generates binary codes, then the binary codes are installed and obtained by a user to operate, after being released by the Flutter application, the AOT operates in a mode, and in the mode, pages can only be dynamically released by adopting a scheme of replacing compiled products. Whereas in JIT mode, the dart virtual machine needs to recompile and run the dart source code.
(3) The page is dynamically generated by utilizing analysis libraries provided by the dart official and the cooperation of the Flutter application.
Disclosure of Invention
The disclosure provides a page generation method and device, electronic equipment and a computer readable medium.
According to a first aspect of the present disclosure, there is provided a page generation method, including:
responding to a received page generation request, acquiring DSL data of a domain-specific language of a page to be generated from a server, wherein the data structure of the DSL data is consistent with the widget tree structure of the page to be generated;
and analyzing the DSL data to generate a page.
According to a second aspect of the present disclosure, there is provided a page generation apparatus, including an acquisition module and an analysis module, where the acquisition module is configured to acquire, from a server, domain-specific language DSL data of a page to be generated, in response to receiving a page generation request, a data structure of the DSL data being consistent with a widget tree structure of the page to be generated;
the parsing module is configured to parse the DSL data to generate a page.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the page generation methods.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform any one of the page generation methods.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of any one of the above page generation methods.
According to the technology disclosed by the disclosure, a DSL (digital subscriber line) description page data structure is adopted, the data structure is consistent with the page data structure, the page data structure is stored in a server, corresponding DSL data is called from the server when the page is generated, and the page can be quickly generated by analyzing the DSL data; the DSL structure is simple, the analysis speed is high, the second-level release of the new page can be realized, the method can be applied to the hot repair scene of the Flutter application, the dynamic generation of the Futter page can be realized, and the defect of the Flutter page in the aspect of dynamic release and update is overcome.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow diagram of a page generation method according to a first embodiment of the present disclosure;
figure 2 is a schematic diagram of a data structure of DSL data according to an embodiment of the present disclosure;
FIG. 3a is a variable storage schematic diagram according to an embodiment of the present disclosure;
FIG. 3b is a schematic diagram of a resulting function definition according to an embodiment of the present disclosure;
fig. 4 is a flow diagram of resolving DSL data according to an embodiment of the present disclosure;
figure 5 is a schematic diagram of resolving DSL data according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a resolved page structure according to an embodiment of the present disclosure;
FIG. 7 is a flow diagram of an interaction process according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of an interaction process according to an embodiment of the present disclosure;
fig. 9 is a schematic diagram of a structure of a page generating apparatus according to a second embodiment of the present disclosure;
fig. 10 is a schematic diagram ii of a structure of a page generating apparatus according to a second embodiment of the present disclosure;
fig. 11 is a block diagram of an electronic device used to implement the page generation method of the first embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The first embodiment of the present disclosure provides a page generation method, where the page in the embodiment of the present disclosure is illustrated by using a Flutter page as an example, but those skilled in the art can know that any page type that does not support instant dynamic update and release is within the protection scope of the present disclosure.
Fig. 1 is a flowchart of a page generation method according to a first embodiment of the present disclosure, as shown in fig. 1, the page generation method including the steps of:
step 11, in response to receiving the page generation request, DSL data of the page to be generated is obtained from the server, and the data structure of the DSL data is consistent with the widget tree structure of the page to be generated.
Fig. 2 is a schematic diagram of a data structure of DSL data in an embodiment of the present disclosure, and as shown in fig. 2, the data structure of the router page is a Widget (Widget) tree structure, that is, a tree data structure composed of a plurality of widgets. The basic construction element of the router page is the widget, each widget can contain 1 or more widgets, and a widget tree is finally constructed through layer-by-layer wrapping of the widgets. DSL (Domain Specific Language ) data of each router page is stored in advance in the server. That is, the data of the Flutter page stored in the server adopts DSL description, and the data structure is a widget tree structure consistent with the data structure of the Flutter page, so that the DSL data is more simply and quickly analyzed when the Flutter page is generated. It should be noted that, DSL data stored in the server may be stored in the initialization stage, or may be adjusted and updated according to the user's requirement, so as to implement dynamic generation of the Flutter page.
In this step, if the router application of the terminal device receives the page generation request, DSL data of the page to be generated (i.e., the page requested to be generated) is acquired from the server. It should be noted that, the page generation request may be an operation performed by the user on the router application, for example, clicking a button of the current page, or the like.
In step 12, the DSL data is parsed to generate a page.
In this step, the DSL parser in the terminal device Flutter application may obtain a new Flutter page by parsing the obtained DSL data.
In the embodiment of the disclosure, a data structure of a DSL description page is adopted, the data structure is consistent with the data structure of the page, the data structure of the page is stored in a server, corresponding DSL data is called from the server when the page is generated, and the page can be quickly generated by analyzing the DSL data; the DSL structure is simple, the analysis speed is high, the second-level release of the new page can be realized, the method can be applied to the hot repair scene of the Flutter application, the dynamic generation of the Futter page can be realized, and the defect of the Flutter page in the aspect of dynamic release and update is overcome.
According to a traditional scheme for replacing compiled products, as services are increased, the compiled products are larger and larger, the time occupied by downloading and replacing the compiled products is increased continuously, and pages can only take effect after the Flutter application is restarted, so that the thermal restoration of the Flutter application cannot be realized, and the use of users is affected. The embodiment of the disclosure does not need to download and replace a compiling product, correspondingly shortens the time for generating and releasing the page, does not need to restart the Flutter application, can realize hot repair of the Flutter application, and improves the availability of the Flutter application.
In the conventional Flutter page generation scheme changing the operation mode from the AOT mode to the JIT mode, if the operation is to be performed in the JIT mode, the start source code needs to be recompiled and operated, and although the dynamic page release can be realized in the JIT mode, the problems of slow operation speed, increased packet size and the like of the Flutter application can be caused. In the embodiment of the disclosure, the component rendering of the page still adopts the AOT mode, so that the fluency of the Flutter application can be ensured.
The traditional method for dynamically generating the Flutter page scheme by matching the analysis library provided by the Dart official with the Flutter application has the defects that the generated data is not easy to read, the granularity is small, the processing amount of the Flutter page generated on the basis is large, and the Flutter page generation speed is low. In the embodiment of the disclosure, through the description mode of the DSL redefined data, the DSL data is consistent with the data structure of the Flutter page, and in the process of generating the Flutter page, the analysis speed of the DSL data is high, and the generating and publishing speeds of the Flutter page are higher.
In some embodiments, as shown in fig. 2, DSL data includes a plurality of objects, each object corresponding one-to-one to each widget of a page. The object comprises a name field (name) and a data field (data), the name field is used for storing a widget name, the data field is used for storing a widget attribute value, the name field and the data field together represent a widget, other objects can be mounted under each attribute in the data field, one object is wrapped by a curly bracket, and other objects can be further contained in the object.
In some embodiments, the DSL data may be in JSON (JavaScript object notation) format. The granularity of the JSON format data is consistent with that of the router page standard component, the data readability is high, the workload of constructing and analyzing the JSON format DSL data is small, and the JSON format DSL data is a lightweight DSL implementation. In addition, the JSON format is a data encapsulation form commonly used in network transmission, so that in the daily iteration process of the version of the router application, for tiny changes or on-line of a certain new page, the new version does not need to be repackaged and released, but is directly on-line, the on-line period of the router application can be shortened, the labor is saved, and the development efficiency of the router application is improved.
In some embodiments, the types of objects may include variables, functions, and page structures, and the DSL data of the embodiments of the present disclosure has a simpler data structure than DSL data directly describing the dart language by abstracting the variables, functions, and page structures. For ease of identification, variables may be defined as one object in DSL data. Fig. 3a is a schematic diagram of variable storage according to an embodiment of the present disclosure, as shown in fig. 3a, an object of a variable type also includes a name field and a data field, wherein a value of the name field of one variable is "variable", an object is stored in the data field, the name field of the object is a variable name var1, and the data field is a variable initial value 2. The value of the name field of the other variable is variable, an object is stored in the data field, the name field in the object is variable name var2, and the data field is variable initial value hello. In the process of analyzing the variables by the analyzer, the identified variables (var 1 and var 2) are stored into a map structure by using the variable name as key and the variable values as value (2 and hello), and the map structure can be searched for to modify the operation of the variables.
Similar to the processing of variables, in DSL data, an object may also be used to represent a function. FIG. 3b is a schematic diagram of a function definition of an embodiment of the disclosure, where, as shown in FIG. 3b, an object of a function type also includes a name field with a value of "function" and a data field, where the data field may store input parameters (input 1, input 2), an operator (op), a return value, and so on.
Fig. 4 is a schematic flow chart of resolving DSL data according to an embodiment of the present disclosure, and fig. 5 is a schematic diagram of resolving DSL data according to an embodiment of the present disclosure. As shown in connection with fig. 4 and 5, the parsing DSL data (i.e., step 12) includes the steps of:
step 121, parsing the variables and functions, respectively.
In this step, the DSL parser parses the variables in the DSL data to obtain variable values, and parses the functions in the DSL data to obtain function values. It should be noted that, the DSL parser parses out the function, and the function calculation may be performed by the Flutter application, or may be performed by a three-party library.
And step 122, analyzing the page structure according to the variable value and the function value obtained by analysis, and generating a widget tree structure.
In this step, the DSL parser parses the page structure in the DSL data to generate a widget tree structure, and when the widget tree structure is constructed, the variable value and the function value obtained in step 121 are called as the value of the data field of the widget.
In fig. 5, the order of analyzing the variables, functions, and page structures is exemplified, and the order of executing the variables and functions is not limited, so long as the variables and functions are executed before the page structures are analyzed.
Fig. 6 is a schematic diagram of a resolved page structure according to an embodiment of the disclosure. In some embodiments, as shown in fig. 6, the parsing the page structure according to the parsed variable values and function values generates a widget tree structure (i.e. step 122), which includes the following steps: traversing the data structure of DSL data in a recursion calling mode to generate a widget tree structure, wherein the value of the data field of the widget in the widget tree structure is a variable value or a function value obtained by analysis. Such as the DSL data shown in fig. 6, which traverses the data structure of the entire DSL data in the order of 1-6.
The DSL parser takes the parsed variable values and function values as parameter values of data fields of respective objects, and stores them in a map structure (key-value) form (see fig. 3 a). Since the map can also be stored in the map, the map structure is actually another expression of JSON format. The DSL parser finds out the corresponding widget through the name field, and transmits the parameter value (namely the value of the data field) corresponding to the name field to the data field of the widget, thereby realizing the instantiation of the widget. And traversing DSL data of the tree structure in a recursion calling mode, and finally constructing a widget tree structure which completely corresponds to the DSL data, thereby completing the DSL analysis process.
In some embodiments, the function comprises an interactive function. Fig. 7 is a schematic flow chart of the interaction process according to the embodiment of the present disclosure, fig. 8 is a schematic flow chart of the interaction process according to the embodiment of the present disclosure, and after the DSL data is parsed to generate a page (i.e. step 12), the method further includes the following steps:
in step 71, in response to detecting the operation on the page, the operation is performed according to the interactive function to obtain a processing result.
In this step, when the user performs a page generation operation (including a page refreshing operation and other page loading operations) on the Flutter application, the Flutter application can detect the operation and call the interactive function to execute the operation, thereby obtaining a corresponding processing result. The interactive function is obtained and stored by the DSL parser parsing DSL data.
And step 72, refreshing the page according to the processing result.
As shown in fig. 8, the page data of the widget tree structure generated by the DSL parser is stored in the filter page container, a callback function is defined in the filter page container, and the callback function is registered to the DSL parser for the DSL parser to call.
In some embodiments, the refreshing the page (i.e., step 72) according to the processing results includes the steps of: and calling a callback function in the page according to the processing result by using the interactive function so as to refresh the page. That is, the DSL parser uses the interactive function to call the callback function in the page container according to the processing result, and the callback function realizes page refreshing.
If the interface refreshing operation needs to be executed, because the interactive function setState corresponding to the refreshing page needs to be executed in the router page, the page needs to register a callback function with the DSL parser, and the callback function is called back when the interactive function of the DSL parser is executed. In DSL, a function that performs interactive processing is defined as an interactive function, which is stored in a data field of an object. In the Fluter page, the widget interactions have corresponding attribute correspondence, and the value of the attribute is the value of the interaction function. In the DSL parsing process, the DSL parser traverses to the object containing the interactive function, and parses out the interactive function. When interaction occurs, the interaction function executes interaction operation (namely corresponding data processing is carried out), and a callback function in the Flutter page is called to refresh the page.
According to an embodiment of the present disclosure, fig. 9 is a schematic structural diagram of a page generating device provided by the second embodiment of the present disclosure, where, as shown in fig. 9, the page generating device includes an obtaining module 901 and a parsing module 902, where the obtaining module 901 is configured to obtain, in response to receiving a page generating request, domain-specific language DSL data of a page to be generated, where a data structure of the DSL data is consistent with a widget tree structure of the page to be generated, from a server.
The parsing module 902 is configured to parse the DSL data to generate a page.
In some embodiments, the DSL data includes a plurality of objects in one-to-one correspondence with the widgets, the objects including a name field for storing the widget name and a data field for storing the widget attribute value.
In some embodiments, the types of objects include variables, functions, and page structures. The parsing module 902 is configured to parse variables and functions respectively; and analyzing the page structure according to the variable value and the function value obtained by analysis, and generating a widget tree structure.
In some embodiments, the parsing module 902 is configured to traverse the data structure of the DSL data by adopting a recursive call manner to generate a widget tree structure, where a value of a data field of a widget in the widget tree structure is a variable value or a function value obtained by the parsing.
Fig. 10 is a schematic diagram of a page generating apparatus according to a second embodiment of the present disclosure. As shown in fig. 10, in some embodiments, the function includes an interaction function, and the page generating apparatus further includes a detection module 903, where the detection module 903 is configured to detect an operation on the page. The parsing module 902 is further configured to, in response to the detection module 903 detecting an operation on the page, execute the operation according to the interaction function to obtain a processing result, and refresh the page according to the processing result.
In some embodiments, the parsing module 903 is configured to call a callback function in the page according to the processing result by using the interaction function, so as to refresh the page.
In some embodiments, the DSL data is in JavaScript object notation JSON format.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 11 illustrates a schematic block diagram of an example electronic device 1100 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 11, the apparatus 1100 includes a computing unit 1101 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a Random Access Memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the device 1100 can also be stored. The computing unit 1101, ROM 1102, and RAM 1103 are connected to each other by a bus 1104. An input/output (I/O) interface 1105 is also connected to bus 1104.
Various components in device 1100 are connected to I/O interface 1105, including: an input unit 1106 such as a keyboard, a mouse, etc.; an output unit 1107 such as various types of displays, speakers, and the like; a storage unit 1108, such as a magnetic disk, optical disk, etc.; and a communication unit 1109 such as a network card, modem, wireless communication transceiver, or the like. The communication unit 1109 allows the device 1100 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 1101 may be a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 1101 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1101 performs the respective methods and processes described above, such as a page generation method. For example, in some embodiments, the page generation method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 1108. In some embodiments, some or all of the computer programs may be loaded and/or installed onto device 1100 via ROM 1102 and/or communication unit 1109. When a computer program is loaded into the RAM 1103 and executed by the computing unit 1101, one or more steps of the page generation method described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured to perform the page generation method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to an embodiment of the present disclosure, the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements any of the above page generation methods.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.
Claims (7)
1. A page generation method, comprising:
responding to a received page generation request, acquiring DSL data of a domain-specific language of a page to be generated from a server, wherein the data structure of the DSL data is consistent with the widget tree structure of the page to be generated; the DSL data comprises a plurality of objects which are in one-to-one correspondence with the widgets, wherein the objects comprise a name field for storing the widget names and a data field for storing the widget attribute values, and the types of the objects comprise variables, functions and page structures;
parsing the DSL data to generate a page;
wherein said parsing said DSL data comprises:
respectively analyzing the variables and the functions;
traversing the data structure of the DSL data in a recursion calling mode to generate a widget tree structure, wherein the value of a data field of the widget in the widget tree structure is a variable value or a function value obtained by analysis.
2. The method of claim 1, wherein the function comprises an interactive function that, after parsing the DSL data to generate a page, further comprises:
responding to the detection of the operation on the page, and executing the operation according to the interactive function to obtain a processing result;
and refreshing the page according to the processing result.
3. The method of claim 2, wherein the refreshing the page according to the processing result comprises:
and calling a callback function in the page according to the processing result by using the interaction function so as to refresh the page.
4. The method of any of claims 1-3, wherein the DSL data is in JavaScript object notation JSON format.
5. A page generating apparatus comprising: the acquisition module is used for responding to the received page generation request, acquiring the DSL data of the domain-specific language of the page to be generated from the server, wherein the data structure of the DSL data is consistent with the widget tree structure of the page to be generated; the DSL data comprises a plurality of objects which are in one-to-one correspondence with the widgets, wherein the objects comprise a name field for storing the widget names and a data field for storing the widget attribute values, and the types of the objects comprise variables, functions and page structures;
the analyzing module is used for analyzing the DSL data to generate a page; and analyzing the variables and the functions respectively, traversing the data structure of the DSL data in a recursion calling mode, and generating a widget tree structure, wherein the value of a data field of the widget in the widget tree structure is a variable value or a function value obtained by analysis.
6. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
7. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011535421.6A CN112506602B (en) | 2020-12-23 | 2020-12-23 | Page generation method and device, electronic equipment and computer readable medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011535421.6A CN112506602B (en) | 2020-12-23 | 2020-12-23 | Page generation method and device, electronic equipment and computer readable medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112506602A CN112506602A (en) | 2021-03-16 |
CN112506602B true CN112506602B (en) | 2023-08-08 |
Family
ID=74923099
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011535421.6A Active CN112506602B (en) | 2020-12-23 | 2020-12-23 | Page generation method and device, electronic equipment and computer readable medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112506602B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115113850B (en) * | 2021-03-18 | 2024-09-10 | 京东方科技集团股份有限公司 | Cross-platform application construction and operation method, server, terminal and system |
CN113392997B (en) * | 2021-06-30 | 2022-11-29 | 广东电网有限责任公司 | Master station system maintenance method, device, maintenance site, master station system and medium |
CN114090015A (en) * | 2021-11-26 | 2022-02-25 | 浩云科技股份有限公司 | Page DSL (digital subscriber line) analysis method, system, equipment and storage medium |
CN114489894A (en) * | 2022-01-13 | 2022-05-13 | 北京齐尔布莱特科技有限公司 | Client user interface updating method and device, client and server |
CN115048100A (en) * | 2022-05-31 | 2022-09-13 | 融创物业服务集团有限公司 | Dynamic display method for software page in mobile equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018082562A1 (en) * | 2016-11-07 | 2018-05-11 | 腾讯科技(深圳)有限公司 | Method and device for compiling page data and rendering page, and storage medium |
CN111324833A (en) * | 2018-12-14 | 2020-06-23 | 北京京东尚科信息技术有限公司 | Page display method, device, electronic design and computer readable medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8732667B2 (en) * | 2009-11-13 | 2014-05-20 | Microsoft Corporation | Debugging services for domain specific languages |
-
2020
- 2020-12-23 CN CN202011535421.6A patent/CN112506602B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018082562A1 (en) * | 2016-11-07 | 2018-05-11 | 腾讯科技(深圳)有限公司 | Method and device for compiling page data and rendering page, and storage medium |
CN111324833A (en) * | 2018-12-14 | 2020-06-23 | 北京京东尚科信息技术有限公司 | Page display method, device, electronic design and computer readable medium |
Non-Patent Citations (1)
Title |
---|
A generative framework for development of CRUD-based Linux desktop applications;Milan Jančár;IEEE;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN112506602A (en) | 2021-03-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112506602B (en) | Page generation method and device, electronic equipment and computer readable medium | |
CN112540806B (en) | Method and device for rendering small program page, electronic equipment and storage medium | |
CN113342345A (en) | Operator fusion method and device of deep learning framework | |
CN111913705B (en) | JavaScript template implementation method based on difference updating algorithm | |
CN113392346B (en) | Path processing method and device for resource file, electronic equipment and storage medium | |
CN113010827A (en) | Page rendering method and device, electronic equipment and storage medium | |
CN116028028B (en) | Request function generation method, device, equipment and storage medium | |
CN112328301B (en) | Method and device for maintaining consistency of operating environments, storage medium and electronic equipment | |
CN112015468A (en) | Interface document processing method and device, electronic equipment and storage medium | |
US11294651B2 (en) | Code execution method, device, and rendering apparatus | |
CN113254043A (en) | Web front-end project processing method and device, electronic equipment and storage medium | |
CN113656533A (en) | Tree control processing method and device and electronic equipment | |
CN115509522A (en) | Interface arranging method and system for low-code scene and electronic equipment | |
JP7389246B2 (en) | Dependency graph generation method, device, device, storage medium, and program product | |
CN112947916A (en) | Method, device, equipment and storage medium for realizing online canvas | |
CN117234582A (en) | Project code processing method and device, electronic equipment and storage medium | |
CN113642295B (en) | Page typesetting method, device and computer program product | |
CN114995800A (en) | Project development method and device, electronic equipment and storage medium | |
CN114661402A (en) | Interface rendering method and device, electronic equipment and computer readable medium | |
CN115168358A (en) | Database access method and device, electronic equipment and storage medium | |
CN113590217A (en) | Function management method and device based on engine, electronic equipment and storage medium | |
CN113849164A (en) | Data processing method and device, electronic equipment and memory | |
CN117270838B (en) | Method, device, equipment and medium for generating universal formula script | |
CN116431108B (en) | Object type processing method and device, electronic equipment and storage medium | |
CN115758021A (en) | Webpage rendering method and device, electronic equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |