A page DSL parsing method, system, device and storage medium
By converting page DSL into page standard DSL and analyzing its contents and generating pages, the problem of developers needing to write a lot of code in the existing technology is solved, and fast and simple page development is achieved, which reduces development thresholds and human resources waste.
Patent Information
- Application Number
- CN202111420905.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-11-26
AI Technical Summary
The existing page DSL technology requires professional developers to write and process a lot of code, resulting in long development cycles, inefficient efficiency and waste of human resources.
By converting the page DSL to the page standard DSL and parsing the page variables, data requests, page actions, expressions and components in the page standard DSL, a variable pool, a request pool, an action pool and an expression calculation pool are generated, and finally through the page layout The parser generates the page.
It realizes rapid page generation, simplifies the development process, improves efficiency, and lowers the development threshold, so that non-professionals can also develop pages to respond to market demand.
Smart Images

Figure CN114090015B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a page DSL parsing method, system, device and storage medium. Background Art
[0002] With the continuous development of information technology, more and more pages are used for display on the Internet.
[0003] However, in the existing technology, if developers want to develop a complete page, they need to write a lot of code, including various components, http requests, business logic processing, etc. This not only has a long project cycle and low efficiency, but also cannot meet the needs of customers for frequent changes. In addition, the existing page development has certain requirements for developers. Non-developers have no development experience and it is difficult for them to participate in the actual development work. Summary of the invention
[0004] The present invention provides a page DSL parsing method, system, device and storage medium, which solves the technical problem that the existing page DSL technology requires professional developers to perform a large amount of code writing and processing work, resulting in a long development cycle, low efficiency and waste of human resources.
[0005] In order to solve the above technical problems, the present invention provides a page DSL parsing method, system, device and storage medium.
[0006] In a first aspect, the present invention provides a page DSL parsing method, the method comprising the following steps:
[0007] Obtain the generated page DSL, and convert the page DSL into a page standard DSL;
[0008] Parsing page variables in the page standard DSL to generate a variable pool;
[0009] The data request, page action and expression in the page standard DSL are parsed simultaneously to generate a corresponding request pool, action pool and expression calculation pool;
[0010] Parsing the page components in the page standard DSL to obtain component parsing results;
[0011] The variable pool, request pool, action pool, expression calculation pool and component parsing results are input into the page layout parser to generate a page.
[0012] In a further embodiment, the page DSL is converted into page standard DSL using a DSL converter.
[0013] In a further embodiment, the method further comprises a variable initialization step, specifically:
[0014] Scan the page standard DSL to obtain page variables, wherein the page variables include system variables, user variables, custom variables, page input variables and control variables;
[0015] Initialize system variables, user variables, custom variables, and page input variables;
[0016] Initialize control variables and configure variable listeners for control variables.
[0017] In a further embodiment, it also includes initializing the request pool, action pool and expression calculation pool;
[0018] When the request pool, the action pool and the expression calculation pool are initialized, the request pool, the action pool and the expression calculation pool register variable listeners with the variable pool respectively.
[0019] In a further implementation scheme, when the variable listener detects a change in a variable, a change notification is sent to the request pool, action pool, and expression calculation pool.
[0020] In a further implementation scheme, when the action pool detects an operation on the page, a trigger request is sent to a request instance in the request pool according to the operation, and the request instance generates and feeds back a callback result according to the trigger request.
[0021] In a further embodiment, the page layout parser is used to replace the placeholders in the component parsing result configuration file with specific methods or specific objects in the variable pool, request pool and action pool.
[0022] In a second aspect, the present invention provides a page DSL parsing system, the system comprising:
[0023] A DSL conversion module, used for acquiring the generated page DSL and converting the page DSL into a page standard DSL;
[0024] A first parsing module, used for parsing page variables in the page standard DSL to generate a variable pool;
[0025] A second parsing module is used to parse the data request, page action and expression in the page standard DSL at the same time, and generate a corresponding request pool, action pool and expression calculation pool;
[0026] A third parsing module is used to parse the page components in the page standard DSL to obtain component parsing results;
[0027] The layout parsing module is used to input the variable pool, request pool, action pool, expression calculation pool and component parsing results into the page layout parser to generate a page.
[0028] In a third aspect, the present invention further provides a computer device, comprising a processor and a memory, wherein the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory so that the computer device performs the steps of implementing the above method.
[0029] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the steps of the above method when executed by a processor.
[0030] The present invention provides a page DSL parsing method, system, device and storage medium, through which the page DSL is converted into a page standard DSL, and the page variable data request, page action, expression and page component in the page standard DSL are parsed to generate a page through a page layout parser, thus realizing a technical solution of using structured data to describe page functions. Compared with the prior art, the method can quickly generate a page by parsing DSL data, and the method is simple, can quickly respond to market demand, and has a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a flow chart of a page DSL parsing method provided by an embodiment of the present invention;
[0032] Figure 2 is a schematic diagram of variable initialization provided by an embodiment of the present invention;
[0033] Figure 3 It is a schematic diagram of the request pool initialization process provided by an embodiment of the present invention;
[0034] Figure 4 is a schematic diagram of an action pool initialization process provided by an embodiment of the present invention;
[0035] Figure 5 is a block diagram of a page DSL parsing system provided by an embodiment of the present invention;
[0036] Figure 6 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The following specifically illustrates the implementation mode of the present invention in conjunction with the accompanying drawings. The embodiments are provided for illustrative purposes only and cannot be understood as limiting the present invention. The accompanying drawings are provided for reference and illustration only and do not constitute a limitation on the scope of patent protection of the present invention, because many changes can be made to the present invention without departing from the spirit and scope of the present invention.
[0038] refer to Figure 1 , an embodiment of the present invention provides a page DSL parsing method, such as Figure 1 As shown, the method includes:
[0039] S1. Obtain the generated page DSL and convert the page DSL into a page standard DSL.
[0040] In this embodiment, a page DSL is generated by a page designer, and the page DSL is converted into a page standard DSL by a DSL converter, wherein the conversion of the page DSL into the page standard DSL by the DSL converter is specifically as follows:
[0041] Nodes are extracted from the page DSL to obtain control configuration, action configuration, expression configuration, etc., the control configuration, action configuration, expression configuration, etc. are converted to obtain page variables, data requests, page actions, expressions, and page components, and the page variables, data requests, page actions, expressions, and page components are assembled to obtain a page standard DSL.
[0042] Among them, the domain-specific language DSL is designed to solve the difficulty in collecting requirements caused by the inconsistent language models of users and builders in the early stage of system construction. As the name suggests, it is to build another language through one language to solve cross-domain / cross-platform problems; this embodiment converts the generated page DSL into a page standard DSL, which can facilitate the connection with the DSL parsing engine, thereby improving the work efficiency of the entire data parsing.
[0043] S2. Parse the page variables in the page standard DSL and generate a variable pool.
[0044] In one embodiment, Figure 2 As shown, the method also includes a variable initialization step, specifically:
[0045] Scan the page standard DSL to obtain page variables, wherein the page variables include system variables, user variables, custom variables, page input variables and control variables;
[0046] Initialize system variables, user variables, custom variables, and page input variables;
[0047] Scan the page standard DSL to obtain all the controls on the page, initialize the control variables, and configure variable listeners for the control variables.
[0048] It should be noted that, in this embodiment, when variables are initialized, system variables, user variables, custom variables and page input variables are initialized first, and then control variables are initialized, and only the initialization of control variables requires the configuration of variable listeners.
[0049] S3. The data request, page action and expression in the page standard DSL are parsed simultaneously to generate a corresponding request pool, action pool and expression calculation pool.
[0050] In one embodiment, the method further comprises initializing the request pool, the action pool and the expression calculation pool, wherein: Figure 3 is a schematic diagram of a request pool initialization process provided by an embodiment of the present invention, Figure 4 It is a schematic diagram of the action pool initialization process provided by an embodiment of the present invention; when the request pool, action pool and expression calculation pool are initialized, the request pool, action pool and expression calculation pool respectively register variable listeners to the variable pool.
[0051] In one embodiment, when the variable listener detects a change in a variable, it sends a change notification to the request pool, action pool, and expression calculation pool.
[0052] like Figure 3 , Figure 4 As shown, in the action pool, when the action body in the action instance detects an operation action on the page, a trigger request is sent to the request instance in the request pool according to the operation action, and the request instance generates and feeds back a callback result according to the trigger request; when the action body detects a variable modification, a variable modification notification is sent to the variable pool.
[0053] The request pool is initialized to uniformly manage all API requests (data requests) configured in the page, where the API call may be called when the data source of the control is initialized, or it may be triggered by a page action; in this embodiment, when the query parameters of the request instance depend on the variables in the variable pool, the corresponding listener is registered with the variable pool.
[0054] The action pool is initialized to uniformly manage the actions configured on the page. The execution of the action may be triggered by a life cycle of the control or by an operation event of the user. In this embodiment, when the input parameters of the action instance depend on the variables in the variable pool, the corresponding listener is registered with the variable pool.
[0055] In this embodiment, the expression calculation pool manages all expressions configured in the page. The expressions are generally associated with certain variables. The expressions are calculated using preset calculation rules to obtain calculation results, and the calculation results are applied to a certain attribute of a control, a query parameter of a request, or an execution condition of an action, etc.
[0056] S4. Parse the page components in the page standard DSL to obtain component parsing results.
[0057] S5. Input the variable pool, request pool, action pool, expression calculation pool and component parsing results into the page layout parser to generate a page.
[0058] In one embodiment, the page layout parser is used to replace the placeholders in the component parsing result configuration file with specific methods or specific objects in the variable pool, request pool and action pool; wherein, in the process of making a web page, the page component instance is represented by a uniformly defined placeholder, and the placeholder is a combination of the type name identifier of the component type of the page component instance and the unique identifier name of the page component instance.
[0059] This embodiment provides a page DSL parsing method. After parsing page variables, data requests, page actions, expressions and page components, the variable pool, request pool, action pool, expression calculation pool and component parsing results are input into the page layout parser to generate a page, thereby realizing a technical solution of describing page functions through structured data and obtaining a complete running page through parsing by a corresponding parser. The method provided in this embodiment can complete the development work only through simple JSON configuration, has a fast response speed and high development efficiency, and can complete the development work without professional developers. It only needs to learn DSL and related grammar rules to realize page development, which reduces the learning cost and lowers the development threshold.
[0060] It should be noted that the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0061] In one embodiment, Figure 5 As shown, this embodiment provides a page DSL parsing system, the system comprising:
[0062] DSL conversion module 101, used to obtain the generated page DSL and convert the page DSL into a page standard DSL;
[0063] A first parsing module 102 is used to parse the page variables in the page standard DSL and generate a variable pool;
[0064] The second parsing module 103 is used to parse the data request, page action and expression in the page standard DSL at the same time, and generate a corresponding request pool, action pool and expression calculation pool;
[0065] The third parsing module 104 is used to parse the page components in the page standard DSL to obtain component parsing results;
[0066] The layout parsing module 105 is used to input the variable pool, request pool, action pool, expression calculation pool and component parsing results into the page layout parser to generate a page.
[0067] For the specific definition of a page DSL parsing system, please refer to the above-mentioned definition of a page DSL parsing method, which will not be repeated here. A person of ordinary skill in the art can appreciate that the various modules and steps described in conjunction with the embodiments disclosed in this application can be implemented in hardware, software, or a combination of both. 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.
[0068] The present application provides a page DSL parsing system, which converts the page DSL into a page standard DSL through a DSL conversion module to facilitate subsequent parsing, and implements parsing of the page standard DSL through various parsing modules to generate a page instance. Compared with the prior art, the system provided in this embodiment implements simple and efficient development and application of data in a specific field by parsing the DSL domain specific language, and is simple to operate and easy to implement, making it more convenient for non-professional developers to get started and lowering the development threshold.
[0069] Figure 6 A computer device provided by an embodiment of the present invention includes a memory, a processor and a transceiver, which are connected via a bus; the memory is used to store a set of computer program instructions and data, and can transmit the stored data to the processor, and the processor can execute the program instructions stored in the memory to perform the steps of the above method.
[0070] The memory may include a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories; the processor may be a central processing unit, a microprocessor, an application-specific integrated circuit, a programmable logic device, or a combination thereof. By way of example but not limitation, the programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0071] Additionally, the memory may be a physically separate unit or may be integrated with the processor.
[0072] It can be understood by those skilled in the art that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have the same component arrangement.
[0073] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0074] The embodiments of the present invention provide a page DSL parsing method, system, device and storage medium. The key to the page DSL parsing method is to describe the function of the page through structured data, which is different from the existing coding development method and solves the problem that the existing page DSL technology requires professional developers to perform a large amount of code writing and processing work, resulting in a long development cycle, low efficiency and waste of human resources. This embodiment completes the development of web pages through simple JSON configuration without adding additional equipment, which not only effectively improves development efficiency and shortens the development cycle, but also can quickly respond to market demand. In addition, the application does not require a complex compilation process, has the characteristics of simple development and low threshold, can improve human resource utilization and reduce technical costs.
[0075] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.
[0076] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0077] The above-mentioned embodiments only express several preferred implementation modes of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in the technical field, several improvements and substitutions can be made without departing from the technical principles of the present invention, and these improvements and substitutions should also be regarded as the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be based on the protection scope of the claims.
Claims
1. A page DSL parsing method, characterized in that: The following steps are involved: Generate a page DSL through a page designer, and convert the page DSL into a page standard DSL through a DSL converter; Parsing page variables in the page standard DSL to generate a variable pool; The data request, page action and expression in the page standard DSL are parsed simultaneously to generate a corresponding request pool, action pool and expression calculation pool; Parsing the page components in the page standard DSL to obtain component parsing results; The variable pool, request pool, action pool, expression calculation pool and component parsing results are input into the page layout parser to generate a page; the page layout parser is used to replace the placeholders in the component parsing result configuration file with specific methods or specific objects in the variable pool, request pool and action pool; The method of converting the page DSL into the page standard DSL by using the DSL converter is specifically as follows: Extracting nodes from the page DSL to obtain control configuration, action configuration and expression configuration, converting the control configuration, action configuration and expression configuration to obtain page variables, data requests, page actions, expressions and page components, assembling the page variables, data requests, page actions, expressions and page components to obtain a page standard DSL; The method further comprises a variable initialization step, specifically: Scan the page standard DSL to obtain page variables, wherein the page variables include system variables, user variables, custom variables, page input variables and control variables; Initialize system variables, user variables, custom variables, and page input variables; Scan the page standard DSL to obtain all the controls on the page, initialize the control variables, and configure variable listeners for the control variables.
2. A page DSL parsing method as claimed in claim 1, characterized in that: It also includes initializing the request pool, action pool and expression calculation pool; When the request pool, the action pool and the expression calculation pool are initialized, the request pool, the action pool and the expression calculation pool register variable listeners with the variable pool respectively.
3. A page DSL parsing method as claimed in claim 2, characterized in that: When the variable listener detects that a variable has changed, it sends a change notification to the request pool, action pool, and expression calculation pool.
4. A page DSL parsing method as claimed in claim 1, characterized in that: When the action pool detects an operation on the page, it sends a trigger request to the request instance in the request pool according to the operation, and the request instance generates and feeds back a callback result according to the trigger request.
5. A page DSL parsing system, characterized in that: The system comprises: A DSL conversion module, used for generating a page DSL through a page designer, and converting the page DSL into a page standard DSL using a DSL converter; A first parsing module, used for parsing page variables in the page standard DSL to generate a variable pool; A second parsing module is used to parse the data request, page action and expression in the page standard DSL at the same time, and generate a corresponding request pool, action pool and expression calculation pool; A third parsing module is used to parse the page components in the page standard DSL to obtain component parsing results; A layout parsing module, used to input the variable pool, request pool, action pool, expression calculation pool and component parsing results into a page layout parser to generate a page; the page layout parser is used to replace the placeholders in the component parsing result configuration file with specific methods or specific objects in the variable pool, request pool and action pool; The method of converting the page DSL into the page standard DSL by using the DSL converter is specifically as follows: Extracting nodes from the page DSL to obtain control configuration, action configuration and expression configuration, converting the control configuration, action configuration and expression configuration to obtain page variables, data requests, page actions, expressions and page components, assembling the page variables, data requests, page actions, expressions and page components to obtain a page standard DSL; The system also includes a variable initialization step, specifically: Scan the page standard DSL to obtain page variables, wherein the page variables include system variables, user variables, custom variables, page input variables and control variables; Initialize system variables, user variables, custom variables, and page input variables; Scan the page standard DSL to obtain all the controls on the page, initialize the control variables, and configure variable listeners for the control variables.
6. A computer device, characterized in that: The computer device comprises a processor and a memory, wherein the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the computer device executes the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 4 is implemented.
