An information query method, device, equipment and medium
By receiving the client's information query request and obtaining the query identifier from the preset database, the problems of fixed information query methods, slow response speed and network bandwidth occupancy in the prior art are solved, and the information query effect with high flexibility, fast response speed and bandwidth saving is achieved.
Patent Information
- Application Number
- CN201910441312.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-05-24
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2039-05-24
AI Technical Summary
In the prior art, the information query method is fixed, the response speed is slow, and it occupies network bandwidth, and the client needs to update the SDK to adapt to the new query method on the server.
By receiving the client's information query request, obtain the request data class identifier and the request field identifier, obtain the query identifier from the preset database, obtain the data return value based on the query identifier, and send the query result to the client.
It improves the flexibility of query methods, improves the response speed of information queries, saves network bandwidth, and allows clients to use the new query method without updating the SDK.
Smart Images

Figure CN111984849B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of information processing, and in particular, to an information query method, device, equipment and medium. Background Art
[0002] With the development of Internet technology, more and more users obtain the query information they want through the Internet. Taking an e-commerce platform as an example, a user may query some or all of the information of the user's orders on the e-commerce platform from the e-commerce platform server through a mobile terminal.
[0003] The existing information query is implemented through Remote Procedure Call (RPC). RPC is a service call protocol. Through RPC calls, the system can be split by service to achieve functional cohesion within the service. The service-oriented architecture (SOA) structure between services is through RPC calls. Through the RPC framework, inter-process communication can be achieved, the underlying implementation of remote calls can be shielded, and remote service calls can be simplified. The existing RPC implementation mainly uses the dynamic proxy method to encapsulate the remote call inside. The main process is as follows: The server publishes the information query methods it supports in the form of a Software Development Kit (SDK). The client calls the query interface according to the SDK published by the server. Specifically, (1) The client serializes the class, method name, and method parameters of the remote service to be called and sends them to the server; (2) After receiving the request, the server deserializes the class, method name, and method parameters, and then calls the method through reflection and obtains the return value; (3) The server serializes the return value and sends it to the client; (4) The client deserializes the return value and returns it to the caller. Among them, the class, method name, and method parameters of the remote service to be called are determined according to the SDK.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following technical problems in the prior art:
[0005] First of all, in the prior art, the query method used by the client must be the query method included in the SDK published by the server. When the query method is updated in the server, the SDK needs to be updated so that the client updates the corresponding dependency version of the SDK, and the query method is relatively fixed. For example, if the server provides a new query method getOrderByUserPin, this method needs to be updated to the SDK, and the client also needs to update the corresponding dependency version of the SDK.
[0006] Secondly, in the case of obtaining a large number of orders, the client needs to filter out the required data from a large amount of returned data, resulting in slow response speed. For example, if the client hopes to obtain some information in the order, it needs to obtain all the information in the order from the server and then filter out the required part of the information from the obtained all information. Specifically, if the client wants to obtain a certain user's order list and the types of orders in the list, it needs to obtain all the data of the user's orders from the server, and then traverse and filter the data to obtain the order list and the types of orders in the list.
[0007] Thirdly, a single query process may include various information of multiple orders, and the various information needs to be obtained through different SDK interfaces. The client needs to return the call data of multiple SDK interfaces and assemble them locally. When it is necessary to traverse and assemble a list of data, multiple query requests will be initiated sequentially, resulting in a large number of network requests, occupying bandwidth resources and thread resources. For example, if the client wants to obtain an order list and the status of each order, but the interface for obtaining the order list and the interface for order status are two separate RPC calls. At this time, the client can only first initiate a request for the order list (getOrderByUserPin), and then traverse the orders and request the order status (getOrderStatusById). If there are dozens of orders in the order list, the performance problem is very obvious.
[0008] It can be seen that the information query method in the prior art is fixed, with slow response speed and occupying network bandwidth. Summary of the Invention
[0009] Embodiments of the present invention provide an information query method, device, equipment and medium to improve the flexibility of the query method, improve the response speed of information query, and save network bandwidth.
[0010] In a first aspect, an embodiment of the present invention provides an information query method, including:
[0011] Receiving an information query request sent by a client, and obtaining at least one request data class identifier included in the information query request and request field identifiers respectively corresponding to each of the request data class identifiers;
[0012] For each of the request data class identifiers, obtaining a query identifier corresponding to the request data class identifier from a preset database, and obtaining a data return value corresponding to the request data class identifier according to the data query method corresponding to the query identifier and the request field identifier corresponding to the data class identifier;
[0013] Obtaining query result information according to the data return values corresponding to the request data class identifiers, and sending the query result information to the client.
[0014] Second aspect, an embodiment of the present invention further provides an information query method, including:
[0015] Obtain an information query instruction, and determine the information to be queried corresponding to the information query instruction;
[0016] Obtain at least one request data class identifier included in the information to be queried and a request field identifier corresponding to each request data class identifier;
[0017] Generate an information query request according to the request data class identifier and the request field identifier, and send the information query request to the server, so that the server obtains query result information corresponding to the information to be queried according to the request data class identifier and the request field identifier included in the query information request.
[0018] Third aspect, an embodiment of the present invention further provides an information query device, including:
[0019] A query request acquisition module, configured to receive an information query request sent by a client, and obtain at least one request data class identifier included in the information query request and a request field identifier corresponding to each request data class identifier;
[0020] A data return value acquisition module, configured to, for each request data class identifier, obtain a query identifier corresponding to the request data class identifier from a preset database, and obtain a data return value corresponding to the request data class identifier according to a data query method corresponding to the query identifier and the request field identifier corresponding to the data class identifier;
[0021] A query result feedback module, configured to obtain query result information according to data return values corresponding to the request data class identifiers, and send the query result information to the client.
[0022] Fourth aspect, an embodiment of the present invention further provides an information query device, including:
[0023] An information query acquisition module, configured to obtain an information query instruction, and determine the information to be queried corresponding to the information query instruction;
[0024] A request parameter acquisition module, configured to obtain at least one request data class identifier included in the information to be queried and a request field identifier corresponding to each request data class identifier;
[0025] A query request sending module, configured to generate an information query request according to the request data class identifier and the request field identifier, and send the information query request to the server, so that the server obtains query result information according to the request data class identifier and the request field identifier included in the query information request.
[0026] In a fifth aspect, an embodiment of the present invention further provides a computer device, the device comprising:
[0027] one or more processors;
[0028] A storage device for storing one or more programs;
[0029] When the one or more programs are executed by the one or more processors, the one or more processors implement the information query method as described in the first aspect of the embodiment of the present invention, and / or implement the information query method as described in the second aspect of the embodiment of the present invention.
[0030] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the information query method as described in the first aspect of the embodiment of the present invention, and / or implements the information query method as described in the second aspect of the embodiment of the present invention.
[0031] The embodiment of the present invention receives an information query request sent by a client, obtains at least one request data class identifier contained in the information query request and a request field identifier corresponding to each request data class identifier; for each request data class identifier, obtains a query identifier corresponding to the request data class identifier from a preset database, and obtains a data return value corresponding to the request data class identifier according to a data query method corresponding to the query identifier and a request field identifier corresponding to the data class identifier; obtains query result information according to the data return value corresponding to each request data class identifier, and sends the query result information to the client, and determines the query logic of the information to be queried on the server according to the data structure of the information to be queried, so that the client does not need to know the query method of each data class when initiating a query request, and can obtain complete information to be queried in one data interaction, thereby improving the flexibility of the query method, the response speed of the information query, and saving network bandwidth. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a flow chart of an information query method provided by Embodiment 1 of the present invention;
[0033] Figure 2 is a flow chart of an information query method provided by Embodiment 2 of the present invention;
[0034] Figure 3 is a flow chart of an information query method provided by Embodiment 3 of the present invention;
[0035] Figure 4a It is a flowchart of an information query method provided by Embodiment 4 of the present invention;
[0036] Figure 4bIt is a schematic structural diagram of an information query system provided in Embodiment 4 of the present invention;
[0037] Figure 4c It is a schematic diagram of data relationship storage in the Neo4j database provided in Embodiment 4 of the present invention;
[0038] Figure 5 It is a schematic structural diagram of an information query device provided in Embodiment 5 of the present invention;
[0039] Figure 6 It is a schematic structural diagram of an information query device provided in Embodiment 6 of the present invention;
[0040] Figure 7 It is a schematic structural diagram of a computer device provided in Embodiment 7 of the present invention. Detailed implementation manners
[0041] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. In addition, it should be noted that for the sake of description, only parts related to the present invention rather than all structures are shown in the drawings.
[0042] Embodiment 1
[0043] Figure 1 It is a flowchart of an information query method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of querying the query result information corresponding to the information query request and feeding it back when receiving the information query request. This method is applied to an information query server and can be executed by an information query device. The information query device can be implemented in software and / or hardware. For example, the information query device can be configured in a computer device. As Figure 1 shown, the method includes:
[0044] S110. Receive the information query request sent by the client, and obtain at least one request data class identifier included in the information query request and the request field identifier corresponding to each request data class identifier respectively.
[0045] In this embodiment, the operation of determining the query method of the information to be queried and filtering and combining the queried data to form the query result information is executed on the server. The client only needs to send an information query request including the data structure of the information to be queried to the server. Optionally, when the server receives the information query request sent by the client, it obtains the data structure of the information to be queried included in the information query request, and obtains at least one request data class identifier included in the data structure and the request field identifier corresponding to each request data class identifier. Among them, the request data class identifier can uniquely determine the data class of the request data, and the request field identifier can uniquely determine the request field. Exemplarily, the request data class identifier can be the data class name of the request data class, and the request field identifier can be the field name of the request field.
[0046] S120. For each request data class identifier, obtain the query identifier corresponding to the request data class identifier from the preset database, and obtain the data return value corresponding to the request data class identifier according to the data query method corresponding to the query identifier and the request field identifier corresponding to the data class identifier.
[0047] In this embodiment, the server determines the query method of the information to be queried. Optionally, a database can be preset to store the associated data class identifier of each data class identifier and the query identifier for querying the data class identifier based on the associated data class. After determining all the request data class identifiers included in the information query request and all the request field identifiers corresponding to each request data class identifier, determine the query identifier required to obtain the data return value corresponding to the request data class identifier according to the association relationship between the data classes stored in the preset database and the request data class identifier. Then, through reflection, call to obtain the data return value corresponding to the request data class identifier based on the determined query identifier, the request data class identifier, and the request field identifier corresponding to the request data class identifier. Among them, the preset database can be a Neo4j graph database. The Neo4j graph database can flexibly store nodes and the relationships between nodes, and the speed of obtaining query identifiers based on the Neo4j graph database is faster.
[0048] Exemplarily, if all the request data class identifiers included in the information query request are request data class A and request data class B, the request field identifier corresponding to request data class A is field 1, and the request field identifier corresponding to request data class B is field 2. Then obtain the query identifier A corresponding to request data class A and the query identifier B corresponding to request data class B from the preset database, and query the data return value corresponding to request data class A according to request data class A, field 1, and query identifier A, and query the data return value corresponding to request data class B according to request data class B, field 2, and query identifier B.
[0049] It should be noted that for each request data class identifier, there may be multiple query identifiers corresponding to the request data class identifier, that is, it may be necessary to perform multiple queries to obtain the data return value corresponding to the request data class identifier. For all request data class identifiers included in the information query request, it is possible to obtain the data return value corresponding to another request data class identifier during the query process of querying the data return value corresponding to a certain request data class identifier. Exemplarily, if all the request data class identifiers included in the information query request are request data class C and request data class D, and when querying the data return value corresponding to request data class D, it is necessary to first query the data return value corresponding to request data class C, then during the query process, first query the data return value corresponding to request data class C according to the query identifier corresponding to request data class C, and then query the data return value corresponding to request data class D according to the data return value corresponding to request data class C and the query identifier corresponding to request data class D. Preferably, when querying the data return value corresponding to each request data class identifier, determine the query order of the request data class identifiers according to the association relationship between the data classes, and query the data return values corresponding to each request data class identifier in sequence according to the determined query order. First, determine the query order according to the association relationship between the data classes, and sequentially query the data return values corresponding to each request data class identifier based on the query order, which can reduce the number of repeated queries and speed up the information query speed.
[0050] S130. Obtain query result information according to the data return values corresponding to each request data class identifier, and send the query result information to the client.
[0051] In this embodiment, after determining the data returns corresponding to each request data class identifier, combine the data return values corresponding to all request data class identifiers to obtain the query result information corresponding to the information query request, and feedback the query result information to the client.
[0052] In an implementation manner of the present invention, the obtaining query result information according to the data return values corresponding to each of the request data class identifiers includes:
[0053] Determine the data structure of the query result information according to the information query request, and assemble the data return values corresponding to each of the request data class identifiers according to the data structure to obtain the query result information.
[0054] Optionally, a data structure of query result information may be determined according to the received information query request, and the data return values corresponding to each request data class identifier are assembled into query result information according to the data structure. For example, the query result information obtained by assembling the data return values corresponding to the request data class identifier may be: "orders": [{"id": 1, "orderType": "nornal", "status": {"name": "finished"}}, {"id": 2, "orderType": "nornal", "status": {"name": "finished"}}]. It means that the obtained order IDs are 1 and 2, the order type of the order with ID 1 is normal, the order status is completed, the order type of the order with ID 2 is normal, and the order status is completed.
[0055] In an embodiment of the present invention, by receiving an information query request sent by a client, at least one request data class identifier included in the information query request and a request field identifier corresponding to each request data class identifier are obtained; for each request data class identifier, a query identifier corresponding to the request data class identifier is obtained from a preset database, and a data return value corresponding to the request data class identifier is obtained according to the data query method corresponding to the query identifier and the request field identifier corresponding to the data class identifier; query result information is obtained according to the data return values corresponding to the respective request data class identifiers, and the query result information is sent to the client. By determining the query logic of the information to be queried in the server according to the data structure of the information to be queried, it is not necessary for the client to know the query methods of each data class when initiating a query request, and the complete information to be queried can be obtained in one data interaction, which improves the flexibility of the query method, the response speed of information query, and saves network bandwidth.
[0056] Embodiment 2
[0057] Figure 2 It is a flowchart of an information query method provided in Embodiment 2 of the present invention. In this embodiment, on the basis of the above embodiment, obtaining the query identifier corresponding to the request data class identifier from the preset database and obtaining the data return value corresponding to the request data class identifier according to the data query method corresponding to the query identifier and the request field identifier corresponding to the data class identifier are concretized. As Figure 2 shown, the method includes:
[0058] S210. Receive an information query request sent by a client, and obtain at least one request data class identifier included in the information query request and a request field identifier corresponding to each request data class identifier.
[0059] S220. Determine the data query logic for obtaining the data corresponding to the requested data class identifier according to the association relationship between data classes. The data query logic includes at least one data query node, and each data query node corresponds to a data class identifier.
[0060] In this embodiment, there is a certain association relationship between data classes. For example, data class B can be obtained by querying based on data class A through a certain query method. For each requested data class identifier, the data return value of the data class corresponding to the requested data class identifier needs to be obtained through at least one query. Exemplarily, if data class G can be obtained from an information query request, the requested data class identifier is data class E, and there is no direct association relationship between data class E and data class G, then data class E cannot be directly obtained by querying based on data class G, that is, the data return value corresponding to data class E cannot be directly queried. Therefore, in this embodiment, to determine the query identifier corresponding to the requested data class identifier, it is necessary to first determine the data query logic for the data class corresponding to the requested data class identifier, and then determine the query identifier corresponding to the requested data class identifier based on the determined data query logic. Among them, the data query logic is the data class query order that needs to be queried when querying the data return value of the data class corresponding to the requested data class identifier, and the node corresponding to the data class identifier to be queried in the data query logic is the data query node.
[0061] Still taking the above example, if the data query logic of data class E is: data class G → data class F → data class E, then the data class F and data class E to be queried respectively correspond to a data query node.
[0062] S230. For each data query node, obtain the query identifier of the data class identifier corresponding to the data query node from the preset database according to the data class identifier corresponding to the data query node and the associated data class identifier associated with the data class identifier corresponding to the data query node.
[0063] In this embodiment, for each data query node in the data query logic, determine the query identifier of the data class identifier corresponding to the query node. For example, assume the data query logic is: data class G → data class F → data class E, then obtain the query identifier of data class F and the query identifier of data class E from the preset database respectively.
[0064] Specifically, for each data query node, determine the data class identifier corresponding to the data query node and the associated data class identifier associated with the data class identifier corresponding to the data query node, and obtain the query identifier of the data class identifier corresponding to the data query node based on the associated data class identifier from the preset database. Among them, the associated data class identifier associated with the data class identifier corresponding to the data query node can be the previous data class identifier of the data class identifier corresponding to the data query node in the data query logic.
[0065] For example, the data query logic is data class G → data class F → data class E. For the first data query node, the corresponding data class identifier is data class F. The associated data class identifier associated with data class F is determined to be data class G, and then the query identifier for querying data class F based on data class G is obtained from the preset database. For the second data query node, the corresponding data class identifier is data class E. The associated data class identifier associated with data class E is determined to be data class F, and then the query identifier for querying data class E based on data class F is obtained from the preset database.
[0066] In an embodiment of the present invention, obtaining the query identifier corresponding to the data class identifier of the data query node from the preset database according to the data class identifier corresponding to the data query node and the associated data class identifier associated with the data class identifier corresponding to the data query node includes:
[0067] The data class identifier corresponding to the data query node and the associated data class identifier are respectively matched with the stored data class identifiers in the preset database to determine the first stored data class identifier that matches the associated data class identifier and the second stored data class identifier that matches the data class identifier corresponding to the data query node. The query identifier for obtaining the data class corresponding to the second stored data class identifier based on the data class corresponding to the first stored data class identifier is used as the query identifier corresponding to the data class identifier corresponding to the data query node.
[0068] Exemplarily, if the data class identifier corresponding to the data query node is data class E and the associated data class identifier associated with the data class identifier corresponding to the data query node is data class F, then data class E and data class F are respectively matched with the stored data class identifiers in the preset database to determine the stored data class E that matches data class E and the stored data class F that matches data class F. The query identifier for querying stored data class E based on stored data class F is used as the query identifier for data class E. Optionally, the matching of the associated data class identifier and the first stored data class identifier may be that the associated data class identifier and the first stored data class identifier are compared and are consistent, and the matching of the data class identifier corresponding to the data query node and the second stored data class identifier may be that the data class identifier corresponding to the data query node and the second stored data class identifier are compared and are consistent.
[0069] S240. Determine the query identifier corresponding to the requested data class identifier according to the query identifiers corresponding to the data class identifiers of each data query node and the data query logic.
[0070] For each requested data class identifier, the combination of the query identifiers of each data class identifier to be queried in the data query logic of the requested data class identifier is used as the query identifier corresponding to the requested data class identifier.
[0071] S250. Based on the data query logic, sequentially query the data return values of the data class identifiers corresponding to each data query node according to the query identifiers of the data class identifiers corresponding to each data query node until the data return value corresponding to the requested data class identifier is obtained.
[0072] In this embodiment, after determining the data query logic of the requested data class identifier, sequentially obtain the data return values of the data class identifiers corresponding to each data query node in the data query logic until the data return value corresponding to the requested data class identifier is obtained.
[0073] Exemplarily, if the requested data class identifier is data class E and the data query logic is data class G → data class F → data class E, first query the data return value corresponding to data class F, and then query the data return value corresponding to the requested data class identifier data class E. Specifically, based on the value of data class G and the query identifier of data class F, query the data return value of data class F, and then based on the data return value of data class F and the query identifier of data class E, query the data return value of data class E.
[0074] In an implementation manner of the present invention, the query identifier includes a data query class identifier and a query method identifier defined in the data query class. The sequentially querying the data return values of the data class identifiers corresponding to each data query node according to the query identifiers of the data class identifiers corresponding to each data query node includes:
[0075] For the data class identifier corresponding to each data query node, generate a data query instruction according to the data query class identifier, the query method identifier defined in the data query class identifier, and the request field identifier of the data class identifier corresponding to the data query node, and obtain the data return values corresponding to each field identifier of the data class identifier corresponding to the data query node according to the data query instruction;
[0076] Obtain the data return value of the data class identifier corresponding to the data query node according to the data return values corresponding to each field identifier of the data class identifier corresponding to the data query node.
[0077] Specifically, the query identifier includes a data query class identifier and a query method identifier. For the data class identifier corresponding to each data query node, according to the data query class identifier, query method identifier of the data class identifier, and the field identifier corresponding to the data class identifier, use the method of reflection call to query the data return values corresponding to each field identifier of the data class identifier, and splice the data identifiers of each field identifier to obtain the data return value corresponding to the data class identifier.
[0078] S260. Obtain query result information according to the data return values corresponding to each requested data class identifier, and send the query result information to the client.
[0079] Based on the technical solution of the embodiment of the present invention, on the basis of the above embodiment, the query identifier corresponding to the request data class identifier is obtained from the preset database, and the data return value corresponding to the request data class identifier is specified according to the data query method corresponding to the query identifier and the request field identifier corresponding to the data class identifier. By generating the data query logic corresponding to each request data class, and sequentially querying the data return values of the data class identifiers corresponding to each data query node in the data query logic based on the data query logic, the data return value of the request data class is finally obtained through query, making the query method more logical and accelerating the response speed of information query.
[0080] On the basis of the above solution, the method further includes:
[0081] According to the association relationship between storage data classes, for each storage data class identifier, the storage data class identifier, the associated storage data class identifier associated with the storage data class identifier, and the query identifier of the storage data class corresponding to the storage data class identifier obtained based on the associated storage data class corresponding to the associated storage data class identifier are stored in the preset database correspondingly.
[0082] Optionally, before the client is released, each storage data class identifier, the associated storage data class identifier associated with the storage data class identifier, and the query identifier of the storage data class corresponding to the storage data class identifier obtained based on the associated storage data class corresponding to the associated storage data class identifier can be stored correspondingly in the preset database, so that the server can determine the query logic of the information to be queried based on the preset database. Storing the association relationship and query relationship between data classes in the preset database, when the server determines the data query logic, only the corresponding relationship in the preset database of the server needs to be updated when the query method of the server changes, without the need for the client to perform synchronous updates, improving the flexibility of information query.
[0083] Embodiment III
[0084] Figure 3 is a flowchart of an information query method provided by Embodiment III of the present invention. This embodiment is applicable to the situation when an information query request is sent to the server according to an information query instruction triggered by a user. This method can be applied to a client and executed by an information query device, and the information query device can be implemented in a software and / or hardware manner. For example, the information query device can be configured in a computer device. As Figure 3 shown, the method includes:
[0085] S310. Obtain an information query instruction and determine the information to be queried corresponding to the information query instruction.
[0086] In this embodiment, the information query instruction can be generated based on user operations and is used to instruct the client to display corresponding information. After the client detects the information query instruction triggered by the user, it determines the information to be queried corresponding to the information query instruction according to the correspondence between the information query instruction and the information to be queried. Exemplarily, when the user wants to view the order list, the user clicks on the order list control in the client. The client detects the order list query instruction triggered by the user and obtains the information to be queried corresponding to the order list query instruction, such as order name, order status, and other information.
[0087] S320. Obtain at least one request data class identifier included in the information to be queried and the request field identifier corresponding to each request data class identifier.
[0088] After determining the information to be queried, obtain the request data class identifier and the request field identifier corresponding to each piece of information in the information to be queried. Combine the request data class identifier and the request field identifier corresponding to each piece of information to obtain all the request data class identifiers corresponding to the information to be queried and the request field identifier corresponding to each request data class identifier.
[0089] S330. Generate an information query request according to the request data class identifier and the request field identifier, and send the information query request to the server, so that the server obtains the query result information corresponding to the information to be queried according to the request data class identifier and the request field identifier included in the query information request.
[0090] In this embodiment, the client does not need to determine the query logic of the information to be queried. It only needs to generate an information query request according to the request data class identifier and the request field identifier of the information to be queried, send the information query request to the server, receive the query result information returned by the server, and display it. By not using specific interfaces for invocation but assembling the target data, the invocation method of the client is simplified.
[0091] In an implementation manner of the present invention, generating an information query request according to the request data class identifier and the request field identifier includes: generating a data structure of the information to be queried according to the request data class identifier and the request field identifier, and adding the data structure to the information query request.
[0092] Optionally, a data structure of the information to be queried can be generated according to the request data class identifier and the request field identifier of the information to be queried, and the data structure can be added to the information query request, so that the server determines the data structure of the query result information according to the data structure in the information query request, making the data returned by the server more in line with the query requirements of the client.
[0093] In an embodiment of the present invention, an information query instruction is obtained to determine the information to be queried corresponding to the information query instruction; at least one request data class identifier included in the information to be queried and a request field identifier corresponding to each of the request data class identifiers are obtained; an information query request is generated according to the request data class identifier and the request field identifier, and the information query request is sent to a server, so that the server obtains query result information corresponding to the information to be queried according to the request data class identifier and the request field identifier included in the query information request. When the client initiates an information query request, it does not need to know the query methods of each data class, and only needs to send an information query request according to the data format of the data to be queried, achieving the acquisition of the complete information to be queried with a single request, improving the flexibility of the query method, the response speed of information query, and saving network bandwidth.
[0094] Embodiment 4
[0095] Figure 4a FIG. is a schematic flowchart of an information query method provided by Embodiment 4 of the present invention. On the basis of the above embodiments, this embodiment provides a preferred embodiment. Optionally, the information query method provided in this embodiment may be executed by an information query system.
[0096] Figure 4b FIG. is a schematic structural diagram of an information query system provided by Embodiment 4 of the present invention. As Figure 4b shown, the information query system includes a client software tool development kit 410 and a server 420. Among them, the client software tool development kit 410 (client SDK) includes a data structure definition module 411, a request assembly tool class 412, and a dynamic data remote procedure call interface 413, and the server 420 includes a request data parsing and return data assembly module 421, a service query interface 422, and a graph database 423.
[0097] In this embodiment, the data structure definition module 411 in the client software tool development kit 410 only includes the definition of the data structure (Domain). The client software tool development kit 410 further includes a request assembly tool class 412 and a dynamic data remote procedure call interface 413. The client software tool development kit 410 does not provide an interface coupled with data, and the client does not depend on an interface that returns a specific data structure and is not coupled with the server interface.
[0098] Exemplarily, the client uses the request assembly utility class 412 to assemble the target Domain, the conditional Domain, and the fields that the target Domain expects to obtain into a DynamicRequest. For example, the invoke method in the RemoteDynamicRequestCaller interface is called, and the DynamicRequest is passed in. Specifically, the dynamic data request DynamicRequest is assembled, and the request assembly utility class 412 is used to assemble the data that needs to be returned. For example, the client hopes to request an order list, and each order data only needs to contain the attributes id, orderType of Order, and the name field in OrderStatus that is not an Order attribute, so that the server can determine based on the assembled data: obtain the Order list based on the RequestContext, obtain the id and orderType in each Order, query the name field in the corresponding OrderStatus based on each Order, and return it as the Order attribute status. After the data is assembled, the RPC interface is called to call the remote service, and the data returned by the server is obtained and parsed.
[0099] In the server 420, the request data parsing and return data assembly module 421 is used to parse the received information query request, determine the request data class identifier and the request field identifier corresponding to the information to be queried, and assemble the data return values corresponding to the request field identifiers in each of the queried request data class identifiers to obtain the query result information that conforms to the data structure of the information to be queried. The graph database 423 can be a Neo4j graph database, which is used to store the relationships and query methods between data classes and associated data classes associated with the stored data classes. The service query interface 422 is used to obtain the query method from the graph database 423, and then call the service query interface 422 to obtain the corresponding data return value according to the query method.
[0100] Optionally, the server uses the characteristic that the Neo4j graph data can flexibly store nodes and the relationships between nodes to store the relationships of the server data structure and its query methods in Neo4j. Figure 4c It is a schematic diagram of the data relationship storage of the Neo4j database provided in the fourth embodiment of the present invention. As Figure 4c shown, there is an association relationship between the request data and the order, and there is an association relationship between the order and the order status. The order information can be queried based on the request data, and the order status information can be queried based on the order information. When the client sends a dynamically assembled data query request, the server parses the data type included in the request, and uses reflection to call the data query based on the classes and methods in the relationship retrieved from Neo4j based on the data type, and then assembles and returns the Map data in the manner expected by the request.
[0101] Specifically, first, store the association relationships between server data, as well as their query classes and methods, in the Neo4j database. When a client request enters, parse the data classes in the request, query Neo4j according to the relationships between the data classes, find the corresponding data query classes and query methods, and call them through reflection to obtain the results; first, call the classes and methods found in the above steps through reflection, then assemble the required data attribute fields in the request into a Map and return; if there are multiple nested different data types in the request data, this module needs to be recursively called until there are no nested data types in the request data, and then assemble the obtained data return value and return it to the client.
[0102] As Figure 4a shown, the method includes:
[0103] S410. The client calls the SDK tool class to assemble the data structure to be queried, and generates request data according to the data structure.
[0104] The client calls the SDK tool class to assemble the data structure of the information to be queried corresponding to the information query instruction according to the information query instruction triggered by the user, and generates request data.
[0105] S420. The client calls the dynamic data RPC structure to send the request data to the server.
[0106] S430. The server parses the request data.
[0107] S440. The server queries the graph database and obtains the query class and query method.
[0108] The server queries the query class and query method of the data class from the graph database Neo4j.
[0109] S450. The server reflects and calls the query class and method to obtain the data return value.
[0110] S460. The server assembles each data return value.
[0111] S470. The server determines whether there are nested non-attribute field data.
[0112] Specifically, if there is nested non-attribute field data, then return the data return value to the client; if there is no nested non-attribute field data, then return to S440 to continue the query.
[0113] S480. The client parses the data returned by the server.
[0114] S490. The server initializes the data relationship and the query class and query method.
[0115] Before information query, initialize the data relationships, query classes, and query methods in the graph database.
[0116] In the client SDK of the information query system provided in this embodiment, no fixed RPC interface is provided. When the server provides a new interface, there is no need to release the SDK. By shielding the specific interface for remotely obtaining data and assembling the target data, the client call is simplified. The work of data query, filtering, and recombination is implemented on the server side, so that the data transmitted by the server to the client through RPC only contains the data required by the client, and the occupation of network bandwidth and local memory by useless data is deleted. In addition, the work of combining multi-Domain data is submitted to the server for implementation, so that only one call is required on the local client, reducing the number of RPC calls, improving the utilization rate of network bandwidth, and improving the code performance.
[0117] Embodiment Five
[0118] Figure 5 It is a schematic structural diagram of an information query device provided in Embodiment Five of the present invention. The information query device can be implemented in software and / or hardware. For example, the information query device can be configured in a computer device. As Figure 5 shown, the device includes a query request acquisition module 510, a data return value acquisition module 520, and a query result feedback module 530, where:
[0119] The query request acquisition module 510 is configured to receive an information query request sent by a client, and acquire at least one request data class identifier included in the information query request and a request field identifier corresponding to each request data class identifier.
[0120] The data return value acquisition module 520 is configured to, for each request data class identifier, acquire a query identifier corresponding to the request data class identifier from a preset database, and acquire a data return value corresponding to the request data class identifier according to the data query method corresponding to the query identifier and the request field identifier corresponding to the data class identifier.
[0121] The query result feedback module 530 is configured to obtain query result information according to the data return values corresponding to the request data class identifiers, and send the query result information to the client.
[0122] In an embodiment of the present invention, an information query request sent by a client is received by an information query request obtaining module, and at least one request data class identifier included in the information query request and a request field identifier corresponding to each request data class identifier are obtained; for each request data class identifier, a data return value obtaining module obtains a query identifier corresponding to the request data class identifier from a preset database, and obtains a data return value corresponding to the request data class identifier according to a data query method corresponding to the query identifier and a request field identifier corresponding to the data class identifier; a query result feedback module obtains query result information according to the data return values corresponding to the respective request data class identifiers, and sends the query result information to the client. By determining the query logic of the information to be queried in the server according to the data structure of the information to be queried, when the client initiates a query request, it is not necessary to know the query methods of each data class, and the complete information to be queried can be obtained in one data interaction, which improves the flexibility of the query method, the response speed of information query, and saves network bandwidth.
[0123] Based on the above solution, the data return value obtaining module 520 includes:
[0124] A query logic determination unit, configured to determine a data query logic for obtaining data of a data class corresponding to the request data class identifier according to an association relationship between data classes, where the data query logic includes at least one data query node, and each data query node corresponds to a data class identifier;
[0125] A node identifier obtaining unit, configured to, for each data query node, obtain a query identifier of the data class identifier corresponding to the data query node from the preset database according to the data class identifier corresponding to the data query node and an associated data class identifier associated with the data class identifier corresponding to the data query node;
[0126] A query identifier determination unit, determines a query identifier corresponding to the request data class identifier according to the query identifiers of the data class identifiers corresponding to the respective data query nodes and the data query logic.
[0127] Based on the above solution, the node identifier obtaining unit is specifically configured to:
[0128] Match the data class identifier corresponding to the data query node and the associated data class identifier with the stored data class identifiers in the preset database respectively, determine a first stored data class identifier that matches the associated data class identifier and a second stored data class identifier that matches the data class identifier corresponding to the data query node, and obtain a query identifier of the data class corresponding to the second stored data class identifier based on the data class corresponding to the first stored data class identifier as the query identifier of the data class identifier corresponding to the data class corresponding to the data query node.
[0129] Based on the above solution, the data return value acquisition module 520 includes:
[0130] A data return value acquisition unit, configured to sequentially query the data return values of the data class identifiers corresponding to each data query node based on the data query logic according to the query identifiers of the data class identifiers corresponding to each data query node until the data return value corresponding to the requested data class identifier is obtained.
[0131] Based on the above solution, the query identifier includes a data query class identifier and a query method identifier defined in the data query class, and the data return value acquisition unit is specifically configured to:
[0132] For each data class identifier corresponding to the data query node, generate a data query instruction according to the data query class identifier, the query method identifier defined in the data query class identifier, and the request field identifier of the data class identifier corresponding to the data query node, and obtain the data return value corresponding to each request field identifier of the data class identifier corresponding to the data query node according to the data query instruction;
[0133] Obtain the data return value of the data class identifier corresponding to the data query node according to the data return value corresponding to each request field identifier of the data class identifier corresponding to the data query node.
[0134] Based on the above solution, the device further includes:
[0135] A query identifier storage unit, configured to store the storage data class identifier, the associated storage data class identifier associated with the storage data class identifier, and the query identifier of the storage data class corresponding to the storage data class obtained based on the associated storage data class corresponding to the associated storage data class identifier, corresponding to each storage data class identifier into the preset database according to the association relationship between the storage data classes.
[0136] Based on the above solution, the query result feedback module 530 is specifically configured to:
[0137] Determine the data structure of the query result information according to the information query request, and assemble the data return values corresponding to each requested data class identifier according to the data structure to obtain the query result information.
[0138] The information query device provided by the embodiments of the present invention can execute the information query method provided by Embodiment 1 and / or Embodiment 2, and has the corresponding functional modules and beneficial effects of the execution method.
[0139] Embodiment Six
[0140] Figure 6 This is a schematic structural diagram of an information query device provided in Embodiment 6 of the present invention. The information query device can be implemented in software and / or hardware. For example, the information query device can be configured in a computer device. As Figure 6 shown, the device includes a query information acquisition module 610, a request parameter acquisition module 620, and a query request sending module 630, where:
[0141] The query information acquisition module 610 is used to acquire an information query instruction and determine the information to be queried corresponding to the information query instruction;
[0142] The request parameter acquisition module 620 is used to acquire at least one request data class identifier included in the information to be queried and the request field identifier corresponding to each request data class identifier;
[0143] The query request sending module 630 is used to generate an information query request according to the request data class identifier and the request field identifier, and send the information query request to the server, so that the server acquires query result information according to the request data class identifier and the request field identifier included in the query information request.
[0144] In the embodiment of the present invention, the query information acquisition module acquires an information query instruction to determine the information to be queried corresponding to the information query instruction; the request parameter acquisition module acquires at least one request data class identifier included in the information to be queried and the request field identifier corresponding to each request data class identifier; the query request sending module generates an information query request according to the request data class identifier and the request field identifier, and sends the information query request to the server, so that the server acquires query result information corresponding to the information to be queried according to the request data class identifier and the request field identifier included in the query information request. When the client initiates an information query request, it does not need to know the query methods of each data class, and only needs to send an information query request according to the data format of the data to be queried, achieving that a complete information query request can be sent at one time, improving the flexibility of the query method, the response speed of information query, and saving network bandwidth.
[0145] Based on the above solution, the query request sending module 630 is specifically used for:
[0146] Generating a data structure of the information to be queried according to the request data class identifier and the request field identifier, and adding the data structure to the information query request.
[0147] The information query device provided in the embodiment of the present invention can execute the information query method provided in Embodiment 3, and has the corresponding functional modules and beneficial effects of the execution method.
[0148] Embodiment VII
[0149] Figure 7 It is a schematic structural diagram of the computer device provided in Embodiment VII of the present invention. Figure 7 It shows a block diagram of an exemplary computer device 712 suitable for implementing the embodiments of the present invention. Figure 7 The shown computer device 712 is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present invention.
[0150] As Figure 7 shown, the computer device 712 is presented in the form of a general-purpose computing device. The components of the computer device 712 may include, but are not limited to: one or more processors 716, a system memory 728, and a bus 718 connecting different system components (including the system memory 728 and the processor 716).
[0151] The bus 718 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor 716, or a local bus using any of the multiple bus structures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0152] The computer device 712 typically includes a variety of computer system-readable media. These media can be any available media accessible by the computer device 712, including volatile and non-volatile media, removable and non-removable media.
[0153] The system memory 728 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 730 and / or cache memory 732. The computer device 712 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage device 734 can be used to read and write non-removable, non-volatile magnetic media ( Figure 7 not shown, commonly referred to as a "hard disk drive"). Although Figure 7Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (such as a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical medium) may be provided. In these cases, each drive may be connected to the bus 718 through one or more data medium interfaces. The memory 728 may include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the various embodiments of the present invention.
[0154] A program / utility 740 having a set (at least one) of program modules 742 may be stored, for example, in the memory 728. Such program modules 742 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules 742 generally perform the functions and / or methods in the embodiments described in the present invention.
[0155] The computer device 712 may also communicate with one or more external devices 714 (such as a keyboard, a pointing device, a display 724, etc.), and may also communicate with one or more devices that enable a user to interact with the computer device 712, and / or communicate with any device that enables the computer device 712 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication may be carried out through the input / output (I / O) interface 722. In addition, the computer device 712 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 720. As shown in the figure, the network adapter 720 communicates with other modules of the computer device 712 through the bus 718. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in combination with the computer device 712, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0156] The processor 716 executes various functional applications and data processing by running the programs stored in the system memory 728, such as implementing the information query method provided in the first and second embodiments of the present invention. The method includes:
[0157] Obtaining the session user identifier included in the detected session event to be answered;
[0158] Search for response logic data corresponding to the session user identifier in the cache database, where the response logic data stored in the cache database is the response logic data corresponding to the original test scenario to which the session user of the current active session is diverted when the test scenario corresponding to the grouped test changes;
[0159] When response logic data corresponding to the session user identifier is found in the cache database, determine a response plan for the session event to be responded to according to the found response logic data;
[0160] And / or, implement the information query method provided in Embodiment 3 of the present invention, the method includes:
[0161] Obtain an information query instruction, and determine the information to be queried corresponding to the information query instruction;
[0162] Obtain at least one request data class identifier included in the information to be queried and the request field identifier corresponding to each request data class identifier respectively;
[0163] Generate an information query request according to the request data class identifier and the request field identifier, and send the information query request to the server, so that the server obtains query result information corresponding to the information to be queried according to the request data class identifier and the request field identifier included in the query information request.
[0164] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the information query method provided in any embodiment of the present invention.
[0165] Embodiment 8
[0166] Embodiment 8 of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements, for example, the information query method provided in Embodiment 1 and Embodiment 2 of the present invention, the method includes:
[0167] Obtain the session user identifier included in the detected session event to be responded to;
[0168] Search for response logic data corresponding to the session user identifier in the cache database, where the response logic data stored in the cache database is the response logic data corresponding to the original test scenario to which the session user of the current active session is diverted when the test scenario corresponding to the grouped test changes;
[0169] When response logic data corresponding to the session user identifier is found in the cache database, determine a response plan for the session event to be responded to according to the found response logic data;
[0170] And / or, implementing the information query method provided in the third embodiment of the present invention, the method includes:
[0171] Obtain an information query instruction, and determine the information to be queried corresponding to the information query instruction;
[0172] Obtain at least one request data class identifier included in the information to be queried and a request field identifier corresponding to each of the request data class identifiers;
[0173] Generate an information query request according to the request data class identifier and the request field identifier, and send the information query request to the server, so that the server obtains query result information corresponding to the information to be queried according to the request data class identifier and the request field identifier included in the query information request.
[0174] Of course, for a computer-readable storage medium provided in an embodiment of the present invention, the computer program stored thereon is not limited to the method operations as described above, and can also execute related operations in the information query method provided in any embodiment of the present invention.
[0175] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device.
[0176] The computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device.
[0177] The program code contained on the computer-readable medium can be transmitted with any suitable medium, including - but not limited to - wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0178] The computer program code for performing the operations of the present invention can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages - such as Java, Smalltalk, C++, and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The program code 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 entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network - including a local area network (LAN) or a wide area network (WAN) - or, it can be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet).
[0179] Note that the above is only the preferred embodiment of the present invention and the applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, it can also include more other equivalent embodiments, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. An information query method, characterized in that, it includes: Receiving an information query request sent by a client, obtaining at least one request data class identifier included in the information query request and a request field identifier corresponding to each of the request data class identifiers, wherein the request data class identifier is used to uniquely determine the data class of the request data, and the request field identifier is used to uniquely determine the request field; For each of the request data class identifiers, obtaining a query identifier corresponding to the request data class identifier from a preset database, and obtaining a data return value corresponding to the request data class identifier according to the data query method corresponding to the query identifier and the request field identifier corresponding to the data class identifier; the preset database is used to store the associated data class identifier of each data class identifier and the query identifier for querying the data class identifier based on the associated data class query; Obtaining query result information according to the data return values corresponding to each of the request data class identifiers, and sending the query result information to the client; Wherein, for each of the request data class identifiers, obtaining the query identifier corresponding to the request data class identifier from the preset database includes: Determining a data query logic for obtaining the data class corresponding to the request data class identifier according to the association relationship between data classes, the data query logic includes at least one data query node, and each data query node corresponds to a data class identifier; For each of the data query nodes, obtaining the query identifier of the data class identifier corresponding to the data query node from the preset database according to the data class identifier corresponding to the data query node and the associated data class identifier associated with the data class identifier corresponding to the data query node; wherein, the associated data class identifier associated with the data class identifier corresponding to the data query node is the previous data class identifier of the data class identifier corresponding to the data query node in the data query logic; Determining the query identifier corresponding to the request data class identifier according to the query identifiers of the data class identifiers corresponding to each of the data query nodes and the data query logic.
2. The method according to claim 1, characterized in that, The obtaining the query identifier of the data class identifier corresponding to the data query node from the preset database according to the data class identifier corresponding to the data query node and the associated data class identifier associated with the data class identifier corresponding to the data query node includes: Matching the data class identifier corresponding to the data query node and the associated data class identifier with the stored data class identifiers in the preset database respectively, determining a first stored data class identifier that matches the associated data class identifier and a second stored data class identifier that matches the data class identifier corresponding to the data query node, and obtaining the query identifier of the data class corresponding to the second stored data class identifier based on the data class corresponding to the first stored data class identifier as the query identifier of the data class identifier corresponding to the data class identifier corresponding to the data query node.
3. The method according to claim 1, characterized in that, Obtaining the data return value corresponding to the requested data class identifier according to the data query method corresponding to the query identifier and the request field identifier corresponding to the data class identifier includes: Based on the data query logic, sequentially query the data return values of the data class identifiers corresponding to each data query node according to the query identifier of the data class identifier corresponding to each data query node until the data return value corresponding to the requested data class identifier is obtained.
4. The method according to claim 3, wherein, the query identifier includes a data query class identifier and a query method identifier defined in the data query class, and sequentially querying the data return values of the data class identifiers corresponding to each data query node according to the query identifier of the data class identifier corresponding to each data query node includes: For the data class identifier corresponding to each data query node, generate a data query instruction according to the data query class identifier, the query method identifier defined in the data query class identifier, and the request field identifier of the data class identifier corresponding to the data query node, and obtain the data return value corresponding to each request field identifier of the data class identifier corresponding to the data query node according to the data query instruction; Obtain the data return value of the data class identifier corresponding to the data query node according to the data return value corresponding to each request field identifier of the data class identifier corresponding to the data query node.
5. The method according to claim 1, wherein, further includes: According to the association relationship between storage data classes, for each storage data class identifier, store the storage data class identifier, the associated storage data class identifier associated with the storage data class identifier, and the query identifier of the storage data class corresponding to the storage data class identifier obtained based on the associated storage data class corresponding to the associated storage data class identifier, into the preset database correspondingly.
6. The method according to claim 1, wherein, obtaining the query result information according to the data return values corresponding to each of the requested data class identifiers includes: Determine the data structure of the query result information according to the information query request, and assemble the data return values corresponding to each of the requested data class identifiers according to the data structure to obtain the query result information.
7. An information query method, wherein, includes: Obtain an information query instruction and determine the information to be queried corresponding to the information query instruction; Obtain at least one requested data class identifier included in the information to be queried and the request field identifier corresponding to each of the requested data class identifiers, wherein the requested data class identifier is used to uniquely determine the data class of the requested data, and the request field identifier is used to uniquely determine the request field; Generate an information query request according to the request data class identifier and the request field identifier, and send the information query request to the server, so that the server, for each of the request data class identifiers, obtains the query identifier corresponding to the request data class identifier from a preset database, and obtains the data return value corresponding to the request data class identifier according to the data query method corresponding to the query identifier and the request field identifier corresponding to the data class identifier; the preset database is used to store the associated data class identifier of each data class identifier and the query identifier for querying the data class identifier based on the associated data class; obtain query result information according to the data return values corresponding to each of the request data class identifiers; Among them, the step of obtaining, for each of the request data class identifiers, the query identifier corresponding to the request data class identifier from a preset database includes: Determine the data query logic for obtaining the data class corresponding to the request data class identifier according to the association relationship between data classes, where the data query logic includes at least one data query node, and each data query node corresponds to a data class identifier; For each of the data query nodes, obtain the query identifier of the data class identifier corresponding to the data query node from the preset database according to the data class identifier corresponding to the data query node and the associated data class identifier associated with the data class identifier corresponding to the data query node; among them, the associated data class identifier associated with the data class identifier corresponding to the data query node is the previous data class identifier of the data class identifier corresponding to the data query node in the data query logic; Determine the query identifier corresponding to the request data class identifier according to the query identifiers of the data class identifiers corresponding to each of the data query nodes and the data query logic.
8. The method according to claim 7, wherein, the step of generating an information query request according to the request data class identifier and the request field identifier includes: Generate the data structure of the information to be queried according to the request data class identifier and the request field identifier, and add the data structure to the information query request.
9. An information query device, wherein, it includes: A query request acquisition module, configured to receive an information query request sent by a client, and acquire at least one request data class identifier included in the information query request and the request field identifier corresponding to each of the request data class identifiers, where the request data class identifier is used to uniquely determine the data class of the request data, and the request field identifier is used to uniquely determine the request field; A data return value acquisition module, configured to, for each of the request data class identifiers, obtain the query identifier corresponding to the request data class identifier from a preset database, and obtain the data return value corresponding to the request data class identifier according to the data query method corresponding to the query identifier and the request field identifier corresponding to the data class identifier; the preset database is used to store the associated data class identifier of each data class identifier and the query identifier for querying the data class identifier based on the associated data class; A query result feedback module, configured to obtain query result information based on data return values corresponding to each of the request data class identifiers, and send the query result information to a client; Wherein, the data return value obtaining module includes: A query logic determination unit, configured to determine a data query logic for obtaining data of the data class corresponding to the request data class identifier according to the association relationship between data classes, where the data query logic includes at least one data query node, and each data query node corresponds to a data class identifier; A node identifier obtaining unit, configured to, for each of the data query nodes, obtain a query identifier of the data class identifier corresponding to the data query node from the preset database according to the data class identifier corresponding to the data query node and an associated data class identifier associated with the data class identifier corresponding to the data query node; wherein, the associated data class identifier associated with the data class identifier corresponding to the data query node is the previous data class identifier of the data class identifier corresponding to the data query node in the data query logic; A query identifier determination unit, configured to determine a query identifier corresponding to the request data class identifier according to the query identifiers of the data class identifiers corresponding to each of the data query nodes and the data query logic.
10. An information query device, characterized in that, it includes: A query information obtaining module, configured to obtain an information query instruction and determine information to be queried corresponding to the information query instruction; A request parameter obtaining module, configured to obtain at least one request data class identifier included in the information to be queried and a request field identifier corresponding to each of the request data class identifiers, wherein the request data class identifier is used to uniquely determine the data class of the request data, and the request field identifier is used to uniquely determine the request field; A query request sending module, configured to generate an information query request according to the request data class identifier and the request field identifier, and send the information query request to a server, so that the server, for each of the request data class identifiers, obtains a query identifier corresponding to the request data class identifier from a preset database, and obtains a data return value corresponding to the request data class identifier according to the data query method corresponding to the query identifier and the request field identifier corresponding to the data class identifier; the preset database is used to store an associated data class identifier of each data class identifier and a query identifier for querying the data class identifier based on the associated data class; obtain query result information according to the data return values corresponding to each of the request data class identifiers; Wherein, for each of the request data class identifiers, obtaining a query identifier corresponding to the request data class identifier from the preset database includes: Determining a data query logic for obtaining data of the data class corresponding to the request data class identifier according to the association relationship between data classes, where the data query logic includes at least one data query node, and each data query node corresponds to a data class identifier; For each of the data query nodes, according to the data class identifier corresponding to the data query node and the associated data class identifier associated with the data class identifier corresponding to the data query node, obtain the query identifier of the data class identifier corresponding to the data query node from the preset database; wherein, the associated data class identifier associated with the data class identifier corresponding to the data query node is the previous data class identifier of the data class identifier corresponding to the data query node in the data query logic. According to the query identifiers of the data class identifiers corresponding to each of the data query nodes and the data query logic, determine the query identifier corresponding to the requested data class identifier.
11. A computer device Characterized in that The device includes: One or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the information query method according to any one of claims 1-6, and / or implement the information query method according to any one of claims 7-8.
12. A computer-readable storage medium, on which a computer program is stored Characterized in that When the program is executed by a processor, it implements the information query method according to any one of claims 1-6, and / or implements the information query method according to any one of claims 7-8.
Citation Information
Patent Citations
General custom query system and method
CN102402515A
Information query system and method
CN103729386A
Method and device for database query
CN103729471A
Data query method, client and server
CN104991921A
Data query method and device
CN107391506A