Data processing method and data processing apparatus
By acquiring and parsing DSL scripts to generate semantic executors, the response data of HTTP requests is automatically processed, solving the problem of needing to manually call multiple tools in existing technologies and achieving simplified and efficient data processing.
Patent Information
- Application Number
- CN202211350307.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-10-31
AI Technical Summary
Existing technologies require manual invocation of multiple external third-party tools such as jq, grep, sed, and awk to process HTTP request response data, with each step being independent and cumbersome.
By acquiring domain-specific language (DSL) scripts, parsing the DSL scripts to obtain semantic executors, and using the semantic executors to send HTTP requests and process response data based on business logic data, automatic data processing is achieved.
It eliminates the need for manual invocation of third-party tools, simplifying the data processing workflow and improving processing efficiency and convenience.
Smart Images

Figure CN116127225B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically to a data processing method and a data processing device. Background Technology
[0002] Currently, for HTTP requests, the usual approach is to first send an HTTP request via cURL to obtain the response data, and then save the obtained response data locally. When users need to process the response data (such as searching, replacing characters, etc.), they need to manually call external third-party tools such as jq, grep, sed, and awk to process the data according to their needs. Each step is independent and complex. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a data processing method and a data processing device that can automatically process data according to data processing business logic without requiring manual invocation of third-party tools, making it convenient and fast.
[0004] According to a first aspect of the present invention, a data processing method is provided, comprising: acquiring a domain-specific language (DSL) script, wherein the DSL script defines a Hypertext Transfer Protocol (HTTP) request and business logic data for processing response data of the HTTP request; parsing the DSL script to obtain a semantic executor; using the semantic executor to send an HTTP request and acquire response data of the HTTP request; and using the semantic executor to process the response data based on the business logic data to obtain a data processing result.
[0005] According to a second aspect of the present invention, a data processing apparatus is provided, comprising: an acquisition module for acquiring a domain-specific language (DSL) script, wherein the DSL script defines a Hypertext Transfer Protocol (HTTP) request and business logic data for processing response data of the HTTP request; a parsing module for parsing the DSL script to obtain a semantic executor; a sending module for sending an HTTP request using the semantic executor and obtaining response data of the HTTP request; and a processing module for processing the response data based on the business logic data using the semantic executor to obtain a data processing result.
[0006] According to a third aspect of the present invention, a computer-readable storage medium is provided, the storage medium storing a computer program for performing the data processing method described in any of the above embodiments.
[0007] According to a fourth aspect of the present invention, an electronic device is provided, the electronic device comprising: a processor; and a memory for storing processor-executable instructions, wherein the processor is configured to perform the data processing method described in any of the above embodiments.
[0008] According to the technical solution provided by the embodiments of the present invention, by acquiring a domain-specific language (DSL) script, parsing the DSL script, obtaining a semantic executor, using the semantic executor to send an HTTP request, obtaining the response data of the HTTP request, and using the semantic executor to process the response data based on business logic data to obtain the data processing result, by writing the business logic data for sending HTTP requests and processing the response data into the DSL script, and parsing the DSL script to obtain the semantic executor, the semantic executor can automatically process data according to the data processing business logic without the need for manual invocation of third-party tools, which is convenient and fast. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 The diagram shown is a flowchart of a data processing method provided in an embodiment of the present invention.
[0011] Figure 2 The diagram shown is a flowchart of a data processing method provided in an embodiment of the present invention.
[0012] Figure 3 The diagram shown is a schematic representation of the data processing method provided in an embodiment of the present invention.
[0013] Figure 4 The diagram shown is a block diagram of a data processing apparatus provided in an embodiment of the present invention.
[0014] Figure 5 The diagram shown is a block diagram of an electronic device provided according to an embodiment of the present invention. Detailed Implementation
[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0016] Currently, cURL is sufficient for simple, single HTTP requests; sending an HTTP request via cURL will retrieve the response data. However, when users need to process the response data (such as searching or replacing characters), cURL cannot meet the requirements. In such cases, it is necessary to manually call external third-party tools such as jq, grep, sed, and awk for data processing. Since the steps of sending the HTTP request and calling each third-party tool to process the response data are independent, and the third-party tools need to be called manually, it is quite cumbersome.
[0017] To address the aforementioned problems, embodiments of the present invention provide a data processing method and apparatus. Various non-limiting embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0018] Figure 1 The diagram shown is a schematic flowchart of a data processing method provided by an embodiment of the present invention. This method can be executed by a computer device (e.g., a server). Figure 1 As shown, the method includes the following:
[0019] S110: Obtain the domain-specific language DSL script, wherein the DSL script defines Hypertext Transfer Protocol (HTTP) requests and business logic data for processing the response data of the HTTP requests.
[0020] It should be noted that the language design of DSL (Domain Specific Language) scripts can include data type and variable definitions, logical control operators, and / or built-in method definitions. Specifically, data type and variable definitions can support at least one of the following: strings, numbers, booleans, arrays, objects, and comments; logical control operator definitions can support at least one of the following: IF conditional expressions, MATCH conditional expressions, loops and loop control, logical expressions, and logical operators; and built-in method definitions can support at least one of the following: input / output (IO) operations, environment variable operations, process operations, encoding / decoding operations, and HTTP (Hypertext Transfer Protocol) request operations.
[0021] The above input / output operations are used to read and write files; environment variable operations are used to dynamically read environment parameters; process operations are used to optimize HTTP request performance, such as concurrently handling multiple identical or different HTTP requests; and encoding / decoding operations are used to encode and decode the response data of HTTP requests.
[0022] Specifically, environment variable operations support variables of various types, including strings, integers, arrays, and objects. The code can be seen as follows:
[0023] Str = "string";
[0024] int = 10;
[0025] Array = [0, 1, 2];
[0026] Object = (
[0027] Authorization: "Bearer token" )
[0029] Specifically, the code for input / output operations can be as follows:
[0030] Open file: open <string>
[0031] Reading a file stream: read <stram>
[0032] Write to a file stream: write <stream>
[0033] Specifically, the encoding and decoding operations can support different formats, such as Base64, JSON, and URL, as shown in the code below:
[0034] The code that supports Base64 encoding and decoding can be shown below:
[0035] encode form-data <object>
[0036] decode form-data <form-data>
[0037] The code that supports JSON encoding and decoding can be shown below:
[0038] encode json<array|object>
[0039] decode json<stream|string>
[0040] The code that supports URL encoding and decoding can be shown below:
[0041] encode url <object>
[0042] decode url <string>
[0043] Specifically, the code that supports HTTP requests can be shown below:
[0044] HTTP_METHOD <string>[object][stream|string]
[0045] The code that supports HTTP cookies can be shown below:
[0046] cookie <object>
[0047] It should be understood that the above DSL script may define one or more identical or different HTTP requests, and this invention does not specifically limit this.
[0048] In addition, the DSL script also includes business logic data for processing the response data of HTTP requests. That is, the DSL script can describe a series of data processing methods so that the semantic executor can process the HTTP request response data according to these methods. For example, it can include data processing methods corresponding to external third-party tools such as jq, grep, sed, and awk. Specifically, the data processing methods corresponding to jq are used to process JSON formatted text data; the data processing methods corresponding to grep are used to find strings that meet certain conditions in a file, often used for simple text searching and matching; the data processing methods corresponding to sed are used to process data in text files, often used for editing matched text; and the data processing methods corresponding to awk are used for text processing, often used for formatting text and performing more complex formatting. It should be understood that the above description is merely illustrative, and the present invention does not impose any specific limitations on it.
[0049] S120: Parse the DSL script to obtain the semantic executor.
[0050] For example, lexical and syntactic parsing can be performed sequentially on a DSL script to obtain the abstract syntax tree corresponding to the DSL script, and then information can be extracted from the abstract syntax tree to construct a semantic executor.
[0051] S130: Use the semantic executor to send an HTTP request and obtain the response data of the HTTP request.
[0052] S140: Use the semantic executor to process the response data based on business logic data to obtain the data processing results.
[0053] In other words, without needing to call external third-party tools such as jq, grep, sed, or awk, the semantic executor can perform corresponding processing on the response data. For example, it can be used to process JSON formatted text data; search and match text; edit matched text; format text; and perform more complex formatting operations on text.
[0054] In this embodiment of the invention, users can write business logic data for sending HTTP requests and processing response data into a DSL script. By parsing the DSL script to obtain a semantic executor, the semantic executor can be used to execute the data processing results. Users do not need to understand the implementation details of the semantic executor, but only need to understand the DSL syntax rules, which reduces the threshold for use and development costs.
[0055] According to the technical solution provided by the embodiments of the present invention, by acquiring a domain-specific language (DSL) script, parsing the DSL script, obtaining a semantic executor, using the semantic executor to send an HTTP request, obtaining the response data of the HTTP request, and using the semantic executor to process the response data based on business logic data to obtain the data processing result, by writing the business logic data for sending HTTP requests and processing the response data into the DSL script, and parsing the DSL script to obtain the semantic executor, the semantic executor can automatically process data according to the data processing business logic without the need for manual invocation of third-party tools, which is convenient and fast.
[0056] Figure 2 The diagram shown is a schematic flowchart of a data processing method provided in an embodiment of the present invention. This method can be executed by a computer device (e.g., a server). In the present invention... Figure 1 The present invention extends from the illustrated embodiments. Figure 2 The illustrated embodiment will be described in detail below. Figure 2 The illustrated embodiments and Figure 1 The differences between the embodiments shown are not repeated here, and the similarities are not repeated here.
[0057] like Figure 2 As shown, in Figure 1 In the data processing method provided in the embodiment, step S120 may include the following, which will be discussed below. Figure 3 Provide a detailed description.
[0058] S210: Perform lexical analysis on the DSL script, converting the character sequences in the DSL script into token sequences.
[0059] Specifically, a DSL parser can be used to perform lexical analysis on DSL scripts and convert character sequences in the DSL scripts into token sequences. It should be noted that a DSL parser can include a lexical analyzer, a syntax analyzer, and a semantic executor. The DSL parser is built using the Go programming language. Importing the DSL parser source code into the workspace and running the `go build` command will automatically compile all `.go` source files in the current directory and generate the executable binary file of the DSL parser.
[0060] Specifically, the DSL script can be input into the aforementioned lexical analyzer, which first performs lexical analysis on the DSL script. Specifically, during the lexical analysis stage, the lexical analyzer can scan the input DSL script line by line from left to right, identify each word, determine the type of each word, and then convert the identified words into a unified lexical unit notation format.
[0061] For example, the conversion rules are as follows:
[0062]
[0063] Here, `package printf("PACKAGE")` means converting `package` in the source code to `PACKAGE`, and so on. It should be understood that the above rule description is only an illustrative description, and the present invention does not make any specific limitations on it.
[0064] For example, the above conversion rules can be used to convert the source code of the following DSL script:
[0065]
[0066]
[0067] The output label sequence is:
[0068] PACKAGE IDENT
[0069] IMPORT LPAREN
[0070] QUOTE IDENT QUOTE
[0071] RPAREN
[0072] FUNC IDENT LPAREN RPAREN LBRACE
[0073] IDENT DOT IDENT LPAREN QUOTE IDENT QUOTE RPAREN
[0074] RBRACE
[0075] S220: Perform syntax parsing on the marked sequence to determine the syntax structure of the DSL script.
[0076] S230: Construct the corresponding abstract syntax tree for the DSL script based on the syntax structure.
[0077] During the syntax parsing phase, the token sequence output during lexical parsing can be parsed using a grammar defined according to the programming language to obtain the syntax structure, and nodes in the abstract syntax tree can be constructed based on the syntax structure.
[0078] For example, the parser described above can be used to parse the token sequence sequentially. This process reduces the token sequence generated by lexical analysis according to the LALR (Look-Ahead LR) grammar defined by the programming language, either from bottom to top or top to bottom, transforming it into a meaningful structure, i.e., an abstract syntax tree. For example, each Go source code file can be summarized into a SourceFile structure. Here, the top-down approach means first constructing the root node and then scanning downwards, for example, describing Token, String, Func, etc., until the program ends. The bottom-up approach means first constructing subtrees and then assembling them into a complete tree.
[0079] For example, the corresponding syntax tree generated from the source code is as follows:
[0080]
[0081]
[0082] S240: Generate a semantic executor based on the abstract syntax tree.
[0083] Specifically, the abstract syntax tree can be converted into intermediate code; then, machine code can be generated from the intermediate code to obtain a semantic executor.
[0084] First, the compiler can be used to traverse the abstract syntax tree to obtain intermediate code and optimize it.
[0085] The optimization of intermediate code includes optimizing the intermediate code through at least one of the following methods: constant propagation, value range propagation, sparse conditional constant propagation, dead code elimination, global value numbering, partial redundancy elimination, strength reduction, and register allocation. It should be understood that this invention does not specifically limit the optimization method.
[0086] The intermediate code described above can take the form of Static Single Assignment (SSA), Reverse Polish Notation, ternaries, quadruples, etc. It should be understood that intermediate code can have multiple representations; the above description is merely illustrative, and this invention does not limit the specific representation of the intermediate code. In this embodiment of the invention, SSA intermediate code is used as an example for explanation.
[0087] The optimization of SSA intermediate code can be described using S-expressions, which are a representation of nested list (tree structure) data. It should be understood that this invention does not impose specific limitations on this method.
[0088] For example, during the optimization of the SSA intermediate code, the application of the S expression is as follows, which can combine 8-bit constant multiplication: (Mul8(Const8[c])(Const8[d]))->(Const8[int64(int8(c*d))]).
[0089] Secondly, machine code can be generated from the intermediate code to obtain a semantic executor.
[0090] Specifically, the compiler is used to traverse the intermediate code to generate assembly code; the assembler is used to convert the assembly code into machine code.
[0091] The Go programming language includes many packages related to machine code generation. Different types of CPUs use different packages to generate machine code, such as amd64, arm, arm64, mips, mips64, ppc64, s390x, and x86 wasm. The compiler traverses the intermediate code to generate assembly code, and then the assembler translates the assembly language into the language of the machine program (machine code), thus obtaining the semantic executor described above.
[0092] Semantic executors can be used to process HTTP request response data and obtain result data.
[0093] According to the technical solution provided by the embodiments of the present invention, by writing the business logic data of sending HTTP requests and processing response data into a DSL script, and parsing the DSL script to obtain a semantic executor, the semantic executor can automatically process data according to the data processing business logic without the need for manual invocation of third-party tools, which is convenient and fast.
[0094] In one embodiment of the present invention, taking the scenario of obtaining the username of the current operator as an example, the DSL script can be as follows:
[0095]
[0096]
[0097] To execute the above DSL script (e.g., script name user.http) through a DSL resolver, the code can be as follows:
[0098] http user.http
[0099] The output of the DSL resolver is the username, such as "Zhang San".
[0100] All of the above-mentioned optional technical solutions can be combined in any way to form optional embodiments of the present invention, and will not be described in detail here.
[0101] The following are embodiments of the apparatus of the present invention, which can be used to execute embodiments of the method of the present invention. For details not disclosed in the embodiments of the apparatus of the present invention, please refer to the embodiments of the method of the present invention.
[0102] Figure 4 The diagram shown is a block diagram of a data processing apparatus provided according to an embodiment of the present invention. Figure 4 As shown, the data processing device 400 includes:
[0103] The acquisition module 410 is used to acquire domain-specific language DSL scripts, wherein the DSL scripts define Hypertext Transfer Protocol (HTTP) requests and business logic data for processing the response data of the HTTP requests.
[0104] Parsing module 420 is used to parse DSL scripts to obtain semantic executors;
[0105] Sending module 430 is used to send an HTTP request using a semantic executor and obtain the response data of the HTTP request;
[0106] The processing module 440 is used to process the response data based on business logic data using a semantic executor to obtain the data processing result.
[0107] According to the technical solution provided by the embodiments of the present invention, by acquiring a domain-specific language (DSL) script, parsing the DSL script, obtaining a semantic executor, using the semantic executor to send an HTTP request, obtaining the response data of the HTTP request, and using the semantic executor to process the response data based on business logic data to obtain the data processing result, by writing the business logic data for sending HTTP requests and processing the response data into the DSL script, and parsing the DSL script to obtain the semantic executor, the semantic executor can automatically process data according to the data processing business logic without the need for manual invocation of third-party tools, which is convenient and fast.
[0108] In one embodiment of the present invention, the parsing module 420 is used to perform lexical parsing on the DSL script, converting the character sequence in the DSL script into a token sequence; performing syntactic parsing on the token sequence to determine the syntactic structure of the DSL script; constructing the corresponding Abstract Syntax Tree (AST) of the DSL script based on the syntactic structure; and generating a semantic executor based on the Abstract Syntax Tree.
[0109] In one embodiment of the present invention, the parsing module 420 is used to convert the abstract syntax tree into intermediate code, wherein the intermediate code is an intermediate expression between the source language and the machine language; and to generate machine code based on the intermediate code to obtain a semantic executor.
[0110] In one embodiment of the present invention, the parsing module 420 is used to traverse the abstract syntax tree using a compiler to obtain intermediate code, optimize the intermediate code, and generate the machine code based on the optimized intermediate code to obtain a semantic executor.
[0111] In one embodiment of the present invention, the parsing module 420 optimizes the intermediate code by at least one of constant propagation, range propagation, sparse conditional constant propagation, elimination of useless code, global numerical numbering, elimination of partial redundancy, intensity reduction, and register allocation.
[0112] In one embodiment of the present invention, the parsing module 420 uses a compiler to traverse intermediate code to generate assembly code; and uses an assembler to convert the assembly code into machine code, wherein the machine code is used to implement a semantic executor.
[0113] In one embodiment of the present invention, business logic data is used to perform at least one of the following processing on response data: processing JSON formatted text data; searching and matching text; editing text; and formatting text.
[0114] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0115] Figure 5 The diagram shown is a block diagram of an electronic device 500 provided in an embodiment of the present invention.
[0116] Reference Figure 5 The electronic device 500 includes a processing component 510, which further includes one or more processors, and memory resources represented by memory 520 for storing instructions, such as application programs, that can be executed by the processing component 510. The application programs stored in memory 520 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 510 is configured to execute instructions to perform the aforementioned data processing methods.
[0117] Electronic device 500 may also include a power supply component configured to perform power management of electronic device 500, a wired or wireless network interface configured to connect electronic device 500 to a network, and an input / output (I / O) interface. Electronic device 500 can operate on an operating system, such as Windows Server, stored in memory 520. TM Mac OSX TM Unix TM Linux TM FreeBSD TM Or similar.
[0118] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the aforementioned electronic device 500, enables the electronic device 500 to perform a data processing method, comprising: acquiring a domain-specific language (DSL) script, wherein the DSL script defines a Hypertext Transfer Protocol (HTTP) request and business logic data for processing the response data of the HTTP request; parsing the DSL script to obtain a semantic executor; using the semantic executor to send an HTTP request and acquire the response data of the HTTP request; and using the semantic executor to process the response data based on the business logic data to obtain a data processing result.
[0119] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0120] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0121] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0122] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0123] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0124] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program verification codes, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0125] Furthermore, it should be noted that the combination of the various technical features in this case is not limited to the combination methods described in the claims of this case or the combination methods described in the specific embodiments. All technical features described in this case can be freely combined or combined in any way, unless they contradict each other.
[0126] It should be noted that the above examples are merely specific embodiments of the present invention, and the present invention is obviously not limited to the above embodiments, with many similar variations. All modifications that can be directly derived or conceived by those skilled in the art from the content disclosed in this invention should fall within the protection scope of this invention.
[0127] It should be understood that the terms "first," "second," etc., mentioned in the embodiments of the present invention are merely for the purpose of more clearly describing the use of the technical solutions in the embodiments of the present invention, and are not intended to limit the scope of protection of the present invention.
[0128] The above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.< / object> < / string> < / string> < / object> < / object> < / stream> < / stram> < / string>
Claims
1. A data processing method, characterized in that, include: Obtain a domain-specific language (DSL) script, wherein the DSL script contains Hypertext Transfer Protocol (HTTP) requests and business logic data for processing response data of the HTTP requests; Lexical analysis is performed on the DSL script to convert the character sequences in the DSL script into token sequences; syntactic analysis is performed on the token sequences to determine the syntactic structure of the DSL script; an abstract syntax tree corresponding to the DSL script is constructed based on the syntactic structure; the abstract syntax tree is converted into intermediate code, wherein the intermediate code is an intermediate expression between the source language and the machine language; machine code is generated based on the intermediate code to obtain a semantic executor. The semantic executor is used to send the HTTP request and obtain the response data of the HTTP request; The semantic executor is used to process the response data based on the business logic data to obtain the data processing result.
2. The method according to claim 1, characterized in that, The process of converting the abstract syntax tree into intermediate code includes: The compiler traverses the abstract syntax tree to obtain the intermediate code, and then optimizes the intermediate code. The step of generating machine code based on the intermediate code to obtain the semantic executor includes: The machine code is generated based on the optimized intermediate code to obtain the semantic executor.
3. The method according to claim 2, characterized in that, The optimization of the intermediate code includes: The intermediate code is optimized by at least one of the following methods: constant propagation, range propagation, sparse conditional constant propagation, elimination of useless code, global numerical numbering, elimination of partial redundancy, intensity reduction, and register allocation.
4. The method according to claim 1, characterized in that, The step of generating machine code based on the intermediate code to obtain a semantic executor includes: The compiler is used to traverse the intermediate code and generate assembly code. The assembly code is converted into machine code using an assembler, wherein the machine code is used to implement the semantic executor.
5. The method according to any one of claims 1 to 4, characterized in that, The business logic data is used to perform at least one of the following processing on the response data: processing JSON formatted text data; searching and matching text; editing text; and formatting text.
6. A data processing apparatus, characterized in that, include: The acquisition module is used to acquire domain-specific language (DSL) scripts, wherein the DSL scripts contain Hypertext Transfer Protocol (HTTP) requests and business logic data for processing the response data of the HTTP requests. The parsing module is used to perform lexical analysis on the DSL script, converting the character sequences in the DSL script into token sequences; perform syntactic analysis on the token sequences to determine the syntactic structure of the DSL script; construct the corresponding abstract syntax tree of the DSL script based on the syntactic structure; convert the abstract syntax tree into intermediate code, wherein the intermediate code is an intermediate expression between the source language and the machine language; and generate machine code based on the intermediate code to obtain a semantic executor. The sending module is used to send the HTTP request using the semantic executor and obtain the response data of the HTTP request; The processing module is used to process the response data based on the business logic data using the semantic executor to obtain the data processing result.
7. A computer-readable storage medium storing a computer program for performing the data processing method according to any one of claims 1 to 5.
8. An electronic device, the electronic device comprising: processor; Memory used to store the processor's executable instructions. The processor is used to execute the data processing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
DSL (Digital Subscriber Line)-based interface response method and device, equipment and medium
CN113448751A
Detecting anomalous application messages in telecommunication networks
US20210185066A1