CN115129751A - Data query method and device, electronic equipment and storage medium - Google Patents

Data query method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115129751A
CN115129751A CN202210744480.7A CN202210744480A CN115129751A CN 115129751 A CN115129751 A CN 115129751A CN 202210744480 A CN202210744480 A CN 202210744480A CN 115129751 A CN115129751 A CN 115129751A
Authority
CN
China
Prior art keywords
data
node
query
target
area range
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
CN202210744480.7A
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.)
Hangzhou Dt Dream Technology Co Ltd
Original Assignee
Hangzhou Dt Dream 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 Hangzhou Dt Dream Technology Co Ltd filed Critical Hangzhou Dt Dream Technology Co Ltd
Priority to CN202210744480.7A priority Critical patent/CN115129751A/en
Publication of CN115129751A publication Critical patent/CN115129751A/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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • 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/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages

Landscapes

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

Abstract

The application provides a data query method, a data query device, electronic equipment and a storage medium. The data storage platform based on the DOA system comprises a plurality of data nodes for storing user data and a gateway node for initiating unified query; wherein the plurality of data nodes are deployed in different regional areas; the data nodes are respectively used for storing user data generated in corresponding area ranges; the method is applied to the gateway node; the method comprises the following steps: responding to a query request aiming at target user data of a target user, and acquiring a target area range to which the target user belongs; determining a first data node from the plurality of data nodes according to the corresponding relation between the data nodes stored in the gateway node and the area range; wherein, the area range corresponding to the first data node comprises the target area range; and initiating a data query aiming at the user data stored by the first data node to obtain the target user data.

Description

Data query method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of database technologies, and in particular, to a data query method and apparatus, an electronic device, and a storage medium.
Background
The Data Oriented Architecture (DOA) is built on a hardware Architecture of cloud computing, and by adopting the idea of 'Data Oriented and Data-Oriented core', Data can be uniformly defined, managed and provided with Data services through a Data Registry (DRC), a Data Authority Center (DAC) and a Data Exception Control Center (DEC), and various applications can be managed and serviced through Data Application Units (DAUs). Therefore, a data ecosystem for a data big platform and fragmented application is established, a whole set of mechanism from data protection to authorized application is established, and basic theory and method technical support are provided for effectively solving the problem of a software architecture in the big data era.
In practical application, when data query is performed based on a DOA system, since data is usually distributed on a plurality of data nodes, traversal query of all data nodes is required to obtain a corresponding query result, which results in a problem of low data query performance.
Disclosure of Invention
The application provides a data query method, a data storage platform based on a DOA system comprises a plurality of data nodes for storing user data and a gateway node for initiating unified query; wherein the plurality of data nodes are deployed in different regional areas; the data nodes are respectively used for storing user data generated in corresponding area ranges; the method is applied to the gateway node; the method comprises the following steps:
responding to a query request aiming at target user data of a target user, and acquiring a target area range to which the target user belongs;
determining a first data node from the plurality of data nodes according to the corresponding relation between the data nodes stored in the gateway node and the area range; wherein, the area range corresponding to the first data node comprises the target area range;
and initiating a data query aiming at the user data stored by the first data node to obtain the target user data.
Optionally, the obtaining a target area range to which a target user belongs in response to a query request for target user data of the target user includes:
responding to a query request aiming at target user data of a target user, and acquiring a target area range to which the target user belongs, wherein the target area range is carried in the query request; alternatively, the first and second electrodes may be,
responding to a query request for target user data of a target user initiated by a target application accessing the data storage platform, and sending an acquisition request for a target area range to which the target user belongs to the target application to obtain the target area range to which the target user belongs.
Optionally, the area range corresponding to the first data node includes the target area range and is the smallest.
Optionally, the method further includes:
determining a second data node from other data nodes than the first data node in case that the target user data is not obtained by initiating a data query for user data stored by the first data node; the area range corresponding to the second data node comprises the target area range and is larger than the area range corresponding to the first data node; or the area range corresponding to the second data node is adjacent to the target area range on the area;
and initiating a data query aiming at the user data stored by the second data node to obtain the target user data.
Optionally, the determining a second data node from other data nodes except the first data node includes:
determining a plurality of second data nodes from other data nodes except the first data node;
the initiating a data query for the user data stored by the second data node to obtain the target user data comprises:
and initiating data query aiming at the user data respectively stored by the plurality of second data nodes according to the sequence that the area ranges respectively corresponding to the plurality of second data nodes are from small to large so as to obtain the target user data.
Optionally, the initiating a data query for the user data stored in the first data node includes:
generating a data query statement corresponding to the query request;
sending the data query statement to the first data node so that the first data node executes the data query statement and feeds back an execution result of the data query statement; the execution result indicates a query result for the target user data among user data stored at the first data node;
and acquiring the execution result.
Optionally, the user data comprises health data indicative of a health condition of the user.
Optionally, the health data comprises data for generating a graphical code indicative of a health condition of the user.
The application also provides a data query device, wherein the data storage platform based on the DOA system comprises a plurality of data nodes for storing user data and a gateway node for initiating unified query; wherein the plurality of data nodes are deployed in different regional areas; the data nodes are respectively used for storing user data generated in corresponding area ranges; the device is applied to the gateway node; the device comprises:
the device comprises a first determining unit, a second determining unit and a third determining unit, wherein the first determining unit is used for responding to a query request aiming at target user data of a target user and acquiring a target area range to which the target user belongs;
a second determining unit, configured to determine a first data node from the multiple data nodes according to a correspondence between the data nodes stored in the gateway node and the area range; wherein, the area range corresponding to the first data node comprises the target area range;
and the query unit is used for initiating data query aiming at the user data stored in the first data node so as to obtain the target user data.
The application also provides an electronic device, which comprises a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are mutually connected through the bus;
the memory stores machine-readable instructions, and the processor executes the method by calling the machine-readable instructions.
The present application also provides a machine-readable storage medium having stored thereon machine-readable instructions which, when invoked and executed by a processor, implement the above-described method.
Through the technical scheme disclosed by the embodiment, on one hand, the gateway node initiates unified query aiming at the user data respectively stored by the plurality of data nodes, and can provide unified query entries for different applications accessed to the data storage platform, so that a data query interface is not required to be maintained for each application, the unification of the data query interfaces is realized, and the maintenance cost of the data query interfaces is reduced.
On the other hand, in response to a query request for target user data of a target user, a target area range to which the target user belongs can be acquired, a first data node of which a corresponding area range contains the target area range can be determined from a plurality of data nodes based on a corresponding relation between the data nodes and the area range stored in the gateway node, and then data query can be initiated for the user data stored in the first data node, so that data query can be performed only for the determined first data node, the loss of traversing query for all data nodes can be avoided, accurate query is realized, the data query efficiency is improved, and the data query performance is optimized.
Drawings
FIG. 1 is an architectural diagram illustrating an exemplary embodiment of a DOA architecture-based data storage platform;
FIG. 2 is a flow diagram of a method for data querying in accordance with an exemplary embodiment;
FIG. 3 is a hardware block diagram of an electronic device in which a data query device is located in an exemplary embodiment;
FIG. 4 is a block diagram of a data querying device, in accordance with an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present specification, the following briefly describes the relevant technologies of DOA systems related to the embodiments of the present specification.
The Data Oriented Architecture (DOA) is built on a hardware Architecture of cloud computing, and by adopting the idea of 'Data Oriented and Data-Oriented core', Data can be uniformly defined, managed and provided with Data services through a Data Registry (DRC), a Data Authority Center (DAC) and a Data Exception Control Center (DEC), and various applications can be managed and serviced through Data Application Units (DAUs). Therefore, a data ecosystem of a data big platform and fragmented application is established, a whole set of mechanism from data protection to authorized application is established, and basic theory and method technical support are provided for effectively solving the problem of a software architecture in the big data era.
The Data Registration Center (DRC) is a core component of the DOA, and can register and register various types of data and generalized data to form a logical data resource pool, which facilitates access of applications to the data. In practical applications, DRCs can be designed according to a unified standard, interconnecting and correlating DRCs of various industries or different scales, thereby forming a larger scale DOA system. The functions of DRC may specifically include, but are not limited to: data registration information definition, data attribute information, data classification, metadata standard, metadata classification, registration methods of different types of data, data index, metadata index, data retrieval, generalized data pattern recognition, distributed deployment, data registration content on-demand adaptive mechanism, data generation automatic registration mechanism, historical data registration and management and the like.
A Data Authority Center (DAC) is a key component of the DOA and can conduct authority management on safe storage, transmission and application authorization of data. By implementing a mechanism of 'natural encryption and authorized use' on data, the data can be divided into a 'data state' which is kept encrypted when being stored and transmitted and an 'application state' which is decrypted when being authorized to use in an application, so that the safety and the authorization of use of the data can be fully ensured. The DAC functions may specifically include, but are not limited to: data security attribute definition, data validity authentication, data access authority definition, user authority authentication, application authorization, user authorization, data authorization and PKI (Public Key Infrastructure), accounting algorithm and mechanism, data transparent encryption and decryption mechanism, high-efficiency data encryption and decryption algorithm, and the like.
The data anomaly control center (DEC) is an important component of DOA, can process data consistency when data redundancy exists in a distributed environment, and is also a main component of a data ecosystem. The functions of the DEC may specifically include, but are not limited to: data maintenance, adaptive management, anomaly detection and processing, routing inspection, anomaly and conflict discovery, synchronous processing, redundancy processing, load balancing, and the like.
Data Application Units (DAUs), which are key components of the DOAs, are a series of Application unit modules above a data resource pool, and can be called by a building block mode and an Application Programming Interface (API) similar to a component-based software development model (COA) for Application management and services to 'data-driven Application', so as to quickly meet various Application function requirements of users. Depending on the actual requirements of various applications, the functions of the DAUs may specifically include, but are not limited to: data Function units (DFU, Data Function Unit) providing different functions according to different Data types, Data Service units (DSU, Data Service Unit) providing services in a push mode, Data Encryption and decryption units (DEU, Data Encryption Unit), Data authorization and Invocation units (DIU, Data Invocation Unit), Data application Combination units (DCU, Data composition Unit), Data Visualization units (DVU, Data Visualization Unit), Data Processing units (DPU, Data Processing Unit), and the like.
In practical application, when data query is performed based on a DOA system, since data is usually distributed on a plurality of data nodes, traversal query of all data nodes is required to obtain a corresponding query result, which results in a problem of low data query performance.
In view of this, the present specification aims to provide a technical solution for determining a data node that preferentially initiates a data query from each data node by matching an area range corresponding to each data node with a target area range to which a target user belongs.
When implemented, a DOA architecture-based data storage platform may comprise: the system comprises a plurality of data nodes for storing user data and a gateway node for initiating unified query; wherein the plurality of data nodes can be deployed in different regional areas; the plurality of data nodes may be respectively configured to store user data generated in a corresponding area range.
When the method is implemented, the gateway node responds to a query request aiming at target user data of a target user, and can acquire a target area range to which the target user belongs; further, according to the corresponding relationship between the data nodes stored in the gateway node and the area range, a first data node can be determined from the plurality of data nodes; the area range corresponding to the first data node comprises the target area range; further, a data query may be initiated against the user data stored by the first data node to obtain the target user data.
Therefore, in the technical solution in this specification, on one hand, a uniform query is initiated by the gateway node for the user data stored by the multiple data nodes, and a same query entry can be provided for different applications accessing the data storage platform, so that it is not necessary to maintain a data query interface for each application, thereby implementing the uniformity of the data query interfaces and reducing the maintenance cost of the data query interfaces.
On the other hand, in response to a query request for target user data of a target user, a target area range to which the target user belongs can be acquired, a first data node of which a corresponding area range includes the target area range can be determined from a plurality of data nodes based on a corresponding relationship between the data nodes and the area range stored in the gateway node, and then data query can be initiated for the user data stored in the first data node, so that data query can be performed only for the determined first data node, the loss of traversing query for all data nodes can be avoided, accurate query is realized, the data query efficiency is improved, and the data query performance is optimized.
The present application is described below with reference to specific embodiments and specific application scenarios.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an architecture of a data storage platform based on a DOA architecture according to an exemplary embodiment.
In this specification, the data storage platform based on the DOA system may include: the system comprises a plurality of data nodes for storing user data and a gateway node for initiating a unified query. Wherein the plurality of data nodes can be deployed in different regional areas; the plurality of data nodes may be respectively configured to store user data generated in a corresponding area range.
The gateway node initiating the unified query can also be called a unified query node; the gateway node may be configured to initiate a data query for user data stored by the plurality of data nodes, respectively.
It should be noted that, regarding the dividing manner of the area range, a person skilled in the art may flexibly set the dividing manner according to requirements, and no special limitation is made in this specification. For example, different regional areas can be divided according to administrative areas (such as provinces, cities, districts and the like). For another example, a plurality of grid regions may be divided into different region ranges according to the longitude and latitude coordinates.
For example, as shown in FIG. 1, a DOA architecture-based data storage platform may comprise: primary data node 110, secondary data node 120, secondary data node 121, and gateway node 130. The primary data node 110, the secondary data node 120, and the secondary data node 121 may be respectively deployed in province a, city a of province a, city b of province a, and may be respectively used to store user data generated in area ranges corresponding to city a, city b of province a; the primary data node 110, which is a data node superior to the secondary data node 120 and the secondary data node 121, may perform data communication with the secondary data node. The gateway node 130 may be configured to initiate a unified query for user data stored in the primary data node 110, the secondary data node 120, and the secondary data node 121, respectively.
It should be noted that fig. 1 is only an exemplary architecture diagram, which exemplarily shows two levels of data nodes and one or more data nodes in each level of data nodes, and does not represent a specific limitation to this specification; in practical applications, the plurality of data nodes included in the data storage platform may be divided into any number of levels, and each level of data nodes may include any number of data nodes, which cannot be shown in fig. 1 one by one.
The process of storing the user data generated in the corresponding area range by each data node may specifically include: the data node performs data registration, data storage, data management, and the like through DRC, and provides an access path of user data stored by the data node through DAC, and the like. When the data node issues the external data service, the data node may also issue an area range corresponding to the data node, so that the gateway node may store and maintain a corresponding relationship between the data node and the area range.
In one embodiment, the user data may specifically include health data indicating a health condition of the user.
For example, the user data may specifically include but is not limited to: the disease detection result of the user, the physical examination report of the user, the trip record of the user, and the like. On this basis, the user data generated in the area range corresponding to the secondary data node 120, that is, the detection result obtained by the user performing disease detection in city a, the physical examination report obtained by the user performing physical examination in city a, the travel record of the user in city a, and the like.
In one possible embodiment, in order to prove the health condition of the user to other people while protecting the privacy of the user, a graphic code for indicating the health condition of the user can be generated according to the health data of the user; further, the user may present the generated graphical code indicating that the user's health condition is good to others as proof, who may also scan the graphical code presented by the user to obtain the user's health data. In implementation, the health data may specifically include: for generating graphically encoded data indicative of a health condition of a user.
For example, the health data of the user may be data for generating a "health code" indicating a disease detection result, data for generating a "travel card" indicating a travel record of the user, and the like. It should be noted that, regarding the concrete representation form of the graphic code, those skilled in the art can flexibly set, for example: two-dimensional codes, bar codes, icons with different appearances, and the like, and the description is not limited.
Referring to fig. 2, fig. 2 is a flowchart illustrating a data query method according to an exemplary embodiment. The data query method provided by the present specification can be applied to the gateway node shown in fig. 1. In order to make those skilled in the art better understand the technical solutions in the embodiments of the present disclosure, the embodiments of the present disclosure are described below with reference to the schematic architecture diagram shown in fig. 1.
The data query method may perform the following steps:
step 202: responding to a query request aiming at target user data of a target user, and acquiring a target area range to which the target user belongs;
step 204: determining a first data node from a plurality of data nodes according to the corresponding relation between the data nodes stored in the gateway node and the area range; wherein, the area range corresponding to the first data node comprises the target area range;
step 206: and initiating a data query aiming at the user data stored by the first data node to obtain the target user data.
In this specification, the query request may include a query request initiated by a target application accessing the data storage platform; the target application can be any application accessing the data storage platform based on the DOA system.
For example, as shown in fig. 1, the applications 140 and 141 accessing the data storage platform based on the DOA architecture may be communicatively connected to the gateway node 130, and may further initiate a query request for user data stored in each data node to the gateway node 130.
Wherein, users in different area scopes can initiate query requests through different applications. For example, users in the area range corresponding to province a may initiate a query request for user data stored in each data node through the application 140, and users in the area range corresponding to province B may initiate a query request for user data stored in each data node through the application 141.
In this specification, in response to a query request for target user data of a target user, the gateway node may acquire a target area range to which the target user belongs.
For example, in response to a query request initiated by the application 140 for target user data of a target user, the gateway node may determine that the area scope to which the target user belongs is "1 district a, province a city.
The query request for the target user data of the target user may indicate the target user to be queried and may also indicate the target user data to be queried. For example, the query request may carry a user identifier (e.g., a user ID, an identification number, a phone number, etc.) of the target user, and may also carry data (e.g., a disease detection result, a trip record, etc.) of the target user.
The process of acquiring the target area range to which the target user belongs may specifically include: determining a target area range corresponding to the real-time position information of the target user according to the real-time position information of the target user; or, determining a target area range corresponding to the attribution information of the target user according to the attribution information of the target user maintained by the target application; or determining a target area range corresponding to the motion trail of the user according to the motion trail of the target user. It should be noted that, according to different service requirements, a person skilled in the art may flexibly set a specific implementation manner for determining a target area range to which a target user belongs, so as to improve the query efficiency of user data for the target user.
For example, in a scene where the user does not travel far away, the area range where the user data of the user is generated may be generally in an inclusion relationship with the area range to which the user currently belongs; therefore, the area range corresponding to the real-time position information of the target user is determined as the target area range to which the target user belongs, and the query efficiency of the target user data of the target user can be improved. Specifically, the real-time location information of the target user may be determined through GPS positioning, and an area range corresponding to the real-time location information may be determined as a target area range to which the target user belongs.
For another example, in a scenario where a user who resides in a home location may move to another area range, the user may not yet generate user data in the moved area range, that is, the user data may not yet be generated in an area range corresponding to the real-time location information of the user; therefore, according to the attribution information of the registered user maintained by the target application, the area range corresponding to the attribution information of the target user can be determined as the target area range to which the target user belongs, and therefore the query efficiency of the target user data of the target user is improved. It should be noted that, in practical applications, before initiating a data query to the gateway node through a target application, the target user may register the target application; the target application can provide data query service for the registered user, can also perform authority management on the registered user, and can also maintain the corresponding relationship between the registered user and the attribution information of the user. The attribution information of the user may be provided by the user during the process of registering the target application, or the target application may be determined according to a communication operator, a real-time location of the user during registration, and the like, which is not limited in this specification.
For another example, the MAC address of the mobile terminal may be acquired by using a device such as a base station or a local area network gateway that communicates with the mobile terminal owned by the user, and the position information and the trajectory of the mobile terminal may be determined according to the MAC address of the mobile terminal to determine the motion trajectory of the target user, and further determine the target area range corresponding to the motion trajectory of the target user.
For another example, the data storage platform may obtain a signaling corresponding to the target user from a docked signaling library, and generate a signaling trajectory corresponding to the target user; further, a target area range corresponding to the signaling track of the target user may be determined according to the signaling track corresponding to the target user. The signaling library can comprise a database for storing the signaling reported by the mobile terminal; the signaling may be a signaling sent in a process of communication between a mobile terminal held by the target user and an accessed operator network; the signaling can include information such as user identification, reporting time, terminal position and the like; the user identification can be used for uniquely identifying the identity of a user holding the mobile terminal; the terminal position can be used for representing the geographical position information of the mobile terminal; the reporting time may be used to characterize a time at which the mobile terminal reports the terminal location. For a specific implementation manner of generating a signaling track corresponding to a user, please refer to related technologies, which is not described herein again.
In an embodiment shown, in order to improve the query efficiency, the query request may carry a target area range to which the target user belongs, so that the gateway node may directly determine the target area range to which the target user belongs. In implementation, the process of obtaining the target area range to which the target user belongs in response to the query request for the target user data of the target user may specifically include: responding to a query request aiming at target user data of a target user, and acquiring a target area range to which the target user belongs, wherein the target area range is carried in the query request.
For example, a query request for target user data of a target user initiated by the application 140 carries a target area range to which the target user belongs; in response to the query request, the gateway node may directly determine that the target area range to which the target user belongs is "1 district a city, province a").
In another embodiment shown, if the query request does not carry the target area range to which the target user belongs, the gateway node may request the target application to acquire the target area range to which the user belongs. In implementation, the process of obtaining the target area range to which the target user belongs in response to the query request for the target user data of the target user may specifically include: responding to a query request for target user data of a target user initiated by a target application accessing the data storage platform, and sending an acquisition request for a target area range to which the target user belongs to the target application to obtain the target area range to which the target user belongs.
For example, the query request for the target user data of the target user initiated by the application 140 does not carry the target area range to which the target user belongs; in response to the query request, the gateway node may send an acquisition request for a target area range to which the target user belongs to the application 140; so that the application 140 provides the gateway node 130 with the target area range to which the target user belongs in response to the acquisition request; and the gateway node 130 may obtain the target area range to which the target user belongs.
It should be noted that, in the above illustrated embodiment, a person skilled in the art does not need to perform function upgrade on each application accessing the gateway node, so that each application can provide a target area range to which the target user belongs while sending a query request to the gateway node; the target area range of the target user can be obtained only by applying the data query method on the gateway node, so that accurate query can be realized subsequently according to the target area range of the target user, and the maintenance cost is reduced.
In addition, when the gateway node requests the target application to acquire the home location information or the real-time location information of the target user, the gateway node may first request the target user to authorize the target application to provide the home location information or the real-time location information of the target user for the data storage platform, so as to improve user experience.
In this specification, after obtaining a target area range to which the target user belongs, the gateway node may determine a first data node from the plurality of data nodes according to a correspondence between stored data nodes and the area range; and the area range corresponding to the first data node comprises the target area range.
The area range corresponding to the first data node includes the target area range, and may include that the area range corresponding to the first data node is the same as the target area range, and/or the area range corresponding to the first data node is larger than the target area range.
For example, the gateway node 130 may store and maintain the correspondence between the data nodes and the area coverage, specifically, store the correspondence between the data nodes and the area coverage through a data table as shown in table 1,
data node Region scope to which user data stored in data node belongs
Primary data node 110 A province
Secondary data node 120 City of A province
Secondary data node 121 B city, A province
…… ……
TABLE 1
After determining that the target area range to which the target user belongs is "1 district a city, province a", the gateway node 130 may determine, from all the data nodes, a first data node whose corresponding area range includes the target area range according to the corresponding relationship shown in table 1. Wherein the first data node may comprise at least one data node; in one possible example, the first data node may be determined to include a primary data node 110 and a secondary data node 120.
In an embodiment shown in the present invention, the determining, according to the correspondence between the data node and the area range stored in the gateway node, a first data node from the plurality of data nodes may specifically include: and according to the corresponding relation between the data nodes and the area range stored in the gateway node, determining at least one data node of which the corresponding area range contains the target area range from the plurality of data nodes, and determining the data node with the smallest corresponding area range from the at least one data node as the first data node.
For example, after determining that the target area range to which the target user belongs is "1 district a city, province a", according to the correspondence between the data nodes and the area ranges stored by the gateway node 130 as shown in table 1, at least one data node, which has a corresponding area range including the target area range, may be determined from the plurality of data nodes as the primary data node 110 and the secondary data node 120; further, the data node with the smallest corresponding area range, that is, the secondary data node 120, may be determined as the first data node from the at least one data node.
It should be noted that, in the above illustrated embodiment, in response to a query request for target user data of the target user, a target area range to which the target user belongs may be acquired, and based on a correspondence relationship between data nodes and area ranges stored in a gateway node, one data node, from among a plurality of data nodes, of which the corresponding area range includes the target area range and the corresponding area range is the smallest may be determined as a first data node, and then a data query may be initiated for the user data stored in the first data node. Therefore, data query can be performed only for the determined first data node, accurate query is achieved, data query efficiency is further improved, and data query performance is optimized.
In this specification, after determining the first data node from the plurality of data nodes, the gateway node may initiate a data query with respect to the user data stored in the first data node to obtain the target user data of the target user.
For example, after determining that the first data node is the secondary data node 120, the gateway node 130 may initiate a data query for the user data stored by the secondary data node 120 to obtain the target user data for the target user.
In an embodiment shown, the process of initiating a data query for the user data stored in the first data node may specifically include: generating a data query statement corresponding to the query request; sending the data query statement to the first data node so that the first data node executes the data query statement and feeds back an execution result of the data query statement; the execution result indicates a query result for the target user data among user data stored at the first data node; and acquiring the execution result.
For example, after determining that the first data node is the secondary data node 120, the gateway node 130 may generate a data query statement corresponding to the query request (e.g., an SQL query statement for querying a disease detection result of the target user) according to the target user indicated by the query request, the target user data, and the like; further, the gateway node 130 may send the generated data query statement to the secondary data node 120, so that the secondary data node 120 executes the data query statement and feeds back an execution result of the data query statement; further, the gateway node 130 may obtain an execution result of the data query statement by the secondary data node 120, that is, may obtain a query result of initiating a data query with respect to the user data stored by the secondary data node 120.
It should be noted that, in the above illustrated embodiment, the gateway node only needs to generate the data query statement corresponding to the query request, and call the corresponding data node to execute the data query statement, so as to obtain the execution result of the data query statement returned by the data node, and the data query statement does not need to be executed by the gateway node, so that in a scenario of high concurrent query, a performance bottleneck of the gateway node (that is, a uniform query interface) can be avoided.
In another illustrated embodiment, the gateway node may send a query keyword corresponding to the query request to the first data node, so that the first data node generates a corresponding data query statement based on the query keyword, executes the data query statement, and feeds back an execution result of the data query statement.
For a specific implementation manner of generating the data query statement, please refer to related technologies, which are not described herein again.
In one illustrated embodiment, after initiating a data query for user data stored by the first data node, the method may further comprise: in the event that a data query is initiated for user data stored by the first data node and the target user data is obtained, the target user data may be sent to the target application.
For example, after determining that the first data node is the secondary data node 120, the gateway node 130 may initiate a data query for user data stored by the secondary data node 120; if the target user data of the target user is found in the user data stored in the secondary data node 120, the gateway node 130 may send the target user data to the target application 140 as a query response corresponding to the query request.
In another illustrated embodiment, after initiating a data query for user data stored by the first data node, the method may further comprise: determining a second data node from other data nodes except the first data node under the condition that the target user data is not obtained by initiating a data query aiming at the user data stored by the first data node; and initiating a data query aiming at the user data stored by the second data node to obtain the target user data.
For example, after determining that the first data node is the secondary data node 120, the gateway node 130 may initiate a data query for user data stored by the secondary data node 120; if the target user data of the target user is not found in the user data stored in the secondary data node 120, the gateway node 130 may determine a plurality of second data nodes from other data nodes except the secondary data node 120, and sequentially initiate data queries for the user data stored in each of the plurality of second data nodes according to a sequence from small to large of the area ranges corresponding to the plurality of second data nodes, so as to obtain the target user data of the target user.
A specific implementation manner of the gateway node initiating the data query for the user data stored in the second data node is similar to a specific implementation manner of the gateway node initiating the data query for the user data stored in the first data node, please refer to the above embodiment, and details are not described herein again.
The specific implementation manner of determining the second data node from the other data nodes except the first data node can be flexibly set according to different requirements, and several exemplary implementation manners are provided as follows:
(1) in one possible embodiment, the area range corresponding to the second data node includes the target area range and is larger than the area range corresponding to the first data node.
For example, after determining that the target area range to which the target user belongs is "1 district a city, province a", according to the correspondence between the data nodes and the area ranges stored by the gateway node 130 as shown in table 1, at least one data node, which has a corresponding area range including the target area range, may be determined from the plurality of data nodes as the primary data node 110 and the secondary data node 120; further, one of the at least one data node having the smallest corresponding area range, that is, the secondary data node 120, may be determined as the first data node, and the other data nodes except the first data node, that is, the primary data node 110, may be determined as the second data node; in the event that the target user data is not obtained for the user data initiation data query stored for the first data node, the data query may continue to be initiated for the user data stored for the second data node to obtain the target user data.
It should be noted that, in the above illustrated embodiment, in response to a query request for target user data of the target user, according to a target area range to which the target user belongs and a correspondence between data nodes and area ranges stored in a gateway node, determining, as a first data node, one data node, from among a plurality of data nodes, that includes the target area range in a corresponding area range and has a smallest corresponding area range, and then initiating a data query for the user data stored in the first data node; further, if the target user data of the target user is not found in the user data stored in the first data node with the highest search priority, the area range of the data query may be expanded, that is, the data query may be initiated for the user data stored in the second data node whose corresponding area range includes the target area range and is greater than the area range corresponding to the first data node. Therefore, the data query range can be gradually expanded as required, so that the improvement of the data query efficiency and the saving of data query loss are both considered, and the improvement of the data query performance is realized.
(2) In another possible embodiment, the area scope corresponding to the second data node is adjacent to the target area scope in area.
For example, in a scenario where a target user travels from city a, province b to city a, province a, which is adjacent in the area, the target user has previously generated user data in city a, province b, and stored in the corresponding secondary data node 121, and the target user may not have generated user data yet in city a, province a; in response to a query request for target user data of the target user, it may be determined that a target area range to which the target user belongs is "1 district a city, province a", and according to a correspondence between data nodes and area ranges stored by the gateway node 130 as shown in table 1, the secondary data node 120 may be determined to be a first data node from the plurality of data nodes, and then a data query may be initiated for the user data stored by the secondary data node 120; if the target user data of the target user is not found in the user data stored in the secondary data node 120, the gateway node 130 may further regard at least one data node (e.g., the secondary data node 121) having a corresponding area range and an area adjacent to the target area range as the second data node, and initiate a data query for the user data stored in the second data node (e.g., the secondary data node 121) to obtain the target user data.
It should be noted that, in the above illustrated embodiment, in response to a query request for target user data of the target user, according to a target area range to which the target user belongs and a correspondence between data nodes and area ranges stored in a gateway node, determining, as a first data node, one data node, from among a plurality of data nodes, that includes the target area range in a corresponding area range and has a smallest corresponding area range, and then initiating a data query for the user data stored in the first data node; further, if the user data of the target user is not found in the user data stored in the first data node with the highest search priority, the area range of the data query may be expanded, that is, the data query may be initiated for the user data stored in the second data node whose corresponding area range is adjacent to the target area range in the area. Therefore, the data query range can be gradually expanded as required, and the improvement of the data query efficiency and the saving of the data query loss are both considered.
In addition, it should be noted that, especially in a scenario where the target user may travel a short distance across an area, data query loss may be further reduced, and data query performance may be improved. For example, in the above illustrated embodiment, in the case that the target user data is not obtained when initiating the data query for the secondary data node 120, since the data amount of the user data stored by the secondary data node is generally smaller than the data amount of the user data stored by the primary data node, compared with directly determining the primary data node 110 as the second data node, the secondary data node 121 adjacent to the corresponding area range on the area is determined as the second data node first, obviously, the data query loss can be saved, and the data query efficiency is improved.
According to the technical scheme, on one hand, the gateway node initiates unified query aiming at the user data respectively stored by the plurality of data nodes, and can provide the same query entry for different applications accessed to the data storage platform, so that a data query interface is not required to be maintained for each application, the unification of the data query interfaces is realized, and the maintenance cost of the data query interfaces is reduced.
On the other hand, in response to a query request for target user data of a target user, a target area range to which the target user belongs can be acquired, a first data node of which a corresponding area range contains the target area range can be determined from a plurality of data nodes based on a corresponding relation between the data nodes and the area range stored in the gateway node, and then data query can be initiated for the user data stored in the first data node, so that data query can be performed only for the determined first data node, the loss of traversing query for all data nodes can be avoided, accurate query is realized, the data query efficiency is improved, and the data query performance is optimized.
The present specification also provides an embodiment of a data query apparatus, corresponding to the above-described embodiment of the data query method.
Referring to fig. 3, fig. 3 is a hardware structure diagram of an electronic device in which a data query device is located according to an exemplary embodiment. At the hardware level, the device includes a processor 302, an internal bus 304, a network interface 306, a memory 308, and a non-volatile memory 310, although it may include hardware required for other services. One or more embodiments of the present description may be implemented in software, such as by processor 302 reading a corresponding computer program from non-volatile storage 310 into memory 308 and then executing. Of course, besides software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 4, fig. 4 is a block diagram of a data query device according to an exemplary embodiment. The data query device can be applied to the electronic device shown in fig. 3 to implement the technical solution of the present specification. The data storage platform based on the DOA system comprises a plurality of data nodes for storing user data and a gateway node for initiating unified query; wherein the plurality of data nodes are deployed in different regional areas; the data nodes are respectively used for storing user data generated in corresponding area ranges; the device is applied to the gateway node; the data querying device may include:
a first determining unit 402, configured to, in response to a query request for target user data of a target user, obtain a target area range to which the target user belongs;
a second determining unit 404, configured to determine a first data node from the multiple data nodes according to a correspondence between the data nodes stored in the gateway node and the area range; wherein, the area range corresponding to the first data node comprises the target area range;
a querying unit 406, configured to initiate a data query for the user data stored in the first data node to obtain the target user data.
In this embodiment, the first determining unit 402 is specifically configured to:
responding to a query request aiming at target user data of a target user, and acquiring a target area range to which the target user belongs, wherein the target area range is carried in the query request; alternatively, the first and second liquid crystal display panels may be,
responding to a query request for target user data of a target user initiated by a target application accessing the data storage platform, and sending an acquisition request for a target area range to which the target user belongs to the target application to obtain the target area range to which the target user belongs.
In this embodiment, the area range corresponding to the first data node includes the target area range and is the smallest.
In this embodiment, the apparatus further includes:
a third determining unit, configured to determine a second data node from other data nodes except the first data node if the target user data is not obtained by initiating a data query for the user data stored in the first data node; the area range corresponding to the second data node comprises the target area range and is larger than the area range corresponding to the first data node; or the area range corresponding to the second data node is adjacent to the target area range on the area;
the querying unit 406 is further configured to initiate a data query for the user data stored in the second data node to obtain the target user data.
In this embodiment, the third determining unit is specifically configured to:
determining a plurality of second data nodes from other data nodes except the first data node;
the querying unit 406 is specifically configured to:
and initiating data query aiming at the user data respectively stored by the plurality of second data nodes according to the sequence that the area ranges respectively corresponding to the plurality of second data nodes are from small to large so as to obtain the target user data.
In this embodiment, the querying unit 406 is specifically configured to:
generating a data query statement corresponding to the query request;
sending the data query statement to the first data node so that the first data node executes the data query statement and feeds back an execution result of the data query statement; the execution result indicates a query result for the target user data among user data stored at the first data node;
and acquiring the execution result.
In this embodiment, the user data comprises health data indicative of a health condition of the user.
In this embodiment, the health data comprises data for generating a graphical code indicative of the health condition of the user.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiment, since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment for relevant points. The above-described embodiments of the apparatus are only illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
The systems, apparatuses, modules or units described in the above embodiments may be specifically implemented by a computer chip or an entity, or implemented by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer 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 disk storage, quantum memory, graphene-based storage media 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, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
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.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The above description is intended only to be exemplary of the one or more embodiments of the present disclosure, and should not be taken as limiting the one or more embodiments of the present disclosure, as any modifications, equivalents, improvements, etc. that come within the spirit and scope of the one or more embodiments of the present disclosure are intended to be included within the scope of the one or more embodiments of the present disclosure.

Claims (11)

1. A data query method is characterized in that a data storage platform based on a DOA system comprises a plurality of data nodes for storing user data and a gateway node for initiating unified query; wherein the plurality of data nodes are deployed in different regional areas; the data nodes are respectively used for storing user data generated in corresponding area ranges; the method is applied to the gateway node; the method comprises the following steps:
responding to a query request aiming at target user data of a target user, and acquiring a target area range to which the target user belongs;
determining a first data node from the plurality of data nodes according to the corresponding relation between the data nodes stored in the gateway node and the area range; wherein, the area range corresponding to the first data node comprises the target area range;
and initiating a data query aiming at the user data stored by the first data node to obtain the target user data.
2. The method according to claim 1, wherein the obtaining the target area range to which the target user belongs in response to the query request for the target user data of the target user comprises:
responding to a query request aiming at target user data of a target user, and acquiring a target area range to which the target user belongs, wherein the target area range is carried in the query request; alternatively, the first and second electrodes may be,
responding to a query request for target user data of a target user initiated by a target application accessing the data storage platform, and sending an acquisition request for a target area range to which the target user belongs to the target application to obtain the target area range to which the target user belongs.
3. The method of claim 1, wherein the area scope corresponding to the first data node comprises the target area scope and is minimal.
4. The method of claim 3, further comprising:
determining a second data node from other data nodes than the first data node in case that the target user data is not obtained by initiating a data query for user data stored by the first data node; the area range corresponding to the second data node comprises the target area range and is larger than the area range corresponding to the first data node; or the area range corresponding to the second data node is adjacent to the target area range in area;
and initiating a data query aiming at the user data stored by the second data node to obtain the target user data.
5. The method of claim 4, wherein determining the second data node from the data nodes other than the first data node comprises:
determining a plurality of second data nodes from other data nodes except the first data node;
the initiating a data query for the user data stored by the second data node to obtain the target user data comprises:
and initiating data query aiming at the user data respectively stored by the plurality of second data nodes according to the sequence that the area ranges respectively corresponding to the plurality of second data nodes are from small to large so as to obtain the target user data.
6. The method of claim 1, wherein the initiating a data query for user data stored by the first data node comprises:
generating a data query statement corresponding to the query request;
sending the data query statement to the first data node so that the first data node executes the data query statement and feeds back an execution result of the data query statement; the execution result indicates a query result for the target user data among user data stored at the first data node;
and acquiring the execution result.
7. The method of claim 1, wherein the user data comprises health data indicative of a health condition of the user.
8. The method of claim 7, wherein the health data comprises data used to generate a graphical code indicative of a health condition of the user.
9. A data query device is characterized in that a data storage platform based on a DOA system comprises a plurality of data nodes for storing user data and a gateway node for initiating unified query; wherein the plurality of data nodes are deployed in different regional areas; the data nodes are respectively used for storing user data generated in corresponding area ranges; the device is applied to the gateway node; the device comprises:
the device comprises a first determining unit, a second determining unit and a third determining unit, wherein the first determining unit is used for responding to a query request aiming at target user data of a target user and acquiring a target area range to which the target user belongs;
a second determining unit, configured to determine a first data node from the multiple data nodes according to a correspondence between the data nodes stored in the gateway node and the area range; wherein, the area range corresponding to the first data node comprises the target area range;
and the query unit is used for initiating data query aiming at the user data stored in the first data node so as to obtain the target user data.
10. An electronic device is characterized by comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are connected with each other through the bus;
the memory has stored therein machine-readable instructions, which the processor executes by calling to perform the method of any one of claims 1 to 8.
11. A machine-readable storage medium having stored thereon machine-readable instructions which, when invoked and executed by a processor, carry out the method of any of claims 1 to 8.
CN202210744480.7A 2022-06-27 2022-06-27 Data query method and device, electronic equipment and storage medium Pending CN115129751A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210744480.7A CN115129751A (en) 2022-06-27 2022-06-27 Data query method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210744480.7A CN115129751A (en) 2022-06-27 2022-06-27 Data query method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115129751A true CN115129751A (en) 2022-09-30

Family

ID=83379645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210744480.7A Pending CN115129751A (en) 2022-06-27 2022-06-27 Data query method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115129751A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117407578A (en) * 2023-12-15 2024-01-16 南京飓风引擎信息技术有限公司 Decentralized cloud resource data retrieval system and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117407578A (en) * 2023-12-15 2024-01-16 南京飓风引擎信息技术有限公司 Decentralized cloud resource data retrieval system and method
CN117407578B (en) * 2023-12-15 2024-02-23 南京飓风引擎信息技术有限公司 Decentralized cloud resource data retrieval system and method

Similar Documents

Publication Publication Date Title
CN110020902B (en) Cross-link certificate storage method, access method, device and electronic equipment
US9344993B2 (en) Location verification
US9305019B2 (en) Method of associating user related data with spatial hierarchy identifiers for efficient location-based processing
RU2704750C2 (en) Mobile device identification systems and methods
TWI662426B (en) Method and device for distributed stream data processing
Victor et al. Geofences on the blockchain: Enabling decentralized location-based services
CN104581625A (en) Position privacy protection method and system based on particle size control
WO2021254261A1 (en) Device positioning method and apparatus
CN111815454B (en) Data uplink method and device, electronic equipment and storage medium
CN104080081A (en) Space anonymization method suitable for mobile terminal position privacy protection
CN107567071B (en) Method and equipment for inquiring wireless hotspot
US9501669B2 (en) Method and apparatus for location-based recovery of stolen mobile devices
CN115129751A (en) Data query method and device, electronic equipment and storage medium
JP5863255B2 (en) Mobile terminal device, control method for mobile terminal device, and program
CN112906064B (en) Method and device for generating description information
US9832605B1 (en) Location based services for exigent circumstances
CN113194143A (en) Block chain account creating method and device and electronic equipment
US20160147838A1 (en) Receiving node, data management system, data management method and strage medium
KR20160066661A (en) Method and system for achieving anonymity in location based services
CN111460057B (en) POI (Point of interest) coordinate determining method, device and equipment
US8554757B2 (en) Determining a score for a product based on a location of the product
CN116010677B (en) Spatial index method and device and electronic equipment thereof
CN110674843A (en) Method and system for generating parking lot entity
CN116963274B (en) Bluetooth AOA (automated optical inspection) based indoor positioning method and system
CN111274272B (en) Object searching method and device and computer system

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