CN112445805A - Data query method and device - Google Patents

Data query method and device Download PDF

Info

Publication number
CN112445805A
CN112445805A CN201910807240.5A CN201910807240A CN112445805A CN 112445805 A CN112445805 A CN 112445805A CN 201910807240 A CN201910807240 A CN 201910807240A CN 112445805 A CN112445805 A CN 112445805A
Authority
CN
China
Prior art keywords
data
time point
freezing time
freezing
database
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
CN201910807240.5A
Other languages
Chinese (zh)
Inventor
袁园
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201910807240.5A priority Critical patent/CN112445805A/en
Publication of CN112445805A publication Critical patent/CN112445805A/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/23Updating
    • G06F16/2365Ensuring data consistency and integrity

Landscapes

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

Abstract

The invention discloses a data query method and a data query device, relates to the technical field of computers, and mainly aims to provide data consistency service for data queried by a plurality of users. The main technical scheme of the invention is as follows: receiving a freezing time point of a database, wherein the freezing time point is used for forbidding updating data with the release time after the freezing time point; filtering the updated data in the database according to the freezing time point; and responding to a data query request according to the freezing time point, and ensuring that the data after the freezing time point has consistency in the queried release time after the time corresponding to the freezing time point is set. The invention is mainly used for data query.

Description

Data query method and device
Technical Field
The invention relates to the technical field of computers, in particular to a data query method and device.
Background
With the advent of the big data era, various decisions of people increasingly depend on the analysis results of big data, so that data analysis becomes the current popular profession, and the main work of a data analyst or a consultant is to acquire required data from a corresponding system database, analyze the acquired data in a certain analysis mode to obtain an analysis result, and provide corresponding guidance opinions according to the analysis result.
For some projects with large data volume, when data analysis is performed, multiple service personnel (data analysts) are often required to use the same data from different dimensions for analysis according to requirements, but because the data content has a real-time updating requirement, for example, in a book library where data is crawled by a crawler, the crawler can continuously crawl data for updating the data content in the database, so that different service personnel can obtain data of the same time period at different time points and also have differences, because the data in the same time period can be updated during the data query period of different service personnel, the basic data used for analysis is different, and the accuracy of final analysis is affected. Therefore, after the required data is derived by the current business personnel, the obtained data needs to be queried and verified by the personnel for updating time so as to ensure that different business personnel can obtain the same data for analysis, but the method has low efficiency and is not beneficial to quick analysis by the business personnel.
Disclosure of Invention
In view of the above problems, the present invention provides a method and an apparatus for querying data, and a main objective of the present invention is to provide a service for data consistency for data queried by a plurality of users.
In order to achieve the purpose, the invention mainly provides the following technical scheme:
in one aspect, the present invention provides a data query method, which specifically includes:
receiving a freezing time point of a database, wherein the freezing time point is used for forbidding updating data with the release time after the freezing time point;
filtering the updated data in the database according to the freezing time point;
and responding to a data query request according to the freezing time point, and ensuring that the data after the freezing time point has consistency in the queried release time after the time corresponding to the freezing time point is set.
In another aspect, the present invention provides a data query apparatus, which specifically includes:
the receiving unit is used for receiving a freezing time point of the database, and the freezing time point is used for forbidding updating data with the release time after the freezing time point;
the filtering unit is used for filtering the updated data in the database according to the freezing time point obtained by the receiving unit;
and the query unit is used for responding to a data query request according to the freezing time point obtained by the receiving unit and ensuring that the queried data after the freezing time point has consistency after the time corresponding to the freezing time point is set.
In another aspect, the present invention provides a storage medium for storing a computer program, where the computer program controls a device on which the storage medium is located to execute the above-mentioned data query method when running.
In another aspect, the present invention provides a processor, where the processor is configured to execute a program, where the program executes the above-mentioned data query method during execution.
By means of the technical scheme, the data query method and the data query device provided by the invention can receive and set a freezing time point according to requirements before providing queried data for users, filter the updated data in the database according to the freezing time point, and avoid updating the data after the freezing time point, so that when a plurality of users obtain the data after the freezing time point, the same data content of the obtained same data can be ensured, and the problem of inaccurate data analysis result caused by different data contents is avoided.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating a data query method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating another data query method according to an embodiment of the present invention;
FIG. 3 is a block diagram illustrating an apparatus for querying data according to an embodiment of the present invention;
fig. 4 is a block diagram showing another data query apparatus according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
The embodiment of the invention provides a data query method which is mainly applied to a database with real-time updating capability. The method comprises the following specific steps as shown in figure 1:
step 101, receiving a freezing time point of a database.
Wherein the freezing time point is used for forbidding updating the data in the database, the publishing time of which is after the freezing time point. Generally, the freezing time point is a setting request made by a service person according to the requirement, and the system receives the setting request, acquires the freezing time point therein and applies the freezing time point in the database. The freezing time point is generally a historical time point relative to the time point of the execution of the step or the time corresponding to the set freezing time point, i.e. the freezing time point is earlier than the time point of the execution of the step or the time corresponding to the set freezing time point.
It should be noted that the publishing time of the data refers to the time when the data is generated, but not the time when the data is added to the database, for example, an article crawled from a page by a crawler in 2019, 8, 4, is not in the database, needs to be added to the database, and if the article is published in a web page in 2019, 5, 4, then two times of the article are recorded when the article is added to the database, one time is the updating time when the article is added, i.e., the date of the current time point (8, 4), and the other time is the publishing time, i.e., the date of 2019, 5, 4.
And step 102, filtering the updated data in the database according to the freezing time point.
After the freezing time point is set in the database, when the database updates the data, an updating condition based on the freezing time point is added, namely the data is prohibited from being updated if the issuing time of the data is after the freezing time point. Still taking the above-mentioned crawler crawling article as an example, since the crawler crawls data in real time, the obtained data is not only the data that has been crawled but also new data that is to be added to the database, but the update data is not all the current newly generated data, and also includes data that has not been crawled successfully before, that is, the update data includes data that has been published before, for example, new data crawled by the crawler in 8 months and 20 days is not all the current newly published data, and may also be published in 8 months and 10 days, but is not crawled before the crawling, or the data content in the data changes and needs to be updated.
In addition, after the freezing time point is set, data after the freezing time point of the release time in the database is also frozen, namely, the data is prohibited from being updated.
And 103, responding to the data query request according to the freezing time point.
The data query request is sent by a service person according to the requirement, after the freezing time point is set, because the data in the database is bounded by the freezing time point, the previous data are updated normally, and the subsequent data are prohibited from being updated, when the data to be queried by a plurality of service persons are all behind the freezing time point, the data contents of the same data queried by the service persons at different time points can be ensured to be the same.
The above steps are exemplified: assuming that data A, B and the like are recorded in the database, the release time is 7 months and 1 day later, the business person applies for setting the freezing time point to 7 months and 1 day at 8 months and 5 days, after the freezing point in time is approved to be set and validated on day 8, month 5, the database will freeze the update operation of the data A, B and the like, that is, after 8/5/day, if there is an operation to update data whose release time is after 7/1/day to be prohibited, whereas if there is an operation of updating the data C whose release time is 7 months and 1 day before, it will be possible to normally perform, at this time, another service person at any point in time after day 5 of 8 months (before the freeze point in time is revoked), such as day 7 of 8 months, day 10 of 8 months, etc., the data released 7 months and 1 day later is the same as the data content of the data acquired by the previous service personnel.
As can be seen from the embodiment shown in fig. 1, the data query method provided by the present invention can set a freezing time point in the database, where the freezing time point can freeze part of data in the database, and ensure that the data content of the data is unchanged during the freezing period, so that when data query requests initiated by multiple service personnel at different time points are responded, data with consistent data content can be provided for the service personnel, and it is ensured that when the service personnel use the same data to perform data analysis, the analysis result is not inaccurate due to the difference in data content.
Furthermore, the embodiment of the present invention, in combination with the database of the crawler system, details how to ensure that the obtained data are consistent when a plurality of service personnel query the same data. As shown in fig. 2, the method includes:
step 201, receiving a freezing time point of the database.
In the crawler system in this embodiment, the crawler acquires data, and the database can determine whether the data has new data, where the new data refers to data that is not present in the database or data with different data contents. The specific structure of the database is mainly divided into two parts, one part is a total database containing all data, the database can identify whether the data crawled by a crawler is new data, the other part is a sub-database providing query data for business personnel, the number of the sub-databases can be multiple, and the sub-databases can be specifically determined according to actual requirements, for example, different projects can create corresponding sub-databases according to required data contents. After the total library determines that new data exists, the sub-libraries to which the total library belongs are further identified and sent to the sub-libraries for data updating.
The embodiment of the invention supports the addition of the filtering condition in the process of sending the updated data from the master library to the sub-libraries, wherein the filtering condition is the setting of the freezing time point, and partial data is frozen through the freezing time point, and is prohibited from being written into the sub-libraries, updated and modified.
The step is to obtain a freezing time point, which may be set in real time based on an instruction or preset, that is, a service person may specify the freezing time point by setting an instruction, such as 8 months, 5 days, 8 months, 15 days, or the like, or may be a specified instruction, where the instruction includes the freezing time point, such as freezing previous month data, and if the current time is 8 months, 20 days, the freezing time point determined by the instruction is 7 months, 1 day.
Step 202, judging whether the set freezing time point exists in the database.
In this embodiment, only one freezing time point is allowed to exist in one sub-library, so as to avoid the situation that a plurality of freezing time points are interfered with each other. Therefore, when a freezing time point is received, the sub-library needs to be detected and judged first, when the freezing time point which is not currently effective is determined, the freezing time point is set, and if the freezing time point which is currently effective exists in the sub-library, prompt information needs to be fed back to inform service personnel that the new freezing time point can be started after the currently set freezing time point needs to be cancelled.
In addition, in this embodiment, the state information of the freezing time point set in the sub-library may also be synchronized to the client of the service person, so that the service person can know the freezing state of the data in the sub-library conveniently, and thus, it is clear whether the operation of canceling the freezing time point needs to be performed first.
Step 203, filtering the updated data in the database according to the freezing time point.
And after the freezing time point is set, the filtering condition corresponding to the update data sent to the sub-library takes effect immediately, at the moment, the sent update data is detected, the update data which does not meet the filtering condition is returned, and the sub-library is forbidden to be added, so that the updating and the modification are forbidden.
Specifically, in practical applications, the detection process needs to analyze the release time corresponding to the update data, for example, for a page article crawled by a crawler, the release time generally refers to the release date marked in the page, and therefore, the data needs to be analyzed, the release date is obtained and determined as the release time, and then it is determined whether the release time is after the freezing time point, if so, the update data is prohibited to be added to the sub-library, otherwise, the update data is permitted to be added to the sub-library, wherein the sub-library is used to store the update data of the release time before the freezing time point in the database, so that the update data of the release time before the freezing time point is added to the sub-library for updating, and the update data of the release time after the freezing time point is prohibited to be added to the sub-library and still stored in the main library of the database, and forbidding updating and modifying. Note that only one of the freezing time point and the freezing time point is included in both the time point before the freezing time point and the time point after the freezing time point. For example, when a freezing time point is interpreted before as containing the freezing time point, a freezing time point is interpreted after as not containing the freezing time point; conversely, when a freezing time point is interpreted before as not including a freezing time point, a freezing time point is interpreted after as including a freezing time point.
And step 204, responding to the data query request according to the freezing time point.
The data queried in the data query request does not necessarily belong to frozen data, and therefore, when responding to the data query request, the data query request needs to be analyzed first to obtain the issuing time of the data queried in the data query request, and then whether the issuing time of the query data is after the freezing time point is judged, if so, the query data is directly fed back, otherwise, the query data needs to be fed back while the query data is simultaneously prompted to belong to unfrozen data, and a specific prompting form is not limited in this embodiment.
And step 205, canceling the freezing time point according to the canceling instruction.
The revocation instruction can be an instruction sent by a service worker, or an instruction actively triggered by the system according to a preset condition. Generally, in the case of a revocation instruction sent by a service person, the service person needs to re-establish a new freezing time point, or needs to update data in a database; and under the condition that the system actively triggers the cancellation instruction, the data in the database cannot be frozen for a long time and cannot be updated, so that when the effective time duration of the freezing time point is longer than the preset time period and other cancellation instructions are not received, the cancellation instruction aiming at the existing freezing time point can be actively triggered, and prompt information that the freezing time point is invalid is generated.
After the freezing time point is cancelled and before the next new freezing time point is set, the embodiment of the present invention may further update the data in the database, so that the data that cannot be updated before the cancelled freezing time point becomes effective is updated, where the updated data refers to data that is prohibited from being updated during the period from the reception freezing time point to the cancellation freezing time point, specifically, the data may be stored in the master library in a manner of a flag when the updating is denied, and once the updating is started, the corresponding data may be quickly found according to the flag and updated.
Further, in this embodiment, there is a possible situation that the freezing time point may be set, and the acquired data content may still be inconsistent. The situation is that during the freezing time point, a service person obtains the data to be frozen through a data query request, and in the process, the data just has updated data, so that the obtained data causes the content of the data to be different from that obtained by the service person obtaining the data at other time points later. To avoid this, the embodiment of the present invention will, while executing step 203, detect whether there is currently a data query request in process, and the issuing time of the query data in the data query request is after the freezing time point, if the data query request exists, when responding to the data query request, i.e., step 204 is performed, the data is checked, it is determined whether there is newly updated data therein, wherein the newly updated data refers to the query data that has been updated after the freezing time point of the database is received, and if it exists, the data is deleted, where the deleted data includes both data fed back to the business person, as well as data stored in the database, in this way, the subsequent service personnel can not obtain the data, so that the subsequent service personnel can obtain the same data content.
Further, as an implementation of the data query method, an embodiment of the present invention provides a data query apparatus, which is mainly used for providing a service of data consistency for data queried by multiple users. For convenience of reading, details in the foregoing method embodiments are not described in detail again in this apparatus embodiment, but it should be clear that the apparatus in this embodiment can correspondingly implement all the contents in the foregoing method embodiments. As shown in fig. 3, the apparatus specifically includes:
a receiving unit 301, configured to receive a freezing time point of a database, where the freezing time point is used to prohibit updating data whose release time is after the freezing time point;
a filtering unit 302, configured to filter the update data in the database according to the freezing time point obtained by the receiving unit 301;
an inquiring unit 303, configured to respond to a data inquiring request according to the freezing time point obtained by the receiving unit 301, and ensure that data after the freezing time point has consistency in the inquired release time after the time corresponding to the freezing time point is set.
Further, as shown in fig. 4, the apparatus further includes:
a judging unit 304, configured to judge whether there is a set freezing time point in the database after the receiving unit 301 receives the freezing time point of the database;
a prompting unit 305, configured to prompt that the set freezing time point needs to be cancelled if the judging unit 304 determines that the set freezing time point exists;
a setting unit 306, configured to set the received freezing time point in the database if the judging unit 304 determines that there is no set freezing time point.
Further, as shown in fig. 4, the querying unit 303 includes:
an obtaining module 3031, configured to obtain a publishing time of query data in the data query request;
a determining module 3032, configured to determine whether the release time obtained by the obtaining module 3031 is after the freezing time point;
a feedback module 3033, configured to feed back the query data if the determination module 3032 determines that the time is after the freezing time point;
a prompting module 3034, configured to prompt that the query data is not frozen if the determining module 3032 determines that the query data is not after the freezing time point.
Further, as shown in fig. 4, the filtering unit 302 includes:
an analyzing module 3021, configured to analyze the release time corresponding to the update data of the database;
a judging module 3022, configured to judge whether the release time obtained by the analyzing module 3021 is after the freezing time point;
a filtering module 3023, configured to prohibit adding the update data to a sub-library if the determining module 3022 determines that the update data is after the freezing time point, where the sub-library is used to store the update data in the database, where the release time of the update data is before the freezing time point; otherwise, adding the updated data into the sub-library.
Further, as shown in fig. 4, the apparatus further includes:
a detecting unit 307, configured to detect whether there is a data query request in processing while the filtering unit 302 performs filtering on the updated data in the database according to the freezing time point, where an issue time of query data in the data query request is after the freezing time point;
a deleting unit 308, configured to delete, in response to the data query request, query data that has been updated after the freezing time point of the database is received if the detecting unit 307 determines that there is a data query request in the process.
Further, as shown in fig. 4, the apparatus further includes:
a canceling unit 309, configured to cancel the freeze time point according to a canceling instruction;
an updating unit 310 for updating data in the database after the revocation unit revokes the freeze time point and before the next freeze time point is set, the data being data prohibited from being updated during the period from the reception of the freeze time point to the revocation of the freeze time point.
Further, as shown in fig. 4, the apparatus further includes:
the cancelling unit 309 is further configured to, when the effective time duration of the freezing time point is greater than a preset time period and a cancelling instruction is not received, actively cancel the freezing time point;
a generating unit 311, configured to generate a prompt message indicating that the freezing time point is invalid after the canceling unit 309 cancels the freezing time point actively.
In summary, before providing queried data to service personnel, the method and the device for querying data according to embodiments of the present invention receive and set a freezing time point according to a requirement, and filter updated data in a database according to the freezing time point, so as to avoid updating data after the freezing time point.
The data inquiry device comprises a processor and a memory, wherein the receiving unit, the filtering unit, the inquiry unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can set one or more than one kernel, and provides a service of data consistency for the data inquired by a plurality of users by adjusting the kernel parameters, so that the data inquired by the plurality of users and after the freezing time point is not different due to data updating.
The embodiment of the invention provides a storage medium, which is used for storing a computer program, wherein when the computer program runs, the device where the storage medium is located is controlled to execute the data query method.
The embodiment of the invention provides a processor, which is used for running a computer program, wherein the computer program executes the data query method during running.
The embodiment of the invention provides equipment, which comprises at least one processor, at least one memory and a bus, wherein the memory and the bus are connected with the processor; the processor and the memory complete mutual communication through a bus; the processor is used for calling the program instructions in the memory so as to execute the data query method. The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
receiving a freezing time point of a database, wherein the freezing time point is used for forbidding updating data with the release time after the freezing time point;
filtering the updated data in the database according to the freezing time point;
and responding to a data query request according to the freezing time point, and ensuring that the data after the freezing time point has consistency in the queried release time after the time corresponding to the freezing time point is set.
Further, after receiving the freezing time point of the database, the method further comprises:
judging whether a set freezing time point exists in the database or not;
if yes, prompting that the set freezing time point needs to be cancelled;
if not, setting the received freezing time point in the database.
Further, responding to a data query request according to the freezing time point includes:
acquiring the issuing time of the query data in the data query request;
judging whether the release time is after the freezing time point;
if yes, feeding back the query data;
if not, prompting that the query data is not frozen.
Further, filtering the updated data in the database according to the freezing time point includes:
analyzing the release time corresponding to the updated data of the database;
judging whether the release time is after the freezing time point;
if so, forbidding adding the updated data into a sub-library, wherein the sub-library is used for storing the updated data of which the release time is before the freezing time point in the database;
and if not, adding the updated data into the sub-library.
Further, the method further comprises:
while filtering the updated data in the database according to the freezing time point, detecting whether a data query request in processing exists, wherein the issuing time of the query data in the data query request is behind the freezing time point;
and if so, deleting the query data updated after the freezing time point of the database is received when the data query request is responded.
Further, the method further comprises:
canceling the freezing time point according to a canceling instruction;
updating data in the database before setting a next freeze time point, the data being data prohibited from being updated during the reception freeze time point to the revocation freeze time point.
Further, the method further comprises:
when the effective time length of the freezing time point is longer than a preset time period and a cancelling instruction is not received, actively cancelling the freezing time point;
and generating prompt information of failure of the freezing time point.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be appreciated that the relevant features of the method and apparatus described above are referred to one another. In addition, "first", "second", and the like in the above embodiments are for distinguishing the embodiments, and do not represent merits of the embodiments.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In addition, the memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for querying data, the method comprising:
receiving a freezing time point of a database, wherein the freezing time point is used for forbidding updating data with the release time after the freezing time point;
filtering the updated data in the database according to the freezing time point;
and responding to a data query request according to the freezing time point, and ensuring that the data after the freezing time point has consistency in the queried release time after the time corresponding to the freezing time point is set.
2. The method of claim 1, wherein after receiving a freezing point in time of the database, the method further comprises:
judging whether a set freezing time point exists in the database or not;
if yes, prompting that the set freezing time point needs to be cancelled;
if not, setting the received freezing time point in the database.
3. The method of claim 1, wherein responding to a data query request according to the freeze time point comprises:
acquiring the issuing time of the query data in the data query request;
judging whether the release time is after the freezing time point;
if yes, feeding back the query data;
if not, prompting that the query data is not frozen.
4. The method of claim 1, wherein filtering the updated data in the database according to the freeze time point comprises:
analyzing the release time corresponding to the updated data of the database;
judging whether the release time is after the freezing time point;
if so, forbidding adding the updated data into a sub-library, wherein the sub-library is used for storing the updated data of which the release time is before the freezing time point in the database;
and if not, adding the updated data into the sub-library.
5. The method according to any one of claims 1-4, further comprising:
while filtering the updated data in the database according to the freezing time point, detecting whether a data query request in processing exists, wherein the issuing time of the query data in the data query request is behind the freezing time point;
and if so, deleting the query data updated after the freezing time point of the database is received when the data query request is responded.
6. The method of claim 1, further comprising:
canceling the freezing time point according to a canceling instruction;
updating data in the database before setting a next freeze time point, the data being data prohibited from being updated during the reception freeze time point to the revocation freeze time point.
7. The method of claim 1, further comprising:
when the effective time length of the freezing time point is longer than a preset time period and a cancelling instruction is not received, actively cancelling the freezing time point;
and generating prompt information of failure of the freezing time point.
8. An apparatus for querying data, the apparatus comprising:
the receiving unit is used for receiving a freezing time point of the database, and the freezing time point is used for forbidding updating data with the release time after the freezing time point;
the filtering unit is used for filtering the updated data in the database according to the freezing time point obtained by the receiving unit;
and the query unit is used for responding to a data query request according to the freezing time point obtained by the receiving unit and ensuring that the queried data after the freezing time point has consistency after the time corresponding to the freezing time point is set.
9. A storage medium for storing a computer program, wherein the computer program controls a device in which the storage medium is located to execute a method for querying data according to any one of claims 1 to 7 when running.
10. A processor for executing a computer program, wherein the computer program executes to perform a method for querying data according to any one of claims 1 to 7.
CN201910807240.5A 2019-08-29 2019-08-29 Data query method and device Pending CN112445805A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910807240.5A CN112445805A (en) 2019-08-29 2019-08-29 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910807240.5A CN112445805A (en) 2019-08-29 2019-08-29 Data query method and device

Publications (1)

Publication Number Publication Date
CN112445805A true CN112445805A (en) 2021-03-05

Family

ID=74742135

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910807240.5A Pending CN112445805A (en) 2019-08-29 2019-08-29 Data query method and device

Country Status (1)

Country Link
CN (1) CN112445805A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254502A (en) * 2021-06-07 2021-08-13 湖北央中巨石信息技术有限公司 Method, system, device and medium for filtering and valuing multi-party homogeneous data
CN113672965A (en) * 2021-10-21 2021-11-19 杭州太美星程医药科技有限公司 Information processing method, information processing apparatus, information transmitting apparatus, and storage medium
CN116719845A (en) * 2023-08-07 2023-09-08 烟台东方威思顿电气有限公司 Quick query method for periodic frozen data of electric energy meter

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0772981A (en) * 1993-07-07 1995-03-17 Hitachi Ltd Memory control unit and controlling method for the same
JPH1031609A (en) * 1996-07-16 1998-02-03 Nec Corp Time series database freezer
KR20010017650A (en) * 1999-08-13 2001-03-05 이계철 Method for managing transaction based on freezing scheme
CN102004681A (en) * 2009-09-01 2011-04-06 Lsi公司 A method for implementing continuous data protection utilizing allocate-on-write snapshots
CN104657148A (en) * 2015-03-11 2015-05-27 北京汽车研究总院有限公司 Data checking method and data checking device
CN108732977A (en) * 2018-08-30 2018-11-02 四川中电启明星信息技术有限公司 A kind of collecting method and system
CN109614447A (en) * 2018-10-15 2019-04-12 国网新疆电力有限公司阿克苏供电公司 A kind of intelligent electric meter divides the storage method, querying method and device of freezing data
CN109933596A (en) * 2019-02-27 2019-06-25 深圳市轱辘汽车维修技术有限公司 A kind of method of data synchronization, device and terminal device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0772981A (en) * 1993-07-07 1995-03-17 Hitachi Ltd Memory control unit and controlling method for the same
JPH1031609A (en) * 1996-07-16 1998-02-03 Nec Corp Time series database freezer
KR20010017650A (en) * 1999-08-13 2001-03-05 이계철 Method for managing transaction based on freezing scheme
CN102004681A (en) * 2009-09-01 2011-04-06 Lsi公司 A method for implementing continuous data protection utilizing allocate-on-write snapshots
CN104657148A (en) * 2015-03-11 2015-05-27 北京汽车研究总院有限公司 Data checking method and data checking device
CN108732977A (en) * 2018-08-30 2018-11-02 四川中电启明星信息技术有限公司 A kind of collecting method and system
CN109614447A (en) * 2018-10-15 2019-04-12 国网新疆电力有限公司阿克苏供电公司 A kind of intelligent electric meter divides the storage method, querying method and device of freezing data
CN109933596A (en) * 2019-02-27 2019-06-25 深圳市轱辘汽车维修技术有限公司 A kind of method of data synchronization, device and terminal device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254502A (en) * 2021-06-07 2021-08-13 湖北央中巨石信息技术有限公司 Method, system, device and medium for filtering and valuing multi-party homogeneous data
CN113672965A (en) * 2021-10-21 2021-11-19 杭州太美星程医药科技有限公司 Information processing method, information processing apparatus, information transmitting apparatus, and storage medium
CN116719845A (en) * 2023-08-07 2023-09-08 烟台东方威思顿电气有限公司 Quick query method for periodic frozen data of electric energy meter
CN116719845B (en) * 2023-08-07 2023-11-10 烟台东方威思顿电气有限公司 Quick query method for periodic frozen data of electric energy meter

Similar Documents

Publication Publication Date Title
CN112445805A (en) Data query method and device
JP6633059B2 (en) Rating files
CN108287708B (en) Data processing method and device, server and computer readable storage medium
CN111241122B (en) Task monitoring method, device, electronic equipment and readable storage medium
CN111400355B (en) Data query method and device
CN111124480B (en) Method and device for generating application program package, electronic equipment and storage medium
CN112866212A (en) Access control method and device for cloud computing resources, computer equipment and medium
CN107679937B (en) Method, system, storage medium and device for customizing service function
CN110336813B (en) Access control method, device, equipment and storage medium
CN107122663B (en) Injection attack detection method and device
CN114218619A (en) Data security protection method, device, medium and electronic equipment
CN109977317B (en) Data query method and device
CN113157600A (en) Space allocation method of shingled hard disk, file storage system and server
CN112597105A (en) Processing method of file associated object, server side equipment and storage medium
EP4050495A1 (en) Trigger implementing method and device
CN113590264A (en) File tamper-proofing method and device under container environment
CN115827589A (en) Authority verification method and device, electronic equipment and storage medium
CN109656672B (en) File loading method and system
CN114647663A (en) Resource processing method, device and system, electronic equipment and storage medium
CN111444483A (en) Authentication method, device and equipment
CN116484403A (en) Cluster resource processing method and device and electronic equipment
KR102561492B1 (en) Devices and methods for safe storage of media containing personal data and erasure of stored personal data
CN117170823B (en) Method and device for executing operation in batch container and electronic equipment
CN110569171B (en) File monitoring method and device
CN108399323B (en) Parameter management system and parameter management method

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