CN110674112A - Data query method and device and electronic equipment - Google Patents

Data query method and device and electronic equipment Download PDF

Info

Publication number
CN110674112A
CN110674112A CN201910899832.4A CN201910899832A CN110674112A CN 110674112 A CN110674112 A CN 110674112A CN 201910899832 A CN201910899832 A CN 201910899832A CN 110674112 A CN110674112 A CN 110674112A
Authority
CN
China
Prior art keywords
database
information
entity
target
entity information
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.)
Pending
Application number
CN201910899832.4A
Other languages
Chinese (zh)
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 Baifendian Information Science & Technology Co Ltd
Original Assignee
Beijing Baifendian Information Science & 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 Baifendian Information Science & Technology Co Ltd filed Critical Beijing Baifendian Information Science & Technology Co Ltd
Priority to CN201910899832.4A priority Critical patent/CN110674112A/en
Publication of CN110674112A publication Critical patent/CN110674112A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/288Entity relationship models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

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)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a method, a device and electronic equipment for data query, wherein the method, the device and the electronic equipment comprise the following steps: acquiring target entity information contained in a statement to be queried; the method comprises the steps of acquiring target associated information matched with target entity information from a preset database based on the target entity information, wherein the preset database comprises a first database and a second database, the first database is used for storing the entity information, the second database is used for storing the associated information matched with the entity information, and the associated information comprises an associated event executed and/or responded by an entity and a response or execution object of the associated event. By adopting the method, the device and the electronic equipment, when the plurality of associated information of the target entity is inquired, the plurality of target associated information matched with the target entity information can be acquired from the preset database based on the target entity information in the sentence to be inquired without inquiring for many times, so that the inquiry efficiency of the associated information is improved.

Description

Data query method and device and electronic equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for querying data, and an electronic device.
Background
Complex relationship data, such as social network data, scientific and technological information data and the like, is an important type of big data, and community discovery, scientific research relationship inquiry and the like can be realized by analyzing and mining the complex relationship data. In general, the complex relationship data may be stored based on conventional graph databases, i.e. according to the structure and attributes of graphs, wherein graph databases such as the network-oriented graph database Neo4j, the open source graph database HugeGraph, etc.
However, when the complex relationship data is stored based on the conventional graph database, multiple association events and association relationships of the same entity in the complex relationship data are usually stored to different storage nodes, so that when multiple association information of the same entity is queried, multiple node indexes need to be created, and thus the efficiency of querying the association information is low.
Disclosure of Invention
The embodiment of the invention provides a data query method, a data query device and electronic equipment, which can continuously construct event relation storage among entities, do not need to query for many times when querying a plurality of associated information of a target entity, and can acquire a plurality of target associated information matched with target entity information from a preset database based on the target entity information in a sentence to be queried, so that the query efficiency of the associated information is improved.
To solve the above technical problem, the embodiment of the present invention is implemented as follows:
in a first aspect, an embodiment of the present invention provides a method for querying data, where the method includes: acquiring target entity information contained in a statement to be queried; and acquiring target associated information matched with the target entity information from a preset database based on the target entity information, wherein the preset database comprises a first database and a second database, the first database is used for storing entity information, the second database is used for storing associated information matched with the entity information, and the associated information comprises an entity execution and/or a responded associated event and a response or an execution object of the associated event.
In one implementation manner, before the obtaining, based on the target entity information, target associated information matched with the target entity information from a preset database, the method further includes: acquiring the entity information and associated information matched with the entity information; and constructing the preset database based on the entity information and the associated information matched with the entity information.
In one implementation manner, the constructing a preset database based on the entity information and the associated information matched with the entity information includes: storing the entity information to the first database; storing the associated information matched with the entity information to the second database; establishing an index relationship based on the first database and the second database, wherein the index relationship is used for associating the first database with the second database; and constructing the preset database according to the first database, the second database and the index relation.
In one implementation, the storing the association relationship and the association event to the second database includes: dividing a storage area of the second database into a preset number of sub-storage areas; and storing the associated event to the corresponding sub storage area according to a preset mapping relation between the occurrence time of the associated event and the sub storage area.
In one implementation manner, the obtaining, based on the target entity, target association information matched with the target entity from a preset database includes: determining unique identification information of the target entity; and acquiring information corresponding to the unique identification information from the second database as target associated information based on the unique identification information.
In an implementation manner, the obtaining a target entity included in a statement to be queried includes: and identifying NER and/or a preset keyword extraction rule through the named entity to obtain the target entity contained in the statement to be queried.
In a second aspect, an embodiment of the present invention provides an apparatus for querying data, where the apparatus includes: the first acquisition module is used for acquiring target entity information contained in the statement to be queried; the second obtaining module is configured to obtain target associated information matched with the target entity information from a preset database based on the target entity information, where the preset database includes a first database and a second database, the first database is used for storing entity information, and the second database is used for storing associated information matched with the entity information, where the associated information includes an entity execution and/or a responded associated event and a response or an execution object of the associated event.
In one implementation, the apparatus further comprises: the third acquisition module is used for acquiring the entity information and the associated information matched with the entity information; and the construction module is used for constructing a preset database based on the entity information and the associated information matched with the entity information.
In one implementation, the building module includes: storing the entity information to the first database; storing the associated information matched with the entity information to the second database; establishing an index relationship based on the first database and the second database, wherein the index relationship is used for associating the first database with the second database; and constructing the preset database according to the first database, the second database and the index relation.
In one implementation, the building module includes: dividing a storage area of the second database into a preset number of sub-storage areas; and storing the associated event to the corresponding sub storage area according to a preset mapping relation between the occurrence time of the associated event and the sub storage area.
In one implementation, the second obtaining module includes: determining unique identification information of the target entity; and acquiring information corresponding to the unique identification information from the second database as target associated information based on the unique identification information.
In one implementation, the first obtaining module includes: and identifying NER and/or a preset keyword extraction rule through the named entity to obtain the target entity contained in the statement to be queried.
In a third aspect, an embodiment of the present invention provides an apparatus for data query, including a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program, when executed by the processor, implements the steps of the method for data query provided in the foregoing embodiment.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of the method for querying data provided in the foregoing embodiment.
According to the technical scheme provided by the embodiment of the invention, when the plurality of associated information of the target entity is inquired, the event relation between the entities can be continuously constructed for storage, when the plurality of associated information of the target entity is inquired, the plurality of associated information matched with the target entity information can be obtained from the preset database based on the target entity information in the statement to be inquired without repeated inquiry, and therefore, the inquiry efficiency of the associated information is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1a is a schematic flowchart of a data query method according to an embodiment of the present invention;
FIG. 1b is a diagram of a default database according to an embodiment of the present invention;
fig. 2a is a schematic flowchart of a data query method according to an embodiment of the present invention;
fig. 2b is a schematic view of storing associated information of a second database according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data query apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device for data query according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
As shown in fig. 1a, the embodiment of the present invention provides a method for querying data, and the execution subject of the method may be a personal computer system, a server computer system, a thin client, a thick client, a handheld or laptop device, a microprocessor-based system, a set-top box, a programmable consumer electronics, a network personal computer, a small computer system, a mainframe computer system, a distributed cloud computing environment including any of the above systems, and the like, or may also be a server, wherein the server may be an independent server or a server cluster consisting of a plurality of servers. The server may be a background server for one or more services, such as a data query service. For convenience of description, the following describes an embodiment of the present invention with an execution subject as a server, and the method may specifically include the following steps:
step S101, obtaining target entity information contained in the statement to be queried.
And the target entity information comprises attribute information and/or identification information of the target entity. If the target entity is a user, the attribute information of the target entity may be, for example, height, weight, and the like of the user, and the identification information may be, for example, an identity card number of the user, and the like, and may uniquely identify the user.
It should be noted that, when target entity information included in a query statement is acquired, different processing manners exist for different formats of the query statement, for example, for a structured query statement, acquisition may be performed based on a rule, for example, using a named entity to identify an NER or a predetermined keyword extraction rule, and for an unstructured query statement, acquisition may be performed based on a learning method, for example, using a Support Vector Machine (SVM) supervised learning classification manner or using a Recurrent Neural Network (ddrnn) and a Translation Embedding (TE) in combination.
Or, in order to improve the obtaining rate, for an unstructured statement to be queried, the unstructured statement to be queried may be first converted into a structured statement to be queried, and then target entity information included in the statement to be queried is obtained based on a rule of the structured statement to be queried.
In one implementation, the server may obtain a search statement from a user, and use the search statement as a to-be-queried statement for the user to query the server, for example, if the user inputs a search statement "call record about user a" at an application layer, the server may use the search statement "call record about user a" as a to-be-queried statement for the user to query the server for subsequent operations.
After the server obtains the sentence to be queried from the user, the server can utilize natural language to process and analyze the query keyword contained in the sentence to be queried, and after the query keyword is obtained, the server obtains the target entity information contained in the sentence to be queried based on the keyword.
For example, the query information input by the query statement is "zhang san zhu lie si four", and the "zhang san zhu lie four" is analyzed to obtain the entities "zhang san" and "lie four".
Or after the server obtains the statement to be queried from the user, the entity extraction method based on the rule and the template can be as follows: and acquiring target entity information contained in the statement to be queried from the statement to be queried according to the name rule and the template which are manually written and by combining a certain heuristic algorithm.
Or, in an implementation manner, after the server obtains the to-be-queried statement from the user, the server may identify the NER and/or the predetermined keyword extraction rule through the named entity, and obtain the target entity included in the to-be-queried statement.
Step S102, based on the target entity information, acquiring target associated information matched with the target entity information from a preset database, where the preset database includes a first database and a second database, the first database is used for storing entity information, and the second database is used for storing associated information matched with the entity information, where the associated information includes an entity execution and/or a correlated event of the response and a response or an execution object of the correlated event.
The preset database is a data structure based on a graph and used for storing entity information and associated information matched with the entity information, for example, the preset database can be a knowledge map and the like, the associated information can be more effectively and intelligently stored and managed through the preset database, and meanwhile, an interface for conveniently accessing the required associated information can be provided for the outside, so that the associated information on the preset database can become a universal information exchange medium through a unified standard, and the query efficiency of data is greatly improved.
For example, following the above example, if the query information input by the statement to be queried is "association information of zhang xian lieu four", the "association information of zhang xian liang four" is analyzed to obtain entities "zhang san" and "lie four", and since the query information is for zhang san, it may be determined that zhang san is a target entity, the association event is a "meeting event" executed zhang san, and the response object of the association event is lie four.
Or, if the query information is directed to lie four, it may be determined that lie four is a target entity, the associated event is a "meeting event" of the response of lie four, and the execution object of the associated event is zhang.
In an implementation manner, based on the target entity information, before the target associated information matched with the target entity information is acquired from the preset database, a mapping relationship between the first database and the second database may be preset, where the mapping relationship is used to determine the second database corresponding to each entity in the first database.
After the target entity information is obtained in step S101, the target association information matched with the target entity information may be obtained from the second database of the preset database based on the preset mapping relationship.
The entity information in the first database and the associated information matched with the entity information in the second database are used for establishing a reference relationship through a preset mapping relationship, so that the associated information of each entity does not need to be stored independently, the use of I/O (input/output) and storage resources can be reduced, and the query performance is improved.
Or, in order to improve the query rate, in an implementation manner, the unique identification information of the entity may be stored in the second database, and when the unique identification information of the target entity is acquired from the target entity information, the second database in which the unique identification information of the target entity is stored may be found from the preset database based on the unique identification information of the target entity, and then the target associated information matched with the target entity information is acquired from the second database.
For example, as shown in fig. 1b, a schematic diagram of a preset database provided for the embodiment of the present invention includes a first database and n second databases, where the first database is used to store entity information of entities 1 to n, and the second database is used to store association information matching the entity information and unique identification information corresponding to the entities, where the association information includes an association event executed by and/or responded to by an entity and a response or execution object of the association event. The dashed lines between the first database and each second database in fig. 1b represent predetermined mapping relationships.
In the embodiment of the invention, the entity information is respectively stored in the first database, and the associated information matched with the entity information and the unique identification information corresponding to the entity are stored in the second database, so that the storage capacity of the preset database can be separately managed, and the problems that the storage capacity in the traditional database storage mode is limited and the storage and analysis of a large-scale event map cannot be met are solved.
In an implementation manner, if the associated information matched with the entity information includes a plurality of associated events, when the associated information is stored in the second database, the storage area of the second database may be further divided into a preset number of sub-storage areas; and then storing the associated event to the corresponding sub-storage area according to the preset mapping relation between the occurrence time of the associated event and the sub-storage area.
By the method, when the target associated information matched with the target entity information is acquired from the preset database based on the target entity information, information filtering can be performed according to the occurrence time of the associated event, so that the query data volume is reduced, and the query performance is improved.
The embodiment of the invention provides a data query method, which can acquire target entity information contained in a statement to be queried when querying a plurality of associated information of a target entity; and then acquiring target associated information matched with the target entity information from a preset database based on the target entity information, wherein the preset database comprises a first database and a second database, the first database is used for storing the entity information, the second database is used for storing the associated information matched with the entity information, and the associated information comprises an associated event executed and/or responded by the entity and a response or execution object of the associated event.
Example two
As shown in fig. 2a, the embodiment of the present invention provides a method for querying data, and the execution subject of the method may be a personal computer system, a server computer system, a thin client, a thick client, a handheld or laptop device, a microprocessor-based system, a set-top box, a programmable consumer electronics, a network personal computer, a small computer system, a mainframe computer system, a distributed cloud computing environment including any of the above systems, and the like, or may be a server, wherein the server may be an independent server or a server cluster consisting of a plurality of servers. The method may specifically comprise the steps of:
step S201, acquiring entity information and associated information matched with the entity information.
In one implementation, complex relational data can be cleaned in advance, ETL plug-ins are loaded aiming at different complex relational data to obtain ETL rules based on a conditional random field model, and then entities are constructed to obtain entity information and associated information matched with the entity information.
Step S202, a preset database is constructed based on the entity information and the associated information matched with the entity information.
In one implementation, constructing the preset database based on the entity information and the associated information matched with the entity information includes: storing the entity information to a first database; storing the associated information matched with the entity information to a second database; establishing an index relation based on the first database and the second database, wherein the index relation is used for associating the first database with the second database; and constructing a preset database according to the first database, the second database and the index relation.
It should be noted that the entity information is stored in the first database, and the associated information matched with the entity information is stored in the second database, so that the storage capacity of the preset database can be separately managed, and the problems that the storage capacity in the conventional database storage mode is limited, and the storage and analysis of a large-scale event map cannot be satisfied are solved.
In addition, the first database and the second database are associated by establishing an index relationship, so that the association information of each entity does not need to be stored separately, the use of I/O and storage resources can be reduced, and the query performance is improved.
In one implementation, in order to reduce the workload of subsequent query, when the associated information matched with the entity information is stored in the second database, the storage area of the second database may be divided into a preset number of sub-storage areas; and storing the associated events to the corresponding sub-storage areas according to the preset mapping relation between the occurrence time of the associated events and the sub-storage areas, and performing information filtering according to the occurrence time of the associated events, so that the query data volume is reduced, and the query performance is improved.
For example, as shown in fig. 2b, in a schematic view of storing the association information of the second database in the data query method according to the embodiment of the present invention, assuming that the occurrence times of the association events are 20190101, 20190102, 20190103, and 20190104, respectively, the storage area of the second database may be divided into 4 sub-storage areas according to the occurrence times of the association events, and the storage areas are a first sub-storage area, a second sub-storage area, a third sub-storage area, and a fourth sub-storage area from left to right and from top to bottom, respectively.
In one implementation, the preset mapping relationship between the occurrence time of the association event and the sub storage area may be: the first sub storage area stores the associated event with the time of 20190101, the second sub storage area stores the associated event with the time of 20190101, the third sub storage area stores the associated event with the time of 20190103, and the fourth sub storage area stores the associated event with the time of 20190104.
It should be noted that the preset mapping relationship between the occurrence time of the association event and the sub storage area is only an exemplary illustration, and does not limit the embodiment of the present invention in any way.
Step S203, obtain the target entity information contained in the statement to be queried.
This step is the same as the step S101 in embodiment 1, and the related content can be referred to the step S101, which is not described herein again.
Step S204, based on the target entity information, acquiring target associated information matched with the target entity information from a preset database, wherein the preset database comprises a first database and a second database, the first database is used for storing the entity information, the second database is used for storing the associated information matched with the entity information, and the associated information comprises an associated event executed and/or responded by the entity and a response or execution object of the associated event.
This step is the same as the step S102 in embodiment 1, and the related content can be referred to the step S102, which is not described herein again.
The embodiment of the invention provides a data query method, which can acquire target entity information contained in a statement to be queried when querying a plurality of associated information of a target entity; and then acquiring target associated information matched with the target entity information from a preset database based on the target entity information, wherein the preset database comprises a first database and a second database, the first database is used for storing the entity information, the second database is used for storing the associated information matched with the entity information, and the associated information comprises an associated event executed and/or responded by the entity and a response or execution object of the associated event.
EXAMPLE III
Based on the same idea, the data query method provided in the embodiment of the present invention further provides a data query device, as shown in fig. 3.
The data processing device comprises: a first obtaining module 301 and a second obtaining module 302, wherein:
a first obtaining module 301, configured to obtain target entity information included in a statement to be queried; a second obtaining module 302, configured to obtain target associated information matched with the target entity information from a preset database based on the target entity information, where the preset database includes a first database and a second database, the first database is used to store the entity information, and the second database is used to store the associated information matched with the entity information, where the associated information includes an associated event executed by and/or responded to by the entity and a response or execution object of the associated event.
In one implementation, the apparatus further comprises: the third acquisition module is used for acquiring entity information and associated information matched with the entity information; and the construction module is used for constructing a preset database based on the entity information and the associated information matched with the entity information.
In one implementation, the building module includes: storing the entity information to a first database; storing the associated information matched with the entity information to a second database; establishing an index relation based on the first database and the second database, wherein the index relation is used for associating the first database with the second database; and constructing the preset database according to the first database, the second database and the index relation.
In one implementation, the building module includes: dividing a storage area of a second database into a preset number of sub-storage areas; and storing the associated events to the corresponding sub-storage areas according to the preset mapping relation between the occurrence time of the associated events and the sub-storage areas.
In one implementation, the second obtaining module includes: determining unique identification information of a target entity; and acquiring information corresponding to the unique identification information from the second database as target associated information based on the unique identification information.
In one implementation, the first obtaining module includes: and identifying NER and/or a preset keyword extraction rule through the named entity to obtain the target entity contained in the statement to be queried.
The embodiment of the invention provides a data query device, wherein when a plurality of associated information of a target entity is queried, a first acquisition module can acquire target entity information contained in a statement to be queried; then, the second obtaining module obtains target associated information matched with the target entity information from a preset database based on the target entity information, the preset database comprises a first database and a second database, the first database is used for storing the entity information, the second database is used for storing the associated information matched with the entity information, and the associated information comprises an associated event executed and/or responded by the entity and a response or execution object of the associated event, so that event relation storage among entities can be continuously constructed, when a plurality of associated information of the target entity is queried, a plurality of queries are not needed, the plurality of target associated information matched with the target entity information can be obtained from the preset database based on the target entity information in a statement to be queried, and the query efficiency of the associated information is improved.
Example four
Fig. 4 is a schematic diagram of a hardware structure of an electronic device for data query according to various embodiments of the present invention, where the electronic device is used to solve a problem in the conventional art that efficiency is low when querying related information due to the need of creating node indexes for multiple times when querying multiple related information of the same entity, and improve efficiency of querying related information.
The electronic device 400 for data query includes but is not limited to: radio frequency unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, processor 410, and power supply 411. Those skilled in the art will appreciate that the electronic device architecture of the data query shown in FIG. 4 does not constitute a limitation of the electronic device of the data query, which may include more or fewer components than shown, or some components in combination, or a different arrangement of components. In the embodiment of the present invention, the electronic device for data query includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, and a pedometer.
The processor 410 is configured to obtain target entity information included in a statement to be queried; and acquiring target associated information matched with the target entity information from a preset database based on the target entity information, wherein the preset database comprises a first database and a second database, the first database is used for storing the entity information, the second database is used for storing the associated information matched with the entity information, and the associated information comprises an associated event executed and/or responded by the entity and a response or execution object of the associated event.
In one implementation, the processor 410 is further configured to obtain the entity information and the associated information matching the entity information before obtaining the target associated information matching the target entity information from the preset database based on the target entity information; and constructing a preset database based on the entity information and the associated information matched with the entity information.
In one implementation, the processor 410 constructs a preset database based on the entity information and the associated information matched with the entity information, including: storing the entity information to a first database; storing the associated information matched with the entity information to a second database; establishing an index relation based on the first database and the second database, wherein the index relation is used for associating the first database with the second database; and constructing a preset database according to the first database, the second database and the index relation.
In one implementation, the processor 410 stores the association relationship and the association event to the second database, including: dividing a storage area of a second database into a preset number of sub-storage areas; and storing the associated events to the corresponding sub-storage areas according to the preset mapping relation between the occurrence time of the associated events and the sub-storage areas.
In one implementation, acquiring target association information matched with a target entity from a preset database based on the target entity includes: determining unique identification information of a target entity; and acquiring information corresponding to the unique identification information from the second database as target associated information based on the unique identification information.
In one implementation, obtaining a target entity included in a statement to be queried includes: and identifying the NER and/or a preset keyword extraction rule through the named entity to obtain a target entity contained in the statement to be queried.
The embodiment of the invention provides electronic equipment for data query, which is used for acquiring target entity information contained in a sentence to be queried; and acquiring target associated information matched with the target entity information from a preset database based on the target entity information, wherein the preset database comprises a first database and a second database, the first database is used for storing entity information, the second database is used for storing associated information matched with the entity information, and the associated information comprises an entity execution and/or a responded associated event and a response or an execution object of the associated event.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 401 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 410; in addition, the uplink data is transmitted to the base station. Typically, radio unit 401 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio unit 401 can also communicate with a network and other electronic devices for data query through a wireless communication system.
The electronic device for data query provides wireless broadband internet access to the user through the network module 402, such as helping the user send and receive e-mails, browse web pages, and access streaming media.
The audio output unit 403 may convert audio data received by the radio frequency unit 401 or the network module 402 or stored in the memory 409 into an audio signal and output as sound. Also, the audio output unit 403 may also provide audio output (e.g., a call signal reception sound, a message reception sound, etc.) related to a specific function performed by the electronic device 400 for data query. The audio output unit 403 includes a speaker, a buzzer, a receiver, and the like.
The input unit 404 is used to receive audio or video signals. The input Unit 404 may include a Graphics Processing Unit (GPU) 4041 and a microphone 4042, and the Graphics processor 4041 processes image data of a still picture or video obtained by an image capturing apparatus (such as a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 406. The image frames processed by the graphic processor 4041 may be stored in the memory 409 (or other storage medium) or transmitted via the radio frequency unit 401 or the network module 402. The microphone 4042 may receive sound, and may be capable of processing such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 401 in case of the phone call mode.
The data querying electronic device 400 further comprises at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel 4051 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 4051 and/or the backlight when the electronic device 400 for data query moves to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device for data query (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration recognition related functions (such as pedometer and tapping); the sensors 405 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be described in detail herein.
The display unit 406 is used to display information input by the user or information provided to the user. The Display unit 406 may include a Display panel 4051, and the Display panel 5061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 407 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the data-queried electronic device. Specifically, the user input unit 407 includes a touch panel 4071 and other input devices 4072. Touch panel 4071, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., operations by a user on or near touch panel 4071 using a finger, a stylus, or any suitable object or attachment). The touch panel 4071 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 410, receives a command from the processor 410, and executes the command. In addition, the touch panel 4071 can be implemented by using various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 4071, the user input unit 407 may include other input devices 4072. Specifically, the other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a track ball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 4071 can be overlaid on the display panel 4061, and when the touch panel 4071 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 410 to determine the type of the touch event, and then the processor 410 provides a corresponding visual output on the display panel 4051 according to the type of the touch event. The touch panel 4071 and the display panel 4051 are two independent components to implement the input and output functions of the electronic device for data query, but in some embodiments, the touch panel 4071 and the display panel 4051 may be integrated to implement the input and output functions of the electronic device for data query, which is not limited herein.
The interface unit 408 is an interface through which an external device is connected to the electronic apparatus 400 for data query. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 408 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the data-queried electronic apparatus 400 or may be used to transmit data between the data-queried electronic apparatus 400 and an external device.
The memory 409 may be used to store software programs as well as various data. The memory 409 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 409 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 410 is a control center of the electronic device for data query, connects various parts of the electronic device for data query as a whole using various interfaces and lines, and performs various functions of the electronic device for data query and processes data by operating or executing software programs and/or modules stored in the memory 409 and calling the data stored in the memory 409, thereby performing overall monitoring of the electronic device for data query. Processor 410 may include one or more processing units; preferably, the processor 410 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 410.
The electronic device 400 for data query may further include a power supply 411 (such as a battery) for supplying power to each component, and preferably, the power supply 411 may be logically connected to the processor 410 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
Preferably, an embodiment of the present invention further provides an electronic device for data query, which includes a processor 410, a memory 409, and a computer program that is stored in the memory 409 and can be run on the processor 410, and when being executed by the processor 410, the computer program implements each process of the above-mentioned method for data query, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
EXAMPLE five
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above-mentioned method for querying data, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
The embodiment of the invention provides a computer-readable storage medium, which stores a computer program, wherein when the computer program is executed by a processor to realize the query of a plurality of associated information of a target entity, the computer program can acquire the target entity information contained in a statement to be queried; and then acquiring target associated information matched with the target entity information from a preset database based on the target entity information, wherein the preset database comprises a first database and a second database, the first database is used for storing the entity information, the second database is used for storing the associated information matched with the entity information, and the associated information comprises an associated event executed and/or responded by the entity and a response or execution object of the associated event.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (transient media) such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present invention, and is not intended to limit the present invention. Various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (10)

1. A method of data querying, the method comprising:
acquiring target entity information contained in a statement to be queried;
and acquiring target associated information matched with the target entity information from a preset database based on the target entity information, wherein the preset database comprises a first database and a second database, the first database is used for storing entity information, the second database is used for storing associated information matched with the entity information, and the associated information comprises an entity execution and/or a responded associated event and a response or an execution object of the associated event.
2. The method according to claim 1, further comprising, before the obtaining target association information matching the target entity information from a preset database based on the target entity information, the step of:
acquiring the entity information and associated information matched with the entity information;
and constructing the preset database based on the entity information and the associated information matched with the entity information.
3. The method according to claim 2, wherein the constructing the preset database based on the entity information and the association information matched with the entity information comprises:
storing the entity information to the first database;
storing the associated information matched with the entity information to the second database;
establishing an index relationship based on the first database and the second database, wherein the index relationship is used for associating the first database with the second database;
and constructing the preset database according to the first database, the second database and the index relation.
4. The method of claim 3, wherein storing the association relationship and the association event to the second database comprises:
dividing a storage area of the second database into a preset number of sub-storage areas;
and storing the associated event to the corresponding sub storage area according to a preset mapping relation between the occurrence time of the associated event and the sub storage area.
5. The method according to claim 1, wherein the obtaining target association information matched with the target entity from a preset database based on the target entity comprises:
determining unique identification information of the target entity;
and acquiring information corresponding to the unique identification information from the second database as target associated information based on the unique identification information.
6. The method according to claim 1, wherein the obtaining the target entity contained in the query statement comprises:
and identifying NER and/or a preset keyword extraction rule through the named entity to obtain the target entity contained in the statement to be queried.
7. An apparatus for data query, the apparatus comprising:
the first acquisition module is used for acquiring target entity information contained in the statement to be queried;
the second obtaining module is configured to obtain target associated information matched with the target entity information from a preset database based on the target entity information, where the preset database includes a first database and a second database, the first database is used for storing entity information, and the second database is used for storing associated information matched with the entity information, where the associated information includes an entity execution and/or a responded associated event and a response or an execution object of the associated event.
8. The method of claim 1, wherein the apparatus further comprises:
the third acquisition module is used for acquiring the entity information and the associated information matched with the entity information;
and the construction module is used for constructing the preset database based on the entity information and the associated information matched with the entity information.
9. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method of data querying according to any one of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of data querying according to one of claims 1 to 6.
CN201910899832.4A 2019-09-23 2019-09-23 Data query method and device and electronic equipment Pending CN110674112A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910899832.4A CN110674112A (en) 2019-09-23 2019-09-23 Data query method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910899832.4A CN110674112A (en) 2019-09-23 2019-09-23 Data query method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN110674112A true CN110674112A (en) 2020-01-10

Family

ID=69077315

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910899832.4A Pending CN110674112A (en) 2019-09-23 2019-09-23 Data query method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110674112A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111427870A (en) * 2020-04-15 2020-07-17 赞同科技股份有限公司 Resource management method, device and equipment
CN111782653A (en) * 2020-06-30 2020-10-16 平安国际智慧城市科技股份有限公司 Data query method and device, electronic equipment and storage medium
CN112463798A (en) * 2020-12-08 2021-03-09 中国人寿保险股份有限公司 Cross-database data extraction method and device, electronic equipment and storage medium
CN112800179A (en) * 2021-02-02 2021-05-14 浙江公共安全技术研究院有限公司 Associated database query method and device, storage medium and electronic equipment
CN113609335A (en) * 2021-08-12 2021-11-05 北京滴普科技有限公司 Target object searching method, system, electronic equipment and storage medium
CN114135992A (en) * 2021-12-02 2022-03-04 上海德衡数据科技有限公司 Air conditioner refrigeration method and system based on data center
CN115525804A (en) * 2022-09-23 2022-12-27 中电金信软件有限公司 Information query method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101072205A (en) * 2007-06-21 2007-11-14 腾讯科技(深圳)有限公司 Chat information searching method and system
CN102663044A (en) * 2012-03-28 2012-09-12 福建榕基软件股份有限公司 Method and device for creating search base and method and device for full-text search with authorities
US20130110768A1 (en) * 2011-10-31 2013-05-02 Fujitsu Limited Method for managing data, medium, and apparatus for managing data
CN107451208A (en) * 2017-07-12 2017-12-08 北京潘达互娱科技有限公司 A kind of data search method and device
CN107895037A (en) * 2017-11-28 2018-04-10 北京百度网讯科技有限公司 A kind of question and answer data processing method, device, equipment and computer-readable medium
CN108829858A (en) * 2018-06-22 2018-11-16 北京京东金融科技控股有限公司 Data query method, apparatus and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101072205A (en) * 2007-06-21 2007-11-14 腾讯科技(深圳)有限公司 Chat information searching method and system
US20130110768A1 (en) * 2011-10-31 2013-05-02 Fujitsu Limited Method for managing data, medium, and apparatus for managing data
CN102663044A (en) * 2012-03-28 2012-09-12 福建榕基软件股份有限公司 Method and device for creating search base and method and device for full-text search with authorities
CN107451208A (en) * 2017-07-12 2017-12-08 北京潘达互娱科技有限公司 A kind of data search method and device
CN107895037A (en) * 2017-11-28 2018-04-10 北京百度网讯科技有限公司 A kind of question and answer data processing method, device, equipment and computer-readable medium
CN108829858A (en) * 2018-06-22 2018-11-16 北京京东金融科技控股有限公司 Data query method, apparatus and computer readable storage medium

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111427870A (en) * 2020-04-15 2020-07-17 赞同科技股份有限公司 Resource management method, device and equipment
CN111427870B (en) * 2020-04-15 2023-09-05 赞同科技股份有限公司 Resource management method, device and equipment
CN111782653A (en) * 2020-06-30 2020-10-16 平安国际智慧城市科技股份有限公司 Data query method and device, electronic equipment and storage medium
CN112463798A (en) * 2020-12-08 2021-03-09 中国人寿保险股份有限公司 Cross-database data extraction method and device, electronic equipment and storage medium
CN112463798B (en) * 2020-12-08 2024-05-28 中国人寿保险股份有限公司 Cross-database data extraction method and device, electronic equipment and storage medium
CN112800179A (en) * 2021-02-02 2021-05-14 浙江公共安全技术研究院有限公司 Associated database query method and device, storage medium and electronic equipment
CN112800179B (en) * 2021-02-02 2022-02-15 浙江公共安全技术研究院有限公司 Associated database query method and device, storage medium and electronic equipment
CN113609335A (en) * 2021-08-12 2021-11-05 北京滴普科技有限公司 Target object searching method, system, electronic equipment and storage medium
CN114135992A (en) * 2021-12-02 2022-03-04 上海德衡数据科技有限公司 Air conditioner refrigeration method and system based on data center
CN115525804A (en) * 2022-09-23 2022-12-27 中电金信软件有限公司 Information query method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110674112A (en) Data query method and device and electronic equipment
CN108228270B (en) Starting resource loading method and device
CN108255382B (en) Method and device for recommending floating menu content
CN110780793B (en) Tree menu construction method and device, electronic equipment and storage medium
CN111177180A (en) Data query method and device and electronic equipment
CN112262556B (en) Model file management method and terminal equipment
CN110808872A (en) Method and device for realizing flow experiment and electronic equipment
CN111125307A (en) Chat record query method and electronic equipment
CN110659179A (en) Method and device for evaluating system running condition and electronic equipment
CN112231144A (en) Data processing method and device and electronic equipment
CN108846051A (en) Data processing method, device and computer readable storage medium
CN114115895A (en) Code query method and device, electronic equipment and storage medium
CN112650498B (en) Static library integration method and device, electronic equipment and storage medium
CN116167867A (en) Knowledge graph-based insurance business risk identification method and device and electronic equipment
CN115984643A (en) Model training method, related device and storage medium
CN112559532B (en) Data insertion method and device based on red and black trees and electronic equipment
CN115546516A (en) Personnel gathering method and device, computer equipment and storage medium
CN111666421B (en) Data processing method and device and electronic equipment
US11567822B2 (en) Method of monitoring closed system, apparatus thereof and monitoring device
CN111818548B (en) Data processing method, device and equipment
CN111901740A (en) Data processing method, device and equipment
CN114722970B (en) Multimedia detection method, device and storage medium
CN115412726B (en) Video authenticity detection method, device and storage medium
CN115525554B (en) Automatic test method, system and storage medium for model
CN116450808B (en) Data processing method and device and storage medium

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
CB02 Change of applicant information

Address after: 100081 No.101, 1st floor, building 14, 27 Jiancai Chengzhong Road, Haidian District, Beijing

Applicant after: Beijing PERCENT Technology Group Co.,Ltd.

Address before: 100081 16 / F, block a, Beichen Century Center, building 2, courtyard 8, Beichen West Road, Chaoyang District, Beijing

Applicant before: BEIJING BAIFENDIAN INFORMATION SCIENCE & TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20200110

RJ01 Rejection of invention patent application after publication