WO2017167063A1 - 一种数据检索方法和装置、一种数据存储方法和装置 - Google Patents

一种数据检索方法和装置、一种数据存储方法和装置 Download PDF

Info

Publication number
WO2017167063A1
WO2017167063A1 PCT/CN2017/077450 CN2017077450W WO2017167063A1 WO 2017167063 A1 WO2017167063 A1 WO 2017167063A1 CN 2017077450 W CN2017077450 W CN 2017077450W WO 2017167063 A1 WO2017167063 A1 WO 2017167063A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
time
time interval
target
value
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.)
Ceased
Application number
PCT/CN2017/077450
Other languages
English (en)
French (fr)
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Publication of WO2017167063A1 publication Critical patent/WO2017167063A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/248Presentation of query results

Definitions

  • the present application relates to the field of information technology, and in particular, to a data retrieval method and apparatus, and a data storage method and apparatus.
  • Statistical analysis of big data can help make industry decisions. For example, in an industry dominated by transactional data, such as finance, e-commerce, etc., analysis of big data can quickly extract information of commercial value.
  • a common big data analysis requirement is specifically: determining whether the target data grows or declines in a certain period of time. For example, if a website has tens of millions of members, you need to analyze the transaction data of all members to get a member with a growing trend in transaction volume data over a certain period of time.
  • An existing scheme can use the trend graph to determine the growth or decline trend of the object data in a certain period of time, so as to reflect the dynamic change process of the object data by means of the rise and fall of the continuous curve of the trend graph. Specifically, all object data can be read out at once, and drawn point by point.
  • the technical problem to be solved by the embodiments of the present application is to provide a data retrieval method, which can greatly improve the efficiency of trend determination and the acquisition efficiency of target identification data, and can save system resources. Source, as well as the ability to save labor costs.
  • the embodiment of the present application further provides a data retrieval device, a data storage method and device, to ensure implementation and application of the foregoing method.
  • a data retrieval method including:
  • the retrieval request includes: a preset first time interval
  • the identification data is used as a grouping, and the mapping relationship between the identification data, the time data, the current value of the object data, and the historical mean value is retrieved, so as to obtain the number of target data records in the first time interval within a preset range.
  • Target identification data the relationship between the current value and the historical mean value in the target data record is fixed;
  • the target identification data is output.
  • the relationship between the current value and the historical mean value is fixed, including: the current value is greater than the historical average value, or the current value is smaller than the historical average value.
  • the number of the target data records is within a preset range, including: the number of the target data records exceeds a threshold.
  • the threshold is greater than or equal to one-half of a length of the first time interval, and the threshold is less than or equal to a length of the first time interval.
  • the step of searching for the mapping relationship between the identification data, the time data, the current value of the object data, and the historical mean value, as the grouping includes:
  • identifying by using the identifier data as a group, a mapping relationship between the identifier data, the time data, the current value of the object data, and the historical mean value, to obtain a target data record with a fixed relationship between the object data value and the historical mean value;
  • the historical mean value includes: a second corresponding to the current data of the object data value The mean within the time interval, the second time interval comprising: time data prior to the current time data.
  • the present application discloses a data storage method, including:
  • the second time interval includes : time data earlier than the current time data;
  • a mapping relationship between the identification data, the time data, the current value of the object data, and the historical mean value is established and saved.
  • the end point of the second time interval is previous time data.
  • the length of the second time interval is greater than or equal to one-half of the length of the first time interval, and the length of the second time interval is less than or equal to the length of the first time interval.
  • a data retrieval device including:
  • a receiving module configured to receive a retrieval request, where the retrieval request includes: a preset first time interval;
  • a retrieval module configured to perform the mapping between the identification data, the time data, the current value of the object data, and the historical mean value, to obtain the number of the target data records in the first time interval.
  • Target identification data within a preset range; the magnitude relationship between the current value and the historical mean value in the target data record is fixed;
  • an output module configured to output the target identification data.
  • the relationship between the current value and the historical mean value is fixed, including: the current value is greater than the historical average value, or the current value is smaller than the historical average value.
  • the number of the target data records is within a preset range, including: the number of the target data records exceeds a threshold.
  • the searching module includes:
  • a first retrieval sub-module for using the identification data as a grouping, in identifying data, time data, Retrieving a mapping relationship between a current value of the object data and a historical mean value to obtain a target data record having a fixed relationship between the object data value and the historical mean value;
  • a second retrieval submodule configured to perform a retrieval in a mapping relationship between the object data and the number of the target data records to obtain target identification data in which the number of target data records is within a preset range.
  • the present application discloses a data storage device, including:
  • a determining module configured to determine, according to a mapping relationship between the identifier data, the time data, and the current value of the object data, an average value of the object data in a second time interval corresponding to the current time data, as a corresponding historical mean value;
  • the second time interval includes: time data that is earlier than the current time data;
  • the saving module is configured to establish and save a mapping relationship between the identifier data, the time data, the current value of the object data, and the historical mean value according to the historical mean value.
  • the embodiment of the present application includes the following advantages:
  • the embodiment of the present application uses simple retrieval logic to perform the retrieval of the target identification data (for example, the user identifier or the website identifier of the transaction amount that continues to grow), which can be greatly improved, The efficiency of trend determination and the efficiency of acquisition of target identification data, and the ability to save system resources.
  • the target identification data for example, the user identifier or the website identifier of the transaction amount that continues to grow
  • the trend determination result can be obtained after the analyst analyzes and analyzes the drawn trend graph in the existing solution, and the embodiment of the present application can directly output the target identifier data that meets the specific trend, thereby further improving the trend determination.
  • the efficiency and target identification data are obtained efficiently, and the corresponding labor cost can be saved.
  • FIG. 1 is a flow chart showing the steps of an embodiment of a data storage method of the present application.
  • FIG. 2 is a flow chart showing the steps of an embodiment of a data retrieval method of the present application
  • FIG. 3 is a structural block diagram of an embodiment of a data retrieval device of the present application.
  • FIG. 4 is a block diagram showing the structure of an embodiment of a data storage device of the present application.
  • the present invention provides a basis for the current value in the continuous interval, which is a technical problem that requires a large amount of time, a large amount of system resources, and a trend graph analysis in the existing solution, which requires a large amount of labor cost.
  • a scheme for determining a trend of the object data according to the size relationship of the historical mean value which may be implemented in a base retrieval manner.
  • the preset first time interval may be carried in the retrieval request, and the identification data is grouped, and the identification data is Retrieving the mapping relationship between the time data, the current value of the object data, and the historical mean value to obtain target identification data within the preset time range in the first time interval, and the current data in the target data record
  • the relationship between the value and the historical mean value is fixed, and the target identification data is output.
  • the historical mean value can be used to indicate that the object data is in the historical time interval corresponding to the current object data, it can reflect the overall situation of the object data in the historical time interval. Therefore, in the embodiment of the present application, the current value and the historical mean value are The size relationship can reflect the current incremental change of the object data. Specifically, if the current value is greater than the historical mean value, the corresponding increment is positive. If the current value is less than the historical mean value, the corresponding increment is negative; The relationship between the current value and the historical mean value above is fixed to reflect a certain trend (such as a growth or a downward trend), so that the number of target data records in the first time interval can be used.
  • a specific growth or downward trend of whether the object data of the current identification data in the first time interval is present as a whole is determined. Further, when the number of target data records in the first time interval is within a preset range, a specific trend of the object data in the first time interval may be determined, so that the current identification data may be output as the target identification data. .
  • the embodiment of the present application uses simple retrieval logic to perform the retrieval of the target identification data (for example, the user identifier or the website identifier of the transaction volume that continues to grow), It can greatly improve the efficiency of trend determination and the acquisition efficiency of target identification data, and can save system resources.
  • the target identification data for example, the user identifier or the website identifier of the transaction volume that continues to grow
  • the trend determination result can be obtained after the analyst analyzes and analyzes the drawn trend graph in the existing solution, and the embodiment of the present application can directly output the target identifier data that meets the specific trend, thereby further improving the trend determination.
  • the efficiency and target identification data are obtained efficiently, and the corresponding labor cost can be saved.
  • the solution flow provided by the embodiment of the present application can be applied to a big data scenario, wherein the big data may belong to an industry mainly based on transactional data such as finance and e-commerce, and may also belong to medicine, meteorology, etc., and need to store a large amount of monitoring information.
  • the embodiments of the present application do not limit specific big data.
  • the solution provided by the application may be run on an information device.
  • the information device includes but is not limited to: a smart phone, a tablet computer, an e-book reader, and an MP3 (motion image expert compresses a standard audio layer 3 ,Moving Picture Experts Group Audio Layer III) Player, MP4 (Moving Picture Experts Group Audio Layer IV) player, laptop portable computer, car computer, desktop computer, set-top box, smart TV Machines, wearables, and more.
  • FIG. 1 a flow chart of steps of an embodiment of a data storage method of the present application is shown, which may specifically include the following steps:
  • Step 101 Determine, according to a mapping relationship between the identifier data, the time data, and the current value of the object data, an average value of the object data in a second time interval corresponding to the current time data, as a corresponding historical mean value;
  • the time interval may specifically include: time data earlier than the current time data;
  • Step 102 Establish and save, according to the historical mean value, a mapping relationship between the identifier data, the time data, the current value of the object data, and the historical mean value.
  • the mapping relationship between the identifier data, the time data, and the current value of the object data may specifically include three fields: Key (identification data), Time (time data), and Data (current value of the object data).
  • the above identification data may be used to identify object data to be retrieved, for example, it may include: a user ID (Identity), a website ID, a product ID, and the like.
  • the value of the Key field can be represented as key k , where k can represent the number of the key.
  • the above time data can be used to represent the production time of the object data, wherein the object data can have a specific production cycle, and usually adjacent time data is separated by one production cycle.
  • the above production cycle may include: year, month, day, hour, minute, and the like.
  • the value of the Time field can be expressed as time t , where k can represent the number of the Time.
  • time 1 "2015-01-01 01”
  • time 2 "2015-01-01 02”.
  • the object data may be used to represent the data to be retrieved and the data to be determined.
  • the object data may specifically include: website traffic, consumption amount, transaction amount, etc., which is usually an integer type.
  • the value of the Data field data k, t may represent the object data of the key k corresponding to the current time data at time t (such as the access amount 20000, etc.).
  • each data record includes identification data, current time data (representing the current time point), and current value of the object data.
  • the second time interval may be a historical time interval corresponding to the current time data, where the second time interval may specifically include: time data earlier than the current time data; that is, the second time At least one time data in the interval is earlier than the current time data, thereby ensuring the historical significance of the historical mean, thereby being able to reflect the overall situation of the object data in the second time interval described above.
  • the first time interval may specifically include: a start point and an end point, wherein the time data corresponding to the start point may be earlier than the time data corresponding to the end point.
  • the end point of the second time interval may be previous time data.
  • the time corresponding to the previous time data may be one unit period earlier than the time corresponding to the current time data.
  • the previous time data can be time t-1 .
  • the second time interval may be expressed as [time tn , time t-1 ], that is, the second time interval specifically includes Object data for n production cycles before current time data.
  • avg(k, t, n) represents the historical mean value of the key k at the time t
  • the object data of the key k in the second time interval of the length n may be first acquired. Then, sum all the acquired object data, and finally, the ratio of the summation result to n is taken as the corresponding historical mean value.
  • avg(1, t, n) represents the historical average of the traffic of web1 in the past n days
  • avg(2, t, n) represents the historical average of the number of visits of web2 in the past n days.
  • the length of the second time interval may be greater than or equal to one-half of the length of the first time interval, and the length of the second time interval may be less than or equal to The length of the first time interval.
  • the first time interval may be a time interval for inspection and retrieval, which may be determined according to actual application requirements. For example, if a specific trend of the object data within a certain time interval (such as the most recent month) is to be determined, the time interval may be used as the first time interval.
  • the above step 102 may be the key k and the current time data t, the current value of the object data data k, t , and the historical mean avg(k, t, n) of the past n days. , as a data record is stored in the corresponding data table (hereinafter referred to as the search table).
  • Step 101 is obtained by taking the value 5 for the mapping relationship of Table 1.
  • Website id(Key) Date Visits (Data) Avg_data Web1 2015-01-05 50000 35600 Web2 2015-01-05 40000 44000 Web1 2015-01-06 60000 43000 Web2 2015-01-06 30000 38000 Web3 2015-01-06 40000 42000
  • the embodiment of the present application may store the current value of the object data of each production cycle and the historical average value of the past n production cycles in a data record of the search table, that is, the production cycle of the above-mentioned search table may be
  • the production cycle of the object data is the same, so the continuity of the historical mean data can be guaranteed.
  • FIG. 2 a flow chart of steps of an embodiment of a data retrieval method of the present application is shown, which may specifically include the following steps:
  • Step 201 Receive a retrieval request; the retrieval request may include: a preset first time interval;
  • Step 202 The identification data is used as a group, and the mapping relationship between the identifier data, the time data, the current value of the object data, and the historical average value is retrieved, so as to obtain the preset number of the target data records in the first time interval.
  • Target identification data in the range; the relationship between the current value and the historical mean value in the target data record is fixed;
  • Step 203 Output the target identification data.
  • the search table (c_data_compare) generated in FIG. 1 stores the mapping relationship between the identification data key k , the time data time t , the current value data k, t of the object data , and the historical mean value avg(k, t, n).
  • the search process corresponding to the search request may include: searching by a key in the search table to obtain [time t1 , time t2 ], current value data k, t and
  • the historical mean value avg(k, t, n) is a target identification data in which the number of fixed data records is fixed within a preset range.
  • step 201 can receive the search request input by the user through a preset search interface (such as an input box or the like). It can be understood that the specific process of receiving the search request is not limited in the embodiment of the present application.
  • the step 203, the outputting the target identification data may include: displaying the target identification data to the user on the current information device, or sending the target identification data to other information devices through the current information device, etc.,
  • the specific process of outputting the target identification data in the above step 203 is not limited.
  • the relationship between the current value and the historical mean value is fixed, and the method may include: the current value is greater than the historical average value, or the current value is smaller than the historical average value.
  • the number of the target data records is within a preset range, and specifically, the method may include: the number of the target data records exceeds a threshold.
  • the threshold may be greater than or equal to one-half of the length of the first time interval, and the threshold may be less than or equal to the length of the first time interval. Assuming that the threshold is q, then f/2 ⁇ q ⁇ f.
  • an identification data specifically includes f data records in [time t1 , time t2 ], so the above f/2 ⁇ q ⁇ f can ensure that more than half of the data records in the f data records conform to the current value data k , t is greater than (or less than) the condition of the historical mean avg(k, t, n), that is, more than half of the data records can exhibit a specific trend.
  • the trend of the identification data is determined as the specific trend, Ensure the rationality of the trend determination.
  • the above-mentioned f/2 ⁇ q ⁇ f is only an optional embodiment of q.
  • those skilled in the art may also adopt a q value less than f/2 according to actual application requirements, and the embodiment of the present application is specific to q. The value is not limited.
  • the historical mean value may specifically include: an average value of the object data value in a second time interval corresponding to the current time data, where the second time interval may specifically include: Time data of the current time data. This ensures the historical significance of the historical mean and thus reflects the overall situation of the object data in the second time interval described above.
  • the step 202 of searching the mapping relationship between the identifier data, the time data, the current value of the object data, and the historical average value is performed as the grouping.
  • Step S1 The identification data is used as a group, and the mapping relationship between the identifier data, the time data, the current value of the object data, and the historical mean value is searched to obtain a target with a fixed relationship between the object data value and the historical mean value.
  • data record
  • Step S2 Establish and save a mapping relationship between the object data and the number of the target data records
  • Step S3 Perform a search in a mapping relationship between the object data and the number of the target data records to obtain target identification data in which the number of target data records is within a preset range.
  • step S1 may retrieve target data records in [time t1 , time t2 ], all current values data k, t is greater than (or less than) historical mean avg(k, t, n) .
  • step S2 the Key field may be grouped, and the number D_count of the corresponding target data records is calculated.
  • a mapping relationship between the object data Key and the number of target data records D_count may be established and saved, and the mapping relationship is saved to the intermediate table tmp_c_data_compare.
  • step-by-step retrieval of the above steps S1 to S3 is only an optional embodiment. In fact, those skilled in the art can implement the functions of the embodiments of the present application by one-step retrieval according to actual application requirements.
  • the embodiment of the present application can generate a relatively good technical effect in a big data scenario that supports a SQL (Structured Query Language) language. Specifically, the retrieval efficiency can be greatly improved.
  • SQL Structured Query Language
  • the language supported by the embodiment of the present application is not limited to the SQL, and the C language and the JAVA language are also within the protection scope of the embodiments of the present application.
  • the embodiment of the present application may store the current value of the object data of each production cycle and the historical average value of the past n production cycles in one data record of the search table, that is, the production cycle of the above-mentioned search table may be
  • the production cycle of the object data is the same, which not only ensures the persistence of the historical mean data, but also provides sufficient data for the data retrieval of the embodiment of the present application;
  • the search in the embodiment of the present application may identify the data as a unit and search.
  • the target identification data in which the current value is greater than (or less than) the historical average value of the data record in the preset mapping relationship, that is, the obtained retrieval result includes: a set of target keys; therefore, relative to the existing scheme for each
  • the process of drawing the trend graph separately by the identification data because the embodiment of the present application adopts simple retrieval logic to perform the special
  • the retrieval of the target identification data of the trend (for example, the user ID or the website identifier whose transaction amount continues to increase) can greatly improve the efficiency of the trend determination and the acquisition efficiency of the target identification data, and can save system resources.
  • the trend determination result can be obtained after the analyst analyzes and analyzes the drawn trend graph in the existing solution, and the embodiment of the present application can directly output the target identifier data that meets the specific trend, thereby further improving the trend.
  • the efficiency of the determination and the acquisition efficiency of the target identification data are saved, and the corresponding labor cost can be saved.
  • the present application can adjust the corresponding retrieval quality by setting the threshold value q;
  • FIG. 3 a structural block diagram of an embodiment of a data retrieval apparatus of the present application is shown, which may specifically include the following modules:
  • the receiving module 301 is configured to receive a retrieval request, where the retrieval request may include: a preset first time interval;
  • the retrieval module 302 is configured to perform the mapping between the identification data, the time data, the current value of the object data, and the historical average value as the grouping to obtain the number of the target data records in the first time interval.
  • Target identification data within a preset range; The relationship between the current value and the historical mean value in the target data record is fixed;
  • the output module 303 is configured to output the target identification data.
  • the relationship between the current value and the historical mean value is fixed, and the method may include: the current value is greater than the historical average value, or the current value is smaller than the historical value. Mean.
  • the number of the target data records is within a preset range, and specifically, the method may include: the number of the target data records exceeds a threshold.
  • the threshold may be greater than or equal to one-half of a length of the first time interval, and the threshold may be less than or equal to a length of the first time interval.
  • the retrieving module 302 may specifically include:
  • a first search sub-module configured to perform, by using the identifier data as a group, a mapping relationship between the identifier data, the time data, the current value of the object data, and the historical mean value to obtain the object data value and the historical mean value.
  • a target data record with a fixed size relationship configured to perform, by using the identifier data as a group, a mapping relationship between the identifier data, the time data, the current value of the object data, and the historical mean value to obtain the object data value and the historical mean value.
  • a second retrieval sub-module configured to perform a retrieval in a mapping relationship between the object data and the number of the target data records to obtain target identification data in which the number of target data records is within a preset range.
  • the historical average may specifically include: an average value of the object data value in a second time interval corresponding to the current time data, where the second time interval includes: earlier than the current Time data for time data.
  • FIG. 4 a structural block diagram of an embodiment of a data storage device of the present application is shown, which may specifically include the following modules:
  • a determining module 401 configured to determine, according to a mapping relationship between the identifier data, the time data, and the current value of the object data, an average value of the object data in a second time interval corresponding to the current time data, as a corresponding historical mean value;
  • the second time interval includes: time data that is earlier than the current time data;
  • the saving module 402 is configured to establish and save, according to the historical mean value, a mapping relationship between the identifier data, the time data, the current value of the object data, and the historical mean value.
  • the end point of the second time interval may be previous time data.
  • the length of the second time interval may be greater than or equal to one-half of the length of the first time interval, and the length of the second time interval may be less than or equal to the first The length of the time interval.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • embodiments of the embodiments of the present application can be provided as a method, apparatus, or computer program product. Therefore, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, embodiments of the present application can be implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) in which computer usable program code is embodied. The form of a computer program product.
  • the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, 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 disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include non-persistent computer readable media, such as modulated data signals and carrier waves.
  • Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present application.
  • the computer program can be The instructions implement a combination of the processes and/or blocks in the flowcharts and/or block diagrams, and the flows and/or blocks in the flowcharts and/or block diagrams.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device Means are provided for implementing the functions specified in one or more of the flow or in one or more blocks of the flow chart.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the instruction device implements the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.

Landscapes

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

Abstract

一种数据检索方法和装置、一种数据存储方法和装置,其中的检索方法具体包括:接收检索请求;所述检索请求中包括:预置的第一时间区间(201);将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述第一时间区间内、目标数据记录的数目在预置范围内的目标标识数据;所述目标数据记录中所述当前值和所述历史均值的大小关系固定(202);输出所述目标标识数据(203)。所述方法和装置能够大大提高趋势判定的效率和目标标识数据的获取效率,且能够节省系统资源,以及能够节省人力成本。

Description

一种数据检索方法和装置、一种数据存储方法和装置 技术领域
本申请涉及信息技术技术领域,特别是涉及一种数据检索方法和装置、一种数据存储方法和装置。
背景技术
随着信息技术的高速发展,行业数据量急剧增长。目前各行业涌现的大数据具有数据量大和具有时间相关性的特性,对大数据进行统计分析可以帮助制定行业决策。例如,对于以交易型数据为主的行业,例如金融、电子商务等,对大数据进行分析,能够快速提炼出具有商业价值的信息。其中,常见的一种大数据分析需求具体为:判定对象数据在某个时间段内的增长或者下降趋势。例如,假设网站具有数千万个会员,则需要对所有会员的交易额数据进行分析,以得到在某个时间段内交易额数据呈增长趋势的会员。
一种现有方案可以利用趋势图判定对象数据在某个时间段内的增长或者下降趋势,以借助于趋势图的连续曲线的升降变化,来反映对象数据的动态变化过程。具体地,可以将所有对象数据一次性读出,逐点绘制。
然而,在实际应用中,上述逐点绘制过程需要耗费大量的时长,且占用较多的系统资源。另外,分析人员在查看和分析绘制得到的趋势图后,才能得到对应的趋势判定结果,不仅耗费了大量人力成本,而且影响了趋势判定的效率。
发明内容
本申请实施例所要解决的技术问题是提供一种数据检索方法,能够大大提高趋势判定的效率和目标标识数据的获取效率,且能够节省系统资 源,以及能够节省人力成本。
相应的,本申请实施例还提供了一种数据检索装置、一种数据存储方法和装置,用以保证上述方法的实现及应用。
为了解决上述问题,本申请公开了一种数据检索方法,包括:
接收检索请求;所述检索请求中包括:预置的第一时间区间;
将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述第一时间区间内、目标数据记录的数目在预置范围内的目标标识数据;所述目标数据记录中所述当前值和所述历史均值的大小关系固定;
输出所述目标标识数据。
可选地,所述当前值和所述历史均值的大小关系固定,包括:所述当前值大于所述历史均值,或者,所述当前值小于所述历史均值。
可选地,所述目标数据记录的数目在预置范围内,包括:所述目标数据记录的数目超过阈值。
可选地,所述阈值大于等于所述第一时间区间的长度的二分之一,且所述阈值小于等于所述第一时间区间的长度。
可选地,所述将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索的步骤,包括:
将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述对象数据值和所述历史均值的大小关系固定的目标数据记录;
建立并保存对象数据和所述目标数据记录的数目之间的映射关系;
在所述对象数据和所述目标数据记录的数目之间的映射关系中进行检索,以得到目标数据记录的数目在预置范围内的目标标识数据.
可选地,所述历史均值包括:对象数据值在当前时间数据对应的第二 时间区间内的均值,所述第二时间区间包括:早于所述当前时间数据的时间数据。
另一方面,本申请公开了一种数据存储方法,包括:
依据标识数据、时间数据和对象数据的当前值之间的映射关系,确定所述对象数据在当前时间数据对应的第二时间区间内的均值,作为对应的历史均值;所述第二时间区间包括:早于所述当前时间数据的时间数据;
依据所述历史均值,建立并保存标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系。
可选地,所述第二时间区间的终点为前一时间数据。
可选地,所述第二时间区间的长度大于等于第一时间区间的长度的二分之一,且所述第二时间区间的长度小于等于第一时间区间的长度。
再一方面,本申请公开了一种数据检索装置,包括:
接收模块,用于接收检索请求;所述检索请求中包括:预置的第一时间区间;
检索模块,用于将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述第一时间区间内、目标数据记录的数目在预置范围内的目标标识数据;所述目标数据记录中所述当前值和所述历史均值的大小关系固定;以及
输出模块,用于输出所述目标标识数据。
可选地,所述当前值和所述历史均值的大小关系固定,包括:所述当前值大于所述历史均值,或者,所述当前值小于所述历史均值。
可选地,所述目标数据记录的数目在预置范围内,包括:所述目标数据记录的数目超过阈值。
可选地,所述检索模块,包括:
第一检索子模块,用于将标识数据作为分组,在标识数据、时间数据、 对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述对象数据值和所述历史均值的大小关系固定的目标数据记录;
保存子模块,用于建立并保存对象数据和所述目标数据记录的数目之间的映射关系;以及
第二检索子模块,用于在所述对象数据和所述目标数据记录的数目之间的映射关系中进行检索,以得到目标数据记录的数目在预置范围内的目标标识数据。
又一方面,本申请公开了一种数据存储装置,包括:
确定模块,用于依据标识数据、时间数据和对象数据的当前值之间的映射关系,确定所述对象数据在当前时间数据对应的第二时间区间内的均值,作为对应的历史均值;所述第二时间区间包括:早于所述当前时间数据的时间数据;以及
保存模块,用于依据所述历史均值,建立并保存标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系。
与现有方案相比,本申请实施例包括以下优点:
相对于现有方案中趋势图的绘制过程,由于本申请实施例采用简单的检索逻辑进行符合特定趋势的目标标识数据(例如交易额持续增长的用户标识或网站标识)的检索,故能够大大提高趋势判定的效率和目标标识数据的获取效率,且能够节省系统资源。
另外,相对于现有方案中分析人员在查看和分析绘制得到的趋势图后,才能得到对应的趋势判定结果,本申请实施例能够直接输出符合特定趋势的目标标识数据,因此能够进一步提高趋势判定的效率和目标标识数据的获取效率,且能够节省对应的人力成本。
附图说明
图1是本申请的一种数据存储方法实施例的步骤流程图;;
图2是本申请的一种数据检索方法实施例的步骤流程图;
图3是本申请的一种数据检索装置实施例的结构框图;以及
图4是本申请的一种数据存储装置实施例的结构框图。
具体实施方式
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。
针对现有方案中趋势图的绘制耗费大量的时长、占用较多的系统资源、以及趋势图的分析需要耗费大量的人力成本的技术问题,本申请实施例提供了一种依据连续区间内当前值和历史均值的大小关系确定对象数据的趋势的方案,其可以基检索的方式实现,具体地,可以在检索请求中携带预置的第一时间区间,并将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到上述第一时间区间内、目标数据记录的数目在预置范围内的目标标识数据,上述目标数据记录中上述当前值和上述历史均值的大小关系固定,进而输出上述目标标识数据。
由于上述历史均值可用于表示对象数据在当前对象数据对应的历史时间区间内,故其能够反映对象数据在上述历史时间区间内的总体情况,故本申请实施例中上述当前值和上述历史均值的大小关系能够反映对象数据当前的增量变化,具体地,若上述当前值大于上述历史均值,则对应的增量为正,若上述当前值小于上述历史均值,则对应的增量为负;因此,上述当前值和上述历史均值的大小关系固定可以反映某种特定趋势(如增长或下降趋势),从而可以依据上述第一时间区间内目标数据记录的数目 确定当前标识数据在第一时间区间的对象数据是否整体上呈现出的特定增长或下降趋势。进一步,在上述第一时间区间内目标数据记录的数目在预置范围内时,可以确定第一时间区间的对象数据整体上呈现出的特定趋势,故可以将当前标识数据作为目标标识数据进行输出。
综上,相对于现有方案中趋势图的绘制过程,由于本申请实施例采用简单的检索逻辑进行符合特定趋势的目标标识数据(例如交易额持续增长的用户标识或网站标识)的检索,故能够大大提高趋势判定的效率和目标标识数据的获取效率,且能够节省系统资源。
另外,相对于现有方案中分析人员在查看和分析绘制得到的趋势图后,才能得到对应的趋势判定结果,本申请实施例能够直接输出符合特定趋势的目标标识数据,因此能够进一步提高趋势判定的效率和目标标识数据的获取效率,且能够节省对应的人力成本。
本申请实施例提供的方案流程可以应用于大数据的场景中,其中,上述大数据可以属于金融、电子商务等交易型数据为主的行业,也可以属于医药、气象等需要存储大量的监测信息的行业,可以理解,本申请实施例对于具体的大数据不加以限制。
另外,本申请提供的方案流程可以在信息设备上运行,在实际应用中,上述信息设备具体包括但不限:智能手机、平板电脑、电子书阅读器、MP3(动态影像专家压缩标准音频层面3,Moving Picture Experts Group Audio Layer III)播放器、MP4(动态影像专家压缩标准音频层面4,Moving Picture Experts Group Audio Layer IV)播放器、膝上型便携计算机、车载电脑、台式计算机、机顶盒、智能电视机、可穿戴设备等等。
存储方法实施例
参照图1,示出了本申请的一种数据存储方法实施例的步骤流程图,具体可以包括如下步骤:
步骤101、依据标识数据、时间数据和对象数据的当前值之间的映射关系,确定所述对象数据在当前时间数据对应的第二时间区间内的均值,作为对应的历史均值;所述第二时间区间具体可以包括:早于所述当前时间数据的时间数据;
步骤102、依据所述历史均值,建立并保存标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系。
本申请实施例中,标识数据、时间数据和对象数据的当前值之间的映射关系具体可以包括:Key(标识数据)、Time(时间数据)和Data(对象数据的当前值)3个字段。
上述标识数据可用于标识待检索的对象数据,例如,其可以包括:用户ID(标识,Identity)、网站ID、商品ID等。通常,Key字段的值可以表示为keyk,其中,k可以表示key的编号。
上述时间数据可用于表示对象数据的生产时间,其中,上述对象数据可以具有特定的生产周期,通常相邻的时间数据之间相隔一个生产周期。例如,上述生产周期可以包括:年、月、日、小时、分钟等。通常,Time字段的值可以表示为timet,其中,k可以表示Time的编号。
以生产周期为日为例,若time1=”2015-01-01”,则time2=”2015-01-02”;
以生产周期为小时为例,若time1=”2015-01-01 01”,则time2=”2015-01-01 02”。
对象数据可用于表示待检索的数据和待确定趋势的数据,例如,上述对象数据具体可以包括:网站流量、消费金额、交易额等,其通常为整数类型。通常,Data字段的值datak,t可以表示keyk在timet对应当前时间数据的对象数据(如访问量20000等)。
参照表1(c_data),示出了本申请的一种Key、Time和Data之间的映射关系的示意,其中,Key具体为网站id,Time以日为生产周期,Data 具体为访问量。可以理解,本申请实施例对于Key、Time和Data之间的具体映射关系不加以限制。
表1(c_data)
网站id(Key) 日期(Time) 访问量(Data)
web1 2015-01-01 23000
web2 2015-01-01 60000
web1 2015-01-02 30000
web2 2015-01-02 50000
web1 2015-01-03 35000
web2 2015-01-03 40000
web3 2015-01-03 50000
web1 2015-01-04 40000
web2 2015-01-04 30000
web3 2015-01-04 30000
web1 2015-01-05 50000
web2 2015-01-05 40000
web3 2015-01-05 50000
web1 2015-01-06 60000
web2 2015-01-06 30000
web3 2015-01-06 40000
web1 2015-01-07 70000
web2 2015-01-07 20000
web3 2015-01-07 40000
web1 2015-01-08 50000
web2 2015-01-08 10000
web3 2015-01-08 40000
本申请实施例中,类似表1的映射关系中存在多条数据记录,其中,每条数据记录中均包括标识数据、当前时间数据(表示当前时间点)和对象数据的当前值。
进一步,第二时间区间可以为与当前时间数据相应的历史时间区间,其中,所述第二时间区间具体可以包括:早于所述当前时间数据的时间数据;也即,上述所述第二时间区间中至少一个时间数据早于当前时间数据,由此可以保证历史均值的历史性,从而能够反映对象数据在上述第二时间区间内的总体情况。
在实际应用中,所述第一时间区间具体可以包括:起点和终点,其中,起点对应的时间数据可以早于终点对应的时间数据。在本申请的一种可选实施例中,所述第二时间区间的终点可以为前一时间数据。其中,前一时间数据对应的时间可以比当前时间数据对应的时间早一个单位周期。假设当前时间数据为timet,则前一时间数据可以为timet-1。在本申请的一种应用示例中,假设上述第二时间区间的长度为n,则上述第二时间区间可以表示为[timet-n,timet-1],也即,上述第二时间区间具体包括当前时间数据之前的n个生产周期的对象数据。
在本申请的一种可选实施例中,假设avg(k,t,n)表示keyk在timet的历史均值,则可以首先获取长度为n的上述第二时间区间内keyk的对象数据,然后,对所获取的所有对象数据进行求和,最后,将求和结果与n的比值作为对应的历史均值。以表1为例,avg(1,t,n)表示web1的访问量在过去n天的历史均值,avg(2,t,n)表示web2的访问量在过去n天的历史均值.
在实际应用中,通常第二时间区间的长度n的取值越大,则对历史数据的表达越准确,也即,上述历史均值所反映的对象数据在上述第二时间区间内的总体情况越准确。同时,第二时间区间的长度n的取值越大,则上述历史均值对应的确定过程所需的计算量越大。可以理解,本领域技术 人员可以根据实际应用需求,在准确度和计算量之间取一个较为平衡的n值。
例如,在本申请的另一种可选实施例中,所述第二时间区间的长度可以大于等于第一时间区间的长度的二分之一,且所述第二时间区间的长度可以小于等于第一时间区间的长度。其中,上述第一时间区间可以为用于考察和检索的时间区间,其可以依据实际应用需求确定。例如,欲要确定对象数据在某个时间区间(如最近一个月)内的特定趋势,则可以将该时间区间作为第一时间区间。可以理解,上述大于等于第一时间区间的长度f的二分之一、且小于等于第一时间区间的长度,仅是作为本申请的第二时间区间的长度n的可选实施例,实际上,本领域技术人员还可以根据实际应用需求,采用其他的n值,如小于f/2,或者,大于f等。
在本申请的再一种可选实施例中,上述步骤102可以将keyk以及当前时间数据t、对象数据的当前值datak,t、过去n天的历史均值avg(k,t,n),作为一条数据记录存储到对应的数据表(以下简称检索表)中。
参照表2,示出了本申请的一种检索表(c_data_compare)的示意,其具体可以包括:Key、Time、Data和Avg_data(过去n天的历史均值)等4个均值,其中的Avg_data是利用步骤101针对表1的映射关系对n取值5得到的。
表2(c_data_compare)
网站id(Key) 日期(Time) 访问量(Data) Avg_data
web1 2015-01-05 50000 35600
web2 2015-01-05 40000 44000
web1 2015-01-06 60000 43000
web2 2015-01-06 30000 38000
web3 2015-01-06 40000 42000
web1 2015-01-07 70000 51000
web2 2015-01-07 20000 32000
web3 2015-01-07 40000 42000
web1 2015-01-08 50000 54000
web2 2015-01-08 10000 26000
web3 2015-01-08 40000 40000
综上,本申请实施例可以将每个生产周期的对象数据的当前值、以及过去n个生产周期的历史均值存储在检索表的一条数据记录中,也即,上述检索表的生产周期可以与对象数据的生产周期相同,因此能够保证历史均值数据的持续性。
检索方法实施例
参照图2,示出了本申请的一种数据检索方法实施例的步骤流程图,具体可以包括如下步骤:
步骤201、接收检索请求;所述检索请求中可以包括:预置的第一时间区间;
步骤202、将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述第一时间区间内、目标数据记录的数目在预置范围内的目标标识数据;所述目标数据记录中所述当前值和所述历史均值的大小关系固定;
步骤203、输出所述目标标识数据。
图1所生成检索表(c_data_compare)中存储了标识数据keyk、时间数据timet、对象数据的当前值datak,t和历史均值avg(k,t,n)之间的映射关系。
应用本申请实施例,当存在第一时间区间[timet1,timet2](假设区间长度为f=t2-t1)内保持特定趋势的对象数据的确定需求时,可以将上述确定 需求转化为针对上述检索表的检索需求,具体地,上述检索需求对应的检索过程具体可以包括:以key为分组在检索表中进行检索,以得到[timet1,timet2]内、当前值datak,t和历史均值avg(k,t,n)的大小关系固定的数据记录的数目在预置范围内的目标标识数据。
需要说明的是,上述步骤201可以通过预置的检索接口(如输入框等)接收用户输入的检索请求,可以理解,本申请实施例对于接收检索请求的具体过程不加以限制。
上述步骤203输出所述目标标识数据具体可以包括:在当前的信息设备上将上述目标标识数据展示给用户,或者,通过当前的信息设备向其他的信息设备发送上述目标标识数据等,本申请实施例对于上述步骤203输出所述目标标识数据的具体过程不加以限制。
在实际应用中,所述当前值和所述历史均值的大小关系固定,具体可以包括:所述当前值大于所述历史均值,或者,所述当前值小于所述历史均值。
在本申请的一种可选实施例中,所述目标数据记录的数目在预置范围内,具体可以包括:所述目标数据记录的数目超过阈值。
在本申请的另一种可选实施例中,所述阈值可以大于等于所述第一时间区间的长度的二分之一,且所述阈值可以小于等于所述第一时间区间的长度。假设阈值为q,则f/2≤q≤f。在实际应用,一种标识数据在[timet1,timet2]内具体包括f条数据记录,故上述f/2≤q≤f能够保证f条数据记录中的过半数据记录均符合当前值datak,t大于(或小于)历史均值avg(k,t,n)的条件,也即过半数据记录均能呈现出特定趋势,此种情况下,将该标识数据的趋势确定为该特定趋势,能够保证趋势确定的合理性。当然,上述f/2≤q≤f只是作为q的可选实施例,实际上,本领域技术人员还可以根据实际应用需求,采用小于f/2的q值,本申请实施例对于具体的q 值不加以限制。
在本申请的再一种可选实施例中,所述历史均值具体可以包括:对象数据值在当前时间数据对应的第二时间区间内的均值,所述第二时间区间具体可以包括:早于所述当前时间数据的时间数据。由此可以保证历史均值的历史性,从而能够反映对象数据在上述第二时间区间内的总体情况。
在本申请的一种可选实施例中,所述将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索的步骤202,具体可以包括:
步骤S1、将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述对象数据值和所述历史均值的大小关系固定的目标数据记录;
步骤S2、建立并保存对象数据和所述目标数据记录的数目之间的映射关系;
步骤S3、在所述对象数据和所述目标数据记录的数目之间的映射关系中进行检索,以得到目标数据记录的数目在预置范围内的目标标识数据。
在本申请的一种应用示例中,步骤S1可以检索[timet1,timet2]内、所有的当前值datak,t大于(或小于)历史均值avg(k,t,n)的目标数据记录。
步骤S2可以Key字段为分组,计算对应目标数据记录的数目D_count。可选地,可以建立并保存对象数据Key和目标数据记录的数目D_count之间的映射关系,并将该映射关系保存至中间表tmp_c_data_compare。
进一步,步骤S3可以确定预置范围,并在中间表tmp_c_data_compare中检索D_count在预置范围内的目标标识数据。例如,可以根据第一时间区间的长度f以及对检索可靠性的要求,在q的取值区间(f/2≤q and q≤f)中选取一个值,并在tmp_c_data_compare表中检索D_count>=q的标识数据,作为对应的目标标识数据。
需要说明的是,上述步骤S1-步骤S3的分步检索只是作为可选实施例,实际上,本领域技术人员还可以根据实际应用需求,通过一步式检索实现本申请实施例的功能。
在本申请的一种应用示例中,欲要检索timet1=’2015-01-05’到timet2=’2015-01-08’之间保持增长的key,f=4,则可以确定q=3(也即3天的当前值大于历史均值),则可以构造对应的查询语句,该查询语句的查询目标可以为key,查询条件可以包括:检索表c_data_compare中time>=’2015-01-05’and time<=’2015-01-8’、且Data>Avg_data、且满足上述条件的数据记录的数目大于等于3。
在实际应用中,本申请实施例在应用到支持SQL(结构化查询语言,Structured Query Language)语言的大数据场景中,可以产生比较好的技术效果,具体地,可以大大提高检索效率。当然,本申请实施例所支持的语言不限于SQL,C语言、JAVA语言也在本申请实施例的保护范围内。
综上,本申请实施例具有如下优点:
第一、本申请实施例可以将每个生产周期的对象数据的当前值、以及过去n个生产周期的历史均值存储在检索表的一条数据记录中,也即,上述检索表的生产周期可以与对象数据的生产周期相同,不仅能够保证历史均值数据的持续性,而且能够为本申请实施例的数据检索提供充足的数据;
第二、由于本申请实施例的标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系中可以包括多种标识数据,故本申请实施例的检索可以标识数据为单位,检索上述映射关系中当前值大于(或者小于)历史均值的数据记录数在预置返内的目标标识数据,也即得到的检索结果包括:目标key的集合;因此,相对于现有方案中针对每种标识数据分别绘制趋势图的过程,由于本申请实施例采用简单的检索逻辑进行符合特 定趋势的目标标识数据(例如交易额持续增长的用户标识或网站标识)的检索,故能够大大提高趋势判定的效率和目标标识数据的获取效率,且能够节省系统资源。
第三、相对于现有方案中分析人员在查看和分析绘制得到的趋势图后,才能得到对应的趋势判定结果,本申请实施例能够直接输出符合特定趋势的目标标识数据,因此能够进一步提高趋势判定的效率和目标标识数据的获取效率,且能够节省对应的人力成本。
第四、本申请能够通过阀值q的设定调整对应的检索质量;
第五、在f/2≤q≤f时,能够保证f条数据记录中的过半数据记录均能呈现出特定趋势,此种情况下,将该标识数据的趋势确定为该特定趋势,能够保证趋势确定的合理性。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。
检索装置实施例
参照图3,示出了本申请的一种数据检索装置实施例的结构框图,具体可以包括如下模块:
接收模块301,用于接收检索请求;所述检索请求中可以包括:预置的第一时间区间;
检索模块302,用于将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述第一时间区间内、目标数据记录的数目在预置范围内的目标标识数据;所述目 标数据记录中所述当前值和所述历史均值的大小关系固定;以及
输出模块303,用于输出所述目标标识数据。
在本申请的一种可选实施例中,所述当前值和所述历史均值的大小关系固定,具体可以包括:所述当前值大于所述历史均值,或者,所述当前值小于所述历史均值。
在本申请的另一种可选实施例中,所述目标数据记录的数目在预置范围内,具体可以包括:所述目标数据记录的数目超过阈值。
在本申请的再一种可选实施例中,所述阈值可以大于等于所述第一时间区间的长度的二分之一,且所述阈值可以小于等于所述第一时间区间的长度。
在本申请的又一种可选实施例中,所述检索模块302,具体可以包括:
第一检索子模块,用于将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述对象数据值和所述历史均值的大小关系固定的目标数据记录;
保存子模块,用于建立并保存对象数据和所述目标数据记录的数目之间的映射关系;以及
第二检索子模块,用于在所述对象数据和所述目标数据记录的数目之间的映射关系中进行检索,以得到目标数据记录的数目在预置范围内的目标标识数据.
在本申请的一种可选实施例中,所述历史均值具体可以包括:对象数据值在当前时间数据对应的第二时间区间内的均值,所述第二时间区间包括:早于所述当前时间数据的时间数据。
存储装置实施例
参照图4,示出了本申请的一种数据存储装置实施例的结构框图,具体可以包括如下模块:
确定模块401,用于依据标识数据、时间数据和对象数据的当前值之间的映射关系,确定所述对象数据在当前时间数据对应的第二时间区间内的均值,作为对应的历史均值;所述第二时间区间包括:早于所述当前时间数据的时间数据;以及
保存模块402,用于依据所述历史均值,建立并保存标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系。
在本申请的一种可选实施例中,所述第二时间区间的终点可以为前一时间数据。
在本申请的另一种可选实施例中,所述第二时间区间的长度可以大于等于第一时间区间的长度的二分之一,且所述第二时间区间的长度可以小于等于第一时间区间的长度。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施 的计算机程序产品的形式。
在一个典型的配置中,上述计算机设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非持续性的电脑可读媒体(transitory media),如调制的数据信号和载波。
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序 指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围 的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括上述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。
以上对本申请所提供的一种数据检索方法、一种数据检索装置、一种数据存储方法和一种数据存储装置,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上上述,本说明书内容不应理解为对本申请的限制。

Claims (14)

  1. 一种数据检索方法,其特征在于,包括:
    接收检索请求;所述检索请求中包括:预置的第一时间区间;
    将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述第一时间区间内、目标数据记录的数目在预置范围内的目标标识数据;所述目标数据记录中所述当前值和所述历史均值的大小关系固定;
    输出所述目标标识数据。
  2. 根据权利要求1所述的方法,其特征在于,所述当前值和所述历史均值的大小关系固定,包括:所述当前值大于所述历史均值,或者,所述当前值小于所述历史均值。
  3. 根据权利要求1所述的方法,其特征在于,所述目标数据记录的数目在预置范围内,包括:所述目标数据记录的数目超过阈值。
  4. 根据权利要求3所述的方法,其特征在于,所述阈值大于等于所述第一时间区间的长度的二分之一,且所述阈值小于等于所述第一时间区间的长度。
  5. 根据权利要求1至4中任一所述的方法,其特征在于,所述将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索的步骤,包括:
    将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述对象数据值和所述历史均值的大小关系固定的目标数据记录;
    建立并保存对象数据和所述目标数据记录的数目之间的映射关系;
    在所述对象数据和所述目标数据记录的数目之间的映射关系中进行检索,以得到目标数据记录的数目在预置范围内的目标标识数据.
  6. 根据权利要求1至4中任一所述的方法,其特征在于,所述历史均值包括:对象数据值在当前时间数据对应的第二时间区间内的均值,所述第二时间区间包括:早于所述当前时间数据的时间数据。
  7. 一种数据存储方法,其特征在于,包括:
    依据标识数据、时间数据和对象数据的当前值之间的映射关系,确定所述对象数据在当前时间数据对应的第二时间区间内的均值,作为对应的历史均值;所述第二时间区间包括:早于所述当前时间数据的时间数据;
    依据所述历史均值,建立并保存标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系。
  8. 根据权利要求7所述的方法,其特征在于,所述第二时间区间的终点为前一时间数据。
  9. 根据权利要求7或8所述的方法,其特征在于,所述第二时间区间的长度大于等于第一时间区间的长度的二分之一,且所述第二时间区间的长度小于等于第一时间区间的长度。
  10. 一种数据检索装置,其特征在于,包括:
    接收模块,用于接收检索请求;所述检索请求中包括:预置的第一时间区间;
    检索模块,用于将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述第一时间区间内、目标数据记录的数目在预置范围内的目标标识数据;所述目标数据记录中所述当前值和所述历史均值的大小关系固定;以及
    输出模块,用于输出所述目标标识数据。
  11. 根据权利要求10所述的装置,其特征在于,所述当前值和所述历史均值的大小关系固定,包括:所述当前值大于所述历史均值,或者, 所述当前值小于所述历史均值。
  12. 根据权利要求10所述的装置,其特征在于,所述目标数据记录的数目在预置范围内,包括:所述目标数据记录的数目超过阈值。
  13. 根据权利要求10至12中任一所述的装置,其特征在于,所述检索模块,包括:
    第一检索子模块,用于将标识数据作为分组,在标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系进行检索,以得到所述对象数据值和所述历史均值的大小关系固定的目标数据记录;
    保存子模块,用于建立并保存对象数据和所述目标数据记录的数目之间的映射关系;以及
    第二检索子模块,用于在所述对象数据和所述目标数据记录的数目之间的映射关系中进行检索,以得到目标数据记录的数目在预置范围内的目标标识数据。
  14. 一种数据存储装置,其特征在于,包括:
    确定模块,用于依据标识数据、时间数据和对象数据的当前值之间的映射关系,确定所述对象数据在当前时间数据对应的第二时间区间内的均值,作为对应的历史均值;所述第二时间区间包括:早于所述当前时间数据的时间数据;以及
    保存模块,用于依据所述历史均值,建立并保存标识数据、时间数据、对象数据的当前值和历史均值之间的映射关系。
PCT/CN2017/077450 2016-03-30 2017-03-21 一种数据检索方法和装置、一种数据存储方法和装置 Ceased WO2017167063A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610195039.2 2016-03-30
CN201610195039.2A CN107291719A (zh) 2016-03-30 2016-03-30 一种数据检索方法和装置、一种数据存储方法和装置

Publications (1)

Publication Number Publication Date
WO2017167063A1 true WO2017167063A1 (zh) 2017-10-05

Family

ID=59963491

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/077450 Ceased WO2017167063A1 (zh) 2016-03-30 2017-03-21 一种数据检索方法和装置、一种数据存储方法和装置

Country Status (3)

Country Link
CN (1) CN107291719A (zh)
TW (1) TW201737127A (zh)
WO (1) WO2017167063A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111311112A (zh) * 2020-03-10 2020-06-19 开封博士创新技术转移有限公司 一种企业知识产权数据管理方法、装置、电子设备及可读存储介质
CN111427892A (zh) * 2020-03-25 2020-07-17 中国电子科技集团公司第二十八研究所 一种活动目标的活动数据区块化管理方法及设备

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815004B (zh) * 2017-11-21 2022-11-04 腾讯科技(深圳)有限公司 请求负载控制方法、装置、存储介质和计算机设备
TWI687821B (zh) * 2018-11-21 2020-03-11 核桃運算股份有限公司 資料追蹤裝置、方法及其電腦程式產品
US11797615B2 (en) 2019-07-02 2023-10-24 International Business Machines Corporation Random sampling from a search engine
CN115001853B (zh) * 2022-07-18 2022-11-04 山东云天安全技术有限公司 一种异常数据的识别方法、装置、存储介质及计算机设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6611726B1 (en) * 1999-09-17 2003-08-26 Carl E. Crosswhite Method for determining optimal time series forecasting parameters
US20050256829A1 (en) * 2004-05-14 2005-11-17 Oracle International Corporation Undo advisor
CN104408143A (zh) * 2014-12-01 2015-03-11 北京国双科技有限公司 网页数据的监测方法和装置
CN104462445A (zh) * 2014-12-15 2015-03-25 北京国双科技有限公司 网页访问数据的处理方法和装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7818342B2 (en) * 2004-11-12 2010-10-19 Sap Ag Tracking usage of data elements in electronic business communications
CN102346894B (zh) * 2010-08-03 2017-03-01 阿里巴巴集团控股有限公司 推荐信息的输出方法、系统及服务器
CN103678402B (zh) * 2012-09-21 2018-10-16 厦门雅迅网络股份有限公司 一种海量数据下数据实时统计的方法
CN104216977A (zh) * 2014-09-01 2014-12-17 北京优特捷信息技术有限公司 一种时间序列数据检索方法及装置
CN105354623A (zh) * 2015-09-30 2016-02-24 中国电力科学研究院 一种面向电网时空数据的异常检测优化方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6611726B1 (en) * 1999-09-17 2003-08-26 Carl E. Crosswhite Method for determining optimal time series forecasting parameters
US20050256829A1 (en) * 2004-05-14 2005-11-17 Oracle International Corporation Undo advisor
CN104408143A (zh) * 2014-12-01 2015-03-11 北京国双科技有限公司 网页数据的监测方法和装置
CN104462445A (zh) * 2014-12-15 2015-03-25 北京国双科技有限公司 网页访问数据的处理方法和装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111311112A (zh) * 2020-03-10 2020-06-19 开封博士创新技术转移有限公司 一种企业知识产权数据管理方法、装置、电子设备及可读存储介质
CN111427892A (zh) * 2020-03-25 2020-07-17 中国电子科技集团公司第二十八研究所 一种活动目标的活动数据区块化管理方法及设备
CN111427892B (zh) * 2020-03-25 2022-11-25 中国电子科技集团公司第二十八研究所 一种活动目标的活动数据区块化管理方法及设备

Also Published As

Publication number Publication date
CN107291719A (zh) 2017-10-24
TW201737127A (zh) 2017-10-16

Similar Documents

Publication Publication Date Title
WO2017167063A1 (zh) 一种数据检索方法和装置、一种数据存储方法和装置
US20200327107A1 (en) Data Processing Method, Apparatus, and System
US10055426B2 (en) System and method transforming source data into output data in big data environments
CN107229619B (zh) 互联网业务链路调用情况的统计、展示方法及装置
CN107168977B (zh) 一种数据查询的优化方法及装置
US9600559B2 (en) Data processing for database aggregation operation
CN111078776A (zh) 数据表的标准化方法、装置、设备及存储介质
CN110008393B (zh) 一种用于获取网站信息的方法及设备
CN107391532B (zh) 数据过滤的方法和装置
Zhang et al. Agriculture Big Data: Research status, challenges and countermeasures
CN114297204A (zh) 一种异构数据源的数据存储、检索方法及装置
CN109145225B (zh) 一种数据处理方法及装置
CN116414953A (zh) 搜索推荐词生成方法、装置、计算机设备和存储介质
US20170195449A1 (en) Smart proxy for datasources
CN111723245B (zh) 数据存储系统中建立不同类型存储对象关联关系的方法
CN109582476B (zh) 数据处理方法、装置及系统
CN111143546A (zh) 一种获得推荐语的方法、装置及电子设备
CN110019357B (zh) 数据库查询脚本生成方法及装置
CN112199577B (zh) 一种数据查询方法、装置及电子设备
CN117271578B (zh) 数据查询方法、可视化数据处理方法及其装置、电子设备及存储介质
CN106557469B (zh) 一种处理数据仓库中数据的方法及装置
CN108073596B (zh) 一种olap数据库的数据删除方法及装置
CN106202121B (zh) 数据存储及导出的方法和设备
CN116483930A (zh) 数据处理系统、方法和装置
CN105893393B (zh) 数据保存方法及装置

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17773093

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17773093

Country of ref document: EP

Kind code of ref document: A1