Hierarchical data
By generating and enhancing query-associated ASTs and identifying ancestor objects in hierarchical data, the need for data preprocessing in the existing technology is solved, query efficiency is improved, and storage and computing costs are reduced.
Patent Information
- Application Number
- CN202180009579.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-01-17
- Filing Date
- 2021-01-12
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2041-01-12
AI Technical Summary
When processing hierarchical data, existing technologies need to prepare data in advance to include relationship information, resulting in additional CPU overhead and storage requirements, and are unable to identify parent nodes in data structures that do not include relationship information.
The need for data pre-parsing is avoided by generating an abstract syntax tree (AST) associated with the query and enhancing the AST with parent identifiers to identify ancestor objects in hierarchical data at query evaluation time.
It reduces the need for data preprocessing, improves the efficiency of query evaluation, reduces storage and computing costs, and supports multiple query evaluations.
Smart Images

Figure CN114981802B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention generally relate to hierarchical data, and more particularly to concepts for identifying ancestor objects in hierarchical data. Embodiments of the present invention also relate to concepts for processing hierarchical data using queries according to a query language. The concepts can be computer-implemented.
[0002] Furthermore, embodiments of the present invention also relate to a computer program product comprising computer readable program code enabling a processor of a system or a plurality of processors of a network to implement such a method.
[0003] Additionally, embodiments of the present invention relate to systems for identifying ancestor objects in hierarchical data configured for processing according to a query in a query language. Embodiments of the present invention also relate to systems for processing hierarchical data using a query in a query language. Background Art
[0004] Structured data query languages, such as XPath (Extensible Markup Language (XML) Query Language), include syntax that allows users to find the "parent" element of any other element within a data structure. This is possible because the input data (e.g., XML in the case of XPath) is parsed specifically to contain fully interconnected relationship information within the parsed input structure. Therefore, when requesting a parent element, the query engine only needs to traverse the parsed input structure.
[0005] The above approach relies on pre-prepared data to contain relational information. Pre-preparing input data adds additional CPU overhead to query evaluation. Furthermore, creating a copy of the data with the additional relational metadata consumes significantly more memory and must be created for each query call.
[0006] For cases where the data has not been modified to include relational information, such as natively represented as JSON ( Object Notation) data in an object structure, the query engine cannot identify the "parent" of any data within the data structure (because relationship information is not available). Summary of the Invention
[0007] Embodiments of the present invention seek to provide methods for identifying ancestor objects in hierarchical data configured to be processed according to a query of a query language.
[0008] Embodiments of the present invention also seek to provide a method for processing hierarchical data using a query according to a query language, the query having an associated abstract syntax tree (AST).
[0009] Embodiments of the present invention also seek to provide a computer program product comprising computer program code for implementing the proposed method when executed by a processing unit.Embodiments of the present invention also seek to provide a processing system adapted to execute the computer program code.
[0010] Embodiments of the present invention also seek to provide a system for identifying ancestor objects in hierarchical data configured to be processed with a query according to a query language.Furthermore, embodiments of the present invention seek to provide a system for processing hierarchical data with a query according to a query language.
[0011] According to an embodiment of the present invention, a computer-implemented method for identifying ancestor objects in hierarchical data is provided, the hierarchical data being configured to be processed using a query according to a query language, the query having an associated abstract syntax tree (AST). The method includes processing the AST associated with the query to determine a parent node of the AST associated with the query. The method also includes augmenting the AST with a parent identifier configured to identify the determined parent node to generate an augmented AST.
[0012] The proposed concept can provide a query language to determine the parent node or any higher-level ancestor of any data item within a hierarchical data structure without encoding hierarchical information (e.g., parent relationship information) into the data itself. Instead, embodiments propose that the parse tree of the query language itself is post-processed and enhanced with appropriate information.
[0013] Thus, the proposed embodiments may provide the advantage that processing the AST of a query may be done as part of query compilation and may therefore only need to be done once, while evaluation of the compiled query may be performed multiple times. Embodiments may also have the advantage that pre-processing of the query will not be affected by the size of the data.
[0014] By augmenting the AST associated with a query with information identifying the query's parent nodes, embodiments can eliminate the need to pre-parse input data. In other words, by encoding the identification of one or more parent objects into the query language's AST, embodiments can alleviate the need to pre-prepare input data to include relationship information.
[0015] In some embodiments, processing the AST associated with the query to determine the parent node of the AST associated with the query may include traversing the AST to determine a node of the AST that represents the parent node of the query. In this way, the parent node can be identified in a computationally efficient manner using a simple process of stepping through a path of the AST.
[0016] The parent identifier can be configured to instruct the query processor to save a reference to the parent node. Like this, an embodiment can be configured to instruct the query processor to save a reference to the requested parent in an appropriate storage mechanism so that the reference is available when the ancestor is actually requested in a subsequent query.
[0017] In one embodiment, enhancing the AST with a parent identifier configured to identify the determined parent node to generate the enhanced AST may include adding an ancestor attribute to the parent node of the AST. Various embodiments may pre-process the AST to add metadata to relevant parts rather than enhancing the data with relationship information, which may result in high computational and / or storage costs (because each value must store a hidden reference back to its parent object).
[0018] For example, adding an ancestor attribute to a parent node of an AST may include setting the value of the ancestor attribute to a predetermined value. For example, the predetermined value may be based on a counter value that is incremented for each parent node identified. The use of a counter value may, for example, support a simple counting method for identifying corresponding parent nodes in a hierarchy with multiple levels of ancestors.
[0019] Some embodiments may also include a prior step of generating an AST by parsing the query. Thus, it will be appreciated that embodiments may include generating an AST, while other embodiments may be configured to process a pre-existing AST (e.g., an AST that has previously been generated by a separate system / method).
[0020] The proposed embodiment may also include: storing the enhanced AST; and associating the stored enhanced AST with the hierarchical data. In this way, the embodiment can be configured to provide query resources that can be used (possibly multiple times) when evaluating queries at a later time. Thus, a query may only need to be processed once according to the proposed concept, while it can be evaluated multiple times.
[0021] The hierarchical data may include JSON data, and the query language may be JSONata query language (JSON query and transformation language). Thus, embodiments may be used in conjunction with traditional languages and object structures.
[0022] According to another embodiment of the present invention, a computer-implemented method for processing hierarchical data using a query according to a query language, the query having an associated abstract syntax tree (AST). The method includes identifying ancestor objects in the hierarchical data according to the proposed embodiment. The method also includes evaluating the query using the AST enhanced for processing hierarchical data.
[0023] According to another embodiment of the present invention, a computer program product is provided, which includes a computer-readable storage medium having program instructions embodied therein, wherein the program instructions can be executed by a processing unit to cause the processing unit to perform the method according to the proposed embodiment.
[0024] According to another embodiment of the present invention, a computer system is provided, comprising at least one processor and a computer program product according to an embodiment. The at least one processor is adapted to execute computer program code of the computer program product.
[0025] According to another embodiment of the present invention, a system for identifying ancestor objects in hierarchical data configured to be processed according to a query in a query language, the query having an associated AST, is provided. The system includes a processing unit configured to process the AST associated with the query to determine a parent node of the AST associated with the query. The system also includes an enhancement component configured to enhance the AST using a parent identifier configured to identify the determined parent node to generate an enhanced AST.
[0026] According to another embodiment of the present invention, a system for processing hierarchical data using a query according to a query language, the query having an associated AST, is provided. The system includes a system for identifying ancestor objects in hierarchical data according to the proposed embodiment. The system also includes a processor device configured to evaluate the query using the AST enhanced for processing hierarchical data.
[0027] The above is a rather general overview of the features and technical advantages of one or more embodiments of the present invention so that the following detailed description of the invention can be better understood. Other features and advantages of the present invention will be described below, which may form the subject of the claims of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] A better understanding of the present invention may be obtained when the following detailed description is considered in conjunction with the accompanying drawings, in which:
[0029] Figure 1 Described is a graphical representation of an example distributed system in which aspects of the illustrative embodiments may be implemented, according to an embodiment of the present invention;
[0030] Figure 2 is a schematic diagram of a proposed system for identifying ancestor objects in hierarchical data according to an embodiment of the present invention;
[0031] Figure 3 is a flow chart of a computer-implemented method for identifying ancestor objects in hierarchical data according to an embodiment of the present invention;
[0032] Figure 4 is a flow chart of a computer-implemented method for processing hierarchical data using queries according to an embodiment of the present invention; and
[0033] Figure 5 A system according to another embodiment of the present invention is shown. DETAILED DESCRIPTION
[0034] It will be appreciated that the drawings are schematic and not drawn to scale. It will also be appreciated that the same reference numerals are used throughout the drawings to represent the same or similar components.
[0035] In the context of this application, where embodiments of the present invention constitute a method, it will be understood that the method may be a process for execution by a computer, i.e., a computer-implementable method. Accordingly, the various steps of the method may reflect various parts of a computer program, such as various parts of one or more algorithms.
[0036] Furthermore, in the context of this application, a system can be a single device or a collection of distributed devices suitable for performing one or more embodiments of the method of the present invention. For example, a system can be a personal computer (PC), a server, or a collection of PCs and / or servers connected via a network such as a local area network, the Internet, etc. to collaboratively perform at least one embodiment of the method of the present invention. Furthermore, a component can be an integrated process executed by one or more processing units.
[0037] A concept for identifying ancestor (e.g., parent) objects in hierarchical data configured for processing with queries is proposed. This concept can process the AST associated with a query to generate an enhanced AST that includes a parent identifier configured to identify the parent node of the query. In this way, the need for pre-parsed data can be alleviated. Instead, the identification of the parent node of the query can be encoded into the query's AST.
[0038] For example, the proposed embodiments may pre-process the AST of a data query to add metadata (identifying the parent nodes of the query) to the relevant parts of the AST, rather than enhancing the data with information about hierarchical relationships (which may be computationally expensive and / or require large amounts of data storage since each value would have to store a hidden reference back to its parent object).
[0039] A reference to "parent" can be thought of as an object representing the query including a property whose value we currently have a reference to in the query.
[0040] Thus, embodiments may provide concepts for finding ancestor objects in hierarchical data.
[0041] Figure 1A graphical representation of an exemplary distributed system in which aspects of the illustrative embodiments may be implemented is depicted. Distributed system 100 may include a computer network in which aspects of the illustrative embodiments may be implemented. Distributed system 100 includes at least one network 102, which is a medium for providing communication links between various devices and computers connected together within distributed data processing system 100. Network 102 may include connections such as wired, wireless communication links, or fiber optic cables.
[0042] In the depicted example, first server 104 and second server 106 are connected to network 102 along with storage unit 108. Additionally, clients 110, 112, and 114 are also connected to network 102. Clients 110, 112, and 114 may be edge devices, such as personal computers, network computers, IoT devices, and the like. In the depicted example, first server 104 provides data, such as boot files, operating system images, and applications, to clients 110, 112, and 114. In the depicted example, clients 110, 112, and 114 are clients to first server 104. Distributed processing system 100 may include additional servers, clients, and other devices not shown.
[0043] In the depicted example, distributed system 100 is the Internet, where network 102 represents a worldwide collection of networks and gateways that use the Transmission Control Protocol / Internet Protocol (TCP / IP) suite of protocols to communicate with one another. The core of the Internet is a backbone of high-speed data communication lines between major nodes or host computers, which includes thousands of commercial, government, educational, and other computer systems that route data and messages. Of course, distributed system 100 can also be implemented to include multiple different types of networks, such as intranets, local area networks (LANs), wide area networks (WANs), etc. As described above, Figure 1 It is intended as an example, not as an architectural limitation for different embodiments of the present invention, and therefore, Figure 1 The specific elements shown should not be construed as limiting the environments in which illustrative embodiments of the invention may be implemented.
[0044] Those skilled in the art will understand that Figure 1 The hardware in the can vary depending on the implementation. Furthermore, the processes of the exemplary embodiments can be applied to multi-processor data processing systems in addition to the aforementioned systems without departing from the scope of the present invention.
[0045] Furthermore, embodiments can take the form of any of a variety of different data processing systems, including client computing devices, server computing devices, tablet computers, laptop computers, phones or other communication devices, personal digital assistants (PDAs), and the like. In some illustrative examples, a system according to an embodiment can be a portable computing device that is configured with flash memory to provide non-volatile memory for storing, for example, operating system files and / or user-generated data. Thus, a system according to the presented embodiments can be essentially any known or later developed data processing system, without architectural limitation.
[0046] As described above, the proposed embodiments provide methods and systems for identifying ancestor objects in hierarchical data configured for processing according to a query in a query language, the query having an associated abstract syntax tree (AST).
[0047] By way of further explanation, reference will now be made to Figure 2 An embodiment of the proposed system is described.
[0048] refer to Figure 2 , a schematic diagram of a proposed system 200 for identifying ancestor objects in hierarchical data according to an embodiment is shown. The hierarchical data is stored in a database 210 (e.g., a remote data store accessible via the Internet) and is configured to be processed using queries 215 according to a query language. Specifically, in this example, the hierarchical data includes JSON ( Object Notation) data, and the query language is JSONata query language (JSON Query and Transformation Language).
[0049] The system 200 includes a query parser 220 configured to generate an abstract syntax tree AST 225 by parsing the query 210. As such, the system 200 is configured to generate the AST 225 associated with the query 210.
[0050] System 200 also includes a processing unit 230 configured to process AST 225 associated with query 210 to determine a parent node of AST 225. Here, processing unit 230 includes a traversal component 235 configured to traverse AST 225 to determine a node of AST 225 representing a parent node of query 215.
[0051] The enhancement component 240 of the system 200 is configured to enhance the AST 225 with a parent identifier that identifies the determined parent node. The parent identifier is configured to instruct the query processor to save a reference to the parent node. In this exemplary embodiment, the enhancement component 240 generates an enhanced AST 245 (in Figure 2denoted by "*" in FIG. 1 ). Specifically, the enhancement component 240 includes a property editor 250 configured to add an ancestor property to the parent node of the AST 225. The property editor 250 sets the value of the ancestor property to a predetermined value, which in this example is based on a count value that is incremented for each parent node identified.
[0052] The system 200 also includes a storage component 260 configured to store the enhanced AST (e.g., for subsequent access / use via an input / output (I / O) interface of the system 200). The system 200 also includes an association component 270 configured to associate the stored enhanced AST 245 with the hierarchical data 210.
[0053] By way of further example, a query may have the following expression: account.orders.products.!.billingID The above query expression will be parsed into the following abstract syntax tree (AST):
[0054] _path_
[0055] Account
[0056] Order
[0057] product
[0058] ! (father)
[0059] Order ID
[0060] A traditional expression evaluator would step through this path, applying each step to the input document. The first step selects the value associated with the "account" attribute in the input data. It then moves to the next step and, using the result of the previous step as input (context) data, selects the value associated with the "order" attribute. This continues for each step until it reaches the "!" token, which represents the "select parent" operation. Now there will be a problem because the input (context) data (i.e., the value associated with the product attribute) does not contain any reference back to the "order value."
[0061] The inventors proposed the concept of pre-processing the AST to add additional information (e.g., metadata) for identifying parent nodes, rather than augmenting the input data with such relationship information (which would be computationally expensive, for example). In the above example, when the parent operator "!" is encountered, a uniquely named label can be created, one step is counted down, and then the "product" step is marked with the label. The resulting augmented AST for this example is then as follows:
[0062] _path_
[0063] Account
[0064] Order
[0065] Product (Ancestor #0)
[0066] ! (Parent #0)
[0067] Account ID
[0068] where #0 is the generated label (the number is incremented for each additional occurrence of "!").
[0069] The query evaluator is then configured to recognize this additional information so that when it processes the "Product" step, it first stores a reference to its input context value (which is the order value) in an appropriate storage mechanism (i.e., a hash table) keyed by the label "#0". When it begins processing the parent "!" step, the result of that step will be the value previously stored for the label "#0".
[0070] It will be appreciated that the above example is simplistic and may not necessarily represent a realistic need for a parent operator. A more realistic example could be as follows, which for each product would create an object with two properties ("name" and "order").
[0071] Account.Order.Product.{
[0072] 'name': product name,
[0073] 'order': !.order ID
[0074] }
[0075] The value of the output "name" attribute will be the value of the "productname" attribute of the input "product" (context) value. The value of the output "order" attribute depends on finding the parent of the current "product" in order to obtain its "orderid" value.
[0076] Based on the proposed concept(s), the following enhanced AST is generated for the above expression:
[0077]
[0078]
[0079] The complication in this example is that the parent "!" operator is the first step in its child path, so it's not as simple as marking the previous step. Since the function processing the AST is recursive, when the function returns (and unwinds the stack), if the first step is still searching for its parent, the search carries the stack by adding the attribute "seekingParent: label" to the containing node in the AST (in this case, the object constructor). After it promotes this attribute to the node containing the step in the path, it finds the previous step marked with the "ancestor" attribute.
[0080] The proposed embodiment can also be configured to cater to any level of ancestors. For example, consider the following query expression:
[0081] Account.Order.Product.{
[0082] 'name': product name,
[0083] 'order': order ID,
[0084] 'account': !.!.Account ID
[0085] }
[0086] The expression in the previous paragraph contains the subexpression !.!.AccountID, which is configured to select the product's grandparent. It is also proposed to associate a "Level" counter with the "Find Parent" attribute. This attribute is then decremented for each step it returns, but incremented if the step is a parent ("!" operator). When the counter reaches zero, it has found the correct ancestor.
[0087] From the above description, it will be understood that the proposed embodiments can be configured to provide extended functionality in a hierarchical data storage and processing system. Such functionality can be driven by utilizing the concept of pre-processing the AST associated with a query in order to generate an enhanced AST that includes information for identifying the parent node of the query.
[0088] By way of further explanation, reference will now be made to Figure 3 Proposed embodiments of a method for identifying ancestor objects in hierarchical data are described.
[0089] refer to Figure 3 , a flow chart of a computer-implemented method for identifying ancestor objects in hierarchical data configured to process queries in accordance with a query language. In this example, the query language is the XPath query language. XPath has the ability to query parent nodes (and other nodes preceding the current context node). To do this, XPath assumes that the XML document has been parsed by a DOM parser that creates a tree of interconnected nodes (infoset), with each node including a link to its parent node.
[0090] The method begins at step 310 by parsing a query and generating an AST. This generation of an AST is well known, and one of many different AST generation processes can be employed in step 310. By way of example, a well-known parser known as the Pratt parser can be used to generate an AST for the query. A parser generator tool can also be used that creates parser code when provided with a formal grammar for a language.
[0091] Next, in step 320, the generated AST is processed based on the query to determine the parent node of the AST related to the query. Specifically, the process of determining the parent node of the AST related to the query includes step 325: traversing the AST to determine the node of the AST representing the parent node of the query.
[0092] Then, in step 330, the AST is enhanced with the parent identifier. Here, enhancing the AST with the parent identifier includes step 335, namely adding an ancestor attribute to the determined parent node of the AST. This includes setting the value of the ancestor attribute to a value based on a counter value. For example, the counter value can be incremented for each parent node identified, thereby providing a way to distinguish between multiple identified parent nodes. In this way, the parent identifier can be used to instruct the query processor to save a reference to the corresponding parent node.
[0093] The enhanced AST is then stored in a data storage component in step 340. The data storage component may be located remotely from the components / systems that process and enhance the AST (e.g., via the Internet or a distributed communication network). Finally, in step 350, the stored enhanced AST is associated with the hierarchical data.
[0094] In addition to the above description, embodiments can also be applied to ASTs representing XPath expressions. This enables an XPath processor to query ancestor nodes in an XML document parsed by a SAX parser (SAX is a higher-performance API for parsing XML documents that emits events as it scans the document from beginning to end without storing any data), while avoiding the need to store any additional structural information about the data itself. This technique can also be extended to apply to all other backward-looking axes in XPath (ancestor, ancestor or self, parent, previous sibling).
[0095] As a further explanation, we will now provide a detailed description of how to implement the proposed method using the JSONata query language as an example. JSONata is designed for querying and transforming JSON data. It has a location path syntax for navigating JSON structures, similar in nature to the XPath syntax for XML data. Consider the following example:
[0096] Input data:
[0097]
[0098]
[0099] Here, the dot operator "." specifies that for each item matched by the left-hand side (context), all items matched by the right-hand side are selected (a functional mapping operation). The "!" symbol indicates a request to select the parent object of the context. In this case, the subpath "!.OrderID" requests the OrderID attribute of the "Order" object, which is the parent (enclosing object) of the ProductContext object.
[0100] The expected result of evaluating this expression on the example input data above is as follows: [
[0102] {"name":"Bowler Hat","order":"Order 103"},
[0103] {"name":"Felt Hat","order":"Order 103"},
[0104] {"name":"Bowler Hat","order":"Order 104"},
[0105] {"name":"cloak","order":"order 104"} ]
[0107] To achieve this without changing the input data to include parent references, the AST of the parsed query expression is traversed to identify AST nodes representing the portion of the query that matched the parent object.
[0108] According to the proposed concept(s), the enhanced AST for the above JSONata query expression is as follows:
[0109] Type: Path
[0110] step:
[0111] -Value: Account
[0112] Type: Name
[0113] -Value: Order
[0114] Type: Name
[0115] -value: product <-- AST node decorated with the "ancestor" attribute.
[0116] Type: Name
[0117] Ancestors: 0
[0118] Tuple: truth value
[0119] -Type: Unary
[0120] value:"{"
[0121] Find Parent: 0 <-- a temporary property used while traversing the AST
[0122] lhs:
[0123] --value:name
[0124] Type: String
[0125] -Type: Path
[0126] step:
[0127] -Value: Product Name
[0128] Type: Name
[0129] -Value: Order
[0130] Type: String
[0131] -Type: Path
[0132] step:
[0133] -type: parent <-- AST node representing the "!" token
[0134] slot: 0
[0135] -Value: Order ID
[0136] Type: Name
[0137] Find Parent: 0 <-- a temporary property used while traversing the AST
[0138] When processing this augmented AST against input data, the query evaluation engine will identify AST nodes decorated with the "ancestors" attribute and store their input context items (i.e., the current "order" value) in a tuple stream containing the accumulated query results plus any temporary variable bindings. This stored value is then available when processing an AST node representing a "!" token and is looked up using a unique "slot" number.
[0139] The algorithm used to find the parent AST node is as follows:
[0140] (i) The parent operator is a step of type "parent" in the path matrix
[0141] (ii) If it is the first step, mark the path as "seekingParent" <number>and step up the AST marking nodes as "seekingParent" until you are in the path. Repeat this.
[0142] (iii) If its step index is >= 1 (ie, not the first step), then check the previous step (iv) Does the previous step have type "name" or "wildcard"?
[0143] (v) Yes: Mark this step parent= <number>;break(done)
[0144] (vi) Was the previous step of type "block"?
[0145] (vii) Yes: Look at the last expression in the block - repeat from the beginning
[0146] (viii) Otherwise throws error - Unable to determine parent
[0147] From the above description, it will be understood that Figure 3 The embodiments of can be used for the purpose of processing hierarchical data using queries. As an example, reference will now be made to Figure 4 Proposed embodiments for processing hierarchical data using queries according to a query language are described.
[0148] refer to Figure 4 , shows a flowchart of a computer-implemented method 400 for processing hierarchical data using a query according to a query language. The method 400 includes first executing Figure 3 The method 300 of an embodiment of identifying ancestor objects in hierarchical data then evaluates the query in step 410 by processing the enhanced AST for the hierarchical data.
[0149] An embodiment may include a computer system 70 that may form Figure 5 7. For example, an enhancement component according to an embodiment may be implemented in a computer system 70 (e.g., as a processing unit 71). Components of the computer system / server 70 may include, but are not limited to, one or more processing devices, such as a processor or processing unit 71, a system memory 74, and a bus 90 that couples various system components, including the system memory 74, to the processing unit 71.
[0150] System memory 74 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 75 and / or cache memory 76. Computer system / server 70 may also include other removable / non-removable, volatile / non-volatile computer system storage media. In this case, each may be connected to bus 90 via one or more data media interfaces. Memory 74 may include at least one program product having a set (e.g., at least one) program modules configured to perform the functions of the proposed embodiments. For example, memory 74 may include a computer program product having a program executable by processing unit 71 to cause input / output (I / O) interface 72 to perform the methods of a middleware system for a publish / subscribe messaging system according to the proposed embodiments. A program / utility 78 having a set (at least one) program modules 79 may be stored in memory 74. Program modules 79 generally perform the functions and / or methods of embodiments of the proposed publish / subscribe messaging system.
[0151] The computer system / server 70 may also communicate with one or more external devices 80, such as a keyboard, pointing device, display 85, etc.; one or more devices that enable a user to interact with the computer system / server 70; and / or any device that enables the computer system / server 70 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may occur via an input / output (I / O) interface 72. However, the computer system / server 70 may communicate with one or more networks, such as a local area network (LAN), a general wide area network (WAN), and / or a public network (e.g., the Internet) via a network adapter 73 (e.g., to communicate the determined optimal value of the DFWF to an edge device of the distributed network).
[0152] In the context of this application, where the embodiments of the present invention constitute a method, it will be understood that the method is a process for being performed by a computer, i.e., a computer-implementable method. Accordingly, the steps of the method reflect various parts of a computer program, e.g., parts of one or more algorithms.
[0153] The present invention may be a system, method and / or computer program product at any possible level of technical detail integration. The computer program product may include a computer-readable storage medium (or multiple media) having computer-readable program instructions thereon, the computer-readable program instructions being used to cause a processor to perform various aspects of the present invention.
[0154] A computer-readable storage medium can be a tangible device that can retain and store instructions used by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. A non-exhaustive list of more specific examples of computer-readable storage media includes the following: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device such as a punch card or a raised structure in a groove on which instructions are recorded, and any suitable combination thereof. As used herein, a computer-readable storage medium should not be interpreted as a temporary signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (e.g., a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0155] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to a corresponding computing / processing device, or downloaded to an external computer or external storage device via a network (e.g., the Internet, a local area network, a wide area network, and / or a wireless network). The network can include copper transmission cables, optical transmission fibers, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in a computer-readable storage medium within the corresponding computing / processing device.
[0156] The computer-readable program instructions for performing the operation of the present invention can be assembly instructions, instruction set architecture (ISA) instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, configuration data of an integrated circuit, or source code or object code written in any combination of one or more programming languages (including object-oriented programming languages, such as Smalltalk, C++, etc.) and procedural programming languages (such as "C" programming language or similar programming languages). The computer-readable program instructions can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or completely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider through the Internet). In some embodiments, in order to perform various aspects of the present invention, an electronic circuit comprising, for example, a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA) can execute the computer-readable program instructions to personalize the electronic circuit by utilizing the state information of the computer-readable program instructions.
[0157] Aspects of the present invention are described herein with reference to the flowcharts and / or block diagrams of the methods, apparatus (systems) and computer program products according to embodiments of the present invention. It will be understood that each block of the flowcharts and / or block diagrams and the combination of blocks in the flowcharts and / or block diagrams can be implemented by computer-readable program instructions.
[0158] These computer-readable program instructions can be provided to a processor of a computer or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device create a device for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, which can direct the computer, programmable data processing device and / or other equipment to operate in a specific manner, so that the computer-readable storage medium having the instructions stored therein includes an article of manufacture, which includes instructions for implementing various aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0159] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable apparatus, or other device implement the functions / actions specified in one or more boxes of the flowchart and / or block diagram.
[0160] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flow chart or block diagram can represent a module, segment or portion of an instruction, which includes one or more executable instructions for realizing a specified logical function. In some alternative embodiments, the functions noted in the frame may not occur in the order noted in the figure. For example, the two frames shown in succession can actually be implemented as a step, simultaneously, substantially simultaneously, in a manner that overlaps part or all of the time, or these frames can sometimes be performed in reverse order, depending on the functions involved. It will also be noted that each block of the block diagram and / or flow chart illustration and the combination of the blocks in the block diagram and / or flow chart illustration can be implemented by a dedicated hardware-based system that performs a specified function or action or performs a combination of dedicated hardware and computer instructions.
[0161] The description of various embodiments of the present invention has been provided for the purpose of illustration, but is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the embodiments, practical applications, or improvements over existing technologies in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.< / number> < / number>
Claims
1. A computer-implemented method for identifying ancestor objects in hierarchical data, the hierarchical data being configured to process queries according to a query language, the queries having associated abstract syntax trees (ASTs), the method comprising: processing the AST associated with the query to determine a parent node of the AST related to the query; as well as enhancing the AST with a parent identifier configured to identify the determined parent node to generate an enhanced AST; wherein enhancing the AST using a parent identifier configured to identify the determined parent node to generate an enhanced AST comprises: adding an ancestor attribute to the parent node of the AST; And wherein adding an ancestor attribute to the parent node of the AST includes setting a value of the ancestor attribute to a predetermined value, the predetermined value being based on a counter value that is incremented for each parent node identified.
2. The method according to claim 1, wherein Processing the AST associated with the query to determine a parent node of the AST related to the query includes: The AST is traversed to determine a node of the AST that represents a parent node of the query.
3. The method according to claim 1, wherein The parent identifier is configured to instruct a query processor to save a reference to the parent node.
4. The method according to claim 1, further comprising: The abstract syntax tree is generated by parsing the query.
5. The method according to claim 1, further comprising: Store the enhanced AST; as well as The stored enhanced AST is associated with the hierarchical data.
6. The method according to claim 1, wherein The hierarchical data includes JSON data, wherein the query language is a JSONata query language.
7. A computer program product for identifying ancestor objects in hierarchical data, the hierarchical data being configured to process queries according to a query language, the queries having associated abstract syntax trees (ASTs), the computer program product comprising programming instructions that, when executed by a computer, perform the following method: processing the AST associated with the query to determine a parent node of the AST related to the query; as well as enhancing the AST with a parent identifier configured to identify the determined parent node to generate an enhanced AST; in, Augmenting the AST with a parent identifier configured to identify the determined parent node to generate an augmented AST includes: adding an ancestor attribute to the parent node of the AST; And wherein adding an ancestor attribute to the parent node of the AST includes setting a value of the ancestor attribute to a predetermined value, the predetermined value being based on a counter value that is incremented for each parent node identified.
8. The computer program product of claim 7, wherein: The processing the AST associated with the query to determine a parent node of the AST related to the query includes: The AST is traversed to determine a node of the AST that represents a parent node of the query.
9. The computer program product of claim 7, wherein: The parent identifier is configured to instruct a query processor to save a reference to the parent node.
10. The computer program product of claim 7, wherein: The method further comprises: The abstract syntax tree is generated by parsing the query.
11. The computer program product of claim 7, wherein: The method further comprises: storing the enhanced AST; and The stored enhanced AST is associated with the hierarchical data.
12. A computer system comprising: a memory for storing a computer program for identifying an ancestor object in hierarchical data, the ancestor object being configured to process a query according to a query language, the query having an associated abstract syntax tree (AST); as well as a processor connected to the memory, wherein the processor is configured to execute program instructions of the computer program, the program instructions comprising: processing the AST associated with the query to determine a parent node of the AST relevant to the query; and enhancing the AST with a parent identifier configured to identify the determined parent node to generate an enhanced AST; wherein enhancing the AST using a parent identifier configured to identify the determined parent node to generate an enhanced AST comprises: adding an ancestor attribute to the parent node of the AST; And wherein adding an ancestor attribute to the parent node of the AST includes setting a value of the ancestor attribute to a predetermined value, the predetermined value being based on a counter value that is incremented for each parent node identified.
13. The system according to claim 12, wherein: Processing the AST associated with the query to determine a parent node of the AST related to the query includes: The AST is traversed to determine a node of the AST that represents a parent node of the query.
14. The system according to claim 12, wherein: The parent identifier is configured to instruct a query processor to save a reference to the parent node.
15. The system according to claim 12, wherein: The program instructions of the computer program further include: The abstract syntax tree is generated by parsing the query.
16. The system of claim 12, wherein: The program instructions of the computer program further include: storing the enhanced AST; and The stored enhanced AST is associated with the hierarchical data.
Citation Information
Patent Citations
Task processing method and equipment based on asynchronous callback
CN107506247A
Query-by-example in large-scale code repositories
US20150046492A1