CN107153688A - A kind of data query method, equipment and computer-readable storage medium - Google Patents

A kind of data query method, equipment and computer-readable storage medium Download PDF

Info

Publication number
CN107153688A
CN107153688A CN201710286485.9A CN201710286485A CN107153688A CN 107153688 A CN107153688 A CN 107153688A CN 201710286485 A CN201710286485 A CN 201710286485A CN 107153688 A CN107153688 A CN 107153688A
Authority
CN
China
Prior art keywords
application
data
data query
namespace
request message
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.)
Granted
Application number
CN201710286485.9A
Other languages
Chinese (zh)
Other versions
CN107153688B (en
Inventor
陈奇川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201710286485.9A priority Critical patent/CN107153688B/en
Publication of CN107153688A publication Critical patent/CN107153688A/en
Application granted granted Critical
Publication of CN107153688B publication Critical patent/CN107153688B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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

Landscapes

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

Abstract

The embodiment of the present invention provides a kind of data query method, including:The data inquiry request message that receiving terminal is sent based on application, the corresponding NameSpace of the application is determined according to the data inquiry request message;Data are obtained based on the view being pre-created in the NameSpace;The embodiment of the present invention also provides a kind of data query equipment and computer-readable storage medium.In this way, by the way that the same type data of a variety of applications are preserved to a public sheet to collect, mining data when, the isolation of data between each application can be effectively realized.

Description

Data query method, equipment and computer storage medium
Technical Field
The present invention relates to information processing technologies, and in particular, to a data query method, device, and computer storage medium.
Background
With the rapid development of big data technology, various merchants collect and mine data through various applications; at present, the management of big data includes two schemes, one is that each application creates a database or a table to store its own data; the method has the advantages that the data access is simple, and the data of each application is only stored in the database or table established by the application; the method has the disadvantages that each application needs to maintain the database or table created by the application, and the number of the databases or tables corresponding to the application is increased along with the increase of the number of the applications, so that the maintenance is not facilitated; moreover, due to different data structures, the scheme is not beneficial to subsequently communicating each application data to carry out data mining; therefore, the scheme is rarely used for collecting and mining data at present.
The other scheme is that the same type of data of multiple applications is stored in a public table, and the method has the advantages that the method is beneficial to subsequently communicating each application data to carry out data mining; the disadvantage is that the data isolation between applications is difficult because the same type of data for all applications is stored in a common table.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a data query method, device and computer storage medium to solve the problems in the prior art.
The embodiment of the invention provides a data query method, which comprises the following steps: receiving a data query request message sent by a terminal based on an application;
determining a namespace corresponding to the application according to the data query request message;
data is acquired based on a pre-created view in the namespace.
In the foregoing solution, the determining a namespace corresponding to the application according to the data query request message includes:
judging whether the name space indicated by the data query request message is consistent with the name space corresponding to the application in a pre-stored mapping table or not to obtain a judgment result; the mapping table is used for representing the corresponding relation between the application and the name space;
and when the judgment result is yes, confirming that the namespace indicated by the data query request message is the namespace corresponding to the application.
In the foregoing solution, the determining a namespace corresponding to the application according to the data query request message includes:
inquiring a name space corresponding to the application identifier in a pre-stored mapping table according to the application identifier carried in the data inquiry request message;
and determining the name space obtained by query as the name space corresponding to the application.
In the above scheme, the method further comprises:
and adding the namespace identification obtained by query to the query request message.
In the above scheme, the acquiring data based on the view created in advance in the namespace includes:
searching a storage area of data corresponding to the application in a view pre-created in the namespace;
data is acquired within the storage area.
An embodiment of the present invention further provides a data query device, including: a processor, a memory, and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is used for executing the data query program stored in the memory so as to realize the following steps:
receiving a data query request message sent by a terminal based on an application;
determining a namespace corresponding to the application according to the data query request message;
data is acquired based on a pre-created view in the namespace.
In the foregoing solution, the processor is specifically configured to execute the data query program, so as to implement the following steps:
judging whether the name space indicated by the data query request message is consistent with the name space corresponding to the application in a pre-stored mapping table or not to obtain a judgment result; the mapping table is used for representing the corresponding relation between the application and the name space
And when the judgment result is yes, confirming that the namespace indicated by the data query request message is the namespace corresponding to the application.
In the foregoing solution, the processor is specifically configured to execute the data query program, so as to implement the following steps:
inquiring a name space corresponding to the application identifier in a pre-stored mapping table according to the application identifier carried in the data inquiry request message;
and determining the name space obtained by query as the name space corresponding to the application.
In the foregoing solution, the processor is specifically configured to execute the data query program, so as to implement the following steps:
searching a storage area of data corresponding to the application in a view pre-created in the namespace;
data is acquired within the storage area.
Embodiments of the present invention also provide a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement the steps of:
receiving a data query request message sent by a terminal based on an application;
determining a namespace corresponding to the application according to the data query request message;
data is acquired based on a pre-created view in the namespace.
According to the data query method, the data query equipment and the computer storage medium, a server creates a name space corresponding to an application in advance, and creates a view comprising application data under the name space of each application; after receiving a data query request message sent by a terminal based on an application, a server determines a name space corresponding to the application according to the data query request message, and acquires data based on a view in the name space; in this way, by creating a corresponding namespace for each application and creating a view including application data under the namespace, isolation of data among applications is effectively achieved when data is collected and mined by saving the same type of data of multiple applications to a common table.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a mobile terminal according to the present invention;
FIG. 2 is a diagram of a communication network system architecture according to the present invention;
FIG. 3 is a schematic diagram of a basic processing flow of an information query method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating a detailed processing flow of a second information query method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a detailed processing flow of a third information query method according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a detailed processing flow of a fourth information query method according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a fifth data query device according to an embodiment of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include mobile terminals such as a mobile phone, a tablet computer, a notebook computer, a palm top computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and fixed terminals such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 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 frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex-Long Term Evolution), and TDD-LTE (Time Division duplex-Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sound (audio data) via the microphone 1042 in an operation mode such as a phone call mode, a recording mode, a voice recognition mode, and the like, and can process such sound into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 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 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of 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 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. 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 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 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 109 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 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 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 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and charging functions Entity) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
Example one
The basic processing flow diagram of the data query method in the embodiment of the present invention, as shown in fig. 3, includes the following steps:
step S101, receiving a data query request message sent by a terminal based on an application;
specifically, a server receives a data query request message sent by a terminal based on an application;
the data query request message at least carries an application identifier, and the application identifier is uniquely corresponding to the application represented by the application identifier;
here, the data Query request message received by the server may be transmitted by the terminal through a Structured Query Language (SQL);
the data query request message is used for storing requested data in a public table, the public table also stores application identification corresponding to the application, and the application identification is uniquely corresponding to the application represented by the application identification; the structure of the public table is as follows: create table _ table (channel ID String, data Map).
Step S102, determining a namespace corresponding to the application according to the data query request message;
here, the server creates a name space corresponding to the application and a name space identifier corresponding to the name space in advance, establishes a mapping table representing the mapping relationship between the application and the name space, and stores the mapping table; if the identifier corresponding to the application is channelA, creating a namespace for the application: create database channel A;
specifically, the server may determine the namespace corresponding to the application according to the application identifier carried in the data query request message and the mapping table, or the server may determine the namespace corresponding to the application according to the namespace identifier carried in the data query request message and the mapping table.
Step S103, acquiring data based on a view created in advance in the namespace;
here, the server creates a view containing only the application data in advance under the namespace of each application; creating a view under the channelA namespace for the share _ table as follows: create viewchannel a. share _ table as selected from free default. share _ table;
specifically, the server searches a storage area of the data corresponding to the application in the view, and acquires the data in the storage area.
Example two
A schematic processing flow diagram of a data query method according to a second embodiment of the present invention is shown in fig. 4, and includes the following steps:
step S201, receiving a data query request message sent by a terminal based on an application;
specifically, a server receives a data query request message sent by a terminal based on an application;
the data query request message at least carries the application identifier, and the application identifier is uniquely corresponding to the application represented by the application identifier;
here, the data query request message received by the server may be transmitted by the terminal through SQL.
Step S202, determining a namespace corresponding to the application according to the data query request message;
here, the server creates a name space corresponding to the application and a name space identifier corresponding to the name space in advance, establishes a mapping table representing the mapping relationship between the application and the name space, and stores the mapping table;
specifically, the server may determine the namespace corresponding to the application according to the application identifier carried in the data query request message and the mapping table, or the server may determine the namespace corresponding to the application according to the namespace identifier carried in the data query request message and the mapping table.
Step S203, acquiring data based on a view created in advance in the namespace;
here, the server creates a view containing only the application data in advance under the namespace of each application;
specifically, the server searches a storage area of the data corresponding to the application in the view, and acquires the data in the storage area.
And step S204, the server sends the data to the terminal.
EXAMPLE III
A detailed processing flow diagram of a data query method according to a third embodiment of the present invention is shown in fig. 5, and includes the following steps:
step S301, receiving a data query request message sent by a terminal based on an application;
specifically, a server receives a data query request message sent by a terminal based on an application;
the data query request message at least carries the application identifier, and the application identifier is uniquely corresponding to the application represented by the application identifier;
here, the data query request message received by the server may be sent by the terminal through SQL, where the SQL is: select from channel share table.
Step S302, judging whether the name space identification carried in the data query request message is consistent with the name space identification corresponding to the application; if yes, executing step S303; if not, indicating that the terminal does not have the authority to inquire the application data corresponding to the namespace identifier, and ending the process;
here, the server creates a name space corresponding to the application and a name space identifier corresponding to the name space in advance, establishes a mapping table representing the mapping relationship between the application and the name space, and stores the mapping table;
specifically, when detecting that the data query request message carries a namespace identifier, the server queries the mapping table for an application corresponding to the namespace identifier carried in the data query request message, and queries whether the application corresponding to the namespace identifier is consistent with the application corresponding to the data query request message.
In this embodiment, the namespace identifier carried in the data query request message is channelB, an application corresponding to the namespace identifier channelB is obtained by querying according to the mapping table as application B, if the data query request message in step S301 is sent by the terminal based on application B, the determination result is consistent, and step S303 is executed; if the data query request message in step S301 is sent by the terminal based on the application a, the determination result is inconsistent, which indicates that the terminal does not have the authority to query the application data corresponding to the namespace identifier channelB, and the process is ended.
Step S303, the server determines that the namespace corresponding to the namespace identifier carried in the data query request message is the namespace corresponding to the application.
Step S304, acquiring data based on a view created in advance in the namespace;
here, the server creates a view containing only the application data in advance under the namespace of each application;
specifically, the server searches a storage area of the data corresponding to the application in the view, and acquires the data in the storage area.
Step S305, the server sends the data to the terminal.
Example four
A detailed processing flow diagram of a data query method according to a fourth embodiment of the present invention is shown in fig. 6, and includes the following steps:
step S401, receiving a data query request message sent by a terminal based on an application;
specifically, a server receives a data query request message sent by a terminal based on an application;
the data query request message at least carries the application identifier, and the application identifier is uniquely corresponding to the application represented by the application identifier;
here, the data query request message received by the server may be sent by the terminal through SQL, where the SQL is: select from share table.
Step S402, inquiring a name space corresponding to the application identifier in a pre-stored mapping table according to the application identifier carried in the data inquiry request message;
specifically, a server creates a name space corresponding to an application and a name space identifier corresponding to the name space in advance, establishes a mapping table representing the mapping relation between the application and the name space, and stores the mapping table; and the server queries a name space corresponding to the application identifier in a pre-stored mapping table according to the application identifier carried in the data query request message.
Step S403, the server determines the queried name space as the name space corresponding to the application;
specifically, if the namespace identifier obtained by the server query is channelA, after the namespace corresponding to the application is determined, the SQL is modified as follows: select from channel a share table; namely adding the name space identification obtained by the query to SQL.
Step S404, acquiring data based on a view created in advance in the namespace;
here, the server creates a view containing only the application data in advance under the namespace of each application;
specifically, the server searches a storage area of the data corresponding to the application in the view, and acquires the data in the storage area.
Step S405, the server sends the data to the terminal.
It should be noted that, in the above embodiments of the present invention, the same type of data of each application is stored in a common table, and the common table further stores an application identifier corresponding to the application, where the application identifier uniquely corresponds to the application characterized by the application identifier.
EXAMPLE five
To implement the foregoing data query method embodiment of the present invention, a fifth embodiment of the present invention further provides a data query device, where a schematic structural diagram of the data query device is shown in fig. 7, and the data query device includes: a processor 301, a memory 302, and a communication bus 303; wherein,
the communication bus 303 is used for realizing connection communication between the processor 301 and the memory 302; (ii) a
The processor 301 is configured to execute the data query program stored in the memory 302 to implement the following steps:
receiving a data query request message sent by a terminal based on an application;
determining a namespace corresponding to the application according to the data query request message;
data is acquired based on a pre-created view in the namespace.
In a preferred embodiment, when determining the namespace corresponding to the application according to the data query request message, the processor 301 is specifically configured to determine whether the namespace indicated by the data query request message is consistent with the namespace corresponding to the application in a pre-stored mapping table, and obtain a determination result; the mapping table is used for representing the corresponding relation between the application and the name space; if so, confirming that the name space indicated by the data query request message is the name space corresponding to the application
In a preferred embodiment, when determining the namespace corresponding to the application according to the data query request message, the processor 301 is specifically configured to query the namespace corresponding to the application identifier in a pre-stored mapping table according to the application identifier carried in the data query request message; and determining the name space obtained by query as the name space corresponding to the application, and adding the name space identification obtained by query to the query request message.
In a preferred embodiment, when acquiring data based on a view created in advance in the namespace, the processor 301 is specifically configured to search a storage area of data corresponding to the application in the view created in advance in the namespace, and acquire the data in the storage area.
In a preferred embodiment, the processor 301 is further configured to execute the data query program to implement the following steps: and sending the data to the terminal.
In this embodiment of the present invention, the functions executed by the processor 301 in the data query device may be implemented by a Central Processing Unit (CPU), a microprocessor unit (MPU), a Digital Signal Processor (DSP), or a programmable gate array (FPGA) located on the same server.
EXAMPLE six
To implement the foregoing data query method embodiment of the present invention, a sixth embodiment of the present invention further provides a computer-readable storage medium, where one or more programs are stored in the computer-readable storage medium, and the one or more programs are executable by one or more processors to implement the following steps:
receiving a data query request message sent by a terminal based on an application;
determining a namespace corresponding to the application according to the data query request message;
data is acquired based on a pre-created view in the namespace.
In a preferred embodiment, the one or more programs are specifically executable by the one or more processors to perform the steps of:
judging whether the name space indicated by the data query request message is consistent with the name space corresponding to the application in a pre-stored mapping table or not to obtain a judgment result; the mapping table is used for representing the corresponding relation between the application and the name space;
and when the judgment result is yes, confirming that the namespace indicated by the data query request message is the namespace corresponding to the application.
In a preferred embodiment, the one or more programs are specifically executable by the one or more processors to perform the steps of:
inquiring a name space corresponding to the application identifier in a pre-stored mapping table according to the application identifier carried in the data inquiry request message;
and determining the name space obtained by query as the name space corresponding to the application.
In a preferred embodiment, the one or more programs are further executable by the one or more processors to perform the steps of: and adding the namespace identification obtained by query to the query request message.
In a preferred embodiment, the one or more programs are specifically executable by the one or more processors to perform the steps of:
searching a storage area of data corresponding to the application in a view pre-created in the namespace; data is acquired within the storage area.
In a preferred embodiment, after the step of obtaining data based on the pre-created view in the namespace, the one or more programs are further executable by the one or more processors to perform the steps of: and sending the data to the terminal.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
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, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. A data query method, comprising:
receiving a data query request message sent by a terminal based on an application;
determining a namespace corresponding to the application according to the data query request message;
data is acquired based on a pre-created view in the namespace.
2. The data query method according to claim 1, wherein the determining the namespace corresponding to the application according to the data query request message includes:
judging whether the name space indicated by the data query request message is consistent with the name space corresponding to the application in a pre-stored mapping table or not to obtain a judgment result; the mapping table is used for representing the corresponding relation between the application and the name space;
and when the judgment result is yes, confirming that the namespace indicated by the data query request message is the namespace corresponding to the application.
3. The data query method according to claim 1 or 2, wherein the determining the namespace corresponding to the application according to the data query request message includes:
inquiring a name space corresponding to the application identifier in a pre-stored mapping table according to the application identifier carried in the data inquiry request message;
and determining the name space obtained by query as the name space corresponding to the application.
4. The data query method of claim 3, further comprising:
and adding the namespace identification obtained by query to the query request message.
5. The data query method according to claim 1 or 2, wherein the obtaining data based on the pre-created view in the namespace comprises:
searching a storage area of data corresponding to the application in a view pre-created in the namespace;
data is acquired within the storage area.
6. A data query device, the data query device comprising: a processor, a memory, and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is used for executing the data query program stored in the memory so as to realize the following steps:
receiving a data query request message sent by a terminal based on an application;
determining a namespace corresponding to the application according to the data query request message;
data is acquired based on a pre-created view in the namespace.
7. The data query device of claim 6, wherein the processor is specifically configured to execute the data query program to implement the following steps:
judging whether the name space indicated by the data query request message is consistent with the name space corresponding to the application in a pre-stored mapping table or not to obtain a judgment result; the mapping table is used for representing the corresponding relation between the application and the name space
And when the judgment result is yes, confirming that the namespace indicated by the data query request message is the namespace corresponding to the application.
8. The data query device of claim 6 or 7, wherein the processor is specifically configured to execute the data query program to implement the following steps:
inquiring a name space corresponding to the application identifier in a pre-stored mapping table according to the application identifier carried in the data inquiry request message;
and determining the name space obtained by query as the name space corresponding to the application.
9. The data query device of claim 6 or 7, wherein the processor is specifically configured to execute the data query program to implement the following steps:
searching a storage area of data corresponding to the application in a view pre-created in the namespace;
data is acquired within the storage area.
10. A computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors for performing the steps of:
receiving a data query request message sent by a terminal based on an application;
determining a namespace corresponding to the application according to the data query request message;
data is acquired based on a pre-created view in the namespace.
CN201710286485.9A 2017-04-27 2017-04-27 Data query method, equipment and computer storage medium Active CN107153688B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710286485.9A CN107153688B (en) 2017-04-27 2017-04-27 Data query method, equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710286485.9A CN107153688B (en) 2017-04-27 2017-04-27 Data query method, equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN107153688A true CN107153688A (en) 2017-09-12
CN107153688B CN107153688B (en) 2020-11-17

Family

ID=59793514

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710286485.9A Active CN107153688B (en) 2017-04-27 2017-04-27 Data query method, equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN107153688B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107886887A (en) * 2017-10-31 2018-04-06 维沃移动通信有限公司 A kind of pixel processing method and device
CN111600827A (en) * 2019-02-20 2020-08-28 成都鼎桥通信技术有限公司 Communication method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060143167A1 (en) * 2004-12-28 2006-06-29 International Business Machines Corporation System and method for providing access to data with user defined table functions
CN101378392A (en) * 2007-08-29 2009-03-04 华为技术有限公司 Method and apparatus for searching resource in P2P circumstance
CN102622361A (en) * 2011-01-28 2012-08-01 天脉聚源(北京)传媒科技有限公司 Method for querying database
CN104572727A (en) * 2013-10-22 2015-04-29 阿里巴巴集团控股有限公司 Data querying method and device
CN104966024A (en) * 2015-03-11 2015-10-07 深圳市腾讯计算机系统有限公司 Database protection method and apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060143167A1 (en) * 2004-12-28 2006-06-29 International Business Machines Corporation System and method for providing access to data with user defined table functions
CN101378392A (en) * 2007-08-29 2009-03-04 华为技术有限公司 Method and apparatus for searching resource in P2P circumstance
CN102622361A (en) * 2011-01-28 2012-08-01 天脉聚源(北京)传媒科技有限公司 Method for querying database
CN104572727A (en) * 2013-10-22 2015-04-29 阿里巴巴集团控股有限公司 Data querying method and device
CN104966024A (en) * 2015-03-11 2015-10-07 深圳市腾讯计算机系统有限公司 Database protection method and apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
龚立群 等: "RDF查询语言的比较研究", 《计算机时代》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107886887A (en) * 2017-10-31 2018-04-06 维沃移动通信有限公司 A kind of pixel processing method and device
CN107886887B (en) * 2017-10-31 2019-09-27 维沃移动通信有限公司 A kind of pixel processing method and device
CN111600827A (en) * 2019-02-20 2020-08-28 成都鼎桥通信技术有限公司 Communication method and device

Also Published As

Publication number Publication date
CN107153688B (en) 2020-11-17

Similar Documents

Publication Publication Date Title
CN109195143B (en) Network access method, mobile terminal and readable storage medium
CN108768775B (en) Information processing method, electronic device, and computer storage medium
CN109379735B (en) eSIM card operation method, mobile terminal and eSIM card device
CN107423238B (en) Screen projection connection method and device and computer readable storage medium
CN107862217B (en) Position information acquisition method, mobile terminal and computer storage medium
CN107124466B (en) Method and device for preventing cache from penetrating and computer readable storage medium
CN107566980A (en) The localization method and mobile terminal of a kind of mobile terminal
CN109168189B (en) Power saving method, mobile terminal and computer readable storage medium
CN108563388B (en) Screen operation method, mobile terminal and computer-readable storage medium
CN107818022B (en) Application program interface merging method, mobile terminal and computer readable storage medium
CN107707755B (en) Key using method, terminal and computer readable storage medium
CN109491577B (en) Holding interaction method and device and computer readable storage medium
CN110955397A (en) Method for setting frame rate of game terminal, game terminal and storage medium
CN108040116B (en) Message pushing method, router and computer readable storage medium
CN107153688B (en) Data query method, equipment and computer storage medium
CN109089258B (en) eSIM card operation method, mobile terminal and eSIM card device
CN109219039B (en) eSIM card operation method, mobile terminal and eSIM card device
CN109257739B (en) eSIM card operation method, mobile terminal and eSIM card device
CN109462829B (en) Call transfer method, device and computer readable storage medium
CN109683796B (en) Interaction control method, equipment and computer readable storage medium
CN108845821B (en) Application program updating method, terminal and computer readable storage medium
CN108183833B (en) Response processing method and device and computer readable storage medium
CN108037959B (en) Intelligent interface merging method, mobile terminal and computer readable storage medium
CN107222933B (en) Communication method, terminal and computer readable storage medium
CN109495948B (en) Communication connection method, equipment and computer readable 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
GR01 Patent grant
GR01 Patent grant