CN111580799A - Domain specific language script assembling method and system - Google Patents
Domain specific language script assembling method and system Download PDFInfo
- Publication number
- CN111580799A CN111580799A CN202010272748.2A CN202010272748A CN111580799A CN 111580799 A CN111580799 A CN 111580799A CN 202010272748 A CN202010272748 A CN 202010272748A CN 111580799 A CN111580799 A CN 111580799A
- Authority
- CN
- China
- Prior art keywords
- script
- data
- language
- original
- specific language
- 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.)
- Pending
Links
- 238000013515 script Methods 0.000 title claims abstract description 285
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000004590 computer program Methods 0.000 claims description 10
- 238000013507 mapping Methods 0.000 claims description 10
- 238000010586 diagram Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 238000006243 chemical reaction Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- 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/31—Programming languages or programming paradigms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/258—Data format conversion from or to a database
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/283—Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a domain specific language script splicing method, which comprises the following steps: acquiring an original script or an original script group in a data language format; identifying object types of the original script or original script packet in the data language format, the object types including logical objects, operators, and data objects; replacing a logic object in the object type with a logic block based on a script language, replacing the data object with a placeholder, combining the logic block, the placeholder and the operational character, and generating an initial version field specific language script or a script group based on the script language; and replacing the placeholders with the service data to generate a script or script group of the terminal version domain specific language based on the script language. The field specific language script assembling method, the field specific language script assembling system, the computer equipment and the computer readable storage medium improve the assembling efficiency of the field specific language script and optimize the performance of the system.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a domain specific language script assembling method and system.
Background
A domain-specific language (DSL) refers to a computer language that is dedicated to a certain application domain. Most of the domain-specific languages on the market currently only use a program language to package business logic and data, and users only need to provide simple logic without concern of the programming language and system processing details. However, the current domain-specific language design method on the market has a problem of data source acquisition. Often, designers cannot predict which data will be used by the user, so before executing the domain-specific language script written by the user, the designers will acquire all the data that may be used by the user and transfer the data to the domain-specific language script written by the user. The design mode leads the system to inquire useless data, so that the compiling efficiency is low and the system resource occupation is overhigh when the domain specific language script is compiled.
Disclosure of Invention
In view of this, embodiments of the present invention provide a domain-specific language script assembling method, system, computer device, and computer-readable storage medium, which are used to solve the problems of low compiling efficiency of the domain-specific language script and over-high system resource occupation.
The embodiment of the invention solves the technical problems through the following technical scheme:
a domain specific language script splicing method comprises the following steps:
acquiring an original script or an original script group in a data language format;
identifying object types of the original script or original script packet in the data language format, the object types including logical objects, operators, and data objects;
replacing a logic object in the object type with a logic block based on a script language, replacing the data object with a placeholder, combining the logic block, the placeholder and the operational character, and generating an initial version field specific language script or a script group based on the script language;
and replacing the placeholders with the service data to generate a script or script group of the terminal version domain specific language based on the script language.
Further, said identifying object types of the original script or original script packet in the data language format, the object types including logical objects, operators, and data objects comprises:
dividing the original script or the original script group in the data language format into a plurality of single characters;
and traversing the single characters and judging the object types of the single characters one by one.
Further, the replacing the logical object in the object type with a logical block based on a scripting language, replacing the data object with a placeholder, combining the logical block, the placeholder and the operator, and generating an initial version domain specific language script or script packet based on the scripting language includes:
pre-establishing and storing a mapping relation between the logic object and the logic block;
and acquiring the logic block according to the logic object and the mapping relation.
Further, the replacing the placeholder with the service data, and generating a final edition domain specific language script or script packet based on the data language format includes:
acquiring the service data;
and replacing the placeholders with the service data to generate a script or script group of a terminal version domain specific language based on the script language.
Further, the acquiring the service data includes:
acquiring a data definition written in the original script or the original script packet, wherein the data definition is used for positioning the position of data classification corresponding to the service data;
and acquiring a service main key corresponding to the service data, wherein the service main key is used for acquiring the service data from the data classification.
Further, the obtaining the script or script packet in the data language format includes:
receiving an original script in a data language format or an original script grouping acquisition instruction;
acquiring an instruction according to the original script or the original script group to generate a service code;
and acquiring the original script or the original script group in the data language format according to the service code.
Further, after the service data is acquired, the method further includes:
and caching the service data to avoid repeated acquisition of the service data.
In order to achieve the above object, the present invention further provides a domain-specific language script assembling system, including:
the script acquisition module is used for acquiring an original script or an original script group in a data language format;
the object type identification module is used for identifying the object type of the original script or the original script group in the data language format, and the object type comprises a logic object, an operator and a data object;
the initial version field specific language script generation module is used for replacing the logic object in the object type with a logic block based on a script language, replacing the data object with a placeholder, combining the logic block, the placeholder and the operational character, and generating an initial version field specific language script or a script group based on the script language;
and the terminal version field specific language script generation module is used for replacing the placeholder with service data and generating a terminal version field specific language script or script group based on the script language.
To achieve the above object, the present invention further provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the domain-specific language script assembling method as described above when executing the computer program.
To achieve the above object, the present invention also provides a computer-readable storage medium having stored therein a computer program, the computer program being executable by at least one processor to cause the at least one processor to perform the steps of the domain-specific language script assembling method as described above.
According to the domain specific language script assembling method, the domain specific language script assembling system, the computer equipment and the computer readable storage medium, data required by generating the domain specific language script are actively acquired, so that the occupation of system resources is reduced, and the compiling efficiency of the domain specific language script is improved; meanwhile, the placeholders are used for replacing business data, and then the placeholders are replaced by real business data through unified data query, so that frequent query of the needed business data is avoided, the assembly efficiency of the domain specific language script is improved, and the performance of the system is optimized.
The invention is described in detail below with reference to the drawings and specific examples, but the invention is not limited thereto.
Drawings
FIG. 1 is a flowchart illustrating steps of a domain specific language script assembling method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of the steps for obtaining an original script or an original script packet in a data language format;
FIG. 3 is a schematic flow chart illustrating the steps of identifying object types of the original script or original script packet in the data language format, wherein the object types include logical objects, operators, and data objects;
FIG. 4 is a flowchart illustrating the steps of replacing the logical objects in the object types with logical blocks based on a scripting language, replacing the data objects with placeholders, and combining the logical blocks, the placeholders, and the operators to generate scripts or script groups based on an initial domain specific language of the scripting language;
FIG. 5 is a flowchart illustrating the steps of replacing the placeholders with business data to generate script or script groupings based on the script language in the domain-specific language of the final edition;
fig. 6 is a schematic diagram of a specific process for acquiring the service data;
FIG. 7 is a schematic diagram of program modules of a second embodiment of a language-specific script assembly system in accordance with the present invention;
FIG. 8 is a diagram of a hardware configuration of a third embodiment of a computer apparatus according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Technical solutions between various embodiments may be combined with each other, but must be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Example one
Referring to fig. 1, a flowchart illustrating steps of a domain specific language script assembling method according to an embodiment of the present invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description is given by taking a computer device as an execution subject, specifically as follows:
step S100: an original script or original script packet in a data language format is obtained.
Specifically, the data language format refers to a language for unifying exchange formats when exchanging data at the front end and the back end of the computer, and in this embodiment, the data language format is a JSON format, and JSON (JavaScript Object Notation) is a lightweight data exchange format. It stores and represents data in a text format that is completely independent of the programming language.
In an exemplary embodiment, as shown in fig. 2, step S100 further includes:
step S101: receiving an original script in a data language format or an original script grouping acquisition instruction;
step S102: acquiring an instruction according to the original script or the original script group to generate a service code;
step S103: and acquiring the original script or the original script group in the data language format according to the service code.
Specifically, after receiving an acquisition request of an original script or an original script packet, the developer computer device acquires the original script or the original script packet in the JSON format from the script library. The script library is a warehouse for storing scripts and logical relations between the scripts, wherein the script library comprises scripts or script groups with multiple language formats, the scripts or the script groups with multiple language formats are pre-compiled for developers or users according to all services possibly related to a project and stored in the script library, each script or script group in the script library has a corresponding service code, the service code is pre-correspondingly set with an acquisition request of the script or the script group of the developers or the users, when the developers perform corresponding operations according to requirements and initiate a corresponding request for acquiring the script or the script group, the service code is triggered, and after the service code is triggered, the corresponding script or the script group is taken out from the script library.
The original script or the original script group defines the attributes of the service data in the script through a script language, wherein the attributes include a data code value, a data name, a data source processing type, a data source acquisition type, a resource identifier and the like, and the attributes of the service data are different according to different sub-scripts.
Step S200: identifying object types of the original script or original script packet in the data language format, the object types including logical objects, operators, and data objects;
in an exemplary embodiment, as shown in fig. 3, step S200 further includes:
step S201: dividing the original script or the original script group in the data language format into a plurality of single characters;
step S202: and traversing the single characters and judging the object types of the single characters one by one.
Specifically, in this embodiment, the script or the script packet is divided into a plurality of single characters by using a split method, where the split method is to slice a character string by specifying a separator, and the script or the script packet is divided into a plurality of single characters by setting a number parameter, a sep parameter, and a count parameter in the split method, so as to obtain a divided character string.
Traversing the segmented character strings, and judging the object types of the single characters one by one, in the embodiment, performing character matching in a classification dictionary to obtain the object types of the single characters, wherein the object types comprise logical objects, operational characters and data objects, and the logical objects refer to logically judged characters, such as if, else, for and other logical characters; operators refer to symbols used to describe a set of data values that can only be made, such as arithmetic operators, bitoperators, relational operators, and equivalent operators; data objects refer to constants, such as "1", "2", "3", etc., or variables, such as "a", "b", etc.
Step S300: and replacing the logic object in the object type with a logic block based on a script language, replacing the data object with a placeholder, combining the logic block, the placeholder and the operational character, and generating an initial version field specific language script or a script group based on the script language.
In an exemplary embodiment, as shown in fig. 4, step S300 further includes:
step S301: pre-establishing and storing a mapping relation between the logic object and the logic block;
step S302: and acquiring the logic block according to the logic object and the mapping relation.
In an exemplary embodiment, the scripting language is a Groovy language, which is an agile dynamic language for Java virtual machines, which is a mature object-oriented programming language that can be used for both object-oriented programming and as a pure scripting language.
In the embodiment, mapping relations of one-to-one correspondence conversion between the logic objects in the JSON format and the logic blocks in the Groovy language are pre-established and stored, the logic blocks in the Groovy language are obtained according to the logic objects in the JSON format and the mapping relations, and all the logic objects are replaced by the corresponding logic blocks.
Meanwhile, all data objects are uniformly replaced by placeholders, the placeholders refer to fixed positions occupied in a script or a script group in advance, different data objects are replaced by different placeholders, and the common placeholders comprise% i (integer placeholder),% f (floating point placeholder),% s (character string placeholder),% g (decimal or scientific counting placeholder) and the like. In this embodiment, since there are multiple data objects with the same data type, different identifiers are added to the placeholders to represent different data of a uniform data type, such as "% s placeholder 001", "% s placeholder 002", and "% s placeholder 003".
Step S400: and replacing the placeholders with the service data to generate a script or script group of the terminal version domain specific language based on the script language.
In an exemplary embodiment, as shown in fig. 5, step S400 further includes:
step S401: acquiring the service data;
step S402: and replacing the placeholders with the service data to generate a script or script group of a terminal version domain specific language based on the script language.
Specifically, after all service data of the script or the script packet are acquired, all the service data are used for replacing placeholders, and a terminal version field specific language script or a script packet based on the Groovy language is generated. All the data objects are replaced by the placeholders in batch, and then all the placeholders are replaced in batch after the business data is uniformly acquired, so that all the related business data in the script or script group can be inquired at one time, one business data does not need to be acquired, the inquiry is carried out at one time, the frequent inquiry of the needed business data is avoided, the performance of the system is optimized, and the generation speed of the domain specific language script or script group is improved.
In an exemplary embodiment, as shown in fig. 6, step S401 further includes:
S401A: and acquiring a data definition written in the original script or the original script packet in the data language format, wherein the data definition is used for positioning the position of the data classification corresponding to the service data.
Specifically, the data definition is written in a JSON-format script or a script packet in advance, and after the JSON-format script or the script packet is converted to generate a Groovy-language-based initial-version-domain-specific-language script or a script packet, the data definition also enters the Groovy-language-based initial-version-domain-specific-language script or the script packet.
The data definition defines attributes of service data, including data code values or data names. Firstly, acquiring a data source type corresponding to service data through attributes of the service data, wherein the data source type comprises system data, external system data and user-defined data, and when the data source type is the system data, acquiring a data resource position corresponding to the service data from the data source type, wherein the data resource position of the service data comprises a data table I, a data table II, a data table III and the like, and then acquiring a data classification position from the data resource position, when the data is defined as a data code value, the corresponding data classification position is classified as a data code value, and when the data is defined as a data name, the corresponding data classification position is classified as a data name; when the data source type is the data of the system, the data source type is analyzed into a corresponding data code value or a data name, and the corresponding data code value or the data name is used for inputting and storing external data into a corresponding data classification by a program; and when the data source type is user-defined data, the data is recorded into the system as fixed data.
A specific example is as follows, for example, If the script is If (audio-amount >% s placeholder 001), wherein the data code value is "audio-amount", then the data code value is located in the data classification with the audio-amount.
S401B: and acquiring a service main key corresponding to the service data, wherein the service main key is used for acquiring the service data from the data classification.
Specifically, the service primary key is a unique index generated when service data is generated, and is present in a system only once. For example, the main service key in the information system of public security and population membership is the identification number, the main service key in the personnel management system is the employee number, the main service key in the shopping system is the order number, the main service key in the payment system is the payment serial number, the main service key in the signature system is the contract number, and the main service key in the bank loan system is the borrow data number. The service main key is provided by a user side, and the user further obtains service data from the data classification through the service main key for the use of the code.
In an exemplary embodiment, the method further comprises:
and caching the service data to avoid repeated acquisition of the service data.
Further, after the service data is obtained by grouping the script or scripts in the specific language in the field of the initial edition, the service data is cached, and the subsequent reading of the service data is obtained through caching.
Specifically, a memory space is opened up for each thread, the obtained service data is cached by a user, after the current script or script packet conversion is completed, the cache space of the current thread is deleted, as long as a certain service data is obtained, the subsequent reading operation can be only obtained through caching, the same service data does not need to be inquired for many times, and the obtaining efficiency of the service data is improved.
In an exemplary embodiment, after the script or script packet conversion is completed to obtain the final version domain specific language script or script packet, the final version domain specific language script or script packet may be executed in packets, each script or script packet may be suspended with a plurality of scripts and a plurality of script packets, and the scripts and script packets may also be suspended in a same packet in a mixed manner. Wherein the packet type comprises a check packet and a logic processing packet, the check packet is used for checking the correctness of the data, and the logic processing packet is used for returning a calculated value.
The embodiment of the invention replaces the placeholder with the real service data by replacing the service data with the placeholder and then performing unified data query, thereby avoiding frequent query of the required service data and optimizing the performance of the system to a certain extent; in addition, the data required by splicing the domain specific language script is actively acquired by the domain specific language script generating end, so that the data acquisition efficiency is improved, the splicing speed of the domain specific language script is improved, and the occupation of system resources is reduced.
Example two
With continued reference to FIG. 7, a schematic diagram of program modules of a language specific script assembly system in the field of the present invention is shown. In this embodiment, the domain-specific language script assembling system 20 may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to implement the present invention and implement the domain-specific language script assembling method. The program module referred to in the embodiments of the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable for describing the execution process of the domain specific language script assembling system 20 in the storage medium than the program itself. The following description will specifically describe the functions of the program modules of the present embodiment:
the script obtaining module 200 is used for obtaining the original script or the original script packet in the data language format.
Further, the script obtaining module 200 is further configured to:
receiving an original script in a data language format or an original script grouping acquisition instruction;
acquiring an instruction according to the original script or the original script group to generate a service code;
and acquiring the original script or the original script group in the data language format according to the service code.
An object type identification module 202, configured to identify an object type of the original script or the original script packet in the data language format, where the object type includes a logical object, an operator, and a data object.
Further, the object type identification module 202 is further configured to:
dividing the original script or the original script group in the data language format into a plurality of single characters;
and traversing the single characters and judging the object types of the single characters one by one.
An initial domain specific language script generating module 204, configured to replace a logic object in the object type with a logic block based on a data language format, replace the data object with a placeholder, and combine the placeholder with the operator to generate an initial domain specific language script or a script packet based on the data language format;
further, the first edition domain specific language script generating module 204 is further configured to:
pre-establishing and storing a mapping relation between the logic object and the logic block;
and acquiring the logic block according to the logic object and the mapping relation.
And a terminal-version-domain-specific-language-script generating module 206, configured to replace the placeholder with service data, and generate a terminal-version-domain-specific-language script or a script packet based on a data language format.
Further, the end-edition domain-specific language script generating module 206 is further configured to:
acquiring the service data;
and replacing the placeholders with the service data to generate a script or script group of a terminal version domain specific language based on the script language.
Further, the end-edition domain-specific language script generating module 206 is further configured to:
acquiring a data definition written in the original script or the original script packet in the data language format, wherein the data definition is used for positioning the position of data classification corresponding to the service data;
and acquiring a service main key corresponding to the service data, wherein the service main key is used for acquiring the service data from the data classification.
Further, the end-edition domain-specific language script generating module 206 is further configured to:
and caching the service data to avoid repeated acquisition of the service data.
EXAMPLE III
Fig. 8 is a schematic diagram of a hardware architecture of a computer device according to a third embodiment of the present invention. In the present embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a preset or stored instruction. The computer device 2 may be a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers), and the like. As shown in FIG. 8, the computer device 2 includes, but is not limited to, at least a memory 21, a processor 22, a network interface 23, and a domain-specific language script assembling system 20, which are communicatively connected to each other via a system bus. Wherein:
in this embodiment, the memory 21 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the computer device 2. Of course, the memory 21 may also comprise both internal and external memory units of the computer device 2. In this embodiment, the memory 21 is generally used for storing an operating system installed on the computer device 2 and various types of application software, such as the program codes of the domain-specific language script assembling system 20 described in the above embodiments. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
The network interface 23 may comprise a wireless network interface or a wired network interface, and the network interface 23 is generally used for establishing communication connection between the computer device 2 and other electronic apparatuses. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 2 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like.
It is noted that fig. 8 only shows the computer device 2 with components 20-23, but it is to be understood that not all shown components are required to be implemented, and that more or less components may be implemented instead.
In this embodiment, the domain-specific language script assembling system 20 stored in the memory 21 can be further divided into one or more program modules, and the one or more program modules are stored in the memory 21 and executed by one or more processors (in this embodiment, the processor 22) to complete the present invention.
For example, fig. 7 is a schematic diagram of program modules of a second embodiment of the domain-specific language script assembling system 20, in which the domain-specific language script assembling system 20 can be divided into a script obtaining module 200, an object type identifying module 202, an initial domain-specific language script generating module 204, and a final domain-specific language script generating module 206. The program module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable for describing the execution process of the domain-specific language script assembling system 20 in the computer device 2 than a program. The specific functions of the program module script obtaining module 200-the terminal version domain specific language script generating module 206 have been described in detail in the above embodiments, and are not described herein again.
Example four
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of this embodiment is used for storing the domain-specific language script assembling system 20, and when being executed by the processor, the computer-readable storage medium implements the domain-specific language script assembling method described in the foregoing embodiment.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A domain specific language script splicing method is characterized by comprising the following steps:
acquiring an original script or an original script group in a data language format;
identifying object types of the original script or original script packet in the data language format, the object types including logical objects, operators, and data objects;
replacing a logic object in the object type with a logic block based on a script language, replacing the data object with a placeholder, combining the logic block, the placeholder and the operational character, and generating an initial version field specific language script or a script group based on the script language;
and replacing the placeholders with the service data to generate a script or script group of the terminal version domain specific language based on the script language.
2. The method of claim 1, wherein identifying object types of the raw scripts or raw script packets in the data language format, the object types including logical objects, operators, and data objects comprises:
dividing the original script or the original script group in the data language format into a plurality of single characters;
and traversing the single characters and judging the object types of the single characters one by one.
3. The method of claim 2, wherein replacing the logical objects in the object types with logical blocks based on a scripting language, replacing the data objects with placeholders, combining the logical blocks, the placeholders, and the operators, and generating an initial version of a domain-specific language script or script packet based on a scripting language comprises:
pre-establishing and storing a mapping relation between the logic object and the logic block;
and acquiring the logic block according to the logic object and the mapping relation.
4. The method of claim 3, wherein replacing the placeholders with the service data to generate a final version domain specific language script or script packet based on a data language format comprises:
acquiring the service data;
and replacing the placeholders with the service data to generate a script or script group of a terminal version domain specific language based on the script language.
5. The domain specific language script assembling method of claim 4, wherein said obtaining said service data comprises:
acquiring a data definition written in the original script or the original script packet in the data language format, wherein the data definition is used for positioning the position of data classification corresponding to the service data;
and acquiring a service main key corresponding to the service data, wherein the service main key is used for acquiring the service data from the data classification.
6. The domain specific language script assembling method of claim 5, wherein said obtaining raw scripts or raw script packets in a data language format comprises:
receiving an original script in a data language format or an original script grouping acquisition instruction;
acquiring an instruction according to the original script or the original script group to generate a service code;
and acquiring the original script or the original script group in the data language format according to the service code.
7. The domain specific language script assembling method of claim 6, wherein after obtaining the service data, the method further comprises:
and caching the service data to avoid repeated acquisition of the service data.
8. A domain specific language script assembly system, comprising:
the script acquisition module is used for acquiring an original script or an original script group in a data language format;
the object type identification module is used for identifying the object type of the original script or the original script group in the data language format, and the object type comprises a logic object, an operator and a data object;
the initial version field specific language script generation module is used for replacing the logic object in the object type with a logic block based on a script language, replacing the data object with a placeholder, combining the logic block, the placeholder and the operational character, and generating an initial version field specific language script or script group based on a data language format;
and the terminal version field specific language script generation module is used for replacing the placeholder with service data and generating a terminal version field specific language script or script group based on the script language.
9. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor when executing the computer program implements the steps of the domain-specific language script assembly method of any one of claims 1 to 7.
10. A computer-readable storage medium, having stored therein a computer program executable by at least one processor to cause the at least one processor to perform the steps of the domain-specific language script assembly method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010272748.2A CN111580799A (en) | 2020-04-09 | 2020-04-09 | Domain specific language script assembling method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010272748.2A CN111580799A (en) | 2020-04-09 | 2020-04-09 | Domain specific language script assembling method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111580799A true CN111580799A (en) | 2020-08-25 |
Family
ID=72111429
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010272748.2A Pending CN111580799A (en) | 2020-04-09 | 2020-04-09 | Domain specific language script assembling method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111580799A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112269566A (en) * | 2020-11-03 | 2021-01-26 | 支付宝(杭州)信息技术有限公司 | Script generation processing method, device, equipment and system |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2002052529A1 (en) * | 2000-12-22 | 2002-07-04 | Siemens Aktiengesellschaft | Multimedia platform and method for supporting an interactive, voice-oriented access to information that is to be transmitted |
US6829746B1 (en) * | 1999-12-09 | 2004-12-07 | International Business Machines Corp. | Electronic document delivery system employing distributed document object model (DOM) based transcoding |
US20130104100A1 (en) * | 2011-10-21 | 2013-04-25 | Sap Ag | Scripting Language for Business Applications |
US20140258321A1 (en) * | 2013-03-11 | 2014-09-11 | Sap Ag | Dynamic bridging of application and data servers |
US20140282376A1 (en) * | 2013-03-15 | 2014-09-18 | Sap Ag | Tailored language sets for business level scripting |
CN106843878A (en) * | 2017-01-20 | 2017-06-13 | 武汉斗鱼网络科技有限公司 | A kind of model generating method and system |
CN107844465A (en) * | 2017-11-11 | 2018-03-27 | 江西金格科技股份有限公司 | A kind of method that OFD format files support script |
CN110175031A (en) * | 2019-04-25 | 2019-08-27 | 平安科技(深圳)有限公司 | Sql like language changes into the method, apparatus, computer equipment and storage medium of DSL language |
-
2020
- 2020-04-09 CN CN202010272748.2A patent/CN111580799A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6829746B1 (en) * | 1999-12-09 | 2004-12-07 | International Business Machines Corp. | Electronic document delivery system employing distributed document object model (DOM) based transcoding |
WO2002052529A1 (en) * | 2000-12-22 | 2002-07-04 | Siemens Aktiengesellschaft | Multimedia platform and method for supporting an interactive, voice-oriented access to information that is to be transmitted |
US20130104100A1 (en) * | 2011-10-21 | 2013-04-25 | Sap Ag | Scripting Language for Business Applications |
US20140258321A1 (en) * | 2013-03-11 | 2014-09-11 | Sap Ag | Dynamic bridging of application and data servers |
US20140282376A1 (en) * | 2013-03-15 | 2014-09-18 | Sap Ag | Tailored language sets for business level scripting |
CN106843878A (en) * | 2017-01-20 | 2017-06-13 | 武汉斗鱼网络科技有限公司 | A kind of model generating method and system |
CN107844465A (en) * | 2017-11-11 | 2018-03-27 | 江西金格科技股份有限公司 | A kind of method that OFD format files support script |
CN110175031A (en) * | 2019-04-25 | 2019-08-27 | 平安科技(深圳)有限公司 | Sql like language changes into the method, apparatus, computer equipment and storage medium of DSL language |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112269566A (en) * | 2020-11-03 | 2021-01-26 | 支付宝(杭州)信息技术有限公司 | Script generation processing method, device, equipment and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112015430A (en) | JavaScript code translation method and device, computer equipment and storage medium | |
CN111414391A (en) | Method and system for accessing multiple data sources | |
CN110928802A (en) | Test method, device, equipment and storage medium based on automatic generation of case | |
CN110688096B (en) | Method and device for constructing application program containing plug-in, medium and electronic equipment | |
CN115599386A (en) | Code generation method, device, equipment and storage medium | |
CN114816420A (en) | Data processing method and device | |
CN114218315A (en) | Interface generation method and device, computer equipment and storage medium | |
CN112346775B (en) | Index data general processing method, electronic device and storage medium | |
CN111240772B (en) | Block chain-based data processing method, device and storage medium | |
CN112965721A (en) | Android-based project compiling method and device, computer equipment and storage medium | |
CN111580799A (en) | Domain specific language script assembling method and system | |
CN111324645B (en) | Block chain data processing method and device | |
CN117008920A (en) | Engine system, request processing method and device, computer equipment and storage medium | |
CN114625372A (en) | Automatic component compiling method and device, computer equipment and storage medium | |
CN114371886A (en) | Front-end frame assembly conversion method and device, computer equipment and storage medium | |
CN115150483A (en) | Network data packet analysis method, system and readable storage medium | |
CN115576624A (en) | Programming framework optimization method, system, terminal equipment and storage medium | |
CN112988778B (en) | Method and device for processing database query script | |
CN114186958A (en) | Method, computing device and storage medium for exporting list data as spreadsheet | |
CN114003317B (en) | Inline implementation method and device, electronic equipment, storage medium and program product | |
CN113806372B (en) | New data information construction method, device, computer equipment and storage medium | |
CN112052034B (en) | Computing interface construction method, device, computer equipment and readable storage medium | |
EP4068141B1 (en) | Method and system to enable print functionality in high-level synthesis (hls) design platforms | |
CN115964075A (en) | Application export and import method and device, computer equipment and storage medium | |
CN110413644B (en) | Data caching method, electronic device and computer readable storage 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 |