一种SQL语句处理方法、数据库系统、设备和存储介质

By rewriting rules to automatically construct SQL statements and adding selection and grouping clauses, the problem of large development workload and errors caused by manually editing SQL statements in existing technologies is solved, and efficient time-segmented statistics are achieved.

CN117194473BActive Publication Date: 2026-07-17BEIJING LANYUN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING LANYUN TECH CO LTD
Filing Date
2023-09-01
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing technologies require manual editing of multiple SQL statements to achieve time-segmented statistics when performing time-series queries, resulting in a large development workload and a high risk of errors, making it difficult to meet flexible statistical needs.

Method used

By rewriting rules to automatically construct SQL statements, adding selection and grouping clauses, and generating a second SQL statement for the target data to achieve time-segmented statistics, the development workload is reduced and consistency is improved.

Benefits of technology

It significantly reduced the probability of development errors, improved development efficiency, and met the requirements for flexible time-period statistical functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117194473B_ABST
    Figure CN117194473B_ABST
Patent Text Reader

Abstract

本文公开了一种SQL语句处理方法、数据库系统、电子设备和存储介质。所述方法包括,获取用于查询目标数据的第一SQL语句、待分段统计的时间戳字段和分段时长;根据设定的改写规则,改写所述第一SQL语句得到针对所述目标数据进一步按时间段统计行数的第二SQL语句;执行所述第二SQL语句得到对应的分时段统计结果;其中,所述改写规则包括选择子句修改子规则和分组子句修改子规则;所述选择子句修改子规则包括:新增第一字段和第二字段,保留所述第一SQL语句包括的选择子句中与所述语第一SQL语句包括的分组子句中相同的字段;所述分组子句修改子规则包括:新增所述第一字段。
Need to check novelty before this filing date? Find Prior Art