CN114564491A - Data query method, device, equipment, medium, product and query assembly - Google Patents

Data query method, device, equipment, medium, product and query assembly Download PDF

Info

Publication number
CN114564491A
CN114564491A CN202210208652.9A CN202210208652A CN114564491A CN 114564491 A CN114564491 A CN 114564491A CN 202210208652 A CN202210208652 A CN 202210208652A CN 114564491 A CN114564491 A CN 114564491A
Authority
CN
China
Prior art keywords
data
query
time
timestamp
user
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
CN202210208652.9A
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.)
Eversec Beijing Technology Co Ltd
Original Assignee
Eversec Beijing 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 Eversec Beijing Technology Co Ltd filed Critical Eversec Beijing Technology Co Ltd
Priority to CN202210208652.9A priority Critical patent/CN114564491A/en
Publication of CN114564491A publication Critical patent/CN114564491A/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/242Query formulation
    • G06F16/2433Query languages
    • 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
    • G06F16/24553Query execution of query operations

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 invention discloses a data query method, a data query device, data query equipment, a data query medium, a data query product and a data query component. The method comprises the following steps: after receiving a data query request of a user, acquiring a timestamp and a result of whether data aggregation is performed, wherein the timestamp is obtained by converting start-stop time of data query selected by the user, and the time granularity of the start-stop time is arbitrarily selected by the user; constructing a query statement according to the timestamp and the result of whether the data aggregation is performed or not and the type of a database where the data are located; and carrying out data query according to the query statement. By the method, data query under different time granularities can be supported, data aggregation is performed according to the time granularities, and the satisfaction degree of a user is improved.

Description

Data query method, device, equipment, medium, product and query assembly
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a data query method, a data query device, data query equipment, a data query medium, a data query product and a data query component.
Background
The query component of a common application system is generally a time operation panel accurate to days or seconds, a user selects start and end times on the time panel to query data, and the data is screened out as a query result according to the start and end times selected by the user during query.
In a conventional scenario of performing data query according to the start-stop time, the time operation panel is generally fixed, for example, selecting a year, month, day, hour, minute, second, and the like. If the user wants to view the service data of another statistical period, the time operation panel does not support or the backend program cannot be aggregated according to different time granularities.
In the prior art, the existing time operation panel can only inquire data according to fixed time granularity, and if the time granularity needs to be changed, a new time panel needs to be developed again; in addition, the existing time operation panel cannot perform data aggregation.
Disclosure of Invention
The invention provides a data query method, a data query device, equipment, a medium, a product and a query assembly, which aim to solve the problem that the prior art can not provide a data query method capable of switching time granularity and carrying out data aggregation.
According to an aspect of the present invention, there is provided a data query method, including:
after receiving a data query request of a user, acquiring a timestamp and a result of whether data aggregation is performed, wherein the timestamp is obtained by converting start-stop time of data query selected by the user, and the time granularity of the start-stop time is arbitrarily selected by the user;
constructing a query statement according to the timestamp and the result of whether the data aggregation is performed or not and the type of a database where the data are located;
and carrying out data query according to the query statement.
According to another aspect of the present invention, there is provided a data query apparatus including:
the acquisition module is used for acquiring a timestamp and a result of whether data aggregation is performed or not after receiving a data query request of a user, wherein the timestamp is obtained after conversion of start-stop time of data query selected by the user, and the time granularity of the start-stop time is arbitrarily selected by the user;
the building module is used for building a query statement according to the timestamp and the result of whether the data aggregation is performed or not and the type of a database where the data are located;
and the query module is used for carrying out data query according to the query statement.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the data query method according to any of the embodiments of the present invention
According to another aspect of the present invention, there is provided a computer-readable storage medium, the computer
The readable storage medium stores computer instructions for causing a processor to implement the data query method according to any one of the embodiments of the present invention when executed.
According to the technical scheme of the embodiment of the invention, the starting and ending time of data query of different time granularities is provided, and the query statement is constructed according to the result of whether data aggregation is performed or not, so that the problems that only data query time of single time granularity can be provided and data aggregation cannot be performed according to the time granularity in the prior art are solved, the data query under different time granularities is supported, and the beneficial effect of data aggregation is provided.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a time granularity configuration of a time operation panel according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of time granularity options on a time operation panel according to an embodiment of the present invention;
fig. 3 is a display diagram of a time operation panel according to an embodiment of the present invention;
fig. 4 is another display diagram of a time operation panel according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a convergence option in a time operation panel according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of a data query method according to a second embodiment of the present invention;
fig. 7 is a schematic structural diagram of a data query apparatus according to a third embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device of a data query method according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. It should be understood that the various steps recited in the method embodiments of the present invention may be performed in a different order and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the invention is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It is noted that references to "a" or "an" or "the" modification(s) in the present invention are intended to be illustrative rather than limiting and that those skilled in the art will understand that reference to "one or more" unless the context clearly indicates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present invention are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Example one
The first embodiment of the present invention provides a query component of an application system, where the query component may be a front end of the application system, the query component may be a time operation panel, and a user may select a time start-stop range and a time granularity of data query, and whether to perform data aggregation, etc. through the time operation panel.
The query component is configured with a time granularity option; the query component is configured with a time range option, and selectable time ranges are displayed according to time granularity; the query component is configured with an option of whether to perform data aggregation, and the data aggregation performs data aggregation according to time granularity.
In this embodiment, the query component provides a configuration of time granularity, may freely configure optional time granularity, may perform sorting of time granularity options, and the like. The configuration for showing the selectable start-stop time range according to the time granularity is also provided, and the configuration for judging whether to carry out data aggregation is also provided.
Fig. 1 is a schematic time granularity configuration diagram of a time operation panel according to an embodiment of the present invention, as shown in fig. 1, selectable items may be configured in a time granularity drop-down box, and an administrator may add any time granularity option by clicking an edit button on the time operation panel. Time granularity options may include days, weeks, years, 5 minutes, 1 hour, and the like.
For example, fig. 2 is a schematic diagram of time granularity options on a time operation panel according to an embodiment of the present invention, and as shown in fig. 2, the time granularity that can be selected in the multi-granularity time range option includes 15 minutes, 30 minutes, hours, half-day, week, half-month, and month.
It is understood that if the time granularity selected by the user is days, after the user selects the start-stop time, each day selectable in the current month can be provided every year and every month; if the time granularity selected by the user is 5 minutes, the options of 0-24 hours can pop up when the user selects a certain day in the start-stop time options, and each of the options of 0, 5, 10, 15 through 55 can pop up when the user selects a certain hour in the start-stop time options for 5 minutes.
For example, fig. 3 is a display diagram of a time operation panel according to an embodiment of the present invention, and as shown in fig. 3, after a month is selected in a multi-granularity time range and then a time range option is clicked, the time operation panel may display a time option of each month. For example, fig. 4 is another display diagram of the time operation panel according to the first embodiment of the present invention, and as shown in fig. 4, the time operation panel may display the time options per hour by clicking the time range option after selecting an hour in the multi-granularity time range.
In this embodiment, the time operation panel is configured with an option whether to perform data aggregation, and fig. 5 is a schematic diagram of an option whether to perform data aggregation in the time operation panel according to a first embodiment of the present invention. As shown in fig. 5, the user may determine whether to perform data aggregation on the queried data by clicking a convergence button, and if the user selects to perform data aggregation, may perform data aggregation according to the time granularity selected by the user and display the query result. Illustratively, if the time granularity selected by the user is week, inputting the first week and the 10 th week, and when the user selects not to aggregate data, displaying each piece of data in the 1 st week and the 10 th week; and when the user selects to carry out data aggregation, displaying the total data in the first week and the seventh week.
In this embodiment, by performing time granularity configuration on the query component, displaying the configuration of the selectable start-stop time range according to the time granularity, and performing configuration on whether to perform data aggregation, the user can select the time granularity, the start-stop time of the data query, and whether to perform data aggregation on the query component. And constructing a query statement corresponding to the database according to the starting and ending time of the data query selected by the user, the time granularity and the result of whether the data aggregation is performed, performing the data query according to the query statement, and aggregating and displaying the queried data according to the time granularity if the data aggregation is required.
It should be noted that the program corresponding to the query component may be developed by using different front-end frameworks, which is not specifically limited herein and may be specifically selected according to actual situations. Illustratively, the program corresponding to the query component may be developed by using the Vue framework, and may be replaced by using other front-end frameworks, such as React and AgualarJs.
According to the query component of the application system provided by the first embodiment of the invention, a user can select any time granularity to perform data query by configuring the time granularity option; by configuring whether to perform the data aggregation option, the user can obtain the data query result of performing data aggregation with time granularity. The flexibility of the system is improved, and the satisfaction degree of a user is increased. A user can switch and select the required starting and stopping time granularity on one operation interface without developing a new time operation panel, so that the input efficiency is improved, and the development and maintenance cost of the system is reduced.
Example two
Fig. 6 is a schematic flowchart of a data query method according to a second embodiment of the present invention, where the method is applicable to data query, and is particularly applicable to data query according to time granularity. The method may be performed by a data query apparatus, wherein the apparatus may be implemented by software and/or hardware, and is generally integrated on an electronic device, which may be a server device in this embodiment.
As shown in fig. 6, a data query method provided by the second embodiment of the present invention includes the following steps:
s110, after receiving a data query request of a user, obtaining a timestamp and a result of whether data aggregation is performed, wherein the timestamp is obtained by converting the start-stop time of the data query selected by the user, and the time granularity of the start-stop time is arbitrarily selected by the user.
The time granularity is understood to be a span of time, for example, the time granularity may be 1 day, 5 minutes, or 1 hour.
In this embodiment, after the user selects the start-stop time and the time granularity of the data query on the time operation panel and whether to perform data aggregation, the generation of the data query request can be triggered by clicking the query button, and the front end can convert the start-stop time selected by the user into a corresponding timestamp and transmit the timestamp to the back end. After receiving the data query request of the user, the back end can directly obtain the timestamp transmitted by the front end and the result of whether to perform data aggregation. The result of whether to perform data aggregation may include performing data aggregation and not performing data aggregation.
It should be noted that the front-end and the back-end may use Json format, or may use other formats such as XML. Json is a lightweight data exchange format, which is based on a subset of ECMAScript, and adopts a text format completely independent of a programming language to store and represent data, and a compact and clear hierarchy makes Json an ideal data exchange language. XML refers to extensible markup language, which is a simple data storage language.
Wherein converting the start-stop time to a timestamp may be understood as an example: if the query starting time selected by the user is 10 points at 20 days at 2 months and 12 days in 2022, the time is converted into a time value corresponding to 2022-02-1210: 55:00.000 to be used as the starting time stamp.
And S120, constructing a query statement according to the timestamp and the result of whether the data aggregation is performed or not and the type of the database where the data is located.
In this embodiment, data queried by a user is stored in a corresponding database, data query needs to be performed in the corresponding database, different databases correspond to different query statements, and data query can be performed in the database only if the query statements corresponding to the databases need to be constructed. The database type for storing data may include MySQL, Hive, Impala, and the like.
It should be explained that MySQL is a relational database management system, which is one of the most popular relational database management systems, and in WEB application, MySQL is one of the best relational database management system applications. Hive is a data warehouse tool based on Hadoop, which is used for data extraction, transformation and loading, and is a mechanism for storing, querying and analyzing large-scale data stored in Hadoop. Impala is a novel query system mainly developed by Cloudera, provides SQL semantics and can query PB-level big data stored in HDFS and HBase of Hadoop.
In this embodiment, the constructed query statement may perform data query in a corresponding database, and according to the timestamp in the query statement, it may be known which time period of data query is performed when performing data query; according to the result of whether data query is performed in the query statement, whether data aggregation is required or not can be known during data query. The constructed query statement corresponds to the time query grouping field, and the data of what attribute is queried, for example, the sales data of the commodity can be known according to the time query grouping field.
And S130, performing data query according to the query statement.
In this embodiment, data query can be performed in the database of the corresponding type according to the query statement. When the back end performs data filtering, the timestamp in the query statement may be converted into a filtering condition.
Further, according to the field type of the timestamp corresponding to the database, converting the timestamp to be used as a filtering condition corresponding to the query statement; and performing data query in the database according to the filtering condition.
The databases of different types correspond to different field types, and the field types may be time types or other types.
Illustratively, if the database is SQL, when data query is performed, the timestamp is converted into a filtering condition of the database SQL statement according to a field type of the timestamp corresponding to the SQL.
In this embodiment, the timestamp is converted into a filtering condition that can be executed by the corresponding database, and data query can be performed according to the filtering condition.
The term "timestamp" as a filtering condition is understood to mean that the start-stop time period is used as a filtering condition, and data in the start-stop time period is filtered out from the database.
Further, after the data query is performed according to the query statement, the method further includes: if the data aggregation is not determined according to the query statement, displaying each piece of queried data; and if the data aggregation is determined according to the query statement, performing data aggregation on each piece of queried data according to the time granularity, and displaying the aggregated data analysis statistical chart.
In this embodiment, if the result of whether to perform data aggregation in the query statement is yes, each piece of queried data is listed and displayed one by one; and if the result of whether the data aggregation is carried out in the query statement is negative, aggregating the queried data according to the time granularity, and enabling the data to be aggregated at points in each time interval according to the time granularity and displayed.
The data can be gathered according to the time granularity in the data analysis statistical chart, and different data tables do not need to be respectively inquired through data preprocessing, so that the data statistics is more flexible.
In this embodiment, data aggregation according to time granularity is implemented by a built-in function manner or a modulo manner. It should be noted that, if data aggregation is performed by using a built-in function, the built-in function is written in when a query statement is constructed; and if the data are gathered in a modular mode, writing the specific modular mode when constructing the query statement.
Further, the data aggregation method includes: converging the inquired data in a corresponding time period according to a built-in function; and when the query statement is generated, adding the built-in function to the time query grouping field corresponding to the query statement.
The built-in function can be set by itself, and for example, the time can be automatically converted into the current week according to the built-in function.
Further, the data aggregation method includes: segmenting the start-stop time in a mode of taking a module; and aggregating the inquired data in a corresponding time period.
Dividing the timestamp by the number of milliseconds corresponding to the time granularity to obtain a value of the time granularity; carrying out zero wiping treatment on the timestamp according to the numerical value, and segmenting the treated timestamp; and aggregating the inquired data in a corresponding time period.
For example, if the time granularity is 5 minutes, the times from 12 points 5 minutes 0 seconds to 12 points 10 minutes 0 seconds can all be considered as 12 points 5 minutes 0 seconds counts. The realization process is as follows: the time stamp corresponding to each time is divided by the number of milliseconds corresponding to 5 minutes, i.e., 3000000, to obtain a value, which is an entire 5 minute value, e.g., 15 minutes 0 seconds after 16 minutes 10 seconds, so as to complete the zero-erasing.
For example, when the data aggregation is performed at the time granularity of hours, the data generated by 2022-02-2112: 11:10 can be aggregated to the time point of 2022-02-2112: 00: 00.
The data query method provided by the embodiment of the invention comprises the steps of firstly, after a data query request of a user is received, obtaining a time stamp and a result of whether data aggregation is carried out, wherein the time stamp is obtained by converting the start-stop time of the data query selected by the user, and the time granularity of the start-stop time is arbitrarily selected by the user; then, according to the time stamp and the result of whether the data aggregation is carried out, establishing a query statement according to the type of a database where the data are located; and finally, carrying out data query according to the query statement. By the method, data in the starting and stopping time ranges with different time granularities can be inquired, data can be gathered according to the time granularity, and flexibility of data inquiry is improved.
EXAMPLE III
Fig. 7 is a schematic structural diagram of a data query apparatus according to a third embodiment of the present invention, which is applicable to a case of performing data query, especially to a case of performing data query according to time granularity, where the apparatus may be implemented by software and/or hardware and is generally integrated on a back-end electronic device.
As shown in fig. 7, the apparatus includes: an acquisition module 110, a construction module 120, and a query module 130.
An obtaining module 110, configured to obtain a timestamp and a result of whether to perform data aggregation after receiving a data query request of a user, where the timestamp is obtained by converting start-stop time of a data query selected by the user, and a time granularity of the start-stop time is arbitrarily selected by the user;
a constructing module 120, configured to construct a query statement according to the type of the database where the data is located, according to the timestamp and the result of whether to perform data aggregation;
and the query module 130 is configured to perform data query according to the query statement.
In this embodiment, the apparatus first receives a data query request from a user through the obtaining module 110, and then obtains a timestamp and a result of whether to perform data aggregation, where the timestamp is obtained by converting a start-stop time of a data query selected by the user, and a time granularity of the start-stop time is arbitrarily selected by the user; then, a query statement is constructed by the construction module 120 according to the timestamp and the result of whether data aggregation is performed or not and according to the type of the database where the data is located; and finally, performing data query according to the query statement through a query module 130.
The embodiment provides a data query device, which can support data query under different time granularities, perform data aggregation according to the time granularities, and improve the satisfaction degree of users.
Further, the query module 120 is specifically configured to: converting the timestamp to be used as a filtering condition corresponding to the query statement according to the field type of the timestamp corresponding to the database; and performing data query in the database according to the filtering condition.
Based on the above technical scheme, the device further comprises a display module, which is used for: if the query statement determines that data aggregation is not performed, displaying each piece of queried data; and if the data aggregation is determined according to the query statement, performing data aggregation on each piece of queried data according to the time granularity, and displaying the aggregated data analysis statistical chart.
Further, the data aggregation method includes: converging the inquired data in a corresponding time period according to a built-in function; and when the query statement is generated, adding the built-in function to the time query grouping field corresponding to the query statement.
Further, the data aggregation method includes: segmenting the start-stop time according to a mode of taking a module; and aggregating the inquired data in a corresponding time period.
The data query device can execute the data query method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 8 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 8, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM)12, a Random Access Memory (RAM)13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM)12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the data query method.
In some embodiments, the data query method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the data query method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the data query method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for data query, the method comprising:
after receiving a data query request of a user, acquiring a timestamp and a result of whether data aggregation is performed, wherein the timestamp is obtained by converting start-stop time of data query selected by the user, and the time granularity of the start-stop time is arbitrarily selected by the user;
constructing a query statement according to the timestamp and the result of whether the data aggregation is performed or not and the type of a database where the data are located;
and carrying out data query according to the query statement.
2. The method of claim 1, wherein the querying data according to the query statement comprises:
converting the timestamp to be used as a filtering condition corresponding to the query statement according to the field type of the timestamp corresponding to the database;
and performing data query in the database according to the filtering condition.
3. The method of claim 1, wherein after the querying the data according to the query statement, further comprising:
if the query statement determines that data aggregation is not performed, displaying each piece of queried data;
and if the data aggregation is determined according to the query statement, performing data aggregation on each piece of queried data according to the time granularity, and displaying the aggregated data analysis statistical chart.
4. The method of claim 3, wherein the data aggregation comprises:
converging the inquired data in a corresponding time period according to a built-in function;
and when the query statement is generated, adding the built-in function to the time query grouping field corresponding to the query statement.
5. The method of claim 3, wherein the data aggregation comprises:
segmenting the start-stop time according to a mode of taking a module;
and aggregating the inquired data in a corresponding time period.
6. A data query apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring a timestamp and a result of whether data aggregation is performed or not after receiving a data query request of a user, wherein the timestamp is obtained after conversion of start-stop time of data query selected by the user, and the time granularity of the start-stop time is arbitrarily selected by the user;
the building module is used for building a query statement according to the timestamp and the result of whether the data aggregation is performed or not and the type of a database where the data are located;
and the query module is used for carrying out data query according to the query statement.
7. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data query method of any one of claims 1-5.
8. A computer-readable storage medium storing computer instructions for causing a processor to implement the data query method of any one of claims 1-5 when executed.
9. A computer program product, characterized in that the computer program product comprises a computer program which, when being executed by a processor, carries out the data query method according to any one of claims 1-5.
10. A query component of an application system, wherein the query component is configured with time granularity options; the query component is configured with a time range option, and selectable time ranges are displayed according to time granularity; the query component is configured with an option of whether to perform data aggregation, and the data aggregation performs data aggregation according to time granularity.
CN202210208652.9A 2022-03-04 2022-03-04 Data query method, device, equipment, medium, product and query assembly Pending CN114564491A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210208652.9A CN114564491A (en) 2022-03-04 2022-03-04 Data query method, device, equipment, medium, product and query assembly

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210208652.9A CN114564491A (en) 2022-03-04 2022-03-04 Data query method, device, equipment, medium, product and query assembly

Publications (1)

Publication Number Publication Date
CN114564491A true CN114564491A (en) 2022-05-31

Family

ID=81718030

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210208652.9A Pending CN114564491A (en) 2022-03-04 2022-03-04 Data query method, device, equipment, medium, product and query assembly

Country Status (1)

Country Link
CN (1) CN114564491A (en)

Similar Documents

Publication Publication Date Title
US11442930B2 (en) Method, apparatus, device and storage medium for data aggregation
CN115204815A (en) Power grid customer service work order timeout early warning method, device, equipment and storage medium
WO2023005635A1 (en) Method and apparatus for generating information
CN114925143A (en) Method, device, equipment, medium and product for describing logical model blood relationship
CN114564491A (en) Data query method, device, equipment, medium, product and query assembly
CN116383207A (en) Data tag management method and device, electronic equipment and storage medium
CN115080607A (en) Method, device, equipment and storage medium for optimizing structured query statement
CN113722141B (en) Method and device for determining delay reason of data task, electronic equipment and medium
CN115329150A (en) Method and device for generating search condition tree, electronic equipment and storage medium
CN114995875A (en) Page component configuration method and device, electronic equipment and storage medium
CN115408546A (en) Time sequence data management method, device, equipment and storage medium
CN112561332B (en) Model management method, device, electronic equipment, storage medium and program product
CN116431698B (en) Data extraction method, device, equipment and storage medium
CN114595231B (en) Database table generation method and device, electronic equipment and storage medium
CN115601172A (en) Data processing method, device, equipment and storage medium
CN114416881A (en) Real-time synchronization method, device, equipment and medium for multi-source data
CN114706578A (en) Data processing method, device, equipment and medium
CN116186176A (en) Data processing method, device, equipment and storage medium
CN115794860A (en) Data query method, device, equipment and storage medium
CN115687395A (en) Advertisement data statistical method, device, equipment and storage medium
CN117709902A (en) Material input method, device, equipment and medium based on BOM file
CN115328918A (en) Flexible report generation method and device, electronic equipment and storage medium
CN115408395A (en) Data processing method and device, electronic equipment and storage medium
CN115455060A (en) Data processing method, device, equipment and medium
CN115730000A (en) Medical data integration method, device, equipment and medium based on data lake

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