WO2023020247A1 - Method and apparatus for precision reduction of time series index data, and computer device - Google Patents

Method and apparatus for precision reduction of time series index data, and computer device Download PDF

Info

Publication number
WO2023020247A1
WO2023020247A1 PCT/CN2022/108712 CN2022108712W WO2023020247A1 WO 2023020247 A1 WO2023020247 A1 WO 2023020247A1 CN 2022108712 W CN2022108712 W CN 2022108712W WO 2023020247 A1 WO2023020247 A1 WO 2023020247A1
Authority
WO
WIPO (PCT)
Prior art keywords
index data
precision
precision reduction
timing index
data
Prior art date
Application number
PCT/CN2022/108712
Other languages
French (fr)
Chinese (zh)
Inventor
李翔远
赵三妨
肖政
Original Assignee
杭州涂鸦信息技术有限公司
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 杭州涂鸦信息技术有限公司 filed Critical 杭州涂鸦信息技术有限公司
Publication of WO2023020247A1 publication Critical patent/WO2023020247A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2477Temporal data queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures

Definitions

  • the present application relates to the field of data processing, in particular to a method, device and computer equipment for processing timing index data with reduced accuracy.
  • time series indicator data In monitoring and other fields, data with time series characteristics is to collect the current value of a certain indicator at intervals. This kind of data is all floating-point numbers or integer values, and often changes little or even unchanged for a period of time. Therefore, some implementations different from general compression algorithms can be used to compress the data volume to a higher compression ratio.
  • the data may be referred to as time series indicator data. Since time-series data is usually time-sensitive, most users only care about the most recent period of data, and do not care much about the data of a long time ago. Compared with the business data, it does not matter even if the monitoring data has a certain loss of precision. Therefore, In order to reduce disk usage for time-series data, in addition to using special compression algorithms, old data will also be considered for precision reduction.
  • the current time-series databases such as influxdb, etc., adopt the method of reducing accuracy to allow users to define dml statements (database operation statements) by themselves.
  • dml statements database operation statements
  • the user needs to manually add a dml statement, and the operation and maintenance cost is high, and the operation is not friendly.
  • Embodiments of the present application provide a method, device, and computer equipment for processing time series index data with reduced precision, so as to at least solve the problems of high cost and inconvenient operation in the related art of processing time series index data with reduced precision.
  • an embodiment of the present application provides a method for processing timing index data with reduced accuracy, the method comprising:
  • the metadata information of the time series indicator data is subjected to precision reduction processing.
  • the method before searching for a corresponding precision reduction algorithm according to the type of timing index data, the method further includes:
  • performing precision reduction processing on the metadata information of the timing index data according to the precision reduction algorithm includes:
  • the metadata information of the timing index data is subjected to precision reduction processing according to the found precision reduction algorithm.
  • the method also includes:
  • a storage strategy for the timing index data is configured, and the storage strategy specifies that the timing index data is stored for a preset time to perform precision reduction processing.
  • the configuring the precision reduction algorithm corresponding to the timing index data includes:
  • the precision reduction algorithm of the timing index data includes:
  • Avg take at least one of the sum of all timing index data within the preset time precision range, and the quantity of all timing index data within the preset time precision range.
  • each of the time series index data corresponds to at least one of the precision reduction algorithms; and performing precision reduction processing on the metadata information of the time series index data according to the precision reduction algorithm includes:
  • the metadata information of the timing index data is respectively subjected to precision reduction processing to obtain multiple sets of reduced precision timing index data.
  • the embodiment of the present application provides a timing index data precision reduction processing device, including a receiving module, a search module and a processing module; wherein:
  • a receiving module configured to receive timing index data
  • the search module is used to find the corresponding precision reduction algorithm according to the type of time series index data
  • the processing module is configured to perform precision reduction processing on the metadata information of the time series indicator data according to the precision reduction algorithm.
  • the embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and operable on the processor.
  • the processor executes the computer program, Realize the method for processing timing index data with reduced precision as described in the first aspect above.
  • an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method for processing timing index data with reduced accuracy as described in the first aspect above is implemented.
  • the timing index data reduction processing method configures the accuracy reduction algorithm corresponding to each timing index data; Corresponding storage of metadata information; acquiring the storage policy of the time series index data; the storage policy specifies that the time series index data is stored for a preset time, and the time series index data is subjected to precision reduction processing; according to the precision reduction algorithm
  • the metadata information of the time-series index data is subjected to precision-reducing processing, which solves the problems of high cost and inconvenient operation in the related art of performing precision-reduction processing on time-series data.
  • FIG. 1 is a flow chart of a method for processing timing index data to reduce precision provided in an embodiment of the present application
  • FIG. 2 is a structural block diagram of a timing index data storage device provided in an embodiment of the present application
  • Fig. 3 is an internal structural diagram of a computer device provided by an embodiment of the present application.
  • the "plurality” involved in this application refers to two or more than two.
  • “And/or” describes the association relationship of associated objects, indicating that there may be three types of relationships. For example, “A and/or B” may indicate: A exists alone, A and B exist simultaneously, and B exists independently.
  • the character “/” generally indicates that the contextual objects are an “or” relationship.
  • the terms “first”, “second”, “third” and the like involved in this application are only used to distinguish similar objects, and do not represent a specific ordering of objects.
  • FIG. 1 is a flowchart of a time series data storage method according to an embodiment of the present application. As shown in Fig. 1, the process includes the following steps:
  • Step 110 receiving timing index data
  • Step 120 according to the type of the timing index data, search for a corresponding precision reduction algorithm
  • Step 130 Perform precision reduction processing on the metadata information of the timing index data according to the precision reduction algorithm.
  • Time-series index data can be understood as time-series data reflecting a certain index, which is also referred to as time-series data in this application.
  • monitoring data is time-sensitive.
  • the time-series data will also be processed to reduce precision. For example, a certain indicator reports an integer value (4 bytes) of data every 1 minute, so 1440 bytes of time series data will be generated in 24 hours. After 1 hour of time-series data, use precision reduction processing to reduce the precision of the data from 1 minute to 10 minutes at the expense of a certain decrease in data precision, and only need to store 144 bytes of data.
  • 10 minutes may be the preset accuracy range, and of course, in other embodiments, the preset accuracy range may also be 20 minutes or 30 minutes.
  • the current time-series databases adopt the method of reducing precision: let users define dml statements by themselves, calculate the result of reducing precision from the original data, and then store it in another table to achieve the purpose of reducing precision. For example, the following statement will generate a data that reduces the precision of the original data to 10 minutes, and the precision reduction type is summation: Select sum(api_counter) as api_counter_10min from origin_table into downsampling_table_10min.
  • the user needs to manually add a dml statement, which has high operation and maintenance costs and is not user-friendly.
  • This application configures the corresponding precision reduction algorithm for each time series data, stores the time series index data after receiving it, and searches for the corresponding precision reduction algorithm according to the type of the stored time series index data when it needs to perform precision reduction processing.
  • the metadata information of the indicator data is processed with precision reduction.
  • the storage method is not limited, for example, it may be a mapping table.
  • the cpu usage rate can generally be considered to take the maximum value and/or average value within a certain period of time as the result of the reduced precision.
  • the precision reduction algorithm may only include the type of precision reduction, such as the maximum value, the average value or the last value of a period of time, and the above period of time may be a unified time set by the storage system.
  • the precision reduction algorithm includes a preset time precision range and a precision reduction type.
  • the precision reduction algorithm may be Max: take the maximum value of all timing index data within the preset time precision range.
  • the preset time precision range may be set according to the data characteristics of the time series index data, and the preset time precision ranges set for different types of time series index data may be different.
  • performing precision reduction processing on the metadata information of the time series index data may be that the user issues a control instruction, triggering the metadata information of at least one time series index data to be processed according to the corresponding precision reduction processing algorithm.
  • the control command may carry corresponding identification information, and the timing indicator data may also carry corresponding identification information.
  • the control instruction can include multiple identification information in one instruction to control the precision reduction processing of multiple time series index data at the same time, without requiring the user to manually add a dml statement whenever the time series data needs to be processed with precision reduction.
  • the accuracy reduction algorithm for timing index data includes:
  • Avg take at least one of the sum of all timing index data within the preset time precision range, and the quantity of all timing index data within the preset time precision range.
  • the following table shows the number of times an API is called at each time point.
  • the preset time precision is 5 minutes, and the sum of all values during this period is taken.
  • the present application correspondingly stores the metadata of the time series index data and the precision reduction algorithm configured for it when storing the time series index data.
  • a corresponding precision reduction algorithm may be configured in each data write request of the timing index data; or, when the storage system creates a schema table, specify a precision reduction algorithm for each timing index data.
  • add a reduced precision type ie, a reduced precision algorithm
  • the precision type of the indicator is written into the storage system as the metadata information of the indicator.
  • this application adds a precision reduction processing algorithm corresponding to the timing index data when storing data.
  • the operation and maintenance personnel can realize the reduced precision storage of time series data without creating a separate task for each new indicator.
  • different time series index data can choose different precision reduction algorithms according to their respective data characteristics, and calculate reasonable data precision reduction results.
  • the user does not need to add dml statements for each data.
  • the metadata information of the time series indicator data is subjected to precision reduction processing, including:
  • the metadata information of the timing index data is subjected to precision reduction processing according to the found precision reduction algorithm.
  • the storage policy of the timing index is configured at the same time, so that after the timing index data is detected to be stored for a preset time, the accuracy reduction processing is automatically performed on the timing index data according to the precision reduction algorithm. Specifically, after it is detected that the storage time of the time series data written in the storage system reaches the preset time, the storage operation of the time series data is re-initiated, and the precision reduction algorithm corresponding to the time series data is used, which can also be called the precision reduction type. The metadata information of time series data is reduced to the appropriate result.
  • the above preset time can be 10 minutes, 20 minutes or one day, etc., and can be set according to the type of time series data or the actual situation of the user, and is not specifically limited in this embodiment.
  • the time series index data is reduced in accuracy by the accuracy reduction algorithm, and the original accuracy data can be replaced with the reduced accuracy data according to the user's needs, so as to reduce the disk usage. It is also possible to keep multiple copies of the original precision and reduced precision data at the same time, so as to achieve the purpose of using the reduced precision data to speed up the query and using the original precision time series data to retain the details.
  • each of the timing index data corresponds to at least one of the precision reduction algorithms.
  • the usage rates of the cpu are 10, 20, 30, 40, and 50 respectively. If they are combined into one value (reduced precision processing), if you want to see the peak value, you need to take the maximum value of 50. , if you want to see the average value, you need to average 30. In actual scenarios, if users want to observe whether the CPU has spikes, they need to look at the maximum value. If they just want to observe the whole situation, it is not appropriate to use the maximum value, and the average value is more appropriate. Therefore, in this embodiment, at least one precision reduction algorithm is correspondingly configured for each time series index data, so as to facilitate the user to accurately analyze the data from multiple dimensions, and then judge the corresponding index situation.
  • the query statement of the original solution is select cpu_usage from table, and the query statement of the solution in this embodiment can be written as:
  • multiple sets of reduced-precision timing index data are respectively calculated according to multiple precision reduction algorithms corresponding to the timing index data.
  • the configuration of the precision reduction algorithm corresponding to each timing index data includes:
  • two storage modes are set according to the type of the storage system. If the storage system has a schema (the concept of a table), you can specify the type of precision reduction for each time series data when creating the table. If the storage system does not have the concept of schema, you can include the precision reduction type of each indicator when sending the write request.
  • schema the concept of a table
  • Metadata is a very small table in which data is written only when creating a schema table under normal circumstances, and the actual data is a large table in which new data is written in all the time.
  • the storage systems without a schema and those with a schema are basically similar in actual storage, because even a system without a schema can dynamically write metadata to the metadata table when writing data.
  • the storage system of the schema can finally store the data in the following format:
  • This embodiment also provides a time series indicator data precision reduction processing device, which is used to implement the above embodiments and preferred implementation modes, and what has already been described will not be repeated.
  • the terms “module”, “unit”, “subunit” and the like may be a combination of software and/or hardware that realize a predetermined function.
  • the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
  • FIG. 3 is a structural block diagram of a timing index data storage device according to an embodiment of the present application. As shown in FIG. 3 , the device includes a receiving module 210, a search module 220, and a processing module 230; wherein:
  • a receiving module 210 configured to receive timing index data
  • a search module 220 configured to search for a corresponding precision reduction algorithm according to the type of timing index data
  • the processing module 230 is configured to perform precision reduction processing on the timing index data according to the precision reduction algorithm.
  • This application adds a precision reduction algorithm corresponding to the timing index data when storing data.
  • the operation and maintenance personnel can realize the reduced-precision storage of time series data without creating a separate task for each new indicator.
  • different time series index data can choose different precision reduction algorithms according to their respective data characteristics, and calculate reasonable data precision reduction results.
  • the user does not need to add dml statements for each data.
  • it also includes a first configuration module, configured to configure a precision reduction algorithm corresponding to the timing index data; and associate the precision reduction algorithm of the timing index data with the metadata information of the timing index data.
  • the processing module 230 is also used for:
  • the metadata information of the timing index data is subjected to precision reduction processing according to the found precision reduction algorithm.
  • a second configuration module configured to: configure a storage policy for the timing index data, where the storage policy specifies that the timing index data is stored for a preset time to perform precision reduction processing.
  • the first configuration module is also used for:
  • the precision reduction algorithm of the timing index data includes:
  • Avg take at least one of the sum of all timing index data within the preset time precision range, and the quantity of all timing index data within the preset time precision range.
  • each of the timing index data corresponds to at least one of the precision reduction algorithms; the processing module 230 is further configured to: after detecting that the storage duration is longer than the preset duration, according to the searched multiple precision reduction algorithms , respectively performing precision reduction processing on the metadata information of the time series index data to obtain multiple sets of time series index data with reduced precision.
  • each of the above-mentioned modules may be a function module or a program module, and may be realized by software or by hardware.
  • the above modules may be located in the same processor; or the above modules may be located in different processors in any combination.
  • FIG. 3 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present application.
  • the computer device may comprise a processor 31 and a memory 32 storing computer program instructions.
  • the processor 31 may include a central processing unit (CPU), or an Application Specific Integrated Circuit (ASIC for short), or may be configured to implement one or more integrated circuits in the embodiments of the present application.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • the memory 32 may include a mass memory for data or instructions.
  • memory 32 may include hard disk drive (Hard Disk Drive, referred to as HDD), floppy disk drive, solid state drive (Solid State Drive, referred to as SSD), flash memory, optical disc, magneto-optical disc, magnetic tape or general serial Bus (Universal Serial Bus, referred to as USB) driver or a combination of two or more of the above.
  • Memory 32 may comprise removable or non-removable (or fixed) media, where appropriate.
  • Memory 32 may be internal or external to the data processing arrangement, where appropriate.
  • memory 32 is a non-volatile (Non-Volatile) memory.
  • the memory 32 includes a read-only memory (Read-Only Memory, referred to as ROM) and a random access memory (Random Access Memory, referred to as RAM).
  • the ROM can be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, referred to as PROM), an erasable PROM (Erasable Programmable Read-Only Memory, referred to as EPROM), an electronically programmable Erase PROM (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), electrically rewritable ROM (Electrically Alterable Read-Only Memory, referred to as EAROM) or flash memory (FLASH) or a combination of two or more of these.
  • the RAM can be a Static Random-Access Memory (SRAM for short) or a Dynamic Random-Access Memory (DRAM for short), where the DRAM can be a fast page Mode Dynamic Random Access Memory (Fast Page Mode Dynamic Random Access Memory, referred to as FPMDRAM), Extended Data Output Dynamic Random Access Memory (Extended Date Out Dynamic Random Access Memory, referred to as EDODRAM), Synchronous Dynamic Random Access Memory (Synchronous Dynamic Random-Access Memory, referred to as SDRAM), etc.
  • SRAM Static Random-Access Memory
  • DRAM Dynamic Random-Access Memory
  • FPMDRAM Fast Page Mode Dynamic Random Access Memory
  • EDODRAM Extended Data Output Dynamic Random Access Memory
  • SDRAM Synchronous Dynamic Random Access Memory
  • the memory 32 can be used to store or cache various data files required for processing and/or communication, as well as possible computer program instructions executed by the processor 31 .
  • the processor 31 reads and executes the computer program instructions stored in the memory 32 to implement any one of the timing index data precision reduction processing methods in the above embodiments.
  • the computer device may further include a communication interface 33 and a bus 30 .
  • the processor 31 , the memory 32 , and the communication interface 33 are connected through the bus 30 and complete mutual communication.
  • the communication interface 33 is used to realize the communication between various modules, devices, units and/or devices in the embodiment of the present application.
  • the communication interface 33 can also implement data communication with other components such as external devices, image/data acquisition equipment, databases, external storage, and image/data processing workstations.
  • Bus 30 includes hardware, software, or both, and couples the components of the computer device to each other.
  • the bus 30 includes but is not limited to at least one of the following: a data bus (Data Bus), an address bus (Address Bus), a control bus (Control Bus), an expansion bus (Expansion Bus), and a local bus (Local Bus).
  • the bus 30 may include an Accelerated Graphics Port (AGP for short) or other graphics bus, an Enhanced Industry Standard Architecture (Extended Industry Standard Architecture, EISA for short) bus, a Front Side Bus (Front Side Bus) , FSB for short), Hyper Transport (HT) interconnection, Industry Standard Architecture (ISA) bus, InfiniBand interconnection, Low Pin Count, Referred to as LPC) bus, memory bus, Micro Channel Architecture (Micro Channel Architecture, referred to as MCA) bus, peripheral component interconnect (Peripheral Component Interconnect, referred to as PCI) bus, PCI-Express (PCI-X) bus, serial Advanced Technology Attachment (Serial Advanced Technology Attachment, referred to as SATA) bus, Video Electronics Standards Association Local Bus (referred to as VLB) bus or other suitable bus or a combination of two or more of these.
  • bus 30 may comprise one or more buses.
  • the computer device may execute the method for processing timing index data with reduced precision in the embodiment of the present application based on the acquired program instructions, thereby implementing the method for processing timing index data with reduced precision described in conjunction with FIG. 1 .
  • the embodiments of the present application may provide a computer-readable storage medium for implementation.
  • Computer program instructions are stored on the computer-readable storage medium; when the computer program instructions are executed by a processor, any method for processing timing index data with reduced accuracy in the above-mentioned embodiments is implemented.

Abstract

Disclosed are a method and apparatus for precision reduction of time series index data, and a computer device. The method comprises: receiving time series index data (110); searching for a corresponding precision reduction algorithm according to the type of the time series index data (120); and performing precision reduction on metadata information of the time series index data according to the precision reduction algorithm (130). The present application solves the problems in the related art of high cost and inconvenient operation during precision reduction of time series data.

Description

时序指标数据降精度处理方法、装置和计算机设备Method, device and computer equipment for processing timing index data with reduced accuracy 技术领域technical field
本申请涉及数据处理领域,特别是涉及一种时序指标数据降精度处理方法、装置和计算机设备。The present application relates to the field of data processing, in particular to a method, device and computer equipment for processing timing index data with reduced accuracy.
背景技术Background technique
在监控等领域,带有时序特征的数据是每间隔一段时间采集某个指标当前的数值。这种数据都是浮点数或整型值,经常在一段时间里变化不大甚至没有变化,因此可以用一些有别于通用压缩算法的实现,将数据量压缩到更高的压缩比,这种数据可以称作时序指标数据。由于时序数据通常具有时效性,用户大部分情况只对最近一段时间的数据比较关心,对很久之前的数据不会很关心,而且监控数据相对于业务数据,即使有一定精度丢失也没有关系,因此时序数据为了减少磁盘占用,除了使用特殊压缩算法外,还会考虑将老数据做降精度处理。In monitoring and other fields, data with time series characteristics is to collect the current value of a certain indicator at intervals. This kind of data is all floating-point numbers or integer values, and often changes little or even unchanged for a period of time. Therefore, some implementations different from general compression algorithms can be used to compress the data volume to a higher compression ratio. The data may be referred to as time series indicator data. Since time-series data is usually time-sensitive, most users only care about the most recent period of data, and do not care much about the data of a long time ago. Compared with the business data, it does not matter even if the monitoring data has a certain loss of precision. Therefore, In order to reduce disk usage for time-series data, in addition to using special compression algorithms, old data will also be considered for precision reduction.
目前的时序数据库,例如influxdb等,采用的降精度实现方法为,让用户自行定义dml语句(数据库操作语句)。这种实现方式,每当有时序数据需要做降精度处理,都需要用户手动添加一个dml语句,运维成本较高,且操作不友好。The current time-series databases, such as influxdb, etc., adopt the method of reducing accuracy to allow users to define dml statements (database operation statements) by themselves. In this implementation method, whenever time-series data needs to be processed with precision reduction, the user needs to manually add a dml statement, and the operation and maintenance cost is high, and the operation is not friendly.
目前针对相关技术中对时序数据进行降精度处理存在的成本较高且操作不便的问题,尚未提出有效的解决方案。At present, no effective solution has been proposed for the problems of high cost and inconvenient operation in processing time-series data with reduced accuracy in related technologies.
发明内容Contents of the invention
本申请实施例提供了一种时序指标数据降精度处理方法、装置和计算机设备,以至少解决相关技术中对时序指标数据进行降精度处理存在的成本较高且操作不便的问题。Embodiments of the present application provide a method, device, and computer equipment for processing time series index data with reduced precision, so as to at least solve the problems of high cost and inconvenient operation in the related art of processing time series index data with reduced precision.
第一方面,本申请实施例提供了一种时序指标数据降精度处理方法,所述方法包括:In the first aspect, an embodiment of the present application provides a method for processing timing index data with reduced accuracy, the method comprising:
接收时序指标数据;Receive timing index data;
根据所述时序指标数据的类型,查找对应的降精度算法;Searching for a corresponding precision reduction algorithm according to the type of the timing index data;
根据所述降精度算法,对所述时序指标数据的元数据信息进行降精度处理。According to the precision reduction algorithm, the metadata information of the time series indicator data is subjected to precision reduction processing.
在其中一些实施例中,在所述根据时序指标数据的类型,查找对应的降精度算法之前,所述方法还包括:In some of these embodiments, before searching for a corresponding precision reduction algorithm according to the type of timing index data, the method further includes:
配置所述时序指标数据对应的降精度算法;Configuring a precision reduction algorithm corresponding to the timing index data;
将所述时序指标数据的降精度算法和所述时序指标数据的元数据信息关联。Associating the precision reduction algorithm of the time series index data with the metadata information of the time series index data.
在其中一些实施例中,所述根据所述降精度算法,对所述时序指标数据的元数据信息进行降精度处理,包括:In some of these embodiments, performing precision reduction processing on the metadata information of the timing index data according to the precision reduction algorithm includes:
检测所述时序指标数据的存储时长;Detecting the storage duration of the timing index data;
在检测到所述存储时长大于预设时长后,根据查找到的降精度算法,对所述时序指标数据的元数据信息进行降精度处理。After detecting that the storage duration is longer than the preset duration, the metadata information of the timing index data is subjected to precision reduction processing according to the found precision reduction algorithm.
在其中一些实施例中,所述方法还包括:In some of these embodiments, the method also includes:
配置所述时序指标数据的存储策略,所述存储策略指定所述时序指标数据在存储预设时间后进行降精度处理。A storage strategy for the timing index data is configured, and the storage strategy specifies that the timing index data is stored for a preset time to perform precision reduction processing.
在其中一些实施例中,所述配置所述时序指标数据对应的降精度算法,包括:In some of these embodiments, the configuring the precision reduction algorithm corresponding to the timing index data includes:
在所述时序指标数据的数据写入请求中配置对应的降精度算法;或Configure a corresponding precision reduction algorithm in the data write request of the timing index data; or
在存储系统创建schema表时,配置所述时序指标数据对应的降精度算法。When the storage system creates the schema table, configure the precision reduction algorithm corresponding to the time series index data.
在其中一些实施例中,所述时序指标数据的降精度算法包括:In some of these embodiments, the precision reduction algorithm of the timing index data includes:
Max:取预设时间精度范围内所有时序指标数据的最大值;Max: Take the maximum value of all timing index data within the preset time precision range;
Min:取预设时间精度范围内所有时序指标数据的最小值;Min: Take the minimum value of all timing index data within the preset time precision range;
Gauge:取预设时间精度范围内所有时序指标数据中的最后一个值;Gauge: Take the last value of all timing index data within the preset time precision range;
Sum:取预设时间精度范围内所有时序指标数据的和;Sum: Take the sum of all timing index data within the preset time precision range;
Avg:取预设时间精度范围内所有时序指标数据的和,以及所述预设时间精度范围内所有时序指标数据的数量中的至少一种。Avg: take at least one of the sum of all timing index data within the preset time precision range, and the quantity of all timing index data within the preset time precision range.
在其中一些实施例中,每一个所述时序指标数据对应至少一个所述降精度算法;所述根据所述降精度算法对所述时序指标数据的元数据信息进行降精度 处理,包括:In some of these embodiments, each of the time series index data corresponds to at least one of the precision reduction algorithms; and performing precision reduction processing on the metadata information of the time series index data according to the precision reduction algorithm includes:
在检测到存储时长大于预设时长后,根据查找到的多个降精度算法,分别对所述时序指标数据的元数据信息进行降精度处理,得到多组降精度时序指标数据。After detecting that the storage duration is longer than the preset duration, according to the found multiple precision reduction algorithms, the metadata information of the timing index data is respectively subjected to precision reduction processing to obtain multiple sets of reduced precision timing index data.
第二方面,本申请实施例提供了一种时序指标数据降精度处理装置,包括接收模块、查找模块和处理模块;其中:In the second aspect, the embodiment of the present application provides a timing index data precision reduction processing device, including a receiving module, a search module and a processing module; wherein:
接收模块,用于接收时序指标数据;A receiving module, configured to receive timing index data;
查找模块,用于根据时序指标数据的类型,查找对应的降精度算法;The search module is used to find the corresponding precision reduction algorithm according to the type of time series index data;
处理模块,用于根据所述降精度算法,对所述时序指标数据的元数据信息进行降精度处理。The processing module is configured to perform precision reduction processing on the metadata information of the time series indicator data according to the precision reduction algorithm.
第三方面,本申请实施例提供了一种计算机设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面所述的时序指标数据降精度处理方法。In a third aspect, the embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the computer program, Realize the method for processing timing index data with reduced precision as described in the first aspect above.
第四方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述第一方面所述的时序指标数据降精度处理方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method for processing timing index data with reduced accuracy as described in the first aspect above is implemented.
相比于相关技术,本申请实施例提供的时序指标数据降精度处理方法,通过配置每个时序指标数据对应的降精度算法;将所述时序指标数据的降精度算法和所述时序指标数据的元数据信息对应存储;获取所述时序指标数据的存储策略;所述存储策略指定所述时序指标数据在存储预设时间后,将所述时序指标数据进行降精度处理;根据所述降精度算法和所述存储策略,对所述时序指标数据的元数据信息进行降精度处理,解决了相关技术中对时序数据进行降精度处理存在的成本较高且操作不便的问题。Compared with related technologies, the timing index data reduction processing method provided by the embodiment of the present application configures the accuracy reduction algorithm corresponding to each timing index data; Corresponding storage of metadata information; acquiring the storage policy of the time series index data; the storage policy specifies that the time series index data is stored for a preset time, and the time series index data is subjected to precision reduction processing; according to the precision reduction algorithm With the storage strategy, the metadata information of the time-series index data is subjected to precision-reducing processing, which solves the problems of high cost and inconvenient operation in the related art of performing precision-reduction processing on time-series data.
本申请的一个或多个实施例的细节在以下附图和描述中提出,以使本申请的其他特征、目的和优点更加简明易懂。The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below, so as to make other features, objects, and advantages of the application more comprehensible.
附图说明Description of drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分, 本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The schematic embodiments and descriptions of the application are used to explain the application and do not constitute an improper limitation to the application. In the attached picture:
图1是本申请实施例提供的时序指标数据降精度处理方法的流程图;FIG. 1 is a flow chart of a method for processing timing index data to reduce precision provided in an embodiment of the present application;
图2是本申请实施例的提供的时序指标数据存储装置的结构框图;FIG. 2 is a structural block diagram of a timing index data storage device provided in an embodiment of the present application;
图3是本申请实施例提供的计算机设备的内部结构图。Fig. 3 is an internal structural diagram of a computer device provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行描述和说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。基于本申请提供的实施例,本领域普通技术人员在没有作出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
显而易见地,下面描述中的附图仅仅是本申请的一些示例或实施例,对于本领域的普通技术人员而言,在不付出创造性劳动的前提下,还可以根据这些附图将本申请应用于其他类似情景。此外,还可以理解的是,虽然这种开发过程中所作出的努力可能是复杂并且冗长的,然而对于与本申请公开的内容相关的本领域的普通技术人员而言,在本申请揭露的技术内容的基础上进行的一些设计,制造或者生产等变更只是常规的技术手段,不应当理解为本申请公开的内容不充分。Obviously, the accompanying drawings in the following description are only some examples or embodiments of the present application, and those skilled in the art can also apply the present application to other similar scenarios. In addition, it can also be understood that although such development efforts may be complex and lengthy, for those of ordinary skill in the art relevant to the content disclosed in this application, the technology disclosed in this application Some design, manufacturing or production changes based on the content are just conventional technical means, and should not be understood as insufficient content disclosed in this application.
在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域普通技术人员显式地和隐式地理解的是,本申请所描述的实施例在不冲突的情况下,可以与其它实施例相结合。Reference in this application to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
除非另作定义,本申请所涉及的技术术语或者科学术语应当为本申请所属技术领域内具有一般技能的人士所理解的通常意义。本申请所涉及的“一”、“一个”、“一种”、“该”等类似词语并不表示数量限制,可表示单数或复数。本申请所涉及的术语“包括”、“包含”、“具有”以及它们任何变形,意图在于覆盖 不排他的包含;例如包含了一系列步骤或模块(单元)的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可以还包括没有列出的步骤或单元,或可以还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。本申请所涉及的“多个”是指两个或两个以上。“和/或”描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。本申请所涉及的术语“第一”、“第二”、“第三”等仅仅是区别类似的对象,不代表针对对象的特定排序。Unless otherwise defined, the technical terms or scientific terms involved in the application shall have the usual meanings understood by those with ordinary skill in the technical field to which the application belongs. Words such as "a", "an", "an" and "the" involved in this application do not indicate a limitation on quantity, and may indicate singular or plural numbers. The terms "comprising", "comprising", "having" and any variations thereof involved in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or process that includes a series of steps or modules (units). The apparatus is not limited to the listed steps or units, but may further include steps or units not listed, or may further include other steps or units inherent to the process, method, product or apparatus. The "plurality" involved in this application refers to two or more than two. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships. For example, "A and/or B" may indicate: A exists alone, A and B exist simultaneously, and B exists independently. The character "/" generally indicates that the contextual objects are an "or" relationship. The terms "first", "second", "third" and the like involved in this application are only used to distinguish similar objects, and do not represent a specific ordering of objects.
本实施例提供了一种时序指标数据降精度处理方法。图1是根据本申请实施例的时序数据存储方法的流程图,如图1所示,该流程包括如下步骤:This embodiment provides a method for processing timing index data with reduced accuracy. Fig. 1 is a flowchart of a time series data storage method according to an embodiment of the present application. As shown in Fig. 1, the process includes the following steps:
步骤110,接收时序指标数据; Step 110, receiving timing index data;
步骤120,根据所述时序指标数据的类型,查找对应的降精度算法; Step 120, according to the type of the timing index data, search for a corresponding precision reduction algorithm;
步骤130,根据所述降精度算法,对所述时序指标数据的元数据信息进行降精度处理。Step 130: Perform precision reduction processing on the metadata information of the timing index data according to the precision reduction algorithm.
时序指标数据可以理解为反映某一指标的时序数据,本申请中也称为时序数据。在监控领域,监控数据具有时效性,为了减少监控得到的时序数据对磁盘的占用,除了使用压缩算法外,还会对时序数据进行降精度处理。比如某个指标每1分钟上报一个整型数值(4字节)的数据,这样24小时会产生1440字节的时序数据。时序数据在经过1小时后,利用降精度处理,以数据的精度有一定下降为代价,将其精度从1分钟降低到10分钟,则只需要存储144字节的数据。其中10分钟就可以是预设精度范围,当然在其他实施例中,预设精度范围也可以是20分钟或30分钟等。目前的时序数据库,例如influxdb等,采用的降精度实现方法为:让用户自行定义dml语句,将原始数据计算出降精度的结果,再存储到另一张表上,以达到降精度的目的。比如以下语句,将会生成一份将原始数据降精度为10分钟,降精度类型为求和的数据:Select sum(api_counter)as api_counter_10min from origin_table into downsampling_table_10min。这种实现方式,每当有时序数据需要降精度处理时, 都需要用户手动添加一个dml语句,运维成本较高且操作不友好。Time-series index data can be understood as time-series data reflecting a certain index, which is also referred to as time-series data in this application. In the field of monitoring, monitoring data is time-sensitive. In order to reduce the disk occupation of the time-series data obtained by monitoring, in addition to using the compression algorithm, the time-series data will also be processed to reduce precision. For example, a certain indicator reports an integer value (4 bytes) of data every 1 minute, so 1440 bytes of time series data will be generated in 24 hours. After 1 hour of time-series data, use precision reduction processing to reduce the precision of the data from 1 minute to 10 minutes at the expense of a certain decrease in data precision, and only need to store 144 bytes of data. 10 minutes may be the preset accuracy range, and of course, in other embodiments, the preset accuracy range may also be 20 minutes or 30 minutes. The current time-series databases, such as influxdb, adopt the method of reducing precision: let users define dml statements by themselves, calculate the result of reducing precision from the original data, and then store it in another table to achieve the purpose of reducing precision. For example, the following statement will generate a data that reduces the precision of the original data to 10 minutes, and the precision reduction type is summation: Select sum(api_counter) as api_counter_10min from origin_table into downsampling_table_10min. In this implementation, whenever time series data needs to be processed with reduced accuracy, the user needs to manually add a dml statement, which has high operation and maintenance costs and is not user-friendly.
本申请通过为每个时序数据配置对应的降精度算法,在接收到时序指标数据后进行存储,当需要进行降精度处理时,根据存储的时序指标数据的类型查找对应的降精度算法,对时序指标数据的元数据信息进行降精度处理。This application configures the corresponding precision reduction algorithm for each time series data, stores the time series index data after receiving it, and searches for the corresponding precision reduction algorithm according to the type of the stored time series index data when it needs to perform precision reduction processing. The metadata information of the indicator data is processed with precision reduction.
在根据时序指标数据的类型,查找对应的降精度算法之前,需要根据不同类型的时序数据配置对应不同的降精度算法。并在配置完成后,与时序指标数据进行关联存储。存储的方式可以不限,例如可以是映射表的方式。比如cpu使用率,一般可以考虑取某段时间内最大值和/或平均值作为降精度后的结果。在存储时序指标数据时,将时序指标数据的元数据信息和为其配置的降精度算法对应存储。降精度算法可以仅包括降精度的类型,例如一段时间区间的最大值、平均值或最后一个值,上述的一段时间区间可以是存储系统设定的统一时间。优选的,降精度算法包括预设时间精度范围和降精度类型。例如,降精度算法可以为Max:取预设时间精度范围内所有时序指标数据的最大值。该预设时间精度范围可以是根据时序指标数据的数据特点设置的,不同类型的时序指标数据设置的预设时间精度范围可能不同。Before finding the corresponding precision reduction algorithm according to the type of time series index data, it is necessary to configure different precision reduction algorithms according to different types of time series data. And after the configuration is completed, it will be stored in association with the timing index data. The storage method is not limited, for example, it may be a mapping table. For example, the cpu usage rate can generally be considered to take the maximum value and/or average value within a certain period of time as the result of the reduced precision. When storing time series index data, the metadata information of the time series index data and the precision reduction algorithm configured for it are stored correspondingly. The precision reduction algorithm may only include the type of precision reduction, such as the maximum value, the average value or the last value of a period of time, and the above period of time may be a unified time set by the storage system. Preferably, the precision reduction algorithm includes a preset time precision range and a precision reduction type. For example, the precision reduction algorithm may be Max: take the maximum value of all timing index data within the preset time precision range. The preset time precision range may be set according to the data characteristics of the time series index data, and the preset time precision ranges set for different types of time series index data may be different.
具体地,根据所述降精度算法,对所述时序指标数据的元数据信息进行降精度处理可以是用户发出控制指令,触发对至少一个时序指标数据的元数据信息根据对应的降精度处理算法进行降精度处理。控制指令可以携带有对应的标识信息,时序指标数据也携带有对应的标识信息。控制指令可以在一个指令中包括多个标识信息,以同时控制多个时序指标数据的降精度处理,而不需要用户每当有时序数据需要降精度处理时,都需要用户手动添加一个dml语句。Specifically, according to the precision reduction algorithm, performing precision reduction processing on the metadata information of the time series index data may be that the user issues a control instruction, triggering the metadata information of at least one time series index data to be processed according to the corresponding precision reduction processing algorithm. Reduce precision processing. The control command may carry corresponding identification information, and the timing indicator data may also carry corresponding identification information. The control instruction can include multiple identification information in one instruction to control the precision reduction processing of multiple time series index data at the same time, without requiring the user to manually add a dml statement whenever the time series data needs to be processed with precision reduction.
在其中一些实施例中,时序指标数据的降精度算法包括:In some of these embodiments, the accuracy reduction algorithm for timing index data includes:
Max:取预设时间精度范围内所有时序指标数据的最大值;Max: Take the maximum value of all timing index data within the preset time precision range;
Min:取预设时间精度范围内所有时序指标数据的最小值;Min: Take the minimum value of all timing index data within the preset time precision range;
Gauge:取预设时间精度范围内所有时序指标数据中的最后一个值;Gauge: Take the last value of all timing index data within the preset time precision range;
Sum:取预设时间精度范围内所有时序指标数据的和;Sum: Take the sum of all timing index data within the preset time precision range;
Avg:取预设时间精度范围内所有时序指标数据的和,以及所述预设时间精 度范围内所有时序指标数据的数量中的至少一种。Avg: take at least one of the sum of all timing index data within the preset time precision range, and the quantity of all timing index data within the preset time precision range.
可以理解的是,上述对降精度算法的类型仅是举例说明,本领域技术人员也可以设置其他类型的降精度算法。另外上述每一类型的降精度算法中的预设时间精度范围可以不相同。It can be understood that the types of precision reduction algorithms mentioned above are only examples, and those skilled in the art can also set other types of precision reduction algorithms. In addition, the preset time precision ranges in each type of precision reduction algorithm mentioned above may be different.
为了更清晰的说明本申请的方案,通过以下举例说明。例如统计每个api调用次数,需要将某段时间内所有值相加作为降精度后的结果。具体如下表,该表格为某机器cpu在每个时间点的使用率。预设时间精度为5分钟,取这段时间的最后一个值。In order to illustrate the solution of the present application more clearly, the following examples are used for illustration. For example, to count the number of calls to each API, it is necessary to add all values within a certain period of time as the result of reduced precision. The details are shown in the following table, which shows the usage rate of a certain machine's cpu at each time point. The preset time accuracy is 5 minutes, and the last value within this period is taken.
Figure PCTCN2022108712-appb-000001
Figure PCTCN2022108712-appb-000001
以下表格为某api在每个时间点的调用次数,预设时间精度为5分钟,取这段时间里所有值的总和。The following table shows the number of times an API is called at each time point. The preset time precision is 5 minutes, and the sum of all values during this period is taken.
Figure PCTCN2022108712-appb-000002
Figure PCTCN2022108712-appb-000002
本申请通过上述步骤,在存储时序指标数据时,将时序指标数据的元数据和为其配置的降精度算法对应存储。例如,可以在每个所述时序指标数据的数据写入请求中配置对应的降精度算法;或,在存储系统创建schema表时,指定每个时序指标数据的降精度算法。具体地,在存储系统的写入端在发送写请求时,给每个时序指标数据带上降精度类型(即降精度算法)。存储系统在写入数 据时,将该指标的精度类型作为该指标的元数据信息一并写入存储系统中。Through the above steps, the present application correspondingly stores the metadata of the time series index data and the precision reduction algorithm configured for it when storing the time series index data. For example, a corresponding precision reduction algorithm may be configured in each data write request of the timing index data; or, when the storage system creates a schema table, specify a precision reduction algorithm for each timing index data. Specifically, when sending a write request at the writing end of the storage system, add a reduced precision type (ie, a reduced precision algorithm) to each timing index data. When the storage system writes data, the precision type of the indicator is written into the storage system as the metadata information of the indicator.
传统的时序数据存储系统写入协议为:Insert into table set api_counter=?,cpu_usage=X,time=X。传统的存储系统数据存储格式:The writing protocol of the traditional time series data storage system is: Insert into table set api_counter=? , cpu_usage=X, time=X. Traditional storage system data storage format:
timetime 00:0100:01 ......
Api_counterApi_counter 1616 ......
cpu_usagecpu_usage 1616 ......
本申请的存储系统写入协议:Insert into table set api_counter=X with sum,cpu_usage=X with gauge,time=X。The storage system writing protocol of this application: Insert into table set api_counter=X with sum, cpu_usage=X with gauge, time=X.
本申请的存储系统数据存储格式:The storage system data storage format of this application:
timetime Type=timeType=time 00:0100:01 ......
Api_counterApi_counter Type=sumType=sum 1616 ......
cpu_usagecpu_usage Type=gaugeType = gauge 1616 ......
由上述两个存储系统数据的存储格式可以看出,本申请在存储数据的时候增加了对时序指标数据对应的降精度处理算法。这样运维人员在不需要为每个新增指标单独创创建任务的前提下,也可以实现对时序数据的降精度存储。同时不同的时序指标数据可以根据各自的数据特点,选择不同的降精度算法,计算出合理的数据降精度结果。在数据需要做降精度处理时,用户不需要针对每个数据都添加dml语句,通过查看对应时序指标数据对应的降精度算法就可以实现自动降精度处理的效果,解决了相关技术中对时序数据进行降精度处理存在的成本较高且操作不便的问题。It can be seen from the storage formats of the above two storage system data that this application adds a precision reduction processing algorithm corresponding to the timing index data when storing data. In this way, the operation and maintenance personnel can realize the reduced precision storage of time series data without creating a separate task for each new indicator. At the same time, different time series index data can choose different precision reduction algorithms according to their respective data characteristics, and calculate reasonable data precision reduction results. When the data needs to be processed with precision reduction, the user does not need to add dml statements for each data. By viewing the precision reduction algorithm corresponding to the corresponding time series index data, the effect of automatic precision reduction processing can be realized, which solves the problem of time series data in related technologies. The problem of high cost and inconvenient operation exists in the process of reducing precision.
在其中一些实施例中,根据所述降精度算法,对所述时序指标数据的元数据信息进行降精度处理,包括:In some of these embodiments, according to the precision reduction algorithm, the metadata information of the time series indicator data is subjected to precision reduction processing, including:
检测所述时序指标数据的存储时长;Detecting the storage duration of the timing index data;
在检测到所述存储时长大于预设时长后,根据查找到的降精度算法,对所述时序指标数据的元数据信息进行降精度处理。After detecting that the storage duration is longer than the preset duration, the metadata information of the timing index data is subjected to precision reduction processing according to the found precision reduction algorithm.
本实施例同时配置时序指标的存储策略,以在监测到时序指标数据在存储预设时间后,根据降精度算法对所述时序指标数据自动进行降精度处理。具体地,在监测到写入存储系统的时序数据存储的时间达到预设时间之后,重新发起该时序数据的存储操作,使用该时序数据对应的降精度算法,也可以称为降精度类型,将时序数据的元数据信息降精度为合适的结果。上述的预设时间可 以是10分钟、20分钟或一天等,具体可以根据时序数据类型或用户实际情况进行设置,本实施例不作具体限定。In this embodiment, the storage policy of the timing index is configured at the same time, so that after the timing index data is detected to be stored for a preset time, the accuracy reduction processing is automatically performed on the timing index data according to the precision reduction algorithm. Specifically, after it is detected that the storage time of the time series data written in the storage system reaches the preset time, the storage operation of the time series data is re-initiated, and the precision reduction algorithm corresponding to the time series data is used, which can also be called the precision reduction type. The metadata information of time series data is reduced to the appropriate result. The above preset time can be 10 minutes, 20 minutes or one day, etc., and can be set according to the type of time series data or the actual situation of the user, and is not specifically limited in this embodiment.
在其他一些实施例中,通过降精度算法对时序指标数据进行降精度后的数据,可以根据用户需要,决定将降精度的数据替换原始精度的数据,以达到降低磁盘占用量的目的。也可以同时保留原始精度和降精度的多份数据,以达到用降精度数据加速查询,用原始精度的时序数据来保留明细的目的。In some other embodiments, the time series index data is reduced in accuracy by the accuracy reduction algorithm, and the original accuracy data can be replaced with the reduced accuracy data according to the user's needs, so as to reduce the disk usage. It is also possible to keep multiple copies of the original precision and reduced precision data at the same time, so as to achieve the purpose of using the reduced precision data to speed up the query and using the original precision time series data to retain the details.
在其中一些实施例中,每一个所述时序指标数据对应至少一个所述降精度算法。In some of these embodiments, each of the timing index data corresponds to at least one of the precision reduction algorithms.
考虑到用户的需求,用户可能需要从多个维度来分析时序数据。比如cpu在1,2,3,4,5个时刻,使用率分别为10,20,30,40,50,合并成一个值的话(降精度处理),如果想看峰值就需要取最大值50,如果想看平均值就要平均数30。在实际场景中,如果用户想观察cpu是否有尖刺时需要看最大值,如果只是想观察整个情况的话用最大值就不合适,平均值更合适。因此,本实施例针对每一个时序指标数据会对应配置至少一个降精度算法,以方便用户从多个维度准确分析数据,进而判断对应的指标情况。Considering the needs of users, users may need to analyze time series data from multiple dimensions. For example, at 1, 2, 3, 4, and 5 moments, the usage rates of the cpu are 10, 20, 30, 40, and 50 respectively. If they are combined into one value (reduced precision processing), if you want to see the peak value, you need to take the maximum value of 50. , if you want to see the average value, you need to average 30. In actual scenarios, if users want to observe whether the CPU has spikes, they need to look at the maximum value. If they just want to observe the whole situation, it is not appropriate to use the maximum value, and the average value is more appropriate. Therefore, in this embodiment, at least one precision reduction algorithm is correspondingly configured for each time series index data, so as to facilitate the user to accurately analyze the data from multiple dimensions, and then judge the corresponding index situation.
在时序指标数据仅配置一个降精度算法时,对应的存储语句为:When only one precision reduction algorithm is configured for time series index data, the corresponding storage statement is:
Insert into table set api_counter=?with sum,cpu_usage=?with gauge,time=?Insert into table set api_counter=? with sum, cpu_usage=? with gauge, time=?
本实施例中,存储语句可以写成Insert into table set api_counter=?with sum,cpu_usage=?with[avg,max],time=?。In this embodiment, the storage statement can be written as Insert into table set api_counter=? with sum, cpu_usage=? with[avg,max],time=? .
原来方案查询语句是select cpu_usage from table,本实施例中方案的查询语句可以写成:The query statement of the original solution is select cpu_usage from table, and the query statement of the solution in this embodiment can be written as:
select cpu_usage_avg from table;select cpu_usage_avg from table;
select cpu_usage_max from table。select cpu_usage_max from table.
本实施例中在检测到所述时序指标数据的存储时长达到预设时长后,根据所述时序指标数据对应的多个降精度算法,分别计算得到多组降精度时序指标数据。In this embodiment, after it is detected that the storage duration of the timing index data reaches a preset duration, multiple sets of reduced-precision timing index data are respectively calculated according to multiple precision reduction algorithms corresponding to the timing index data.
在其中一些实施例中,所述配置每个时序指标数据对应的降精度算法,包括:In some of these embodiments, the configuration of the precision reduction algorithm corresponding to each timing index data includes:
在每个所述时序指标数据的数据写入请求中配置对应的降精度算法;或,Configure a corresponding precision reduction algorithm in each data write request of the timing index data; or,
在所述存储系统创建schema表时,指定每个所述时序指标数据的降精度算法。When the storage system creates the schema table, a precision reduction algorithm for each time series index data is specified.
本实施例根据存储系统的类型,设置了两种存储方式。如果存储系统带schema(有表的概念),可以在创建表的时候指定每个时序数据的降精度类型。如果存储系统没有schema的概念,可以在发送写请求时带上每个指标的降精度类型。In this embodiment, two storage modes are set according to the type of the storage system. If the storage system has a schema (the concept of a table), you can specify the type of precision reduction for each time series data when creating the table. If the storage system does not have the concept of schema, you can include the precision reduction type of each indicator when sending the write request.
通过举例来说明,假设存储系统只存一个cpu使用率的数据,然后用户想要按照平均值和最大值两个方式做降精度。By way of example, assume that the storage system only stores one cpu usage data, and then the user wants to reduce the accuracy according to the average value and the maximum value.
针对有schema的存储系统,会记录元数据信息,column=cpu,downsampling=[avg,max];这样写数据时可以写cpu=?。当存储系统收到后,直接存下来元数据的值就可以,后面做降精度时,从元数据里查找发现需要avg,max两种降精度类型,就分别针对两种降精度类型进行降精度处理。For storage systems with schema, metadata information will be recorded, column=cpu, downsampling=[avg,max]; in this way, cpu=? can be written when writing data. . After the storage system receives it, it is enough to directly save the value of the metadata. When the accuracy is reduced later, it is found from the metadata that avg and max are required to reduce the accuracy, and the accuracy is reduced for the two types of accuracy reduction. deal with.
针对没有schema的存储系统,没有元数据信息,因此需要在写数据时加上元数据,即cpu=?with[avg,max],当存储系统收到后,不仅需要存下cpu=?,还需要存下cpu downsampling=[avg,max]。后面做降精度处理时,直接从数据里读到downsampling做降精度。For a storage system without a schema, there is no metadata information, so you need to add metadata when writing data, that is, cpu=? with[avg,max], when the storage system receives it, it not only needs to store cpu=? , also need to save cpu downsampling=[avg,max]. When performing precision reduction processing later, read downsampling directly from the data to perform precision reduction.
比如我们需要记录以下信息:For example, we need to record the following information:
cpu 00:01=10;cpu 00:01 = 10;
cpu 00:02=20;cpu 00:02 = 20;
cpu 00:03=30。cpu 00:03 = 30.
在有shcmea的存储系统中,记录的分别是:In the storage system with shcmea, the records are:
元数据:column=cpu,downsampling=[avg,max];metadata: column=cpu,downsampling=[avg,max];
实际数据:00:01=10,00:02=20,00:03=30。Actual data: 00:01=10, 00:02=20, 00:03=30.
在无schema的存储系统中,记录的是:In the storage system without schema, it is recorded that:
元数据:无;metadata: None;
实际数据:00:01=10[avg,max],00:02=20[avg,max],00:03=30[avg,max]。Actual data: 00:01=10[avg,max], 00:02=20[avg,max], 00:03=30[avg,max].
因为不管写进来多少个时间点的数据,降精度类型都是一定的,所以实际存储可以压缩成:Because no matter how many time points of data are written in, the type of precision reduction is certain, so the actual storage can be compressed into:
元数据:无;metadata: none;
实际数据:[avg,max],00:01=10,00:02=20,00:03=30。Actual data: [avg,max], 00:01=10, 00:02=20, 00:03=30.
可以认为,元数据是一张一般情况下只有创建schema表时才会写进去数据的很小的一张表,实际数据是一张时时刻刻都有新数据写进去的很大的表。It can be considered that metadata is a very small table in which data is written only when creating a schema table under normal circumstances, and the actual data is a large table in which new data is written in all the time.
无schema和有schema的存储系统在实际存储时基本差不多,是因为即使是一个无schema的系统,也可以在写入数据时,动态的把元数据写到元数据表里,那这个时候有无schema的存储系统,最后都可以把数据存储成下面这种格式:The storage systems without a schema and those with a schema are basically similar in actual storage, because even a system without a schema can dynamically write metadata to the metadata table when writing data. The storage system of the schema can finally store the data in the following format:
元数据:column=?,[downsampling];Metadata: column=? ,[downsampling];
实际数据,column=?,[value=timestamp,value=timestamp...]。Actual data, column=? ,[value=timestamp, value=timestamp...].
本实施例还提供了一种时序指标数据降精度处理装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”、“单元”、“子单元”等可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。This embodiment also provides a time series indicator data precision reduction processing device, which is used to implement the above embodiments and preferred implementation modes, and what has already been described will not be repeated. As used below, the terms "module", "unit", "subunit" and the like may be a combination of software and/or hardware that realize a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
图3是根据本申请实施例的时序指标数据存储装置的结构框图,如图3所示,该装置包括接收模块210、查找模块220和处理模块230;其中:FIG. 3 is a structural block diagram of a timing index data storage device according to an embodiment of the present application. As shown in FIG. 3 , the device includes a receiving module 210, a search module 220, and a processing module 230; wherein:
接收模块210,用于接收时序指标数据;A receiving module 210, configured to receive timing index data;
查找模块220,用于根据时序指标数据的类型,查找对应的降精度算法;A search module 220, configured to search for a corresponding precision reduction algorithm according to the type of timing index data;
处理模块230,用于根据所述降精度算法,对所述时序指标数据进行降精度处理。The processing module 230 is configured to perform precision reduction processing on the timing index data according to the precision reduction algorithm.
本申请通过在存储数据时候增加对时序指标数据对应的降精度算法。这样运维人员在不需要为每个新增指标单独创创建任务的前提下,也可以实现对时 序数据的降精度存储。同时不同的时序指标数据可以根据各自的数据特点,选择不同的降精度算法,计算出合理的数据降精度结果。在数据需要做降精度处理时,用户不需要针对每个数据都添加dml语句,通过查看对应时序指标数据对应的降精度算法就可以实现自动降精度处理的效果,解决了相关技术中对时序数据进行降精度处理存在的成本较高且操作不便的问题。This application adds a precision reduction algorithm corresponding to the timing index data when storing data. In this way, the operation and maintenance personnel can realize the reduced-precision storage of time series data without creating a separate task for each new indicator. At the same time, different time series index data can choose different precision reduction algorithms according to their respective data characteristics, and calculate reasonable data precision reduction results. When the data needs to be processed with precision reduction, the user does not need to add dml statements for each data. By viewing the precision reduction algorithm corresponding to the corresponding time series index data, the effect of automatic precision reduction processing can be realized, which solves the problem of time series data in related technologies. The problem of high cost and inconvenient operation exists in the process of reducing precision.
在其中一些实施例中,还包括第一配置模块,用于配置所述时序指标数据对应的降精度算法;将所述时序指标数据的降精度算法和所述时序指标数据的元数据信息关联。In some of these embodiments, it also includes a first configuration module, configured to configure a precision reduction algorithm corresponding to the timing index data; and associate the precision reduction algorithm of the timing index data with the metadata information of the timing index data.
在其中一些实施例中,处理模块230还用于:In some of these embodiments, the processing module 230 is also used for:
检测所述时序指标数据的存储时长;Detecting the storage duration of the timing index data;
在检测到所述存储时长大于预设时长后,根据查找到的降精度算法,对所述时序指标数据的元数据信息进行降精度处理。After detecting that the storage duration is longer than the preset duration, the metadata information of the timing index data is subjected to precision reduction processing according to the found precision reduction algorithm.
在其中一些实施例中,还包括第二配置模块,用于:配置所述时序指标数据的存储策略,所述存储策略指定所述时序指标数据在存储预设时间后进行降精度处理。In some of these embodiments, a second configuration module is also included, configured to: configure a storage policy for the timing index data, where the storage policy specifies that the timing index data is stored for a preset time to perform precision reduction processing.
在其中一些实施例中,第一配置模块还用于:In some of these embodiments, the first configuration module is also used for:
在所述时序指标数据的数据写入请求中配置对应的降精度算法;或,Configure a corresponding precision reduction algorithm in the data write request of the timing index data; or,
在存储系统创建schema表时,配置所述时序指标数据对应的降精度算法。When the storage system creates the schema table, configure the precision reduction algorithm corresponding to the time series index data.
在其中一些实施例中,所述时序指标数据的降精度算法包括:In some of these embodiments, the precision reduction algorithm of the timing index data includes:
Max:取预设时间精度范围内所有时序指标数据的最大值;Max: Take the maximum value of all timing index data within the preset time precision range;
Min:取预设时间精度范围内所有时序指标数据的最小值;Min: Take the minimum value of all timing index data within the preset time precision range;
Gauge:取预设时间精度范围内所有时序指标数据中的最后一个值;Gauge: Take the last value of all timing index data within the preset time precision range;
Sum:取预设时间精度范围内所有时序指标数据的和;Sum: Take the sum of all timing index data within the preset time precision range;
Avg:取预设时间精度范围内所有时序指标数据的和,以及所述预设时间精度范围内所有时序指标数据的数量中的至少一种。Avg: take at least one of the sum of all timing index data within the preset time precision range, and the quantity of all timing index data within the preset time precision range.
在其中一些实施例中,每一个所述时序指标数据对应至少一个所述降精度算法;处理模块230还用于:在检测到存储时长大于预设时长后,根据查找到 的多个降精度算法,分别对所述时序指标数据的元数据信息进行降精度处理,得到多组降精度时序指标数据。In some of these embodiments, each of the timing index data corresponds to at least one of the precision reduction algorithms; the processing module 230 is further configured to: after detecting that the storage duration is longer than the preset duration, according to the searched multiple precision reduction algorithms , respectively performing precision reduction processing on the metadata information of the time series index data to obtain multiple sets of time series index data with reduced precision.
需要说明的是,上述各个模块可以是功能模块也可以是程序模块,既可以通过软件来实现,也可以通过硬件来实现。对于通过硬件来实现的模块而言,上述各个模块可以位于同一处理器中;或者上述各个模块还可以按照任意组合的形式分别位于不同的处理器中。It should be noted that each of the above-mentioned modules may be a function module or a program module, and may be realized by software or by hardware. For the modules implemented by hardware, the above modules may be located in the same processor; or the above modules may be located in different processors in any combination.
另外,结合图1描述的本申请实施例时序指标数据降精度处理方法可以由计算机设备来实现。图3为根据本申请实施例的计算机设备的硬件结构示意图。In addition, the method for processing time-series indicator data to reduce precision in the embodiment of the present application described in conjunction with FIG. 1 may be implemented by a computer device. FIG. 3 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present application.
计算机设备可以包括处理器31以及存储有计算机程序指令的存储器32。The computer device may comprise a processor 31 and a memory 32 storing computer program instructions.
具体地,上述处理器31可以包括中央处理器(CPU),或者特定集成电路(Application Specific Integrated Circuit,简称为ASIC),或者可以被配置成实施本申请实施例的一个或多个集成电路。Specifically, the processor 31 may include a central processing unit (CPU), or an Application Specific Integrated Circuit (ASIC for short), or may be configured to implement one or more integrated circuits in the embodiments of the present application.
其中,存储器32可以包括用于数据或指令的大容量存储器。举例来说而非限制,存储器32可包括硬盘驱动器(Hard Disk Drive,简称为HDD)、软盘驱动器、固态驱动器(Solid State Drive,简称为SSD)、闪存、光盘、磁光盘、磁带或通用串行总线(Universal Serial Bus,简称为USB)驱动器或者两个或更多个以上这些的组合。在合适的情况下,存储器32可包括可移除或不可移除(或固定)的介质。在合适的情况下,存储器32可在数据处理装置的内部或外部。在特定实施例中,存储器32是非易失性(Non-Volatile)存储器。在特定实施例中,存储器32包括只读存储器(Read-Only Memory,简称为ROM)和随机存取存储器(Random Access Memory,简称为RAM)。在合适的情况下,该ROM可以是掩模编程的ROM、可编程ROM(Programmable Read-Only Memory,简称为PROM)、可擦除PROM(Erasable Programmable Read-Only Memory,简称为EPROM)、电可擦除PROM(Electrically Erasable Programmable Read-Only Memory,简称为EEPROM)、电可改写ROM(Electrically Alterable Read-Only Memory,简称为EAROM)或闪存(FLASH)或者两个或更多个以上这些的组 合。在合适的情况下,该RAM可以是静态随机存取存储器(Static Random-Access Memory,简称为SRAM)或动态随机存取存储器(Dynamic Random Access Memory,简称为DRAM),其中,DRAM可以是快速页模式动态随机存取存储器(Fast Page Mode Dynamic Random Access Memory,简称为FPMDRAM)、扩展数据输出动态随机存取存储器(Extended Date Out Dynamic Random Access Memory,简称为EDODRAM)、同步动态随机存取内存(Synchronous Dynamic Random-Access Memory,简称SDRAM)等。Wherein, the memory 32 may include a mass memory for data or instructions. For example without limitation, memory 32 may include hard disk drive (Hard Disk Drive, referred to as HDD), floppy disk drive, solid state drive (Solid State Drive, referred to as SSD), flash memory, optical disc, magneto-optical disc, magnetic tape or general serial Bus (Universal Serial Bus, referred to as USB) driver or a combination of two or more of the above. Memory 32 may comprise removable or non-removable (or fixed) media, where appropriate. Memory 32 may be internal or external to the data processing arrangement, where appropriate. In a particular embodiment, memory 32 is a non-volatile (Non-Volatile) memory. In a specific embodiment, the memory 32 includes a read-only memory (Read-Only Memory, referred to as ROM) and a random access memory (Random Access Memory, referred to as RAM). Where appropriate, the ROM can be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, referred to as PROM), an erasable PROM (Erasable Programmable Read-Only Memory, referred to as EPROM), an electronically programmable Erase PROM (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), electrically rewritable ROM (Electrically Alterable Read-Only Memory, referred to as EAROM) or flash memory (FLASH) or a combination of two or more of these. Where appropriate, the RAM can be a Static Random-Access Memory (SRAM for short) or a Dynamic Random-Access Memory (DRAM for short), where the DRAM can be a fast page Mode Dynamic Random Access Memory (Fast Page Mode Dynamic Random Access Memory, referred to as FPMDRAM), Extended Data Output Dynamic Random Access Memory (Extended Date Out Dynamic Random Access Memory, referred to as EDODRAM), Synchronous Dynamic Random Access Memory (Synchronous Dynamic Random-Access Memory, referred to as SDRAM), etc.
存储器32可以用来存储或者缓存需要处理和/或通信使用的各种数据文件,以及处理器31所执行的可能的计算机程序指令。The memory 32 can be used to store or cache various data files required for processing and/or communication, as well as possible computer program instructions executed by the processor 31 .
处理器31通过读取并执行存储器32中存储的计算机程序指令,以实现上述实施例中的任意一种时序指标数据降精度处理方法。The processor 31 reads and executes the computer program instructions stored in the memory 32 to implement any one of the timing index data precision reduction processing methods in the above embodiments.
在其中一些实施例中,计算机设备还可包括通信接口33和总线30。其中,如图3所示,处理器31、存储器32、通信接口33通过总线30连接并完成相互间的通信。In some of these embodiments, the computer device may further include a communication interface 33 and a bus 30 . Wherein, as shown in FIG. 3 , the processor 31 , the memory 32 , and the communication interface 33 are connected through the bus 30 and complete mutual communication.
通信接口33用于实现本申请实施例中各模块、装置、单元和/或设备之间的通信。通信接口33还可以实现与其他部件例如:外接设备、图像/数据采集设备、数据库、外部存储以及图像/数据处理工作站等之间进行数据通信。The communication interface 33 is used to realize the communication between various modules, devices, units and/or devices in the embodiment of the present application. The communication interface 33 can also implement data communication with other components such as external devices, image/data acquisition equipment, databases, external storage, and image/data processing workstations.
总线30包括硬件、软件或两者,将计算机设备的部件彼此耦接在一起。总线30包括但不限于以下至少之一:数据总线(Data Bus)、地址总线(Address Bus)、控制总线(Control Bus)、扩展总线(Expansion Bus)、局部总线(Local Bus)。举例来说而非限制,总线30可包括图形加速接口(Accelerated Graphics Port,简称为AGP)或其他图形总线、增强工业标准架构(Extended Industry Standard Architecture,简称为EISA)总线、前端总线(Front Side Bus,简称为FSB)、超传输(Hyper Transport,简称为HT)互连、工业标准架构(Industry Standard Architecture,简称为ISA)总线、无线带宽(InfiniBand)互连、低引脚数(Low Pin Count,简称为LPC)总线、存储器总线、微信道架构(Micro Channel Architecture,简称为MCA)总线、外围组件互连(Peripheral Component  Interconnect,简称为PCI)总线、PCI-Express(PCI-X)总线、串行高级技术附件(Serial Advanced Technology Attachment,简称为SATA)总线、视频电子标准协会局部(Video Electronics Standards Association Local Bus,简称为VLB)总线或其他合适的总线或者两个或更多个以上这些的组合。在合适的情况下,总线30可包括一个或多个总线。尽管本申请实施例描述和示出了特定的总线,但本申请考虑任何合适的总线或互连。 Bus 30 includes hardware, software, or both, and couples the components of the computer device to each other. The bus 30 includes but is not limited to at least one of the following: a data bus (Data Bus), an address bus (Address Bus), a control bus (Control Bus), an expansion bus (Expansion Bus), and a local bus (Local Bus). For example without limitation, the bus 30 may include an Accelerated Graphics Port (AGP for short) or other graphics bus, an Enhanced Industry Standard Architecture (Extended Industry Standard Architecture, EISA for short) bus, a Front Side Bus (Front Side Bus) , FSB for short), Hyper Transport (HT) interconnection, Industry Standard Architecture (ISA) bus, InfiniBand interconnection, Low Pin Count, Referred to as LPC) bus, memory bus, Micro Channel Architecture (Micro Channel Architecture, referred to as MCA) bus, peripheral component interconnect (Peripheral Component Interconnect, referred to as PCI) bus, PCI-Express (PCI-X) bus, serial Advanced Technology Attachment (Serial Advanced Technology Attachment, referred to as SATA) bus, Video Electronics Standards Association Local Bus (referred to as VLB) bus or other suitable bus or a combination of two or more of these. Where appropriate, bus 30 may comprise one or more buses. Although the embodiments of this application describe and illustrate a particular bus, this application contemplates any suitable bus or interconnect.
该计算机设备可以基于获取到的程序指令,执行本申请实施例中的时序指标数据降精度处理方法,从而实现结合图1描述的时序指标数据降精度处理方法。The computer device may execute the method for processing timing index data with reduced precision in the embodiment of the present application based on the acquired program instructions, thereby implementing the method for processing timing index data with reduced precision described in conjunction with FIG. 1 .
另外,结合上述实施例中的时序指标数据降精度处理方法,本申请实施例可提供一种计算机可读存储介质来实现。该计算机可读存储介质上存储有计算机程序指令;该计算机程序指令被处理器执行时实现上述实施例中的任意一种时序指标数据降精度处理方法。In addition, in combination with the timing index data precision reduction processing method in the foregoing embodiments, the embodiments of the present application may provide a computer-readable storage medium for implementation. Computer program instructions are stored on the computer-readable storage medium; when the computer program instructions are executed by a processor, any method for processing timing index data with reduced accuracy in the above-mentioned embodiments is implemented.
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-mentioned embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, should be considered as within the scope of this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several implementation modes of the present application, and the description thereof is relatively specific and detailed, but it should not be construed as limiting the scope of the patent for the invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be based on the appended claims.

Claims (10)

  1. 一种时序指标数据降精度处理方法,其特征在于,所述方法包括:A method for processing time series index data with reduced accuracy, characterized in that the method comprises:
    接收时序指标数据;Receive timing index data;
    根据所述时序指标数据的类型,查找对应的降精度算法;Searching for a corresponding precision reduction algorithm according to the type of the timing index data;
    根据所述降精度算法,对所述时序指标数据的元数据信息进行降精度处理。According to the precision reduction algorithm, the metadata information of the time series indicator data is subjected to precision reduction processing.
  2. 根据权利要求1所述的方法,其特征在于,在所述根据时序指标数据的类型,查找对应的降精度算法之前,所述方法还包括:The method according to claim 1, wherein, before searching for a corresponding precision reduction algorithm according to the type of timing index data, the method further comprises:
    配置所述时序指标数据对应的降精度算法;Configuring a precision reduction algorithm corresponding to the timing index data;
    将所述时序指标数据的降精度算法和所述时序指标数据的元数据信息关联。Associating the precision reduction algorithm of the time series index data with the metadata information of the time series index data.
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述降精度算法,对所述时序指标数据的元数据信息进行降精度处理,包括:The method according to claim 1, wherein, according to the precision reduction algorithm, performing precision reduction processing on the metadata information of the timing index data includes:
    检测所述时序指标数据的存储时长;Detecting the storage duration of the timing index data;
    在检测到所述存储时长大于预设时长后,根据查找到的降精度算法,对所述时序指标数据的元数据信息进行降精度处理。After detecting that the storage duration is longer than the preset duration, the metadata information of the timing index data is subjected to precision reduction processing according to the found precision reduction algorithm.
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method according to claim 3, further comprising:
    配置所述时序指标数据的存储策略,所述存储策略指定所述时序指标数据在存储预设时间后进行降精度处理。A storage strategy for the timing index data is configured, and the storage strategy specifies that the timing index data is stored for a preset time to perform precision reduction processing.
  5. 根据权利要求2所述的方法,其特征在于,所述配置所述时序指标数据对应的降精度算法,包括:The method according to claim 2, wherein the configuring the precision reduction algorithm corresponding to the timing index data includes:
    在所述时序指标数据的数据写入请求中配置对应的降精度算法;或Configure a corresponding precision reduction algorithm in the data write request of the timing index data; or
    在存储系统创建schema表时,配置所述时序指标数据对应的降精度算法。When the storage system creates the schema table, configure the precision reduction algorithm corresponding to the time series index data.
  6. 根据权利要求1所述的方法,其特征在于,所述时序指标数据的降精度算法包括:The method according to claim 1, wherein the precision reduction algorithm of the timing index data comprises:
    Max:取预设时间精度范围内所有时序指标数据的最大值;Max: Take the maximum value of all timing index data within the preset time precision range;
    Min:取预设时间精度范围内所有时序指标数据的最小值;Min: Take the minimum value of all timing index data within the preset time precision range;
    Gauge:取预设时间精度范围内所有时序指标数据中的最后一个值;Gauge: Take the last value of all timing index data within the preset time precision range;
    Sum:取预设时间精度范围内所有时序指标数据的和;Sum: Take the sum of all timing index data within the preset time precision range;
    Avg:取预设时间精度范围内所有时序指标数据的和,以及所述预设时间精 度范围内所有时序指标数据的数量中的至少一种。Avg: take at least one of the sum of all timing index data within the preset time precision range, and the quantity of all timing index data within the preset time precision range.
  7. 根据权利要求6所述的方法,其特征在于,每一个所述时序指标数据对应至少一个所述降精度算法;所述根据所述降精度算法对所述时序指标数据的元数据信息进行降精度处理,包括:The method according to claim 6, characterized in that each of the timing index data corresponds to at least one of the precision reduction algorithms; and the precision reduction is performed on the metadata information of the timing index data according to the precision reduction algorithm processing, including:
    在检测到存储时长大于预设时长后,根据查找到的多个降精度算法,分别对所述时序指标数据的元数据信息进行降精度处理,得到多组降精度时序指标数据。After detecting that the storage duration is longer than the preset duration, according to the found multiple precision reduction algorithms, the metadata information of the timing index data is respectively subjected to precision reduction processing to obtain multiple sets of reduced precision timing index data.
  8. 一种时序指标数据降精度处理装置,包括接收模块、查找模块和处理模块;其中:A timing index data reduction precision processing device, including a receiving module, a search module and a processing module; wherein:
    接收模块,用于接收时序指标数据;A receiving module, configured to receive timing index data;
    查找模块,用于根据时序指标数据的类型,查找对应的降精度算法;The search module is used to find the corresponding precision reduction algorithm according to the type of time series index data;
    处理模块,用于根据所述降精度算法,对所述时序指标数据的元数据信息进行降精度处理。The processing module is configured to perform precision reduction processing on the metadata information of the time series indicator data according to the precision reduction algorithm.
  9. 一种计算机设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7中任一项所述的时序指标数据降精度处理方法。A computer device, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, characterized in that, when the processor executes the computer program, the computer program according to claims 1 to 1 is implemented. The processing method for reducing precision of time series index data described in any one of 7.
  10. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1至7中任一项所述的时序指标数据降精度处理方法。A computer-readable storage medium, on which a computer program is stored, wherein, when the program is executed by a processor, the method for processing time-series index data with reduced precision according to any one of claims 1 to 7 is implemented.
PCT/CN2022/108712 2021-08-17 2022-07-28 Method and apparatus for precision reduction of time series index data, and computer device WO2023020247A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110942640.4 2021-08-17
CN202110942640.4A CN113761021A (en) 2021-08-17 2021-08-17 Time sequence index data precision reduction processing method and device and computer equipment

Publications (1)

Publication Number Publication Date
WO2023020247A1 true WO2023020247A1 (en) 2023-02-23

Family

ID=78790073

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/108712 WO2023020247A1 (en) 2021-08-17 2022-07-28 Method and apparatus for precision reduction of time series index data, and computer device

Country Status (2)

Country Link
CN (1) CN113761021A (en)
WO (1) WO2023020247A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116822253A (en) * 2023-08-29 2023-09-29 山东省计算中心(国家超级计算济南中心) Hybrid precision implementation method and system suitable for MANUM sea wave mode

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113761021A (en) * 2021-08-17 2021-12-07 杭州涂鸦信息技术有限公司 Time sequence index data precision reduction processing method and device and computer equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120027131A1 (en) * 2010-07-30 2012-02-02 Ankit Sethi Blind Carrier/Timing Recovery and Detection of Modulation Scheme
CN111274256A (en) * 2020-01-20 2020-06-12 远景智能国际私人投资有限公司 Resource control method, device, equipment and storage medium based on time sequence database
CN112131272A (en) * 2020-09-22 2020-12-25 平安科技(深圳)有限公司 Detection method, device, equipment and storage medium for multi-element KPI time sequence
CN112307057A (en) * 2020-10-27 2021-02-02 北京健康之家科技有限公司 Data processing method and device, electronic equipment and computer storage medium
CN113722383A (en) * 2021-09-13 2021-11-30 福韵数据服务有限公司 Investigation device and method based on time sequence information
CN113761021A (en) * 2021-08-17 2021-12-07 杭州涂鸦信息技术有限公司 Time sequence index data precision reduction processing method and device and computer equipment
CN114328601A (en) * 2021-12-09 2022-04-12 阿里巴巴(中国)有限公司 Data down-sampling and data query method, system and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134723A (en) * 2019-05-22 2019-08-16 网易(杭州)网络有限公司 A kind of method and database of storing data
CN111127700A (en) * 2019-12-13 2020-05-08 苏州智加科技有限公司 System index monitoring system for automatically driving automobile
CN112291114A (en) * 2020-11-17 2021-01-29 恩亿科(北京)数据科技有限公司 Data source monitoring method and system, electronic equipment and storage medium
CN112800061A (en) * 2021-01-29 2021-05-14 北京锐安科技有限公司 Data storage method, device, server and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120027131A1 (en) * 2010-07-30 2012-02-02 Ankit Sethi Blind Carrier/Timing Recovery and Detection of Modulation Scheme
CN111274256A (en) * 2020-01-20 2020-06-12 远景智能国际私人投资有限公司 Resource control method, device, equipment and storage medium based on time sequence database
CN112131272A (en) * 2020-09-22 2020-12-25 平安科技(深圳)有限公司 Detection method, device, equipment and storage medium for multi-element KPI time sequence
CN112307057A (en) * 2020-10-27 2021-02-02 北京健康之家科技有限公司 Data processing method and device, electronic equipment and computer storage medium
CN113761021A (en) * 2021-08-17 2021-12-07 杭州涂鸦信息技术有限公司 Time sequence index data precision reduction processing method and device and computer equipment
CN113722383A (en) * 2021-09-13 2021-11-30 福韵数据服务有限公司 Investigation device and method based on time sequence information
CN114328601A (en) * 2021-12-09 2022-04-12 阿里巴巴(中国)有限公司 Data down-sampling and data query method, system and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116822253A (en) * 2023-08-29 2023-09-29 山东省计算中心(国家超级计算济南中心) Hybrid precision implementation method and system suitable for MANUM sea wave mode
CN116822253B (en) * 2023-08-29 2023-12-08 山东省计算中心(国家超级计算济南中心) Hybrid precision implementation method and system suitable for MANUM sea wave mode

Also Published As

Publication number Publication date
CN113761021A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
WO2023020247A1 (en) Method and apparatus for precision reduction of time series index data, and computer device
CN110149803B (en) Data storage method, system and terminal equipment
WO2019085471A1 (en) Database synchronization method, application server, and computer readable storage medium
WO2017049757A1 (en) Time sequence data storage method and apparatus
CN109388671B (en) Data processing method, device, equipment and storage medium
CN110851474A (en) Data query method, database middleware, data query device and storage medium
WO2017071525A1 (en) Data storage method and apparatus and data query method and apparatus
WO2021043026A1 (en) Storage space management method and device
WO2021057164A1 (en) Query method and device for blockchain ledger, and apparatus
WO2019100853A1 (en) Page query method, device, and electronic apparatus
CN111061758B (en) Data storage method, device and storage medium
WO2017020735A1 (en) Data processing method, backup server and storage system
US9213759B2 (en) System, apparatus, and method for executing a query including boolean and conditional expressions
US9195664B2 (en) Method and device based on android system for tracking imported file
CN109783321B (en) Monitoring data management method and device and terminal equipment
CN111625600B (en) Data storage processing method, system, computer equipment and storage medium
CN103176753B (en) Storing device and data managing method thereof
WO2023098593A1 (en) Data processing method and apparatus
CN111127700A (en) System index monitoring system for automatically driving automobile
CN109063215B (en) Data retrieval method and device
WO2023071367A1 (en) Processing method and apparatus for communication service data, and computer storage medium
WO2019128936A1 (en) Data processing method
CN107894942B (en) Method and device for monitoring data table access amount
CN113342813B (en) Key value data processing method, device, computer equipment and readable storage medium
CN108984720B (en) Data query method and device based on column storage, server and storage medium

Legal Events

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

Ref document number: 22857560

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE