+

CN111984849B - Information query method, device, equipment and medium - Google Patents

Information query method, device, equipment and medium Download PDF

Info

Publication number
CN111984849B
CN111984849B CN201910441312.9A CN201910441312A CN111984849B CN 111984849 B CN111984849 B CN 111984849B CN 201910441312 A CN201910441312 A CN 201910441312A CN 111984849 B CN111984849 B CN 111984849B
Authority
CN
China
Prior art keywords
data
query
identifier
request
data class
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910441312.9A
Other languages
Chinese (zh)
Other versions
CN111984849A (en
Inventor
马浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201910441312.9A priority Critical patent/CN111984849B/en
Publication of CN111984849A publication Critical patent/CN111984849A/en
Application granted granted Critical
Publication of CN111984849B publication Critical patent/CN111984849B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses an information query method, device, equipment and medium, which comprise the steps of receiving an information query request sent by a client, acquiring at least one request data type identifier contained in the information query request and request field identifiers corresponding to each request data type identifier, acquiring query identifiers corresponding to the request data type identifiers from a preset database aiming at each request data type identifier, acquiring data return values corresponding to the request data type identifiers according to a data query mode corresponding to the query identifiers and the request field identifiers corresponding to the data type identifiers, acquiring query result information according to the data return values corresponding to the request data type identifiers, sending the query result information to the client, and determining query logic of the information to be queried in a server according to a data structure of the information to be queried, so that the client can acquire complete information to be queried in one data interaction, the flexibility of the query method is improved, and the network bandwidth is saved.

Description

Information query method, device, equipment and medium
Technical Field
The embodiment of the invention relates to the field of information processing, in particular to an information query method, an information query device, information query equipment and an information query medium.
Background
With the development of internet technology, more and more users acquire query information to be acquired through the internet. Taking an e-commerce platform as an example, a user may query part or all of information of an order of the user on the platform from an e-commerce platform server through a mobile terminal.
The querying of existing information is accomplished through remote procedure calls (Remote Procedure Call, RPC). The RPC is an inter-service call protocol, the system can be split according to the service through the RPC call, the function cohesion in the service is achieved, the service is in a service-oriented architecture (SOA) structure through the RPC call, the inter-process communication can be realized through the RPC framework, the remote call bottom layer realization is shielded, and the remote service call is simplified. The existing RPC implementation mainly uses a dynamic proxy mode to encapsulate remote mobilization inside, and the main flow is that a server issues the information query method supported by the server in a software development kit (Software Development Kit, SDK) mode, and a client calls a query interface according to the SDK issued by the server. Specifically, (1) the client side sequences the class, the method name and the method parameter of the called remote service and sends the sequenced class, the method name and the method parameter to the server, (2) after the server receives the request, the server de-sequences the class, the method name and the method parameter, then calls the method in a reflection mode and obtains a return value, (3) the server sequences the return value and sends the return value to the client side, (4) the client side de-sequences the return value and returns the return value to the calling party. The class, the method name and the method parameters of the called remote service are determined according to the SDK.
In the process of implementing the present invention, the inventor finds that at least the following technical problems exist in the prior art:
Firstly, in the prior art, a query method used by a client must be a query method contained in an SDK issued by a server, and when the query method is updated in the server, the SDK needs to be updated so that the client updates a dependent version of the corresponding SDK, and the query method is relatively fixed. For example, if the server provides a new query method getOrderByUserPin, the method needs to be updated to the SDK, and the client also updates the dependent version of the SDK accordingly.
Secondly, under the condition that the acquired order quantity is large, the client needs to screen out required data from a large quantity of returned data, and the response speed is low. For example, if the client wants to acquire part of the information in the order, all the information in the order needs to be acquired from the server, and then the required part of the information is screened out from the acquired all the information. Specifically, to obtain a certain user order list and the types of orders in the list, the client needs to obtain all data of the user order from the server, and then traverse and filter the data to obtain the order list and the types of orders in the list.
And thirdly, multiple information of multiple orders can be included in one query process, the multiple information needs to be acquired through different SDK interfaces, the client needs to return call data of the multiple SDK interfaces to be assembled locally, and when one list data is required to be traversed and assembled, multiple query requests can be sequentially initiated, so that a large number of network requests are caused, and bandwidth resources and thread resources are occupied. For example, the client obtains the order list and the status of each order, but the order list obtaining interface and the order filling interface are 2 separate RPC calls, and at this time, the client can only initiate the request order list (getOrderByUserPin) first, then traverse the order and request the order status (getOrderStatusById), if there are tens of order lists, the performance problem is very obvious.
Therefore, the information query method in the prior art is fixed, has low response speed and occupies network bandwidth.
Disclosure of Invention
The embodiment of the invention provides an information query method, an information query device and an information query medium, so as to improve the flexibility of the query method, improve the response speed of information query and save network bandwidth.
In a first aspect, an embodiment of the present invention provides an information query method, including:
receiving an information inquiry request sent by a client, and acquiring at least one request data type identifier contained in the information inquiry request and request field identifiers respectively corresponding to each request data type identifier;
For each request data type identifier, acquiring a query identifier corresponding to the request data type identifier from a preset database, and acquiring a data return value corresponding to the request data type identifier according to a data query mode corresponding to the query identifier and a request field identifier corresponding to the data type identifier;
Obtaining query result information according to the data return values corresponding to the request data class identifiers, and sending the query result information to a client.
In a second aspect, an embodiment of the present invention further provides an information query method, including:
acquiring an information inquiry instruction and determining information to be inquired corresponding to the information inquiry instruction;
Acquiring at least one request data type identifier contained in the information to be queried and request field identifiers respectively corresponding to each request data type identifier;
And generating an information inquiry request according to the request data class identifier and the request field identifier, and sending the information inquiry request to a server so that the server obtains inquiry result information corresponding to the information to be inquired according to the request data class identifier and the request field identifier contained in the inquiry information request.
In a third aspect, an embodiment of the present invention further provides an information query apparatus, including:
The query request acquisition module is used for receiving an information query request sent by a client and acquiring at least one request data type identifier and a request field identifier respectively corresponding to each request data type identifier, wherein the at least one request data type identifier is contained in the information query request;
The data return value acquisition module is used for acquiring query identifiers corresponding to the request data class identifiers from a preset database according to each request data class identifier, and acquiring data return values corresponding to the request data class identifiers according to a data query mode corresponding to the query identifiers and a request field identifier corresponding to the data class identifier;
And the query result feedback module is used for receiving 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.
In a fourth aspect, an embodiment of the present invention further provides an information query apparatus, including:
The query information acquisition module is used for acquiring an information query instruction and determining information to be queried corresponding to the information query instruction;
the request parameter acquisition module is used for acquiring at least one request data type identifier contained in the information to be queried and request field identifiers respectively corresponding to each request data type identifier;
And the query request sending module is used for generating an information query request according to the request data class identifier and the request field identifier, and sending the information query request to a server so that the server can acquire query result information according to the request data class identifier and the request field identifier contained in the query information request.
In a fifth aspect, embodiments of the present invention further provide a computer apparatus, the apparatus comprising:
One or more processors;
a storage means 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 the first aspect of the embodiment of the present invention, and/or implement the information query method according to the second aspect of the embodiment of the present invention.
In a sixth aspect, an embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored, where the program when executed by a processor implements the information query method according to the first aspect of the embodiment of the present invention, and/or implements the information query method according to the second aspect of the embodiment of the present invention.
The method and the device for inquiring the information comprise the steps of receiving an information inquiry request sent by a client, acquiring at least one request data type identifier and request field identifiers corresponding to each request data type identifier, acquiring an inquiry identifier corresponding to the request data type identifier from a preset database according to each request data type identifier, acquiring a data return value corresponding to the request data type identifier according to a data inquiry mode corresponding to the inquiry identifier and the request field identifier corresponding to the data type identifier, acquiring inquiry result information according to the data return value corresponding to each request data type identifier, sending the inquiry result information to the client, determining inquiry logic of the information to be inquired in a server according to a data structure of the information to be inquired, enabling the client not to know the inquiry mode of each data type when the client initiates the inquiry request, acquiring complete information to be inquired in one data interaction, improving flexibility of an inquiry method, responding speed of information inquiry and saving network bandwidth.
Drawings
FIG. 1 is a flowchart of an information query method according to an embodiment of the present invention;
fig. 2 is a flowchart of an information query method according to a second embodiment of the present invention;
fig. 3 is a flowchart of an information query method according to a third embodiment of the present invention;
Fig. 4a is a flow chart of an information query method according to a fourth embodiment of the present invention;
fig. 4b is a schematic structural diagram of an information query system according to a fourth embodiment of the present invention;
FIG. 4c is a schematic diagram illustrating a data relationship storage of a Neo4j database according to a fourth embodiment of the present invention;
Fig. 5 is a schematic structural diagram of an information query apparatus according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an information query apparatus according to a sixth embodiment of the present invention;
Fig. 7 is a schematic structural diagram of a computer device according to a seventh embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of an information query method according to an embodiment of the present invention. The embodiment is applicable to the situation when the information query request is received, the query result information corresponding to the information query request is queried and fed back. The method is applied to an information query server and can be executed by an information query device, wherein the information query device can be implemented in a software and/or hardware mode, and the information query device can be configured in computer equipment. As shown in fig. 1, the method includes:
S110, receiving an information query request sent by a client, and acquiring at least one request data type identifier and request field identifiers respectively corresponding to each request data type identifier contained in the information query request.
In this embodiment, the operations of determining the query mode of the information to be queried and filtering and combining the queried data to form the query result information are performed in the server. The client only needs to send an information query request containing the data structure of the information to be queried to the server. Optionally, the server receives an information query request sent by the client, acquires a data structure of information to be queried contained in the information query request, and acquires at least one request data class identifier contained in the data structure and a request field identifier corresponding to each request data class identifier respectively. Wherein the request data class identifier may uniquely identify the data class of the request data and the request field identifier may uniquely identify the request field. Illustratively, the request data class identification may be a data class name of the request data class and the request field identification may be a field name of the request field.
S120, acquiring query identifiers corresponding to the request data class identifiers from a preset database according to each request data class identifier, and acquiring data return values corresponding to the request data class identifiers according to a data query mode corresponding to the query identifiers and the request field identifiers corresponding to the data class identifiers.
In this embodiment, the server determines a query manner of the information to be queried. Optionally, a database may be preset, for storing the associated data class identifier of each data class identifier and the query identifier based on the associated data class query data class identifier. After all request data class identifiers contained in the information query request and all request field identifiers corresponding to each request data class identifier are determined, determining query identifiers required for acquiring data return values corresponding to the request data class identifiers according to the association relationship between data classes stored in a preset database and the request data class identifiers. And then, calling in a reflection mode, and acquiring a 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. The preset database can be a Neo4j graph database, the Neo4j graph database can flexibly store the node and the relation among the nodes, and the query identification is obtained based on the Neo4j graph database more quickly.
For example, if all the request data classes included in the information query request are identified as a request data class a and a request data class B, the request field corresponding to the request data class a is identified as a field 1, and the request field corresponding to the request data class B is identified as a field 2. Acquiring a query identifier A corresponding to the request data class A and a query identifier B corresponding to the request data class B from a preset database, querying a data return value corresponding to the request data class A according to the request data class A, the field 1 and the query identifier A, and querying the data return value corresponding to the request data class B according to the request data class B, the field 2 and the query identifier B.
It should be noted that, for each request data class identifier, the query identifier corresponding to the request data class identifier may be multiple, that is, the data return value corresponding to the request data class identifier may be obtained through multiple queries. For all request data class identifiers contained in the information query request, the data return value corresponding to one request data class identifier may be obtained in the query process of querying the data return value corresponding to the other request data class identifier. For example, if all the request data classes included in the information query request are identified as the request data class C and the request data class D, and when the data return value corresponding to the request data class D is queried, the data return value corresponding to the request data class C needs to be queried first, then the data return value corresponding to the request data class C is queried according to the query identifier corresponding to the request data class C in the query process, and then the data return value corresponding to the request data class D is queried according to the data return value corresponding to the request data class C and the query identifier corresponding to the request data class D. Preferably, when the data return value corresponding to each request data class identifier is queried, determining the query sequence of the request data class identifiers according to the association relation between the data classes, and sequentially querying the data return values corresponding to the request data class identifiers according to the determined query sequence. The query sequence is determined according to the association relation among the data classes, and the data return values corresponding to the request data class identifiers are sequentially queried based on the query sequence, so that the repeated query times can be reduced, and the information query speed is increased.
S130, according to the data return values corresponding to the request data class identifiers, query result information is sent to the client.
In this embodiment, after determining that the data corresponding to each request data class identifier is returned, combining the data return values corresponding to all request data class identifiers to obtain query result information corresponding to the information query request, and feeding back the query result information to the client.
In one embodiment of the present invention, the data return value corresponding to each request data class identifier includes query result information:
And determining a data structure of the query result information according to the information query request, and assembling the data return values corresponding to the request data type identifiers according to the data structure to obtain the query result information.
Optionally, a data structure of the query result information may be determined according to the received information query request, and the data return value corresponding to each request data type identifier is assembled into the 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"}}]., which indicates that the acquired order types of the order with the id of 1 and 2 and the order with the id of 1 are normal, the order state is completed, the order type of the order with the id of 2 is normal, and the order state is completed.
The method and the device for inquiring the information comprise the steps of receiving an information inquiry request sent by a client, acquiring at least one request data type identifier and request field identifiers corresponding to each request data type identifier, acquiring an inquiry identifier corresponding to the request data type identifier from a preset database according to each request data type identifier, acquiring a data return value corresponding to the request data type identifier according to a data inquiry mode corresponding to the inquiry identifier and the request field identifier corresponding to the data type identifier, acquiring inquiry result information according to the data return value corresponding to each request data type identifier, sending the inquiry result information to the client, determining inquiry logic of the information to be inquired in a server according to a data structure of the information to be inquired, enabling the client not to know the inquiry mode of each data type when the client initiates the inquiry request, acquiring complete information to be inquired in one data interaction, improving flexibility of an inquiry method, responding speed of information inquiry and saving network bandwidth.
Example two
Fig. 2 is a flowchart of an information query method according to a second embodiment of the present invention. The embodiment embodies the query identifier corresponding to the request data class identifier obtained from the preset database based on the embodiment, and obtains the data return value corresponding to the request data class identifier according to the data query mode corresponding to the query identifier and the request field identifier corresponding to the data class identifier. As shown in fig. 2, the method includes:
s210, receiving an information query request sent by a client, and acquiring at least one request data type identifier and request field identifiers respectively corresponding to each request data type identifier contained in the information query request.
S220, determining data query logic for acquiring the data class corresponding to the request data class identifier according to the association relation among the data classes, wherein the data query logic comprises at least one data query node, and each data query node corresponds to one data class identifier.
In this embodiment, each data class has a certain association relationship. For example, data class B may be queried based on data class A by some query method. For each request data class identifier, the data return value of the data class corresponding to the request data class identifier needs to be obtained through at least one query. For example, if the data class G can be obtained from the information query request, the request data class is identified as the data class E, and a direct association relationship does not exist between the data class E and the data class G, the data class E cannot be obtained directly according to the data class G query, that is, the data return value corresponding to the data class E cannot be obtained directly by query. Therefore, in this embodiment, determining the query identifier corresponding to the request data class identifier needs to first determine the data query logic of the data class corresponding to the request data class identifier, and then determine the query identifier corresponding to the request data class identifier based on the determined data query logic. The data query logic is a data class query sequence to be queried when the data return value of the data class corresponding to the query request data class identifier is queried, and the node corresponding to the data class identifier to be queried contained in the data query logic is a data query node.
Taking the above example as the case, if the data query logic of the data class E is that the data class g→the data class f→the data class E, the data class F and the data class E to be queried respectively correspond to one data query node.
S230, aiming at each data query node, acquiring a query identifier of the data class identifier corresponding to the data query node from a 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.
In this embodiment, for each data query node in the data query logic, a query identifier of a data class identifier corresponding to the query node is determined. For example, if the data query logic is data class G→data class F→data class E, the query identifier of the data class F and the query identifier of the data class E are respectively obtained from a preset database.
Specifically, for each data query node, determining a 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, and acquiring a query identifier based on the associated data class identifier and acquiring the data class identifier corresponding to the data query node from a preset database. The associated data class identifier associated with the data class identifier corresponding to the data query node may be a previous data class identifier of the data class identifier corresponding to the data query node in the data query logic.
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 the data class F is determined to be data class G, and then the query identifier based on the data class G for querying the data class F is obtained from the preset database. Aiming at a second data query node, the corresponding data class identifier is identified as a data class E, the associated data class identifier associated with the data class E is determined as a data class F, and then the query identifier for querying the data class E based on the data class F is obtained from a preset database.
In one embodiment of the present invention, according to a data class identifier corresponding to a data query node and an associated data class identifier associated with the data class identifier corresponding to the data query node, acquiring a query identifier of the data class identifier corresponding to the data query node from a preset database includes:
And respectively matching the data class identifier corresponding to the data query node and the associated data class identifier with stored data class identifiers in a preset database, determining a first stored data class identifier matched with the associated data class identifier and a second stored data class identifier matched with the data class identifier corresponding to the data query node, and acquiring 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 query node.
For example, if the data class identifier corresponding to the data query node is the data class E, and the associated data class identifier associated with the data class identifier corresponding to the data query node is the data class F, then the data class E and the data class F are respectively matched with the stored data class identifiers in the preset database, the stored data class E matched with the data class E is determined, the stored data class F matched with the data class F queries the query identifier of the stored data class E based on the stored data class F, and the query identifier of the stored data class E is used as the query identifier of the data class E. Optionally, the matching of the association data class identifier with the first storage data class identifier may be that the association data class identifier is aligned with the first storage data class identifier, and the matching of the data class identifier corresponding to the data query node with the second storage data class identifier may be that the data class identifier corresponding to the data query node is aligned with the second storage data class identifier.
S240, determining the query identifier corresponding to the request data class identifier according to the query identifier of the data class identifier corresponding to each data query node and the data query logic.
And aiming at each request data class identifier, taking the combination of query identifiers of each data class identifier to be queried in the data query logic of the request data class identifier as a query identifier corresponding to the request data class identifier.
S250, sequentially inquiring the data return value of the data class identifier corresponding to each data query node based on the data query logic according to the query identifier of the data class identifier corresponding to each data query node until the data return value corresponding to the request data class identifier is obtained.
In this embodiment, after determining the data query logic for requesting the data class identifier, each data query node in the data query logic sequentially queries the data return value of the data class identifier corresponding to each data query node in sequence until the query obtains the data return value corresponding to the request data class identifier.
For example, if the request data class is identified as the data class E, the data query logic is data class g→data class f→data class E, the data return value corresponding to the data class F is queried first, and then the data return value corresponding to the request data class identification data class E is queried. Specifically, a data return value of the data class F is obtained based on the value of the data class G and the query identifier of the data class F, and then the data return value of the data class E is obtained based on the data return value of the data class F and the query identifier of the data class E.
In one embodiment of the present invention, the query identifier includes a data query class identifier and a query method identifier defined in a data query class, and sequentially queries a data return value of a data class identifier corresponding to each data query node according to the query identifier of the data class identifier corresponding to each data query node, including:
Aiming at the data class identifier corresponding to each data query node, generating 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 acquiring a data return value corresponding to each field identifier of the data class identifier corresponding to the data query node according to the data query instruction;
And obtaining the data return value of the data class identifier corresponding to the data query node according to the data return value corresponding to each field identifier of the data class identifier corresponding to the data query node.
Specifically, the query identifier includes a data query class identifier and a query method identifier. And aiming at the data class identifier corresponding to each data query node, according to the data query class identifier, the query method identifier and the field identifier corresponding to the data class identifier of the data class identifier, querying the data return value of each field identifier corresponding to the data class identifier by using a reflection calling method, and splicing the data identifiers of each field identifier to obtain the data return value corresponding to the data class identifier.
S260, according to the data return values corresponding to the request data class identifiers, query result information is sent to the client.
According to the technical scheme, the query identifications corresponding to the request data class identifications are obtained from the preset database on the basis of the embodiment, the data return values corresponding to the request data class identifications are obtained according to the data query modes corresponding to the query identifications and the request field identifications corresponding to the data class identifications, the data query logic corresponding to the request data classes is generated for each request data class, the data return values of the data class identifications corresponding to each data query node in the data query logic are sequentially queried based on the data query logic, and finally the data return values of the request data classes are queried and obtained, so that the query modes are more logical, and the response speed of information query is accelerated.
On the basis of the scheme, the method further comprises the following steps:
According to the association relation among the storage data classes, aiming at each storage data class identifier, storing the storage data class identifier, the association 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 based on the association storage data class corresponding to the association storage data class identifier into a preset database correspondingly.
Optionally, before the client issues, each storage data class identifier, an associated storage data class identifier associated with the storage data class identifier, and a query identifier of the storage data class corresponding to the storage data class identifier based on the associated storage data class corresponding to the associated storage data class identifier may be correspondingly stored in a preset database, so that the server can determine query logic of the information to be queried based on the preset database. The association relation and the query relation among the data classes are stored in the preset database, and when the server determines the data query logic, the corresponding relation in the preset database of the server can be updated only when the query method of the server is changed, the client is not required to update synchronously, and the flexibility of information query is improved.
Example III
Fig. 3 is a flowchart of an information query method according to a third embodiment of the present invention. The embodiment can be applied to the situation when an information inquiry request is sent to a server according to an information inquiry instruction triggered by a user. The method may be applied to a client and executed by an information query apparatus, which may be implemented in software and/or hardware, e.g. the information query apparatus may be configured in a computer device. As shown in fig. 3, the method includes:
s310, acquiring an information inquiry instruction and determining information to be inquired corresponding to the information inquiry instruction.
In this embodiment, the information query instruction may be an instruction generated according to a user operation and used to instruct the client to display corresponding information, and after detecting the information query instruction triggered by the user, the client determines the information to be queried corresponding to the information query instruction according to the corresponding relationship between the information query instruction and the information to be queried. When a user wants to view an order list, the user clicks an order list control in the client, and the client detects an order list query instruction triggered by the user to obtain information to be queried corresponding to the order list query instruction as information such as an order name, an order state and the like.
S320, obtaining at least one request data class identifier contained in the information to be queried, and respectively corresponding request field identifiers of each request data class identifier.
After the information to be queried is determined, the request data type identifier and the request field identifier corresponding to each piece of information in the information to be queried are obtained. And combining the request data class identifiers corresponding to each piece of information and the request field identifiers to obtain all the request data class identifiers corresponding to the information to be queried and the request field identifiers corresponding to each request data class identifier.
S330, generating an information inquiry request according to the request data class identifier and the request field identifier, and sending the information inquiry request to the server, so that the server obtains inquiry result information corresponding to the information to be inquired according to the request data class identifier and the request field identifier contained in the inquiry information request.
In this embodiment, the client does not need to determine the query logic of the information to be queried, and 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, and receive and display query result information returned by the server. The calling mode of the client is simplified by not using a specific interface to call but assembling the target data.
In one embodiment of the invention, generating an information query request according to a request data class identifier and a request field identifier comprises generating a data structure of 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.
Optionally, a data structure of the information to be queried can be generated according to the request data type identifier and the request field identifier of the information to be queried, and the data structure is added into 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, and the data returned by the server more accords with the query requirement of the client.
The embodiment of the invention determines the information to be queried corresponding to the information query instruction by acquiring the information query instruction, acquires at least one request data type identifier contained in the information to be queried and a request field identifier corresponding to each request data type identifier respectively, generates an information query request according to the request data type identifier and the request field identifier, and sends the information query request to a server, so that the server acquires query result information corresponding to the information to be queried according to the request data type identifier and the request field identifier contained in the query information request, a client does not need to know the query mode of each data type when initiating the information query request, and only sends the information query request according to the data format of the data to be queried, thereby achieving the purposes of acquiring the complete information to be queried by one-time request sending, improving the flexibility of the query method and the response speed of the information query and saving the network bandwidth.
Example IV
Fig. 4a is a flow chart of an information query method according to a fourth embodiment of the present invention. This embodiment provides a preferred embodiment on the basis of the above-described embodiments. Alternatively, the information query method provided in this embodiment may be executed by the information query system.
Fig. 4b is a schematic structural diagram of an information query system according to a fourth embodiment of the present invention, as shown in fig. 4b, the information query system includes a client software tool development kit 410 and a server 420, wherein 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.
In this embodiment, the data structure definition module 411 in the client software tool development kit 410 contains only the definition (Domain) of the data structure, and 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 to couple with data, and the client does not rely on an interface to return a specific data structure, and does not couple with a server interface.
Illustratively, the client utilizes the request assembly tool class 412 to assemble DynamicRequest the target Domain, the conditional Domain, and the fields that the target Domain expects to obtain, such as invoking the invoke method in the RemoteDynamicRequestCaller interface, into DynamicRequest. Specifically, the dynamic data request DynamicRequest is assembled by using the request assembling tool class 412, for example, the client wants to request an Order list, and each Order data only needs to include the attribute id of Order, orderType and the name field in OrderStatus of non-Order attribute, so that the server can determine according to the assembled data, obtain the Order list based on RequestContext, obtain ids and orderType in each Order, query the name field in OrderStatus corresponding to each Order, and return as Order attribute status. And after the data is assembled, calling the RPC interface to call the remote service, and obtaining and analyzing the data returned by the server.
In the server 420, the request data parsing and returning data assembling module 421 is configured to parse the received information query request, determine a request data class identifier and a request field identifier corresponding to the information to be queried, and assemble the data returning value corresponding to the request field identifier in each queried request data class identifier, so as to obtain query result information conforming to the data structure of the information to be queried. The graph database 423 may be a Neo4j graph database, which is used to store relationships and query methods between data classes and associated data classes associated with the stored data classes. After the service query interface 422 is used for obtaining the query method from the graph database 423, the service query interface 422 is invoked to obtain a corresponding data return value according to the query method.
Optionally, the server uses the feature that the Neo4j graph data can flexibly store the node and the relationship between the nodes, and stores the relationship of the server data structure and the query method thereof into Neo4j. Fig. 4c is a schematic diagram illustrating data relationship storage of Neo4j database according to the fourth embodiment of the present invention. As shown in fig. 4c, the request data has an association relationship with the order, the order has an association relationship with the order status, and 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 data query request of dynamic assembly, the server analyzes the data types contained in the request, and based on the class and the method in the relation of the data types detected from Neo4j, the data query is invoked by reflection, and then Map data is assembled and returned according to the expected mode of the request.
Specifically, the association relation between server data and query classes and methods thereof are firstly stored in a Neo4j database, when a client requests access, the data classes in the request are analyzed, the Neo4j is queried according to the relation between the data classes, the corresponding data query classes and query methods are found, the data query classes and query methods are called in a reflection mode, the results are obtained, the classes and the methods found in the steps are called in a reflection mode firstly, then the required data attribute fields in the request are assembled into a Map and returned, if a plurality of different data types are nested in the request data, the module is required to be called recursively until the nested data types do not exist in the request data, and the obtained data return values are assembled and returned to the client.
As shown in fig. 4a, the method comprises:
s410, the client calls the SDK tool class to assemble a data structure to be queried, and request data is generated according to the data structure.
And the client calls the SDK tool class to assemble a 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.
S420, the client calls a dynamic data RPC structure to send the request data to the server.
S430, the server analyzes the request data.
S440, the server queries the graph database and obtains query classes and query methods.
The server queries the query class and the query method of the data class from the graph database Neo4 j.
S450, the server reflects and calls the query class and the method to obtain a data return value.
S460, the server assembles each data return value.
S470, the server judges whether nested non-attribute field data exists.
Specifically, if there is nested non-attribute field data, the data return value is returned to the client, and if there is no nested non-attribute field data, the process returns to S440 to continue the query.
S480, the client analyzes the data returned by the server.
S490, the server initializes the data relationship, the query class and the query method.
Data relationships, query classes, and query methods in the graph database are initialized prior to information query.
The method and the system for inquiring the data in the client SDK of the information provided by the embodiment have the advantages that a solidified RPC interface is not provided in the client SDK of the information inquiry system, so that the SDK is not required to be issued when a server provides a new interface, a specific interface for remotely acquiring data is shielded, the call of the client is simplified by assembling target data, the data inquiry, filtering and recombination work is realized by putting the data in the server, the data transmitted to the client by the server through the RPC data only comprise the data required by the client, the occupation of useless data on network bandwidth and local memory is deleted, and in addition, the work of combining multiple Domain data is submitted to the server, so that the local client can be called once, the RPC call times are reduced, the network bandwidth utilization rate is improved, and the code performance is improved.
Example five
Fig. 5 is a schematic structural diagram of an information query apparatus according to a fifth embodiment of the present invention. The information inquiry apparatus may be implemented in a software and/or hardware manner, for example, the information inquiry apparatus may be configured in a computer device. As shown in fig. 5, the apparatus includes a query request acquisition module 510, a data return value acquisition module 520, and a query result feedback module 530, where:
a query request obtaining module 510, configured to receive an information query request sent by a client, and obtain at least one request data class identifier and a request field identifier corresponding to each request data class identifier respectively;
The data return value obtaining module 520 is configured to obtain, for each request data class identifier, 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 mode corresponding to the query identifier and a request field identifier corresponding to the data class identifier;
And the query result feedback module 530 is configured to 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.
The embodiment of the invention receives an information query request sent by a client through a query request acquisition module, acquires at least one request data class identifier and a request field identifier respectively corresponding to each request data class identifier, wherein the information query request is contained in the information query request, the data return value acquisition module acquires a query identifier corresponding to the request data class identifier from a preset database according to each request data class identifier, acquires a data return value corresponding to the request data class identifier according to a data query mode corresponding to the query identifier and a request field identifier corresponding to the data class identifier, and the query result feedback module acquires 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.
On the basis of the above scheme, the data return value obtaining module 520 includes:
The query logic determining unit is used for determining and obtaining data query logic of the data class corresponding to the request data class identifier according to the association relation among the data classes, wherein the data query logic comprises at least one data query node, and each data query node corresponds to one data class identifier;
the node identification acquisition unit is used for acquiring the query identification of the data class identification corresponding to the data query node from the preset database according to the data class identification corresponding to the data query node and the associated data class identification associated with the data class identification corresponding to the data query node;
And the query identifier determining unit is used for determining the query identifier corresponding to the request data class identifier according to the query identifier of the data class identifier corresponding to each data query node and the data query logic.
On the basis of the above scheme, the node identifier obtaining unit is specifically configured to:
And respectively 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, determining a first stored data class identifier matched with the associated data class identifier and a second stored data class identifier matched with the data class identifier corresponding to the data query node, and acquiring 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 query node.
On the basis of the above scheme, the data return value obtaining module 520 includes:
And the data return value acquisition unit is used for sequentially inquiring the data return value of the data class identifier corresponding to each data inquiry node according to the inquiry identifier of the data class identifier corresponding to each data inquiry node based on the data inquiry logic until the data return value corresponding to the request data class identifier is acquired.
On the basis of the scheme, the query identifier comprises 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 used for:
Aiming at the data class identifier corresponding to each data query node, generating a data query instruction according to the data query class identifier, a query method identifier defined in the data query class identifier and a request field identifier of the data class identifier corresponding to the data query node, and acquiring a 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;
And obtaining the data return value of the data class identifier corresponding to the data query node according to the data return value of each request field identifier corresponding to the data class identifier corresponding to the data query node.
On the basis of the scheme, the device further comprises:
The query identifier storage unit is used for correspondingly storing 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 based on the associated storage data class corresponding to the associated storage data class identifier in the preset database according to the association relation among the storage data class identifiers.
Based on the above scheme, the query result feedback module 530 is specifically configured to:
And determining a data structure of the query result information according to the information query request, and assembling the data return values corresponding to the request data type identifiers according to the data structure to obtain the query result information.
The information query device provided by the embodiment of the invention can execute the information query method provided by the first embodiment and/or the second embodiment, and has the corresponding functional modules and beneficial effects of the execution method.
Example six
Fig. 6 is a schematic structural diagram of an information query apparatus according to a sixth embodiment of the present invention. The information inquiry apparatus may be implemented in a software and/or hardware manner, for example, the information inquiry apparatus may be configured in a computer device. As shown in fig. 6, the apparatus includes a query information acquisition module 610, a request parameter acquisition module 620, and a query request sending module 630, where:
The query information acquisition module 610 is configured to acquire an information query instruction, and determine information to be queried corresponding to the information query instruction;
a request parameter obtaining module 620, 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 respectively;
And the query request sending module 630 is 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 obtains query result information according to the request data class identifier and the request field identifier included in the query information request.
The embodiment of the invention comprises the steps of acquiring an information inquiry instruction through an inquiry information acquisition module, determining information to be inquired corresponding to the information inquiry instruction, acquiring at least one request data type identifier contained in the information to be inquired and a request field identifier corresponding to each request data type identifier respectively by a request parameter acquisition module, generating an information inquiry request according to the request data type identifier and the request field identifier by an inquiry request transmission module, and transmitting the information inquiry request to a server, so that the server acquires inquiry result information corresponding to the information to be inquired according to the request data type identifier and the request field identifier contained in the inquiry information request, and a client does not need to know the inquiry mode of each data type when initiating the information inquiry request, and can acquire complete information to be inquired only by transmitting the information inquiry request according to the data format of the data to be inquired, thereby improving the flexibility of an inquiry method, the response speed of information inquiry and saving network bandwidth.
Based on the above scheme, the query request sending module 630 is specifically configured to:
And generating a data structure of the information to be queried according to the request data type identifier and the request field identifier, and adding the data structure into an information query request.
The information query device provided by the embodiment of the invention can execute the information query method provided by the third embodiment, and has the corresponding functional modules and beneficial effects of the execution method.
Example seven
Fig. 7 is a schematic structural diagram of a computer device according to a seventh embodiment of the present invention. FIG. 7 illustrates a block diagram of an exemplary computer device 712 suitable for use in implementing embodiments of the invention. The computer device 712 shown in fig. 7 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in FIG. 7, computer device 712 is in the form of a general purpose computing device. Components of computer device 712 may include, but are not limited to, one or more processors 716, a system memory 728, and a bus 718 that connects the different system components (including system memory 728 and processor 716).
Bus 718 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor 716, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include 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.
Computer device 712 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 712 and includes both volatile and nonvolatile media, removable and non-removable media.
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/nonvolatile computer system storage media. By way of example only, storage 734 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, commonly referred to as a "hard disk drive"). Although not shown in fig. 7, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 718 through one or more data media interfaces. Memory 728 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the invention.
A program/utility 740 having a set (at least one) of program modules 742 may be stored, for example, in 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 which may include an implementation of a network environment. Program modules 742 generally perform the functions and/or methodologies of the described embodiments of the invention.
The computer device 712 can also communicate with one or more external devices 714 (e.g., keyboard, pointing device, display 724, etc.), one or more devices that enable a user to interact with the computer device 712, and/or any devices (e.g., network card, modem, etc.) that enable the computer device 712 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 722. Moreover, 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 via network adapter 720. As shown, the network adapter 720 communicates with other modules of the computer device 712 via the bus 718. It should be appreciated that although not shown, other hardware and/or software modules may be utilized in connection with computer device 712, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
Processor 716 executes programs stored in system memory 728 to perform various functional applications and data processing, such as implementing the information query method provided in embodiments one and two of the present invention, the method comprising:
Acquiring a session user identifier contained in the detected session event to be responded;
Searching response logic data corresponding to the session user identifier from a cache database, wherein the response logic data stored in the cache database is response logic data corresponding to an original test scheme to which a session user of a current active session is shunted when a test scheme corresponding to the packet test is changed;
When response logic data corresponding to the session user identification is searched in the cache database, determining a response scheme of the session event to be responded according to the searched response logic data;
and/or implementing the information query method provided by the third embodiment of the present invention, where the method includes:
acquiring an information inquiry instruction and determining information to be inquired corresponding to the information inquiry instruction;
Acquiring at least one request data type identifier contained in the information to be queried and request field identifiers respectively corresponding to each request data type identifier;
And generating an information inquiry request according to the request data class identifier and the request field identifier, and sending the information inquiry request to a server so that the server obtains inquiry result information corresponding to the information to be inquired according to the request data class identifier and the request field identifier contained in the inquiry information request.
Of course, those skilled in the art will understand that the processor may also implement the technical solution of the information query method provided in any embodiment of the present invention.
Example eight
An eighth embodiment of the present invention further provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements, for example, the information query method provided in the first and second embodiments of the present invention, the method including:
Acquiring a session user identifier contained in the detected session event to be responded;
Searching response logic data corresponding to the session user identifier from a cache database, wherein the response logic data stored in the cache database is response logic data corresponding to an original test scheme to which a session user of a current active session is shunted when a test scheme corresponding to the packet test is changed;
When response logic data corresponding to the session user identification is searched in the cache database, determining a response scheme of the session event to be responded according to the searched response logic data;
and/or implementing the information query method provided by the third embodiment of the present invention, where the method includes:
acquiring an information inquiry instruction and determining information to be inquired corresponding to the information inquiry instruction;
Acquiring at least one request data type identifier contained in the information to be queried and request field identifiers respectively corresponding to each request data type identifier;
And generating an information inquiry request according to the request data class identifier and the request field identifier, and sending the information inquiry request to a server so that the server obtains inquiry result information corresponding to the information to be inquired according to the request data class identifier and the request field identifier contained in the inquiry information request.
Of course, the computer readable storage medium provided by the embodiments of the present invention, on which the computer program stored, is not limited to the method operations described above, but may also perform the related operations in the information query method provided by any embodiment of the present invention.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may 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 electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may 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 may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (12)

1. An information query method, comprising:
Receiving an information query request sent by a client, and acquiring at least one request data type identifier and a request field identifier corresponding to each request data type identifier, wherein the request data type identifier is used for uniquely determining a data type of request data, and the request field identifier is used for uniquely determining a request field;
For each request data type identifier, acquiring a query identifier corresponding to the request data type identifier from a preset database, and acquiring a data return value corresponding to the request data type identifier according to a data query mode corresponding to the query identifier and a request field identifier corresponding to the data type identifier;
Obtaining query result information according to the data return values corresponding to the request data class identifiers, and sending the query result information to a client;
the obtaining, for each request data class identifier, a query identifier corresponding to the request data class identifier from a preset database includes:
Determining and acquiring data query logic of a data class corresponding to the request data class identifier according to the association relation between the data classes, wherein the data query logic comprises at least one data query node, and each data query node corresponds to one data class identifier;
For each data query node, acquiring a query identifier of a 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 a previous data class identifier of the data class identifier corresponding to the data query node in the data query logic;
And determining the query identifier corresponding to the request data class identifier according to the query identifier of the data class identifier corresponding to each data query node and the data query logic.
2. The method according to claim 1, wherein the obtaining, from the preset database, the query identifier of the data class identifier corresponding to the data query node 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:
And respectively 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, determining a first stored data class identifier matched with the associated data class identifier and a second stored data class identifier matched with the data class identifier corresponding to the data query node, and acquiring 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 query node.
3. The method according to claim 1, wherein the obtaining the data return value corresponding to the request data class identifier according to the data query manner corresponding to the query identifier and the request field identifier corresponding to the data class identifier includes:
and sequentially inquiring the data return values of the data class identifiers corresponding to the data inquiry nodes according to the inquiry identifiers of the data class identifiers corresponding to the data inquiry nodes based on the data inquiry logic until the data return values corresponding to the request data class identifiers are obtained.
4. A 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 the sequentially querying the data return value of the data class identifier corresponding to each data query node according to the query identifier of the data class identifier corresponding to each data query node includes:
Aiming at the data class identifier corresponding to each data query node, generating a data query instruction according to the data query class identifier, a query method identifier defined in the data query class identifier and a request field identifier of the data class identifier corresponding to the data query node, and acquiring a 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;
And obtaining the data return value of the data class identifier corresponding to the data query node according to the data return value of each request field identifier corresponding to the data class identifier corresponding to the data query node.
5. The method as recited in claim 1, further comprising:
According to the association relation between the storage data types, aiming at each storage data type identifier, the association storage data type identifier associated with the storage data type identifier, and the query identifier of the storage data type corresponding to the storage data type identifier based on the association storage data type corresponding to the association storage data type identifier are correspondingly stored in the preset database.
6. The method of claim 1, wherein the identifying the corresponding data return value according to each of the request data classes includes:
And determining a data structure of the query result information according to the information query request, and assembling the data return values corresponding to the request data type identifiers according to the data structure to obtain the query result information.
7. An information query method, comprising:
acquiring an information inquiry instruction and determining information to be inquired corresponding to the information inquiry instruction;
Acquiring at least one request data class identifier contained in the information to be queried and request field identifiers respectively corresponding to each request data class identifier, wherein the request data class identifier is used for uniquely determining a data class of request data, and the request field identifier is used for uniquely determining a request field;
Generating an information query request according to the request data class identifiers and the request field identifiers, and sending the information query request to a server so that the server obtains a query identifier corresponding to the request data class identifier from a preset database aiming at each request data class identifier, and obtains a data return value corresponding to the request data class identifier according to a data query mode corresponding to the query identifier and the request field identifier corresponding to the data class identifier;
the obtaining, for each request data class identifier, a query identifier corresponding to the request data class identifier from a preset database includes:
Determining and acquiring data query logic of a data class corresponding to the request data class identifier according to the association relation between the data classes, wherein the data query logic comprises at least one data query node, and each data query node corresponds to one data class identifier;
For each data query node, acquiring a query identifier of a 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 a previous data class identifier of the data class identifier corresponding to the data query node in the data query logic;
And determining the query identifier corresponding to the request data class identifier according to the query identifier of the data class identifier corresponding to each data query node and the data query logic.
8. The method of claim 7, wherein generating an information query request based on the request data class identification and the request field identification comprises:
And generating a data structure of the information to be queried according to the request data type identifier and the request field identifier, and adding the data structure into an information query request.
9. An information inquiry apparatus, characterized by comprising:
the query request acquisition module is used for receiving an information query request sent by a client and acquiring at least one request data type identifier and a request field identifier corresponding to each request data type identifier respectively, wherein the request data type identifier is used for uniquely determining a data type of request data, and the request field identifier is used for uniquely determining a request field;
the data return value acquisition module is used for acquiring query identifications corresponding to the request data type identifications from a preset database aiming at each request data type identification, and acquiring data return values corresponding to the request data type identifications according to a data query mode corresponding to the query identifications and request field identifications corresponding to the data type identifications;
The query result feedback module is used for receiving 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;
The data return value acquisition module comprises:
The query logic determining unit is used for determining and obtaining data query logic of the data class corresponding to the request data class identifier according to the association relation among the data classes, wherein the data query logic comprises at least one data query node, and each data query node corresponds to one data class identifier;
The node identification acquisition unit is used for acquiring the query identification of the data class identification corresponding to the data query node from the preset database according to the data class identification corresponding to the data query node and the associated data class identification associated with the data class identification corresponding to the data query node for each data query node, wherein the associated data class identification associated with the data class identification corresponding to the data query node is the previous data class identification of the data class identification corresponding to the data query node in the data query logic;
And the query identifier determining unit is used for determining the query identifier corresponding to the request data class identifier according to the query identifier of the data class identifier corresponding to each data query node and the data query logic.
10. An information inquiry apparatus, characterized by comprising:
The query information acquisition module is used for acquiring an information query instruction and determining information to be queried corresponding to the information query instruction;
The request parameter acquisition module is used for acquiring at least one request data type identifier contained in the information to be queried and request field identifiers respectively corresponding to each request data type identifier, wherein the request data type identifiers are used for uniquely determining data types of request data, and the request field identifiers are used for uniquely determining request fields;
The query request sending module is used for generating an information query request according to the request data class identifiers and the request field identifiers, sending the information query request to a server, so that the server obtains query identifiers corresponding to the request data class identifiers from a preset database aiming at each request data class identifier, and obtains data return values corresponding to the request data class identifiers according to a data query mode corresponding to the query identifiers and the request field identifiers corresponding to the data class identifiers;
the obtaining, for each request data class identifier, a query identifier corresponding to the request data class identifier from a preset database includes:
Determining and acquiring data query logic of a data class corresponding to the request data class identifier according to the association relation between the data classes, wherein the data query logic comprises at least one data query node, and each data query node corresponds to one data class identifier;
For each data query node, acquiring a query identifier of a 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 a previous data class identifier of the data class identifier corresponding to the data query node in the data query logic;
And determining the query identifier corresponding to the request data class identifier according to the query identifier of the data class identifier corresponding to each data query node and the data query logic.
11. A computer device, the device comprising:
One or more processors;
a storage means for storing one or more programs;
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the information query method of any of claims 1-6 and/or to implement the information query method of any of claims 7-8.
12. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the information query method of any one of claims 1-6 and/or implements the information query method of any one of claims 7-8.
CN201910441312.9A 2019-05-24 2019-05-24 Information query method, device, equipment and medium Active CN111984849B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910441312.9A CN111984849B (en) 2019-05-24 2019-05-24 Information query method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910441312.9A CN111984849B (en) 2019-05-24 2019-05-24 Information query method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN111984849A CN111984849A (en) 2020-11-24
CN111984849B true CN111984849B (en) 2025-06-13

Family

ID=73436809

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910441312.9A Active CN111984849B (en) 2019-05-24 2019-05-24 Information query method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN111984849B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113076302B (en) * 2021-04-08 2025-01-10 广东电网有限责任公司 Power grid data management method, device, equipment and medium
CN115431900A (en) * 2021-11-30 2022-12-06 北京罗克维尔斯科技有限公司 Vehicle control method, vehicle control device, vehicle and storage medium
CN114168595B (en) * 2021-12-09 2024-08-27 中国建设银行股份有限公司 Data analysis method and device
CN114860834B (en) * 2022-06-01 2024-03-26 北京字节跳动网络技术有限公司 Processing method, device, equipment and storage medium of association query request
CN117271840B (en) * 2023-09-22 2024-02-13 北京海致星图科技有限公司 Data query method and device of graph database and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402515A (en) * 2010-09-10 2012-04-04 深圳市鹏海运电子数据交换有限公司 Universal custom query system and method
CN103729386A (en) * 2012-10-16 2014-04-16 阿里巴巴集团控股有限公司 Information query system and method
CN103729471A (en) * 2014-01-21 2014-04-16 华为软件技术有限公司 Method and device for database query
CN104991921A (en) * 2015-06-26 2015-10-21 北京奇虎科技有限公司 Data query method, client and server
CN107391506A (en) * 2016-05-16 2017-11-24 华为软件技术有限公司 Method and apparatus for inquiring about data

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105224560B (en) * 2014-06-20 2019-12-06 腾讯科技(北京)有限公司 Cache data searching method and device
CN106933875B (en) * 2015-12-31 2021-01-26 北京城市网邻信息技术有限公司 Data query method and device
CN106959963B (en) * 2016-01-12 2020-04-28 杭州海康威视数字技术股份有限公司 Data query method, device and system
CN107016001B (en) * 2016-01-28 2020-10-16 创新先进技术有限公司 Data query method and device
CN107798026A (en) * 2016-09-05 2018-03-13 北京京东尚科信息技术有限公司 Data query method and apparatus
CN108959291B (en) * 2017-05-19 2023-03-24 腾讯科技(深圳)有限公司 Query method and related device
CN108090154A (en) * 2017-12-08 2018-05-29 广州市申迪计算机系统有限公司 A kind of isomerous multi-source data fusion querying method and device
CN108062384A (en) * 2017-12-13 2018-05-22 阿里巴巴集团控股有限公司 The method and apparatus of data retrieval
CN109524065B (en) * 2018-11-07 2024-06-25 深圳平安医疗健康科技服务有限公司 Medical data query method, medical data platform and related devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402515A (en) * 2010-09-10 2012-04-04 深圳市鹏海运电子数据交换有限公司 Universal custom query system and method
CN103729386A (en) * 2012-10-16 2014-04-16 阿里巴巴集团控股有限公司 Information query system and method
CN103729471A (en) * 2014-01-21 2014-04-16 华为软件技术有限公司 Method and device for database query
CN104991921A (en) * 2015-06-26 2015-10-21 北京奇虎科技有限公司 Data query method, client and server
CN107391506A (en) * 2016-05-16 2017-11-24 华为软件技术有限公司 Method and apparatus for inquiring about data

Also Published As

Publication number Publication date
CN111984849A (en) 2020-11-24

Similar Documents

Publication Publication Date Title
CN111984849B (en) Information query method, device, equipment and medium
CN111737022B (en) Micro-service-based interface calling method, system, equipment and medium
CN109246220B (en) A message push system and method
US9323587B2 (en) Method and system for automatic detecting and resolving APIs
CN104516908A (en) Database access method and device
US10585722B2 (en) Integrating heterogeneous business events in hybrid cloud environments
CN114978880B (en) Service call chain tracking method, system, computer and storage medium
CN113014681A (en) Network card binding method and device of multi-network card server, electronic equipment and storage medium
US20210141904A1 (en) Application programming interface specification inference
WO2019075845A1 (en) Construction method and device for link call relationship, computer device and storage medium
CN114416075A (en) Business processing method and device
CN110311855B (en) User message processing method and device, electronic equipment and storage medium
CN116523457A (en) Workflow processing method, device, equipment and storage medium based on business process
CN117194039A (en) K8S drive integrated system, request processing method, device and storage medium
WO2025158261A1 (en) Request processing method and apparatus, and task execution method and apparatus
CN111382039A (en) Method, device, electronic equipment and storage medium for reporting user behavior event
CN113542409B (en) Management system and processing method for instances of RocktMQ message queues
US12001458B2 (en) Multi-cloud object store access
CN116032614A (en) Container network micro-isolation method, device, equipment and medium
CN116319810A (en) Distributed system flow control method, device, equipment, medium and product
CN111489212B (en) Order billing method, device, equipment and medium based on big data
CN114980064A (en) Information association method and device, electronic equipment and storage medium
CN115129708A (en) Data processing method, data processing device, storage medium and electronic equipment
CN116662082A (en) Storage device testing method and related device
CN113986995A (en) Request distribution method, device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载