Mobile terminal DSL (Digital Subscriber Line) engine implementation method and device, equipment, medium and product

The method enhances mobile DSL engine performance by optimizing lexical and grammatical parsing, using user behavior prediction and just-in-time compilation to improve execution efficiency and responsiveness on mobile devices.

CN119201119APending Publication Date: 2024-12-27BEIJING BAILONG MAYUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411117419.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Traditional mobile DSL engines suffer from poor performance and low execution efficiency due to resource limitations and inefficient lexical and grammatical parsing on mobile devices.

Method used

A method involving lexical and grammatical analysis of DSL source code, user behavior prediction, just-in-time compilation, and dynamic thread pool adjustment to optimize execution efficiency, including caching and pre-execution of tasks based on user behavior.

Benefits of technology

Improves the execution efficiency of DSL code on mobile devices by reducing repeated calculations and optimizing resource usage, ensuring rapid output and responsiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201119A_ABST
    Figure CN119201119A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of mobile application development, and discloses a mobile terminal DSL (Digital Subscriber Line) engine implementation method, device, equipment, medium and product, the method comprises the following steps: sequentially performing lexical analysis and syntactic analysis on a DSL source code through a lexical analyzer and a syntactic analyzer to obtain a to-be-executed instruction; judging whether the to-be-executed instruction is matched with a pre-executed task or not; if the instruction to be executed is matched with a pre-executed task, outputting a pre-cached execution result corresponding to the pre-executed task, the pre-executed task being obtained based on user behavior prediction, and the execution result corresponding to the pre-executed task being obtained by pre-executing the pre-executed task; if the to-be-executed instruction is not matched with the pre-executed task, the to-be-executed instruction is executed through the execution unit, and the execution result is output, the execution result can be rapidly output, and the DSL code execution efficiency of the mobile terminal is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of mobile application development, and in particular to a method, device, equipment, medium and product for implementing a mobile DSL engine. Background Art

[0002] In the development of mobile applications, it is often necessary to use a Domain-Specific Language (DSL) engine to describe the business logic of a specific domain, such as UI layout, data validation, etc.

[0003] However, due to the performance and resource limitations of mobile devices, traditional mobile DSL engines cannot provide good performance and response speed on mobile devices, and the efficiency of executing DSL code on mobile devices is low. Summary of the invention

[0004] In view of this, the present invention provides a method, apparatus, device, medium and product for implementing a mobile DSL engine to solve or partially solve the technical problem of low efficiency in executing DSL codes on existing mobile devices.

[0005] In a first aspect, the present invention provides a method for implementing a mobile DSL engine, comprising: performing lexical analysis and grammatical analysis on a DSL source code by a lexical analyzer and a grammatical analyzer in turn to obtain instructions to be executed; judging whether the instructions to be executed match a pre-execution task; if the instructions to be executed match the pre-execution task, outputting a pre-cached execution result corresponding to the pre-execution task, wherein the pre-execution task is obtained based on user behavior prediction, and the execution result corresponding to the pre-execution task is obtained by pre-executing the pre-execution task; if the instructions to be executed do not match the pre-execution task, executing the instructions to be executed by an execution unit and outputting the execution result.

[0006] A mobile terminal DSL engine implementation method of the present invention performs lexical analysis and grammatical analysis on DSL source code through a lexical analyzer and a grammatical analyzer to obtain instructions to be executed, and determines whether the instructions to be executed match a pre-execution task. If the instructions to be executed match the pre-execution task, the execution result corresponding to the pre-execution task cached in advance is output; if the instructions to be executed do not match the pre-execution task, the execution unit executes the instructions to be executed and outputs the execution result, so that the execution result can be output quickly, thereby improving the execution efficiency of the DSL code.

[0007] Optionally, the user behavior includes an operation mode and a behavior path of the user; correspondingly, the step of predicting the pre-execution task includes: using a machine learning algorithm to predict the pre-execution task according to the operation mode and the behavior path.

[0008] In this method, the user's operation mode and behavior path are used in combination with a machine learning algorithm to predict the tasks that the user may perform, which can increase the matching probability between the predicted pre-execution tasks and the instructions to be executed, thereby further improving the execution efficiency.

[0009] Optionally, after obtaining the instructions to be executed, the method further includes: identifying hotspot codes in the DSL source code based on user behavior; and optimizing the hotspot codes in combination with a just-in-time compilation technology.

[0010] In this way, by identifying hot spots in the DSL source code and optimizing it with just-in-time compilation technology, the efficiency of word parsing and grammar parsing can be improved, thereby improving the overall execution efficiency.

[0011] Optionally, after obtaining the instruction to be executed, the method further includes: obtaining a real-time load condition of the current device; and adjusting a size of a thread pool of the DSL engine based on the real-time load condition.

[0012] In this way, the size of the thread pool is dynamically adjusted according to the real-time load of the device, which can increase the concurrent processing capability of the DSL engine and ensure the response speed and stability of the DSL engine under different loads.

[0013] Optionally, after the execution unit executes the instruction to be executed and outputs the execution result, the method further includes: caching the instruction to be executed and the execution result corresponding to the instruction to be executed; when the instruction corresponding to the subsequently input DSL source code is the same as the cached instruction to be executed, outputting the execution result corresponding to the cached instruction to be executed.

[0014] In this method, the execution results are cached, and when the same instruction is executed again, the results can be output directly, reducing repeated calculations and improving execution efficiency.

[0015] Optionally, the lexical analyzer uses a deterministic finite automaton algorithm or a non-deterministic finite automaton algorithm to perform lexical analysis; and / or, the syntax analyzer uses a recursive descent analyzer or a LL(K) analyzer to perform syntax analysis.

[0016] In this way, fast lexical analysis and grammatical analysis can be achieved.

[0017] In a second aspect, the present invention provides a mobile DSL engine implementation device, comprising: a source code analysis module, used to perform lexical analysis and grammatical analysis on a DSL source code through a lexical analyzer and a grammatical analyzer in sequence to obtain instructions to be executed; an instruction judgment module, used to judge whether the instructions to be executed match a pre-execution task; a first result output module, used to output a pre-cached execution result corresponding to the pre-execution task if the instructions to be executed match the pre-execution task, wherein the pre-execution task is obtained based on user behavior prediction, and the execution result corresponding to the pre-execution task is obtained by pre-executing the pre-execution task; a second result output module, used to execute the instructions to be executed through an execution unit and output the execution result if the instructions to be executed do not match the pre-execution task.

[0018] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the mobile DSL engine implementation method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0019] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to cause a computer to execute the mobile DSL engine implementation method of the first aspect or any corresponding embodiment thereof.

[0020] In a fifth aspect, the present invention provides a computer program product, including computer instructions, wherein the computer instructions are used to enable a computer to execute the mobile DSL engine implementation method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 It is a flowchart of a method for implementing a mobile DSL engine according to an embodiment of the present invention;

[0023] Figure 2 is a flowchart of another method for implementing a mobile DSL engine according to an embodiment of the present invention;

[0024] Figure 3 is a structural block diagram of a mobile DSL engine implementation device according to an embodiment of the present invention;

[0025] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0027] In view of the problem that traditional mobile DS engines cannot provide good performance and response speed on mobile devices due to fixed thread pools, repeated execution of high-frequency behaviors, no preloading optimization process, no improvement in lexical and grammatical parsing efficiency, and low DSL code execution efficiency, an embodiment of the present invention provides a mobile DSL engine implementation method, which can improve the efficiency of mobile DSL engine in executing DSL code.

[0028] According to an embodiment of the present invention, a method for implementing a mobile DSL engine is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical sequence is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0029] In this embodiment, a method for implementing a mobile DSL engine is provided, which can be used in mobile terminals, such as mobile phones, tablet computers, etc. Figure 1 As shown, the process includes the following steps:

[0030] Step S101 , lexical analysis and grammatical analysis are performed on the DSL source code by a lexical analyzer and a grammatical analyzer in turn to obtain instructions to be executed.

[0031] Specifically, a lexical analyzer is used to scan the DSL source code and decompose the source code into a series of morphemes. For example, identifiers, keywords, and symbols in the source code are identified and converted into morpheme sequences.

[0032] In one example, an efficient lexical analysis algorithm, such as a deterministic finite automaton algorithm or a nondeterministic finite automaton algorithm (Deterministic Finite Automaton, DFA) or a nondeterministic finite automaton algorithm (Nondeterministic Finite Automaton, NFA), is used to implement fast lexical analysis.

[0033] At the same time, pre-compilation technology is used to pre-compile the DSL source code into a lexical unit stream to reduce the overhead of lexical analysis.

[0034] The parser receives a morpheme sequence and constructs an Abstract Syntax Tree (AST) according to the grammatical rules of the DSL. For example, the parser uses a recursive descent parser or an LL(K) parser to perform grammatical analysis and construct an AST. A lightweight execution engine is used to optimize the CPU and memory characteristics of mobile devices, and Just-in-time compilation (JIT) technology is used to dynamically compile the DSL source code into machine code, i.e., instructions to be executed, to improve execution efficiency.

[0035] Step S102, determining whether the instruction to be executed matches the pre-execution task.

[0036] Step S103, if the instruction to be executed matches the pre-execution task, then the execution result corresponding to the pre-execution task cached in advance is output, wherein the pre-execution task is obtained based on user behavior prediction, and the execution result corresponding to the pre-execution task is obtained by pre-executing the pre-execution task.

[0037] Step S104: If the instruction to be executed does not match the pre-execution task, the execution unit executes the instruction to be executed and outputs the execution result.

[0038] Specifically, a cache technology is used to cache pre-execution tasks and corresponding execution results.

[0039] When it is detected that the current instruction to be executed matches the pre-execution task, since the corresponding execution result has been pre-cached, the cached execution result can be directly output at this time, thereby improving the overall execution efficiency.

[0040] When the instruction to be executed does not match the pre-execution task, it means that the execution result of the instruction to be executed has not been cached. At this time, the execution unit needs to execute the instruction to be executed and output the execution result.

[0041] By analyzing user behavior and predicting user behavior to obtain pre-execution tasks, the predicted pre-execution tasks are pre-executed and added to the pre-fetch task management, waiting for the user's actual behavior to specify pre-fetching. By predicting pre-execution tasks based on user behavior, the probability of matching the instructions to be executed with the pre-execution tasks can be increased, thereby improving execution efficiency.

[0042] A mobile terminal DSL engine implementation method according to an embodiment of the present invention performs lexical analysis and grammatical analysis on a DSL source code through a lexical analyzer and a grammatical analyzer to obtain instructions to be executed, and determines whether the instructions to be executed match a pre-execution task. If the instructions to be executed match the pre-execution task, an execution result corresponding to the pre-execution task cached in advance is output; if the instructions to be executed do not match the pre-execution task, an execution unit executes the instructions to be executed and outputs the execution result, thereby enabling rapid output of the execution result and improving the DSL code execution efficiency.

[0043] In some embodiments, the user behavior includes the user's operation mode and behavior path; correspondingly, the step of predicting the pre-execution task in step S103 includes:

[0044] Using machine learning algorithms, pre-execution tasks are predicted based on operation modes and behavior paths.

[0045] Specifically, after the instructions are collected, the inference engine predicts the user behavior. Exemplarily, the inference engine is an MNN neural network inference engine.

[0046] The inference engine uses machine learning algorithms to identify and record the user's common operation modes and paths. This includes frequently used functions, frequently operated behavior paths, and independent modules that are used at high and medium frequencies. At the same time, machine learning algorithms are used to predict the data that may be needed based on user behavior to obtain the corresponding pre-execution tasks. By executing the pre-execution tasks, the required data results can be obtained.

[0047] Execute the pre-execution tasks in advance and load the execution results into the memory, and use the prefetch queue to manage the prefetch tasks.

[0048] In an embodiment of the present invention, the user's operation mode and behavior path are utilized in combination with a machine learning algorithm to predict the tasks that the user may perform, so that the matching probability between the predicted pre-execution tasks and the instructions to be executed can be increased, thereby further improving the execution efficiency.

[0049] In some embodiments, after obtaining the instruction to be executed in step S101, the method further includes:

[0050] Step S1011, identifying hotspot codes in the DSL source code based on user behavior.

[0051] Specifically, user behavior includes high-frequency functions, behavior paths, and independent module scopes. The inference engine identifies hotspot codes based on the high-frequency functions, behavior paths, and independent module scopes.

[0052] Step S1012, optimizing the hotspot code by combining the just-in-time compilation technology.

[0053] Combined with just-in-time compilation technology, hot code optimization such as inlining, loop expansion, macro expansion, etc., improves the efficiency of word parsing and syntax parsing, thereby improving the overall execution efficiency.

[0054] In the embodiment of the present invention, by identifying hot spots in the DSL source code and optimizing it in combination with the just-in-time compilation technology, the efficiency of word parsing and grammar parsing can be improved, thereby improving the overall execution efficiency.

[0055] Furthermore, an optimization strategy based on user behavior can be adopted to dynamically optimize the execution path and performance of the DSL source code according to the user's operation mode.

[0056] In some embodiments, after obtaining the instruction to be executed in step S101, the method further includes:

[0057] Step S1013, obtaining the real-time load status of the current device.

[0058] For example, real-time monitoring of the load on the current device can help understand the processing power requirements.

[0059] Step S1014: adjusting the size of the thread pool of the DSL engine based on the real-time load situation.

[0060] Specifically, a load adapter is set in the DSL engine, and the load adapter performs thread pool size adjustment based on the real-time load of the current device. For example, if the real-time load is detected to be large, the thread pool size needs to be increased; if the real-time load is detected to be small, the thread pool size needs to be reduced.

[0061] By dynamically adjusting the size of the thread pool according to the real-time load of the device, the concurrent processing capability of the DSL engine can be increased while ensuring the response speed and stability of the DSL engine under different loads.

[0062] In some embodiments, after the execution unit executes the instruction to be executed and outputs the execution result in step S104, the method further includes:

[0063] Step S1041, cache the instructions to be executed and the execution results corresponding to the instructions to be executed.

[0064] Step S1042: when the instruction corresponding to the subsequently input DSL source code is the same as the cached instruction to be executed, the execution result corresponding to the cached instruction to be executed is output.

[0065] Specifically, the execution results and instructions to be executed output by the execution unit are cached, and when the DSL source code is subsequently executed, the cache is hit through the same instruction, and the result can be directly output, thereby reducing repeated calculations and improving execution efficiency.

[0066] like Figure 2As shown, an embodiment of the present invention provides a method for implementing a mobile DSL engine, comprising the following steps:

[0067] 1. After the DSL source code is analyzed lexically and grammatically, the instructions to be executed are passed to the instruction collector, which synchronously executes the load adapter and the inference engine.

[0068] 2. The load adapter adjusts the execution thread pool size based on the current real-time load of the device to increase concurrent processing capabilities.

[0069] 3. The pre-fetch task management function determines whether the instruction to be executed hits the task pre-fetch. If not, it is handed over to the execution unit for execution and output. If it hits, it bypasses the execution unit and directly outputs the result, which speeds up the result output and greatly improves the overall execution efficiency.

[0070] 4. After the instructions are collected, the inference engine identifies the hot code based on the user behavior and predicts the user behavior at the same time. The predicted pre-execution tasks are pre-executed and added to the pre-fetch task management, waiting for the user's actual behavior to specify pre-fetching.

[0071] 5. Hotspot codes are identified by the inference engine and optimized by JIT technology, such as inlining, loop expansion, macro expansion, etc., to improve the efficiency of word parsing and syntax parsing, thereby improving the overall execution efficiency.

[0072] 6. Cache the results and instructions output by the instruction execution unit. When the DSL source code is subsequently executed, the cache hit is performed through the same instruction. If a cache hit is found, the result is directly output to improve execution efficiency.

[0073] The mobile DSL engine implementation method provided by the embodiment of the present invention has the following advantages:

[0074] DSL code can be quickly parsed and executed on mobile devices, providing good performance and responsiveness to meet the needs of mobile applications.

[0075] At the same time, it supports various types of DSL, such as UI layout, data validation, etc. Taking the UI layout in a mobile application as an example, the embodiment of the present invention can use a DSL engine to describe the structure and style of the UI layout, and then implement fast UI rendering through the DSL engine.

[0076] By utilizing the mobile DSL engine implementation method provided by the embodiment of the present invention, it is possible to significantly improve performance and optimize resource usage, quickly iterate and customize development, improve development efficiency and simplify maintenance, enhance user experience, ensure cross-platform consistency, reduce development and maintenance costs, and improve market response speed and competitiveness.

[0077] The embodiment of the present invention also provides a mobile terminal DSL engine implementation device, such as Figure 3 As shown, including:

[0078] The source code analysis module 301 is used to perform lexical analysis and grammatical analysis on the DSL source code through a lexical analyzer and a grammatical analyzer in sequence to obtain instructions to be executed;

[0079] The instruction judgment module 302 is used to judge whether the instruction to be executed matches the pre-execution task;

[0080] A first result output module 303 is used to output the execution result corresponding to the pre-cached pre-execution task if the instruction to be executed matches the pre-execution task, wherein the pre-execution task is obtained based on the user behavior prediction, and the execution result corresponding to the pre-execution task is obtained by pre-executing the pre-execution task;

[0081] The second result output module 304 is used to execute the instruction to be executed through the execution unit and output the execution result if the instruction to be executed does not match the pre-execution task.

[0082] The mobile terminal DSL engine implementation device of the embodiment of the present invention performs lexical analysis and grammatical analysis on the DSL source code through a lexical analyzer and a grammatical analyzer to obtain instructions to be executed, and determines whether the instructions to be executed match the pre-execution task. If the instructions to be executed match the pre-execution task, the execution result corresponding to the pre-cached pre-execution task is output; if the instructions to be executed do not match the pre-execution task, the execution unit executes the instructions to be executed and outputs the execution result, so that the execution result can be output quickly, thereby improving the execution efficiency of the DSL code.

[0083] Furthermore, the user behavior includes the user's operation mode and behavior path; the first result output module 103 includes:

[0084] The prediction module is used to use machine learning algorithms to predict pre-execution tasks based on operation modes and behavior paths.

[0085] Furthermore, the source code analysis module 301 includes:

[0086] Hotspot code identification module, used to identify hotspot codes in DSL source code based on user behavior;

[0087] The code optimization module is used to optimize hotspot codes by combining the just-in-time compilation technology.

[0088] Furthermore, the source code analysis module 301 also includes:

[0089] Load acquisition condition, used to obtain the real-time load condition of the current equipment;

[0090] The thread pool adjustment module is used to adjust the size of the thread pool of the DSL engine based on the real-time load situation.

[0091] Further, the second result output module 304 includes:

[0092] A result cache module is used to cache the instructions to be executed and the execution results corresponding to the instructions to be executed;

[0093] When the output module is hit, and when the instruction corresponding to the DSL source code input subsequently is the same as the cached instruction to be executed, the execution result corresponding to the cached instruction to be executed is output.

[0094] Further, the lexical analyzer uses a deterministic finite automaton algorithm or a non-deterministic finite automaton algorithm to perform lexical analysis;

[0095] And / or, the syntax analyzer uses a recursive descent analyzer or a LL(K) analyzer to perform syntax analysis.

[0096] The embodiment of the present invention also provides a schematic diagram of the structure of a computer device, such as Figure 4 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.

[0097] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. 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.

[0098] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0099] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0100] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0101] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0102] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0103] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0104] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0105] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope of protection.

Claims

1. A method for implementing a mobile DSL engine, characterized in that: include: The DSL source code is lexically analyzed and parsed by the lexical analyzer and the grammatical analyzer respectively to obtain the instructions to be executed; Determining whether the instruction to be executed matches the pre-execution task; If the to-be-executed instruction matches the pre-execution task, outputting the pre-cached execution result corresponding to the pre-execution task, wherein the pre-execution task is obtained based on user behavior prediction, and the execution result corresponding to the pre-execution task is obtained by pre-executing the pre-execution task; If the instruction to be executed does not match the pre-execution task, the instruction to be executed is executed by the execution unit and an execution result is output.

2. The method for implementing a mobile DSL engine according to claim 1, characterized in that: The user behavior includes the user's operation mode and behavior path; Correspondingly, the step of predicting the pre-execution task includes: The pre-execution task is predicted based on the operation mode and the behavior path using a machine learning algorithm.

3. The method for implementing a mobile DSL engine according to claim 1, characterized in that: After obtaining the instruction to be executed, the method further includes: Identify hotspot codes in the DSL source code based on user behavior; The hotspot code is optimized by combining the just-in-time compilation technology.

4. The method for implementing a mobile DSL engine according to claim 1, characterized in that: After obtaining the instruction to be executed, the method further includes: Get the real-time load status of the current device; The size of the thread pool of the DSL engine is adjusted based on the real-time load situation.

5. The method for implementing a mobile DSL engine according to claim 1, characterized in that: After the execution unit executes the instruction to be executed and outputs the execution result, the method further includes: caching the instructions to be executed and the execution results corresponding to the instructions to be executed; When the instruction corresponding to the DSL source code input subsequently is the same as the cached instruction to be executed, the execution result corresponding to the cached instruction to be executed is output.

6. The method for implementing a mobile DSL engine according to claim 1, characterized in that: The lexical analyzer uses a deterministic finite automaton algorithm or a non-deterministic finite automaton algorithm to perform lexical analysis; And / or, the syntax analyzer uses a recursive descent analyzer or a LL(K) analyzer to perform syntax analysis.

7. A mobile DSL engine implementation device, characterized in that: include: The source code analysis module is used to perform lexical analysis and grammatical analysis on the DSL source code through a lexical analyzer and a grammatical analyzer in turn to obtain instructions to be executed; An instruction judgment module is used to judge whether the instruction to be executed matches the pre-execution task; A first result output module, configured to output a pre-cached execution result corresponding to the pre-execution task if the to-be-executed instruction matches the pre-execution task, wherein the pre-execution task is obtained based on user behavior prediction, and the execution result corresponding to the pre-execution task is obtained by pre-executing the pre-execution task; The second result output module is used to execute the instruction to be executed through the execution unit and output the execution result if the instruction to be executed does not match the pre-execution task.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the mobile DSL engine implementation method according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the mobile DSL engine implementation method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the mobile DSL engine implementation method according to any one of claims 1 to 6.