Object processing method and device

By analyzing the semantics of the initial language object and configuring the target function in the abstract syntax tree, and designing compilation solutions for different functions, the problem of low DSL translation efficiency is solved and efficient massive data processing is achieved.

CN114089960BActive Publication Date: 2024-10-25ALIBABA CLOUD COMPUTING CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111182648.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-11
Publication Date
2024-10-25
Estimated Expiration
2041-10-11

AI Technical Summary

Technical Problem

Existing DSL translation efficiency is low and difficult to meet the real-time processing needs of massive data. The traditional literal translation method results in low runtime execution efficiency.

Method used

By obtaining the initial object of the initial language type for semantic analysis, an abstract syntax tree is generated, and the target function is configured according to the syntax structure type of the tree node, the function label is determined, and finally the target object of the target language type is generated, and different compilation schemes are designed for different functions. .

Benefits of technology

It improves the semantic accuracy of the compiled target objects and the execution efficiency of the runtime code, increases the data processing volume per unit time, and meets the real-time processing needs of massive data in the field of cloud computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114089960B_ABST
    Figure CN114089960B_ABST
Patent Text Reader

Abstract

The embodiments of the present specification provide an object processing method and device, wherein the object processing method comprises: obtaining an initial object of an initial language type to be compiled, performing semantic analysis on the initial object, and generating a corresponding abstract syntax tree, wherein the abstract syntax tree comprises a plurality of tree nodes, and the plurality of tree nodes correspond to the syntax structure in the initial object, traversing the plurality of tree nodes, and configuring at least one target function for each tree node according to the syntax structure type corresponding to each tree node, and determining a function label corresponding to the at least one target function, and compiling the initial object according to the syntax structure type corresponding to each tree node and the function label, and generating a target object of the target language type.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to an object processing method. Background Art

[0002] Data processing services are widely used in the field of log processing of massive data. With the popularity of mobile devices and the Internet of Things, the types and number of logs have increased dramatically, and the functions and performance requirements of data processing services are relatively high. At present, the data processing services provided by relevant institutions are widely used, supporting a variety of internal business and external customer needs of institutions, and the number of currently deployed servers is large. How to implement a semantically rich, high-performance DSL engine for the log storage data processing service of institutions is an urgent problem to be solved. Summary of the invention

[0003] In view of this, an embodiment of the present specification provides an object processing method. One or more embodiments of the present specification also relate to an object processing device, a computing device, a computer-readable storage medium and a computer program to solve the technical defects existing in the prior art.

[0004] According to a first aspect of an embodiment of this specification, there is provided an object processing method, including:

[0005] Obtaining an initial object of an initial language type to be compiled, performing semantic analysis on the initial object, and generating a corresponding abstract syntax tree, wherein the abstract syntax tree includes a plurality of tree nodes, and the plurality of tree nodes correspond to the syntax structures in the initial object;

[0006] Traversing the plurality of tree nodes, and configuring at least one objective function for each tree node according to a grammatical structure type corresponding to each tree node, and determining a function label corresponding to the at least one objective function;

[0007] The initial object is compiled according to the grammatical structure type corresponding to each tree node and the function label to generate a target object of the target language type.

[0008] Optionally, configuring at least one objective function for each tree node according to the grammatical structure type corresponding to each tree node, and determining a function label corresponding to the at least one objective function includes:

[0009] In the case where it is determined according to the grammatical structure type corresponding to the target tree node that the node function corresponding to the target tree node belongs to the target function type, obtaining the function name of the node function, wherein the target tree node is one of the multiple tree nodes;

[0010] When it is determined that the node function is the first function according to the function name, a first target function is configured for the target tree node, and a function label corresponding to the first target function is determined according to parameter attribute information of the parameters contained in the node function.

[0011] Optionally, the first objective function has some parameters whose attributes are constants;

[0012] Correspondingly, determining the function label corresponding to the first objective function according to the parameter attribute information of the parameter contained in the node function includes:

[0013] Determining whether a first target parameter included in the node function is a constant according to parameter attribute information of the parameter included in the node function;

[0014] If yes, determining that the function label corresponding to the first objective function is yes;

[0015] If not, it is determined that the function label corresponding to the first objective function is no.

[0016] Optionally, the object processing method further includes:

[0017] In the case where it is determined according to the function name that the node function is the second function, configuring the first target function for the target tree node;

[0018] Determining whether a second target parameter included in the node function is a constant according to parameter attribute information of the parameter included in the node function;

[0019] If yes, determining that the function label corresponding to the first objective function is yes;

[0020] If not, it is determined that the function label corresponding to the first objective function is no.

[0021] Optionally, the object processing method further includes:

[0022] When it is determined according to the function name that the node function is the third function, configuring the first target function for the target tree node;

[0023] Determining whether all parameters included in the node function are constants according to parameter attribute information of the parameters included in the node function;

[0024] If yes, determining that the function label corresponding to the first objective function is yes;

[0025] If not, it is determined that the function label corresponding to the first objective function is no.

[0026] Optionally, configuring at least one objective function for each tree node according to the grammatical structure type corresponding to each tree node, and determining a function label corresponding to the at least one objective function includes:

[0027] In the case where it is determined according to the grammatical structure type corresponding to the target tree node that the node function corresponding to the target tree node belongs to the target function type, obtaining the function name of the node function, wherein the target tree node is one of the multiple tree nodes;

[0028] In the case where it is determined according to the function name that the node function is the fourth function, configuring a second objective function for the target tree node, and determining that a function label corresponding to the second objective function is no;

[0029] When it is determined that the node function is a constant function according to the function name, a second objective function is configured for the target tree node, and the function label corresponding to the second objective function is determined to be yes, wherein the function name of the second objective function as the node function is a constant function name.

[0030] Optionally, configuring at least one objective function for each tree node according to the grammatical structure type corresponding to each tree node, and determining a function label corresponding to the at least one objective function includes:

[0031] When it is determined that the parameter corresponding to the target tree node is a variable parameter according to the grammatical structure type corresponding to the target tree node, a third objective function is configured for the target tree node, and it is determined that the function label corresponding to the third objective function is no, wherein the parameter of the third objective function is a constant.

[0032] Optionally, configuring at least one objective function for each tree node according to the attribute information of the node function corresponding to each tree node, and determining a function label corresponding to the at least one objective function includes:

[0033] configuring a fourth objective function for a target tree node, wherein the target tree node is one of the plurality of tree nodes;

[0034] Determine, according to parameter attribute information of the parameters included in the node function of the target tree node, whether all the parameters included in the node function are constants;

[0035] If yes, determining that the function label corresponding to the fourth objective function is yes;

[0036] If not, it is determined that the function label corresponding to the fourth objective function is no.

[0037] Optionally, compiling the initial object according to the grammatical structure type corresponding to each tree node and the function label to generate a target object of the target language type includes:

[0038] In the case where it is determined according to the grammatical structure type corresponding to the target tree node that the node function corresponding to the target tree node belongs to the target function type, obtaining the function name of the node function, wherein the target tree node is one of the multiple tree nodes;

[0039] The initial object is compiled according to the function name and the function labels of the first target function, the second target function and / or the third target function configured by the target tree node to generate a target object of the target language type.

[0040] Optionally, after traversing the plurality of tree nodes, and before configuring at least one objective function for each tree node according to the grammatical structure type corresponding to each tree node, the method further includes:

[0041] When it is determined that the node function corresponding to the target tree node belongs to a search function according to the syntax structure type corresponding to the target tree node, and the number of parameters contained in the node function is equal to 1, the function name of the node function is replaced by a single field value function.

[0042] According to a second aspect of an embodiment of this specification, there is provided an object processing device, including:

[0043] an acquisition module, configured to acquire an initial object of an initial language type to be compiled, perform semantic analysis on the initial object, and generate a corresponding abstract syntax tree, wherein the abstract syntax tree includes a plurality of tree nodes, and the plurality of tree nodes correspond to the grammatical structures in the initial object;

[0044] A determination module is configured to traverse the plurality of tree nodes, and configure at least one target function for each tree node according to a grammatical structure type corresponding to each tree node, and determine a function label corresponding to the at least one target function;

[0045] The compiling module is configured to compile the initial object according to the grammatical structure type corresponding to each tree node and the function label to generate a target object of a target language type.

[0046] According to a third aspect of an embodiment of this specification, a computing device is provided, including:

[0047] Memory and processor;

[0048] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions:

[0049] Obtaining an initial object program of a domain-specific initial language type to be compiled, performing semantic analysis on the domain-specific language program initial object, and generating a corresponding abstract syntax tree, wherein the abstract syntax tree includes a plurality of tree nodes, and the plurality of tree nodes correspond to the grammatical structures in the initial object;

[0050] Traversing the plurality of tree nodes, and configuring parameters of at least one objective function for each tree node according to a grammatical structure type corresponding to each tree node, and determining a function label corresponding to the at least one objective function;

[0051] According to the attribute information of the function corresponding to each tree node and the parameter configuration result function label, the domain specific language program initial object is compiled to generate a target object program of a target language type.

[0052] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of any one of the object processing methods are implemented.

[0053] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned object processing method.

[0054] An embodiment of the present specification obtains an initial object of an initial language type to be compiled, performs semantic analysis on the initial object, and generates a corresponding abstract syntax tree, wherein the abstract syntax tree includes multiple tree nodes, and the multiple tree nodes correspond to the syntax structure in the initial object, traverses the multiple tree nodes, and configures at least one target function for each tree node according to the syntax structure type corresponding to each tree node, and determines a function label corresponding to the at least one target function, compiles the initial object according to the syntax structure type corresponding to each tree node and the function label, and generates a target object of the target language type.

[0055] After generating an abstract syntax tree corresponding to the initial object, the embodiment of this specification configures a corresponding target function for each tree node according to the syntax structure type corresponding to each tree node in the abstract syntax tree, and determines the function label of each target function, so as to compile the initial object according to the syntax structure type and the function label. Therefore, the embodiment of this specification can design different compilation schemes for functions of different initial language types through the aforementioned processing method, which is conducive to ensuring the accuracy of the semantics of the target object of the target language type generated by the compilation. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1is a flow chart of an object processing method provided by an embodiment of this specification;

[0057] Figure 2 is a processing flow chart of an object processing method provided by an embodiment of this specification;

[0058] Figure 3 is a schematic diagram of the structure of an object processing device provided by an embodiment of this specification;

[0059] Figure 4 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0060] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0061] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0062] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0063] In this specification, an object processing method is provided. This specification also relates to an object processing apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0064] DSL (Domain-Specific Language) for data processing does not require users to write more complex general programming languages, has a better user experience, and is widely used. How to translate DSL into machine-executable programs is a problem that every DSL must face, and traditional DSL translation usually uses a literal translation method, which has low runtime execution efficiency.

[0065] Based on this, the embodiments of this specification provide an object processing method, and different compilation schemes are designed for different DSL functions, that is, each type of function implements a code translation optimization algorithm, which not only ensures the correctness of the semantics, but also has a high execution efficiency of the compiled runtime code, thereby increasing the amount of data processed per unit time and effectively solving the real-time processing needs of massive data in the cloud computing field.

[0066] Figure 1 A flowchart of an object processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0067] Step 102, obtaining an initial object of an initial language type to be compiled, performing semantic analysis on the initial object, and generating a corresponding abstract syntax tree, wherein the abstract syntax tree includes a plurality of tree nodes, and the plurality of tree nodes correspond to the grammatical structure in the initial object.

[0068] Specifically, the initial language type may be a domain-specific language DSL, and the initial object may be a code to be compiled that is generated by encoding in the domain-specific language.

[0069] The embodiments of this specification require compiling a domain-specific language DSL into other types of machine-executable programs, such as SQL. Therefore, after obtaining the initial object of the initial language type to be compiled, it is necessary to perform grammatical and semantic analysis on it, so as to parse the initial object based on the analysis results to generate a corresponding abstract syntax tree, and configure the target function for each tree node in the abstract syntax tree to compile the initial object according to the configuration results.

[0070] Before obtaining the initial object, you can first design the language, that is, design a domain-specific language for data processing services. In practical applications, the more than 200 functions supported by the domain-specific language for data processing can be divided into five categories, namely event processing functions, value processing functions, operator functions, resource pool functions, and type-related functions, and these five categories of functions can be used to construct the initial object of the domain-specific language.

[0071] Among them, the event processing function refers to the function that processes the current event. Such functions all start with e_ and omit the default parameter representing the "current event", such as: a function that operates the entire event, a function that operates a certain attribute of the event, a field extraction function, an event inspection function, etc.

[0072] Value processing functions represent functions that process values. Values ​​can be of any data type. The first parameter of such functions is "processing value", such as JSON extraction function, JSON conversion function, IP information enrichment function, regular expression function, etc.

[0073] Operator functions represent general functions related to process control, arithmetic calculation, logic, numerical comparison, etc. These functions all start with op_.

[0074] The resource pool function means that user-maintainable external resources can be loaded into the data processing service. At the same time, the loading interval is provided to meet the user's real-time requirements. The loaded external resources include: database, OSS storage, SLS storage, etc.

[0075] Type-related functions refer to functions that are closely related to data types, such as type conversion functions, arithmetic functions, string functions, date and time functions, list functions, and dictionary functions, etc.

[0076] In one or more embodiments, after constructing the initial object based on the aforementioned five types of functions, the text of the initial object can be converted into an abstract syntax tree (AST) using a parser and a lexer to represent the grammatical structure in the text of the initial object in a tree form.

[0077] Among them, the syntax analyzer can be used to analyze and determine whether the input word sequence (for example, a sentence) conforms to the given grammar, and determine the structure of the sentence and the relationship between the grammatical components at each level by constructing a syntax tree, that is, to determine which words in a sentence constitute a phrase, which words are the subject or object of a verb, etc.; while the lexical analyzer can be used to translate the high-level instructions of the computer language into instructions that can be run by a physical machine or a virtual machine. That is, a single "word" can be separated from the input character stream for use by the syntax analyzer.

[0078] In addition, the abstract syntax tree is a tree representation of the abstract syntax structure of the initial object. The abstract syntax tree uses a tree form to represent the syntax structure of the programming language, wherein each tree node on the abstract syntax tree can be used to represent a syntax structure in the source code, and the syntax structure includes but is not limited to functions or parameters.

[0079] After performing grammatical and semantic analysis on the initial object and generating the corresponding abstract syntax tree, the target function can be configured for each tree node in the abstract syntax tree to compile the initial object based on the configuration result to generate a target object (machine executable program) of the target language type.

[0080] Step 104, traverse the multiple tree nodes, and configure at least one target function for each tree node according to the grammatical structure type corresponding to each tree node, and determine a function label corresponding to the at least one target function.

[0081] Specifically, since the abstract syntax tree is a tree structure composed of multiple tree nodes, wherein a tree node is a data structure that can be used to represent functions, parameters, etc. Therefore, the syntax structure type includes but is not limited to function call, key-value pair (parameter) or others.

[0082] In the process of traversing the abstract syntax tree, when the current tree node is traversed and the syntax structure type corresponding to the current tree node is determined to be a function call, the function name of the current tree node is further determined to configure the target function for the current tree node according to the function name, which can be implemented in the following way:

[0083] In the case where it is determined according to the grammatical structure type corresponding to the target tree node that the node function corresponding to the target tree node belongs to the target function type, obtaining the function name of the node function, wherein the target tree node is one of the multiple tree nodes;

[0084] When it is determined that the node function is the first function according to the function name, a first target function is configured for the target tree node, and a function label corresponding to the first target function is determined according to parameter attribute information of the parameters contained in the node function.

[0085] Furthermore, the first objective function has some parameters whose attributes are constants;

[0086] Correspondingly, determining the function label corresponding to the first objective function according to the parameter attribute information of the parameter contained in the node function includes:

[0087] Determining whether a first target parameter included in the node function is a constant according to parameter attribute information of the parameter included in the node function;

[0088] If yes, determining that the function label corresponding to the first objective function is yes;

[0089] If not, it is determined that the function label corresponding to the first objective function is no.

[0090] Specifically, the target tree node is the current tree node, which is one of multiple tree nodes in the abstract syntax tree; the target function type is function call; the first function is a type-related function, which can be specifically a string function "str_format"; the first target function is "attributes of some parameters are constants", specifically "part_const_attr"; the function label represents the result of the function, specifically "yes" or "no"; the parameter attribute information includes but is not limited to the number of parameters and the type of parameters, and the type of parameter is whether the parameter is a constant or a variable.

[0091] When it is determined that the function of the target tree node is function call, the function name of the node function of the target tree node can be obtained. If the function name is "str_format", the parameter attribute information of the node function containing the parameters is the parameter type of the first parameter of the first function (the first target parameter); if the first parameter is a constant, set "whether the attributes of some parameters are constant part_const_attr" to True (determine that the function label corresponding to the first target function is yes), otherwise set "whether the attributes of some parameters are constant part_const_attr" to False (determine that the function label corresponding to the first target function is no).

[0092] In practical applications, since the abstract syntax tree is generated according to the initial object to be compiled, and the initial object may contain a variety of different functions, in this case, in the abstract syntax tree corresponding to the initial object, the different functions can be represented by the connection relationship between one or at least two tree nodes. Different functions will have function names and parameters. Therefore, in the abstract syntax tree, if a tree node of a certain level is used as a parent node, then the node in the next level of the level where the parent node is located that has a connection relationship with the parent node is the child node of the parent node. The parent node can be a function, and the child node of the parent node can represent the parameters of the function, forming a nested dependency relationship between the parent node and the child node. If the current tree node is a parent node, and the node function of the parent node is the first function, the first target function is configured for the parent node, and when the function label corresponding to the first target function of the parent node needs to be determined, the child nodes under the parent node can be traversed first, and the target function of the parent node can be configured according to the feedback results of the child nodes.

[0093] Among them, if the parent node represents the function format, and the actual function expression is format(name, age), then there will be two child nodes under the parent node, namely child node 1 and child node 2. Child node 1 and child node 2 both represent parameters, and both child node 1 and child node 2 can represent parameters in the form of key-value pairs. For example, the parameter representation of child node 1 is Parameter first=name, and the parameter representation of child node 2 is Parameter second=age.

[0094] Therefore, if it is necessary to determine the function label corresponding to the first objective function of the parent node, it is necessary to determine the parameter type of the parameter represented by the first child node under the parent node. In the embodiment of this specification, the parameter represented by child node 1 is name, which is a constant. Therefore, the parent node can be set to "Whether the attributes of some parameters are constants part_const_attr" to True; if the parameter represented by child node 1 is a variable, the parent node can be set to "Whether the attributes of some parameters are constants part_const_attr" to False.

[0095] Furthermore, when the target tree node is a parent node and the first objective function is configured for the parent node, the grammatical structure type corresponding to the child nodes of the parent node can be traversed and the objective function can be configured for the child nodes. Specifically, when it is determined that the parameter corresponding to the target tree node belongs to a variable parameter according to the grammatical structure type corresponding to the target tree node, the third objective function is configured for the target tree node, and it is determined that the function label corresponding to the third objective function is no, wherein the parameter of the third objective function is a constant.

[0096] Specifically, when configuring a target function for a child node, the target tree node is the child node. Since the child node can represent parameters in the form of a key-value pair, when the grammatical structure type of the child node is determined to be a key-value pair, it can be determined whether the parameter corresponding to the child node is a variable parameter or a constant parameter based on the key value in the key-value pair.

[0097] For example, if the parameter representation of child node 1 is Parameter first=x, where Parameter first is the keyword and x is the key value, since the key value x belongs to a variable parameter, the third objective function "parameter is a constant" can be configured for the target tree node, and the function label corresponding to the third objective function can be determined to be no; when the key value belongs to a constant parameter, the function label corresponding to the third objective function can be determined to be yes.

[0098] After configuring the objective function for the child node and determining the function label corresponding to the objective function, the function label of the child node can be returned to the parent node of the previous level. When the parent node receives the function label returned by the first child node and determines that the function label of the third objective function of the child node is yes, the function label of the first objective function can be set to yes.

[0099] Furthermore, when it is determined that the syntax structure type corresponding to the current tree node is a function call, the function name of the current tree node is further determined, and a target function is configured for the current tree node according to the function name, which can be specifically implemented in the following manner:

[0100] In the case where it is determined according to the function name that the node function is the second function, configuring the first target function for the target tree node;

[0101] Determining whether a second target parameter included in the node function is a constant according to parameter attribute information of the parameter included in the node function;

[0102] If yes, determining that the function label corresponding to the first objective function is yes;

[0103] If not, it is determined that the function label corresponding to the first objective function is no.

[0104] Specifically, the second function can be a value processing function, specifically "json_select / regex / regex_select / regex_findall / \regex_match / regex_replace / regex_split", etc. The second target parameter is the parameter type of other parameters except the first parameter included in the second function.

[0105] When determining that the node function is the second function according to the function name, and determining that among the parameters contained in the second function, except for the first parameter, the other parameters are constants, then set "whether the attributes of some parameters are constants part_const_attr" to True, otherwise set "whether the attributes of some parameters are constants part_const_attr" to False.

[0106] Similarly, as mentioned above, if the current tree node is a parent node and the node function of the parent node is the second function, the first objective function is configured for the parent node, and when the function label corresponding to the first objective function of the parent node needs to be determined, the child nodes under the parent node can be traversed first, and the third objective function can be configured for the child nodes. Then the function label of the third objective function is determined, and the function label is returned to the parent node of the previous level. After determining that the function labels of the third objective functions of other child nodes under the parent node except the first child node are all yes, "Whether the attributes of some parameters are constants part_const_attr" can be set to True, otherwise "Whether the attributes of some parameters are constants part_const_attr" can be set to False.

[0107] Furthermore, when it is determined that the syntax structure type corresponding to the current tree node is a function call, the function name of the current tree node is further determined, and a target function is configured for the current tree node according to the function name, which can be specifically implemented in the following manner:

[0108] When it is determined according to the function name that the node function is the third function, configuring the first target function for the target tree node;

[0109] Determining whether all parameters included in the node function are constants according to parameter attribute information of the parameters included in the node function;

[0110] If yes, determining that the function label corresponding to the first objective function is yes;

[0111] If not, it is determined that the function label corresponding to the first objective function is no.

[0112] Specifically, the third function may be an event processing function, and specifically may be "e_set / dt_fromtimestamp" or the like.

[0113] Similarly, if the current tree node is the parent node, the node function of the parent node is the third function, and after the first objective function is configured for the parent node, if the function label of the first objective function needs to be determined, the child nodes under the parent node can be traversed first, the third objective function can be configured for the child nodes, and then the function label of the third objective function can be determined, and the function label can be returned to the parent node of the previous level. After determining that the function labels of the third objective functions of all child nodes under the parent node are yes, "Whether the attributes of some parameters are constants part_const_attr" can be set to True, otherwise "Whether the attributes of some parameters are constants part_const_attr" can be set to False.

[0114] Through the above process, "whether the attribute of some parameters is constant part_const_attr" can be correctly set for the target tree node.

[0115] The way of setting the first target function of other tree nodes in the abstract syntax tree is similar to the way of setting the target tree node, which will not be repeated here.

[0116] In addition to configuring the first objective function for the target tree node in the aforementioned manner, the second objective function may also be configured for the target tree node, which may be specifically implemented in the following manner:

[0117] In the case where it is determined according to the grammatical structure type corresponding to the target tree node that the node function corresponding to the target tree node belongs to the target function type, obtaining the function name of the node function, wherein the target tree node is one of the multiple tree nodes;

[0118] In the case where it is determined according to the function name that the node function is the fourth function, configuring a second objective function for the target tree node, and determining that a function label corresponding to the second objective function is no;

[0119] When it is determined that the node function is a constant function according to the function name, a second objective function is configured for the target tree node, and the function label corresponding to the second objective function is determined to be yes, wherein the function name of the second objective function as the node function is a constant function name.

[0120] Specifically, the target tree node is the current tree node, and the target function type is function call; the fourth function includes but is not limited to event processing functions, functions related to the current time, and resource pool functions that need to be updated periodically; the second target function is "the function name of the node function is a constant function name", specifically "const_func_name".

[0121] In an embodiment of the present specification, when it is determined that the grammatical structure type corresponding to the target tree node, or the node function corresponding to the target tree node belongs to the function call type, the function name of the node function is obtained, and when the node function is determined to be the fourth function according to the function name, since the event processing function, the function related to the current time and the resource pool function that needs to be updated periodically in the fourth function are not constant functions, the "function name of the node function is the constant function name const_func_name" is set to False, otherwise the "function name of the node function is the constant function name const_func_name" is set to True, that is, when it is determined that the node function is a constant function according to the function name, the second target function is configured for the target tree node, and the function label corresponding to the second target function is determined to be yes.

[0122] Alternatively, there are some functions that have no parameters or whose parameters are constants, but whose function values ​​are variables rather than constants. For example, a function is to determine the current time. Since time is constantly changing, the function value of the function is always in a changing state as time changes. Alternatively, due to different regions, the function value of the function may also be different. In this case, a second objective function can be configured for the function, and the function label of the second objective function can be determined to be no.

[0123] In addition to configuring the first objective function, the second objective function and / or the third objective function for the target tree node in the aforementioned manner, a fourth objective function may also be configured for the target tree node, which may be specifically implemented in the following manner:

[0124] configuring a fourth objective function for a target tree node, wherein the target tree node is one of the plurality of tree nodes;

[0125] Determine, according to parameter attribute information of the parameters included in the node function of the target tree node, whether all the parameters included in the node function are constants;

[0126] If yes, determining that the function label corresponding to the fourth objective function is yes;

[0127] If not, it is determined that the function label corresponding to the fourth objective function is no.

[0128] Specifically, the fourth target function is: the parameters contained in the fourth function are all constants, specifically "const_attr"; when the syntax structure type of the target tree node does not belong to the aforementioned function call, nor to the parameter type, the fourth target function can be configured for the target tree node, and the function label of the fourth target function can be determined. The process of determining the function label is similar to the process of determining the function labels of the aforementioned first and second target functions. The target tree node can be used as the parent node, and the child node of the parent node can be determined. Then, when the language structure type of the child node is a parameter type, the third target function is configured for the child node, and the function label of the third target function is determined, and then the function label is returned to the parent node. When it is determined that the returned function labels are all yes, it can be determined whether the parameters contained in the node function of the target tree node are all constants; therefore, it can be determined that the function label corresponding to the fourth target function is yes; otherwise, it is determined that the function label corresponding to the fourth target function is no.

[0129] For example, the node function of a target tree node is: determine the length of the set {1,2,3,2,2,2,5}. In this case, the grammatical structure type of the tree node in the abstract syntax tree is a list, that is, the parameters in the set are stored in the form of a list. Therefore, after configuring the fourth target function for the target tree node, it is necessary to traverse the list of the target tree node and determine whether the parameters in the list are all constants (configure the third target function for each parameter in the list and determine the function label of the third target function). If so, set "the parameters contained in the fourth function are all constants const_attr" to True and return True; otherwise, set "the parameters contained in the fourth function are all constants const_attr" to False and return False.

[0130] In a specific implementation, after traversing the plurality of tree nodes, before configuring at least one objective function for each tree node according to the grammatical structure type corresponding to each tree node, the method further includes:

[0131] When it is determined that the node function corresponding to the target tree node belongs to a search function according to the syntax structure type corresponding to the target tree node, and the number of parameters contained in the node function is equal to 1, the function name of the node function is replaced by a single field value function.

[0132] Specifically, before configuring the target function for each tree node, each tree node can be preprocessed first, that is, traversing the abstract syntax tree to determine whether the node function corresponding to each tree node is a search function, that is, the vlookup function. If it is determined that the node function of the current tree node is a search function, and the function has one and only one parameter, then the function name of the current tree node is replaced with a single field value function, that is, the "e_single_field_value" function.

[0133] The search function implements the data search function. When there is only one parameter, there is no need to loop through the parameter list, which helps improve processing performance.

[0134] After traversing the abstract syntax tree in the aforementioned manner and configuring the function for each tree node "the function name of the node function is the constant function name const_func_name", "the parameters contained in the fourth function are all constants const_attr" and / or "the attributes of some parameters are constants part_const_attr", the initial object can be compiled according to the configuration results to generate a target object of the target language type.

[0135] Step 106: compile the initial object according to the grammatical structure type corresponding to each tree node and the function label to generate a target object of the target language type.

[0136] In specific implementation, the initial object is compiled according to the syntax structure type and the function label corresponding to each tree node to generate a target object of the target language type, which can be specifically implemented in the following manner:

[0137] In the case where it is determined according to the grammatical structure type corresponding to the target tree node that the node function corresponding to the target tree node belongs to the target function type, obtaining the function name of the node function, wherein the target tree node is one of the multiple tree nodes;

[0138] The initial object is compiled according to the function name and the function labels of the first target function, the second target function and / or the third target function configured by the target tree node to generate a target object of the target language type.

[0139] Specifically, after configuring the target function for the tree nodes in the abstract syntax tree, the initial object can still be compiled according to the function label corresponding to the target function of each tree node by traversing the abstract syntax tree to generate runtime code, that is, a machine executable program.

[0140] In actual applications, if the function name of the node function of the current tree node is "op_and / op_or", in order to implement logical operation short-circuiting, the above two functions are translated into if operations.

[0141] On this basis, if the function label of the fourth target function of the current tree node "the parameters contained in the fourth function are all constants const_attr" is True, or the function label of the first target function "the attributes of some parameters are constants part_const_attr" is True, then the common pattern initialization extraction is performed on functions such as op_and / op_or, and this part will only be executed once during the pattern matching process.

[0142] Since in the actual program execution process, some functions will have repetitive operations, taking the matching function of regular expressions as an example, the processing of this function includes two parts, one part is to compile the matching function of the regular expression into the data structure of the automaton, and the other part is to match the data according to the compilation result; and the first part, compiling the expression into an automaton is equivalent to a repetitive operation, and when some or all of the parameters in the expression are constants, the compilation process can be extracted separately as a common operation, thereby converting the previous need for multiple compilations into only one compilation, which is conducive to reducing the time required for compilation, thereby improving the execution efficiency of the program.

[0143] Alternatively, for resource pool functions with timed refresh functions such as res_rds_mysql, and res_log_logstore_pull / res_oss_file, the result pointer is returned, and then the resource pool is updated in real time through the read-write lock.

[0144] Since the resource pool needs to pull data from the database, and this process will take a lot of time if the amount of data pulled each time is large, it can also be used as a public operation. During the entire program execution process, only one data pull is required, and then the result pointer is returned. Then, the resource pool can be updated in real time according to the data pulling results through the read-write lock.

[0145] Alternatively, for the ultra-high frequency function e_set, the number of parameters and constant attributes are processed separately. If all the key-value pairs of the function are constants, the function is converted to KeyValueConstSetTransformer. If all the keys of the function are constants, the function is converted to KeyConstSetTransformer. In other cases, it is converted to SetTransformer.

[0146] In addition, if the node function of the current tree node is an extended class function, such as e_split, e_coutput, such functions need to be converted into iterator loop access.

[0147] Based on this, if the function labels of the second objective function of the current tree node "the function name of the node function is the constant function name const_func_name" and the fourth objective function "the parameters contained in the fourth function are all constants const_attr" are both True, it means that the execution result of the node function of the current tree node is a constant, and it can be extracted as a global shared variable.

[0148] If the node function of the current tree node is "dt_now / dt_today" and has no parameters, there is no need to perform time zone processing and the function is converted to "DtNowExpression / DtTodayExpression".

[0149] At the same time, all event handling functions need to add the parameter event representing the current event.

[0150] The embodiments of this specification optimize different types of functions, extract the common parts that only need to be executed once for data processing as much as possible, and improve the event processing speed. That is, different compilation schemes are designed for functions of different initial language types, which is conducive to ensuring the accuracy of the semantics of the target object of the target language type generated by compilation.

[0151] After compiling and generating the target object of the target language type, the target object can be published and run. Specifically, the result of code translation can be combined with input and output and packaged into an executable application. In addition, the program will send the running log to the message queue at regular intervals, and then the detection program will read the monitoring log in the message queue, and finally generate a monitoring interface that is convenient for users to use.

[0152] An embodiment of the present specification obtains an initial object of an initial language type to be compiled, performs semantic analysis on the initial object, and generates a corresponding abstract syntax tree, wherein the abstract syntax tree includes multiple tree nodes, and the multiple tree nodes correspond to the syntax structure in the initial object, traverses the multiple tree nodes, and configures at least one target function for each tree node according to the syntax structure type corresponding to each tree node, and determines a function label corresponding to the at least one target function, compiles the initial object according to the syntax structure type corresponding to each tree node and the function label, and generates a target object of the target language type.

[0153] After generating an abstract syntax tree corresponding to the initial object, the embodiment of the present specification configures a corresponding target function for each tree node according to the syntax structure type corresponding to each tree node in the abstract syntax tree, and determines the function label of each target function, so as to compile the initial object according to the syntax structure type and the function label, and design different compilation schemes for functions of different initial language types, thereby facilitating the accuracy of the semantics of the target object of the target language type generated by the compilation, and achieving high execution efficiency of the compiled runtime code.

[0154] In addition, since the domain language for data processing supports more than 200 functions and has relatively rich semantics, it can cope with a wide range of data processing application needs. Moreover, each type of function implements a code translation optimization algorithm, which not only ensures the correctness of the semantics, but also the compiled runtime code has a high execution efficiency, which is conducive to increasing the amount of data processed per unit time, thereby improving the throughput of data processing services, and effectively solving the real-time processing needs of massive data in the cloud computing field.

[0155] The following combination Figure 2 , the application of the object processing method provided in this specification in compiling a specific domain language is used as an example to illustrate. Figure 2 A processing flow chart of an object processing method provided by an embodiment of the present specification is shown, which specifically includes the following steps.

[0156] Step 202: Design a domain-specific language for data processing services.

[0157] Specifically, the 5 basic functions (event processing function, value processing function, operator function, resource pool function, type-related function) constitute a feature-rich DSL. Function is the basic building block of domain-specific languages.

[0158] Step 204: parse the domain-specific language into an abstract syntax tree through lexical grammar.

[0159] Step 206, traverse the abstract syntax tree to determine whether the current tree node is a "v" function and has one and only one parameter.

[0160] If yes, execute step 208 ; if no, execute step 210 .

[0161] Step 208, replace the function name "v" with "single field value".

[0162] Specifically, replace the function name "v" with "e_single_field_value".

[0163] After step 208 is executed, continue to step 210.

[0164] Step 210, traverse the abstract syntax tree, configure at least one target function for each tree node according to the syntax structure type corresponding to each tree node, and determine a function label corresponding to the at least one target function.

[0165] Specifically, if the function name of the current node is "str_format" and the first parameter is a constant string, "whether some parameters are constant part_const_attr" is set to True, otherwise "whether some parameters are constant part_const_attr" is set to False.

[0166] If the function name is "json_select\regex\regex_select\regex_findall\regex_match" or "regex_replace\regex_split", and the second parameter is a constant string, and the other parameters are also constants, then set "Whether some parameters are constants part_const_attr" to True, otherwise set "Whether some parameters are constants part_const_attr" to False.

[0167] If the function name is "e_set\dt_fromtimestamp" and all parameters are constants, set "Whether some parameters are constants part_const_attr" to True, otherwise set "Whether some parameters are constants part_const_attr" to False.

[0168] If the function of the current node is an event processing function, a function related to the current time, or a resource pool function that needs to be updated periodically, set "Is it a constant function name const_func_name" to False; otherwise, set "Is it a constant function name const_func_name" to True.

[0169] If not all function parameters are constants, False is returned, otherwise "whether the function name is a constant const_func_name" is returned as the result.

[0170] Returns False if the argument of the current node is a variable name, otherwise returns True.

[0171] Traverse the parameters of the current node. If the parameter type is a list, traverse the list elements. If the parameter traversal results are all True, set "Are all parameters constant const_attr" to True and return True, otherwise set "Are all parameters constant const_attr" to False and return False.

[0172] Step 212, traverse the abstract syntax tree to determine whether the function name of the current node is op_and or op_or.

[0173] If yes, execute step 214 ; if no, execute step 216 .

[0174] Step 214, translate the op_and or op_or function into an if operation.

[0175] Step 216, determining whether the function label of the first objective function is yes.

[0176] Specifically, determine whether "partial parameters are all constants part_const_attr" is True;

[0177] If yes, execute step 218 ; if no, execute step 220 .

[0178] Step 218, perform initialization extraction of common patterns for different function types respectively.

[0179] Step 220, determining whether the function label of the third objective function is yes.

[0180] Specifically, determine whether “are all parameters constant const_attr” is True; if so, execute step 218; if not, execute step 222.

[0181] Step 222, determine whether the function of the current node is an extended class function.

[0182] If yes, execute step 224; if no, execute step 226.

[0183] Step 224, convert the extended class function into an iterator loop access.

[0184] Step 226, determining whether the function labels of the second objective function and the third objective function are both yes.

[0185] Specifically, determine whether “whether the function name is a constant const_func_name” and “whether all parameters are constant const_attr” are both True. If so, execute step 228; if not, execute step 230.

[0186] Step 228, extract as a global shared variable.

[0187] Specifically, when the function labels of the second objective function and the third objective function are both yes, it indicates that the function result is a constant, and it can be extracted as a global shared variable.

[0188] Step 230, determine whether it is a time function and has no parameters.

[0189] Specifically, determine whether the function of the current node is dt_now or dt_today and has no parameters;

[0190] If yes, execute step 232; if no, do nothing.

[0191] Step 232, converting the time function into a function expression of the target type.

[0192] Specifically, convert dt_now or dt_today into "Dt Now Expression\Dt TodayExpression".

[0193] Step 234, adding a parameter event representing the current event to the event processing function, and generating runtime code.

[0194] After step 214, step 218, step 224, step 228 and step 232 are executed, step 234 may be executed.

[0195] The embodiments of this specification design a domain language with functions as basic units, which has rich semantics and supports multi-scenario application needs. It optimizes different types of functions, effectively extracts the common computing parts that need to be repeatedly executed, and translates and generates better runtime code, which speeds up data processing, shortens processing delays, reduces the number of servers used, saves operating costs, and thus improves the overall competitiveness of the product.

[0196] Corresponding to the above method embodiment, this specification also provides an object processing device embodiment, Figure 3 FIG. 1 shows a schematic diagram of the structure of an object processing device provided by an embodiment of the present specification. Figure 3 As shown, the device comprises:

[0197] The acquisition module 302 is configured to acquire an initial object of an initial language type to be compiled, perform semantic analysis on the initial object, and generate a corresponding abstract syntax tree, wherein the abstract syntax tree includes a plurality of tree nodes, and the plurality of tree nodes correspond to the grammatical structures in the initial object;

[0198] The determination module 304 is configured to traverse the plurality of tree nodes, and configure at least one target function for each tree node according to the grammatical structure type corresponding to each tree node, and determine a function label corresponding to the at least one target function;

[0199] The compiling module 306 is configured to compile the initial object according to the grammatical structure type and the function label corresponding to each tree node to generate a target object of the target language type.

[0200] Optionally, the determining module 304 includes:

[0201] an acquisition submodule, configured to acquire a function name of the node function when it is determined that the node function corresponding to the target tree node belongs to the target function type according to the grammatical structure type corresponding to the target tree node, wherein the target tree node is one of the multiple tree nodes;

[0202] The determination submodule is configured to configure a first target function for the target tree node when the node function is determined to be the first function according to the function name, and determine a function label corresponding to the first target function according to parameter attribute information of the parameters contained in the node function.

[0203] Optionally, the first objective function has some parameters whose attributes are constants;

[0204] Accordingly, the determination submodule is further configured as follows:

[0205] Determining whether a first target parameter included in the node function is a constant according to parameter attribute information of the parameter included in the node function;

[0206] If yes, determining that the function label corresponding to the first objective function is yes;

[0207] If not, it is determined that the function label corresponding to the first objective function is no.

[0208] Optionally, the determining module 304 further includes a first configuration submodule configured to:

[0209] In the case where it is determined according to the function name that the node function is the second function, configuring the first target function for the target tree node;

[0210] Determining whether a second target parameter included in the node function is a constant according to parameter attribute information of the parameter included in the node function;

[0211] If yes, determining that the function label corresponding to the first objective function is yes;

[0212] If not, it is determined that the function label corresponding to the first objective function is no.

[0213] Optionally, the determining module 304 further includes a second configuration submodule configured to:

[0214] When it is determined according to the function name that the node function is the third function, configuring the first target function for the target tree node;

[0215] Determining whether all parameters included in the node function are constants according to parameter attribute information of the parameters included in the node function;

[0216] If yes, determining that the function label corresponding to the first objective function is yes;

[0217] If not, it is determined that the function label corresponding to the first objective function is no.

[0218] Optionally, the determining module 304 is further configured to:

[0219] In the case where it is determined according to the grammatical structure type corresponding to the target tree node that the node function corresponding to the target tree node belongs to the target function type, obtaining the function name of the node function, wherein the target tree node is one of the multiple tree nodes;

[0220] In the case where it is determined according to the function name that the node function is the fourth function, configuring a second objective function for the target tree node, and determining that a function label corresponding to the second objective function is no;

[0221] When it is determined that the node function is a constant function according to the function name, a second objective function is configured for the target tree node, and the function label corresponding to the second objective function is determined to be yes, wherein the function name of the second objective function as the node function is a constant function name.

[0222] Optionally, the determining module 304 is further configured to:

[0223] When it is determined that the parameter corresponding to the target tree node is a variable parameter according to the grammatical structure type corresponding to the target tree node, a third objective function is configured for the target tree node, and it is determined that the function label corresponding to the third objective function is no, wherein the parameter of the third objective function is a constant.

[0224] Optionally, the determining module 304 is further configured to:

[0225] configuring a fourth objective function for a target tree node, wherein the target tree node is one of the plurality of tree nodes;

[0226] Determine, according to parameter attribute information of the parameters included in the node function of the target tree node, whether all the parameters included in the node function are constants;

[0227] If yes, determining that the function label corresponding to the fourth objective function is yes;

[0228] If not, it is determined that the function label corresponding to the fourth objective function is no.

[0229] Optionally, the compiling module 306 is further configured to:

[0230] In the case where it is determined according to the grammatical structure type corresponding to the target tree node that the node function corresponding to the target tree node belongs to the target function type, obtaining the function name of the node function, wherein the target tree node is one of the multiple tree nodes;

[0231] The initial object is compiled according to the function name and the function labels of the first target function, the second target function and / or the third target function configured by the target tree node to generate a target object of the target language type.

[0232] Optionally, the object processing device further includes:

[0233] The replacement module is configured to replace the function name of the node function with a single field value function when it is determined that the node function corresponding to the target tree node belongs to a search function according to the syntax structure type corresponding to the target tree node and the number of parameters contained in the node function is equal to 1.

[0234] The above is a schematic scheme of an object processing device of this embodiment. It should be noted that the technical scheme of the object processing device and the technical scheme of the object processing method described above are of the same concept, and the details not described in detail in the technical scheme of the object processing device can be referred to the description of the technical scheme of the object processing method described above.

[0235] Figure 4 The block diagram of a computing device 400 according to one embodiment of the present specification is shown. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and the database 450 is used to store data.

[0236] The computing device 400 also includes an access device 440 that enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0237] In one embodiment of the present specification, the above components of the computing device 400 and Figure 4 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 4 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0238] Computing device 400 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 400 may also be a mobile or stationary server.

[0239] The processor 420 is used to execute the following computer executable instructions, which implement the steps of the above-mentioned object processing method when executed by the processor.

[0240] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the object processing method described above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the object processing method described above.

[0241] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above-mentioned object processing method when executed by a processor.

[0242] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the object processing method described above are of the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the object processing method described above.

[0243] An embodiment of the present specification also provides a computer program product, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned object processing method.

[0244] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the object processing method described above are of the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the object processing method described above.

[0245] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0246] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0247] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0248] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0249] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. An object processing method, comprising: Obtaining an initial object of an initial language type to be compiled, performing semantic analysis on the initial object, and generating a corresponding abstract syntax tree, wherein the abstract syntax tree includes a plurality of tree nodes, and the plurality of tree nodes correspond to the syntax structures in the initial object; Traversing the plurality of tree nodes, and configuring at least one objective function for each tree node according to a grammatical structure type corresponding to each tree node, and determining a function label corresponding to the at least one objective function; The initial object is compiled according to the grammatical structure type corresponding to each tree node and the function label to generate a target object of the target language type.

2. The object processing method according to claim 1, wherein configuring at least one objective function for each tree node according to the grammatical structure type corresponding to each tree node, and determining a function label corresponding to the at least one objective function, comprises: In the case where it is determined according to the grammatical structure type corresponding to the target tree node that the node function corresponding to the target tree node belongs to the target function type, obtaining the function name of the node function, wherein the target tree node is one of the multiple tree nodes; When it is determined that the node function is the first function according to the function name, a first target function is configured for the target tree node, and a function label corresponding to the first target function is determined according to parameter attribute information of the parameters contained in the node function.

3. The object processing method according to claim 2, wherein the first objective function has some parameters whose attributes are constants; Correspondingly, determining the function label corresponding to the first objective function according to the parameter attribute information of the parameter contained in the node function includes: Determining whether a first target parameter included in the node function is a constant according to parameter attribute information of the parameter included in the node function; If yes, determining that the function label corresponding to the first objective function is yes; If not, it is determined that the function label corresponding to the first objective function is no.

4. The object processing method according to claim 2, further comprising: In the case where it is determined according to the function name that the node function is the second function, configuring the first target function for the target tree node; Determining whether a second target parameter included in the node function is a constant according to parameter attribute information of the parameter included in the node function; If yes, determining that the function label corresponding to the first objective function is yes; If not, it is determined that the function label corresponding to the first objective function is no.

5. The object processing method according to claim 2 or 4, further comprising: When it is determined according to the function name that the node function is the third function, configuring the first target function for the target tree node; Determining whether all parameters included in the node function are constants according to parameter attribute information of the parameters included in the node function; If yes, determining that the function label corresponding to the first objective function is yes; If not, it is determined that the function label corresponding to the first objective function is no.

6. The object processing method according to claim 1, wherein configuring at least one target function for each tree node according to the grammatical structure type corresponding to each tree node, and determining a function label corresponding to the at least one target function, comprises: In the case where it is determined according to the grammatical structure type corresponding to the target tree node that the node function corresponding to the target tree node belongs to the target function type, obtaining the function name of the node function, wherein the target tree node is one of the multiple tree nodes; In the case where it is determined according to the function name that the node function is the fourth function, configuring a second objective function for the target tree node, and determining that a function label corresponding to the second objective function is no; When it is determined that the node function is a constant function according to the function name, a second objective function is configured for the target tree node, and the function label corresponding to the second objective function is determined to be yes, wherein the function name of the second objective function as the node function is a constant function name.

7. The object processing method according to claim 1, wherein configuring at least one target function for each tree node according to the grammatical structure type corresponding to each tree node, and determining a function label corresponding to the at least one target function comprises: When it is determined that the parameter corresponding to the target tree node is a variable parameter according to the grammatical structure type corresponding to the target tree node, a third objective function is configured for the target tree node, and it is determined that the function label corresponding to the third objective function is no, wherein the parameter of the third objective function is a constant.

8. The object processing method according to claim 1, wherein configuring at least one objective function for each tree node according to the attribute information of the node function corresponding to each tree node, and determining the function label corresponding to the at least one objective function, comprises: configuring a fourth objective function for a target tree node, wherein the target tree node is one of the plurality of tree nodes; Determine, according to parameter attribute information of the parameters included in the node function of the target tree node, whether all the parameters included in the node function are constants; If yes, determining that the function label corresponding to the fourth objective function is yes; If not, it is determined that the function label corresponding to the fourth objective function is no.

9. The object processing method according to claim 1, wherein the initial object is compiled according to the grammatical structure type corresponding to each tree node and the function label to generate a target object of the target language type, comprising: In the case where it is determined according to the grammatical structure type corresponding to the target tree node that the node function corresponding to the target tree node belongs to the target function type, obtaining the function name of the node function, wherein the target tree node is one of the multiple tree nodes; The initial object is compiled according to the function name and the function labels of the first target function, the second target function and / or the third target function configured by the target tree node to generate a target object of the target language type.

10. The object processing method according to claim 1, after traversing the plurality of tree nodes and before configuring at least one objective function for each tree node according to the grammatical structure type corresponding to each tree node, further comprising: When it is determined that the node function corresponding to the target tree node belongs to a search function according to the syntax structure type corresponding to the target tree node, and the number of parameters contained in the node function is equal to 1, the function name of the node function is replaced by a single field value function.

11. An object processing device, comprising: an acquisition module, configured to acquire an initial object of an initial language type to be compiled, perform semantic analysis on the initial object, and generate a corresponding abstract syntax tree, wherein the abstract syntax tree includes a plurality of tree nodes, and the plurality of tree nodes correspond to the grammatical structures in the initial object; A determination module is configured to traverse the plurality of tree nodes, and configure at least one target function for each tree node according to a grammatical structure type corresponding to each tree node, and determine a function label corresponding to the at least one target function; The compiling module is configured to compile the initial object according to the grammatical structure type corresponding to each tree node and the function label to generate a target object of a target language type.

12. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the object processing method according to any one of claims 1 to 10 are implemented.

13. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the object processing method according to any one of claims 1 to 10.

14. A computer program product, wherein: When the computer program is executed in a computer, the computer is caused to execute the steps of the object processing method according to any one of claims 1 to 10.