Movatterモバイル変換


[0]ホーム

URL:


CN111858587A - A method, device, equipment and storage medium for counting database data - Google Patents

A method, device, equipment and storage medium for counting database data
Download PDF

Info

Publication number
CN111858587A
CN111858587ACN202010663835.0ACN202010663835ACN111858587ACN 111858587 ACN111858587 ACN 111858587ACN 202010663835 ACN202010663835 ACN 202010663835ACN 111858587 ACN111858587 ACN 111858587A
Authority
CN
China
Prior art keywords
data
database
counting
count
writing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010663835.0A
Other languages
Chinese (zh)
Inventor
汪杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qingyun Science And Technology Co ltd
Original Assignee
Beijing Qingyun Science And Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qingyun Science And Technology Co ltdfiledCriticalBeijing Qingyun Science And Technology Co ltd
Priority to CN202010663835.0ApriorityCriticalpatent/CN111858587A/en
Publication of CN111858587ApublicationCriticalpatent/CN111858587A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The embodiment of the invention discloses a method, a device, equipment and a storage medium for counting database data. The method comprises the following steps: generating counting variable quantity data according to the data quantity of the data to be processed; writing the counting variation data into a database; and updating the count value of the database according to the count variable quantity data. The counting method of the database data disclosed by the embodiment of the invention processes the counting variable quantity data together with the database so as to update the counting value of the database according to the counting variable quantity data, can improve the accuracy of data counting, and does not influence the normal service of the database.

Description

Translated fromChinese
一种数据库数据的计数方法、装置、设备及存储介质A method, device, equipment and storage medium for counting database data

技术领域technical field

本发明实施例涉及数据计数技术领域,尤其涉及一种数据库数据的计数方法、装置、设备及存储介质。Embodiments of the present invention relate to the technical field of data counting, and in particular, to a method, apparatus, device, and storage medium for counting database data.

背景技术Background technique

据库中存储的数据量是非常普遍的需求,在SQL数据库中,如果需要统计一个表中的数据量,可以使用SELECT COUNT(1)FROM table这样的语句,执行这条语句返回的是table中的记录行数。但是在大多数kv数据库中,没有获取数据量的功能接口,因此需要应用程序实现统计计数的逻辑。The amount of data stored in the database is a very common requirement. In a SQL database, if you need to count the amount of data in a table, you can use a statement such as SELECT COUNT(1) FROM table. Executing this statement returns the data in the table. the number of record lines. However, in most kv databases, there is no functional interface to obtain the amount of data, so the application needs to implement the logic of statistical counting.

现有技术中,通常采用如下三种方式实现数据的计数:第一种采用异构数据库来存储计数,该种方式会出现两个数据库信息不统一的情况,造成计数错误;第二种采用key值来存储计数信息,这种方式数据只能串行处理,影响数据处理的效率;第三种时不存储计数信息,在需要获取数据库数据量时,对数据库进行全盘扫描,这种方式在数据查询时会耗费大量的时间。In the prior art, the following three methods are usually used to realize the counting of data: the first method uses a heterogeneous database to store the count, and in this method, the information of the two databases is inconsistent, resulting in a count error; the second method uses a key In this way, the data can only be processed serially, which affects the efficiency of data processing; in the third case, the counting information is not stored. When the data volume of the database needs to be obtained, the database is fully scanned. The query will take a lot of time.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种数据库数据的计数方法、装置、设备及存储介质,以实现对数据库数据量的计数,可以提高数据计数的准确性,且不影响数据库的正常业务。Embodiments of the present invention provide a method, device, device and storage medium for counting database data, so as to count the amount of database data, which can improve the accuracy of data counting without affecting the normal business of the database.

第一方面,本发明实施例提供了一种数据库数据的计数方法,包括:In a first aspect, an embodiment of the present invention provides a method for counting database data, including:

根据待处理数据的数据量生成计数变化量数据;Generate count change data according to the amount of data to be processed;

将所述计数变化量数据写入数据库中;writing the count variation data into the database;

根据所述计数变化量数据对数据库的计数值进行更新。The count value of the database is updated according to the count change amount data.

进一步地,所述计数变化量数据携带有设定标识码。Further, the count variation data carries a set identification code.

进一步地,所述待处理数据包括待写入数据和待删除数据。Further, the data to be processed includes data to be written and data to be deleted.

进一步地,若所述待处理数据为待写入数据,则所述计数变化量数据写入数据库中,包括:Further, if the data to be processed is data to be written, the count change data is written into the database, including:

调用批量操作接口,通过所述批量操作接口将所述待写入数据和所述计数变化量数据写入数据库中。The batch operation interface is called, and the data to be written and the count change data are written into the database through the batch operation interface.

进一步地,若所述待处理数据为待删除数据,则则将所述计数变化量数据写入数据库中,包括:Further, if the data to be processed is data to be deleted, writing the count change data into the database, including:

调用批量操作接口,通过所述批量操作接口将所述计数变化量数据写入数据库中,且将所述待删除数据从所述数据库中删除。A batch operation interface is called, and the count variation data is written into the database through the batch operation interface, and the data to be deleted is deleted from the database.

进一步地,根据所述计数变化量数据对数据库的计数值进行更新,包括:Further, the count value of the database is updated according to the count variation data, including:

根据所述设定标识码查找数据库中的所述计数变化量数据;Find the count change data in the database according to the set identification code;

根据查找的计数变化量数据确定数据的变化值;Determine the change value of the data according to the searched count change data;

将所述变化值与数据库当前计数值进行累加,获得更新后的计数值。Accumulate the change value and the current count value of the database to obtain an updated count value.

进一步地,在根据所述计数变化量数据对数据库的计数值进行更新之后,还包括:Further, after updating the count value of the database according to the count change data, it also includes:

将所述计数变化量数据从数据库中删除。The count delta data is deleted from the database.

第二方面,本发明实施例还提供了一种数据库数据的计数装置,包括:In a second aspect, an embodiment of the present invention also provides a device for counting database data, including:

计数变化量数据生成模块,用于根据待处理数据的数据量生成计数变化量数据;The counting change data generation module is used to generate the counting change data according to the data amount of the data to be processed;

数据写入模块,用于将所述计数变化量数据处理数据库中;a data writing module for processing the count variation data in a database;

计数值更新模块,用于根据所述计数变化量数据对数据库的计数值进行更新。A count value update module, configured to update the count value of the database according to the count change amount data.

第三方面,本发明实施例还提供了一种计算机设备,所述设备包括:包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如本发明实施例所述的数据库数据的计数方法。In a third aspect, an embodiment of the present invention further provides a computer device, the device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program When implementing the method for counting database data according to the embodiment of the present invention.

第四方面,本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理装置执行时实现如本发明实施例所述的数据库数据的计数方法。In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processing device, implements the method for counting database data according to the embodiment of the present invention.

本发明实施例,首先根据待处理数据的数据量生成计数变化量数据,然后将计数变化量数据处理数据库中,最后根据计数变化量数据对数据库的计数值进行更新。本发明实施例公开的数据库数据的计数方法,将计数变化量数据一起处理数据库,以根据计数变化量数据对数据库的计数值进行更新,可以提高数据计数的准确性,且不影响数据库的正常业务。In the embodiment of the present invention, firstly, the count change amount data is generated according to the data volume of the data to be processed, then the count change amount data is processed into the database, and finally the count value of the database is updated according to the count change amount data. The method for counting database data disclosed in the embodiment of the present invention processes the database together with the count change data to update the count value of the database according to the count change data, which can improve the accuracy of data counting without affecting the normal business of the database .

附图说明Description of drawings

图1是本发明实施例一中的一种数据库数据的计数方法的流程图;1 is a flowchart of a method for counting database data in Embodiment 1 of the present invention;

图2是本发明实施例二中的一种数据库数据的计数装置的结构示意图;2 is a schematic structural diagram of a device for counting database data in Embodiment 2 of the present invention;

图3是本发明实施例三中的一种计算机设备的结构示意图。FIG. 3 is a schematic structural diagram of a computer device in Embodiment 3 of the present invention.

具体实施方式Detailed ways

下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all structures related to the present invention.

实施例一Example 1

图1为本发明实施例一提供的一种数据库数据的计数方法的流程图,本实施例可适用于对数据库中的数据量进行统计的情况,该方法可以由数据库数据的计数装置来执行,该装置可由硬件和/或软件组成,并一般可集成在具有数据访问功能的设备中,该设备可以是服务器或服务器集群等电子设备。如图1所示,该方法具体包括如下步骤:1 is a flow chart of a method for counting database data provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation where the amount of data in a database is counted, and the method can be performed by a counting device for database data, The apparatus may be composed of hardware and/or software, and may generally be integrated in a device with data access function, which may be an electronic device such as a server or a server cluster. As shown in Figure 1, the method specifically includes the following steps:

步骤110,根据待处理数据的数据量生成计数变化量数据。Step 110: Generate count variation data according to the data volume of the data to be processed.

其中,待处理数据可以包括待写入数据和待删除数据。数据量可以通过数据条数来体现。计数变化量数据携带有设定标识码,设定标识码可以是一个设定前缀。计数变化量数据的形式可以是:设定标识码+变化值。对于待写入数据,变化值为正数,对于待删除数据,变化值为负数。示例性的,设定标识码可以是delta_count,假设待写入数据的条数为20,那么生成的计数变化量数据表示为:delta_count 20。The data to be processed may include data to be written and data to be deleted. The amount of data can be reflected by the number of data bars. The count variation data carries a setting identification code, and the setting identification code may be a setting prefix. The form of count change data can be: set identification code + change value. For data to be written, the change value is a positive number, and for data to be deleted, the change value is a negative number. Exemplarily, the set identification code may be delta_count. Assuming that the number of pieces of data to be written is 20, the generated count variation data is expressed as: delta_count 20.

具体的,根据待处理数据的数据量生成计数变化量数据的过程可以是,获取待处理数据的条数,将数据条数确定为数据的变化值,然后在该变化值前加设定标识符,生成计数变化量数据。Specifically, the process of generating the count change data according to the data volume of the data to be processed may be as follows: acquiring the number of pieces of data to be processed, determining the number of data pieces as the change value of the data, and then adding a setting identifier before the change value , to generate count delta data.

步骤120,将计数变化量数据写入数据库中。Step 120, write the count variation data into the database.

具体的,若待处理数据为待写入数据,将待处理数据和计数变化量数据写入数据库中的方式可以是:调用批量操作接口,通过批量操作接口将待处理数据和计数变化量数据写入数据库中。Specifically, if the data to be processed is the data to be written, the method of writing the data to be processed and the count change data into the database may be: calling the batch operation interface, and writing the pending data and the count change data through the batch operation interface into the database.

具体的,若待处理数据为待删除数据,则将计数变化量数据写入数据库中的方式可以是:调用批量操作接口,通过批量操作接口将计数变化量数据写入数据库中,并且将待删除数据从数据库中删除。Specifically, if the data to be processed is the data to be deleted, the method of writing the count change data into the database may be: calling the batch operation interface, writing the count change data into the database through the batch operation interface, and writing the to-be-deleted data into the database. Data is deleted from the database.

本实施例中,批量操作接口支持批量变更操作,包括数据的写入及删除,且可以保证批量是一个原子操作,即一批数据要么都操作成功,要么都操作失败。In this embodiment, the batch operation interface supports batch change operations, including data writing and deletion, and can ensure that the batch is an atomic operation, that is, either all operations of a batch of data succeed or all operations fail.

步骤130,根据计数变化量数据对数据库的计数值进行更新。Step 130: Update the count value of the database according to the count change data.

具体的,根据计数变化量数据对数据库的计数值进行更新的方式可以是:根据设定标识码查找数据库中的计数变化量数据;根据查找的计数变化量数据确定数据的变化值;将变化值与数据库当前计数值进行累加,获得更新后的计数值。Specifically, the method of updating the count value of the database according to the count change data may be: searching the count change data in the database according to the set identification code; determining the change value of the data according to the searched count change data; Accumulate with the current count value of the database to obtain the updated count value.

本实施例中,若数据库中包含有多条计数变化量数据,则将多条计数变化量数据的变化值与数据库当前计数值进行累加。示例性的,假设数据库中有三条计数变化量数据,变化值分别为10、-5和20,数据库当前计数值为1000,那么更新后的计数值为1000+10-5+20=1025。In this embodiment, if the database contains multiple pieces of count change data, the change values of the multiple pieces of count change data and the current count value of the database are accumulated. Exemplarily, assuming that there are three pieces of count change data in the database, the change values are 10, -5 and 20 respectively, and the current count value in the database is 1000, then the updated count value is 1000+10-5+20=1025.

可选的,在根据所述计数变化量数据对数据库的计数值进行更新之后,还包括如下步骤:将计数变化量数据从数据库中删除。Optionally, after updating the count value of the database according to the count change data, the method further includes the following step: deleting the count change data from the database.

本实施例中,将参与累加的计数变化量数据从数据库中删除。In this embodiment, the count variation data participating in the accumulation is deleted from the database.

本实施例的技术方案,首先根据待处理数据的数据量生成计数变化量数据,然后将计数变化量数据处理数据库中,最后根据计数变化量数据对数据库的计数值进行更新。本发明实施例公开的数据库数据的计数方法,将计数变化量数据一起处理数据库,以根据计数变化量数据对数据库的计数值进行更新,可以提高数据计数的准确性,且不影响数据库的正常业务。In the technical solution of this embodiment, firstly, the count change data is generated according to the data volume of the data to be processed, then the count change data is processed into the database, and finally the count value of the database is updated according to the count change data. The method for counting database data disclosed in the embodiment of the present invention processes the database together with the count change data to update the count value of the database according to the count change data, which can improve the accuracy of data counting without affecting the normal business of the database .

实施例二Embodiment 2

图2为本发明实施例一提供的一种数据库数据的计数装置的结构示意图。如图2所示,该装置包括:计数变化量数据生成模块210,数据写入模块220和计数值更新模块230。FIG. 2 is a schematic structural diagram of an apparatus for counting database data according to Embodiment 1 of the present invention. As shown in FIG. 2 , the apparatus includes: a count variationdata generating module 210 , adata writing module 220 and a countvalue updating module 230 .

计数变化量数据生成模块210,用于根据待处理数据的数据量生成计数变化量数据;a count variationdata generation module 210, configured to generate count variation data according to the data volume of the data to be processed;

数据写入模块220,用于将计数变化量数据写入数据库中;adata writing module 220, for writing the count variation data into the database;

计数值更新模块230,用于根据计数变化量数据对数据库的计数值进行更新。The countvalue update module 230 is configured to update the count value of the database according to the count change amount data.

可选的,计数变化量数据携带有设定标识码。Optionally, the count variation data carries a set identification code.

可选的,待处理数据包括待写入数据和待删除数据。Optionally, the data to be processed includes data to be written and data to be deleted.

可选的,若待处理数据为待写入数据,数据写入模块220,还用于:Optionally, if the data to be processed is data to be written, thedata writing module 220 is further used for:

调用批量操作接口,通过批量操作接口将待写入数据和计数变化量数据写入数据库中。Call the batch operation interface, and write the data to be written and the count change data into the database through the batch operation interface.

可选的,若待处理数据为待删除数据,数据写入模块220,还用于:Optionally, if the data to be processed is data to be deleted, thedata writing module 220 is also used for:

调用批量操作接口,通过批量操作接口将计数变化量数据写入数据库中,且将待删除数据从数据库中删除。Call the batch operation interface, write the count change data into the database through the batch operation interface, and delete the data to be deleted from the database.

可选的,计数值更新模块230,还用于:Optionally, the countvalue updating module 230 is further configured to:

根据设定标识码查找数据库中的计数变化量数据;Find the count change data in the database according to the set identification code;

根据查找的计数变化量数据确定数据的变化值;Determine the change value of the data according to the searched count change data;

将变化值与数据库当前计数值进行累加,获得更新后的计数值。Accumulate the change value with the current count value of the database to obtain the updated count value.

可选的,还包括:计数变化量数据删除模块,用于:Optionally, it also includes: a count change data deletion module, used for:

将计数变化量数据从数据库中删除。Delete count delta data from the database.

上述装置可执行本发明前述所有实施例所提供的方法,具备执行上述方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本发明前述所有实施例所提供的方法。The above-mentioned apparatus can execute the methods provided by all the foregoing embodiments of the present invention, and has corresponding functional modules and beneficial effects for executing the above-mentioned methods. For technical details not described in detail in this embodiment, reference may be made to the methods provided by all the foregoing embodiments of the present invention.

实施例三Embodiment 3

图3为本发明实施例三提供的一种计算机设备的结构示意图。图3示出了适于用来实现本发明实施方式的计算机设备312的框图。图3显示的计算机设备312仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。设备312是典型的数据库数据的计数功能的计算设备。FIG. 3 is a schematic structural diagram of a computer device according to Embodiment 3 of the present invention. Figure 3 shows a block diagram of acomputer device 312 suitable for use in implementing embodiments of the present invention. Thecomputer device 312 shown in FIG. 3 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present invention.Device 312 is a computing device that is typically a counting function of database data.

如图3所示,计算机设备312以通用计算设备的形式表现。计算机设备312的组件可以包括但不限于:一个或者多个处理器316,存储装置328,连接不同系统组件(包括存储装置328和处理器316)的总线318。As shown in FIG. 3,computer device 312 takes the form of a general-purpose computing device. Components ofcomputer device 312 may include, but are not limited to, one ormore processors 316,storage 328, and abus 318 connecting various systemcomponents including storage 328 andprocessor 316.

总线318表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(Industry StandardArchitecture,ISA)总线,微通道体系结构(Micro Channel Architecture,MCA)总线,增强型ISA总线、视频电子标准协会(Video Electronics Standards Association,VESA)局域总线以及外围组件互连(Peripheral Component Interconnect,PCI)总线。Thebus 318 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, enhanced ISA bus, Video Electronics Standards Association (Video Electronics Standards Association) , VESA) local bus and peripheral component interconnect (Peripheral Component Interconnect, PCI) bus.

计算机设备312典型地包括多种计算机系统可读介质。这些介质可以是任何能够被计算机设备312访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。Computer device 312 typically includes a variety of computer system readable media. These media can be any available media that can be accessed bycomputer device 312, including both volatile and nonvolatile media, removable and non-removable media.

存储装置328可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(Random Access Memory,RAM)330和/或高速缓存存储器332。计算机设备312可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统334可以用于读写不可移动的、非易失性磁介质(图3未显示,通常称为“硬盘驱动器”)。尽管图3中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如只读光盘(Compact Disc-Read Only Memory,CD-ROM)、数字视盘(Digital Video Disc-Read Only Memory,DVD-ROM)或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线318相连。存储装置328可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本发明各实施例的功能。Storage 328 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 330 and/orcache memory 332 .Computer device 312 may further include other removable/non-removable, volatile/non-volatile computer system storage media. For example only,storage system 334 may be used to read and write to non-removable, non-volatile magnetic media (not shown in FIG. 3, commonly referred to as a "hard drive"). Although not shown in FIG. 3, a magnetic disk drive may be provided for reading and writing to removable non-volatile magnetic disks (eg "floppy disks"), as well as removable non-volatile optical disks (eg Compact Disc-Read only) Read Only Memory, CD-ROM), Digital Video Disc (Digital Video Disc-Read Only Memory, DVD-ROM) or other optical media) read and write optical disc drives. In these cases, each drive may be connected tobus 318 through one or more data media interfaces.Storage 328 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of various embodiments of the present invention.

具有一组(至少一个)程序模块326的程序336,可以存储在例如存储装置328中,这样的程序模块326包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块326通常执行本发明所描述的实施例中的功能和/或方法。Aprogram 336 having a set (at least one) of program modules 326, which may be stored, for example, in astorage device 328, such program modules 326 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, which An implementation of a network environment may be included in each or some combination of the examples. Program modules 326 generally perform the functions and/or methods of the described embodiments of the present invention.

计算机设备312也可以与一个或多个外部设备314(例如键盘、指向设备、摄像头、显示器324等)通信,还可与一个或者多个使得用户能与该计算机设备312交互的设备通信,和/或与使得该计算机设备312能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口322进行。并且,计算机设备312还可以通过网络适配器320与一个或者多个网络(例如局域网(Local AreaNetwork,LAN),广域网Wide Area Network,WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器320通过总线318与计算机设备312的其它模块通信。应当明白,尽管图中未示出,可以结合计算机设备312使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、磁盘阵列(Redundant Arrays of IndependentDisks,RAID)系统、磁带驱动器以及数据备份存储系统等。Thecomputer device 312 may also communicate with one or more external devices 314 (eg, a keyboard, pointing device, camera,display 324, etc.), and may also communicate with one or more devices that enable a user to interact with thecomputer device 312, and/or Or with any device (eg, network card, modem, etc.) that enables thecomputer device 312 to communicate with one or more other computing devices. Such communication may take place through input/output (I/O)interface 322 . Also,computer device 312 may communicate with one or more networks (eg, Local Area Network (LAN), Wide Area Network, WAN) and/or public networks, such as the Internet, throughnetwork adapter 320 . As shown,network adapter 320 communicates with other modules ofcomputer device 312 viabus 318 . It should be understood that, although not shown, other hardware and/or software modules may be used in conjunction withcomputer device 312, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.

处理器316通过运行存储在存储装置328中的程序,从而执行各种功能应用以及数据处理,例如实现本发明上述实施例所提供的数据库数据的计数方法。Theprocessor 316 executes various functional applications and data processing by running the programs stored in thestorage device 328, for example, implementing the database data counting method provided by the above embodiments of the present invention.

实施例四Embodiment 4

本发明实施例提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该程序被处理装置执行时实现如本发明实施例中的数据库数据的计数方法。本发明上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。An embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the program is executed by a processing apparatus, the method for counting database data in the embodiment of the present invention is implemented. The above-mentioned computer-readable medium of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.

在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText TransferProtocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the client and server can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can communicate with digital data in any form or medium (eg, a communications network) interconnected. Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (eg, the Internet), and peer-to-peer networks (eg, ad hoc peer-to-peer networks), as well as any currently known or future development network of.

上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device.

上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:根据待处理数据的数据量生成计数变化量数据;将所述计数变化量数据写入数据库中;根据所述计数变化量数据对数据库的计数值进行更新。The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: generates count variation data according to the data amount of the data to be processed; The amount data is written into the database; the count value of the database is updated according to the count change amount data.

可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing operations of the present disclosure may be written in one or more programming languages, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and This includes conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through Internet connection).

附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.

描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments of the present disclosure may be implemented in a software manner, and may also be implemented in a hardware manner. Among them, the name of the unit does not constitute a limitation of the unit itself under certain circumstances.

本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chips (SOCs), Complex Programmable Logical Devices (CPLDs) and more.

在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with the instruction execution system, apparatus or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), fiber optics, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention. The scope is determined by the scope of the appended claims.

Claims (10)

CN202010663835.0A2020-07-102020-07-10 A method, device, equipment and storage medium for counting database dataPendingCN111858587A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202010663835.0ACN111858587A (en)2020-07-102020-07-10 A method, device, equipment and storage medium for counting database data

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202010663835.0ACN111858587A (en)2020-07-102020-07-10 A method, device, equipment and storage medium for counting database data

Publications (1)

Publication NumberPublication Date
CN111858587Atrue CN111858587A (en)2020-10-30

Family

ID=72982887

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010663835.0APendingCN111858587A (en)2020-07-102020-07-10 A method, device, equipment and storage medium for counting database data

Country Status (1)

CountryLink
CN (1)CN111858587A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101557316A (en)*2009-05-142009-10-14阿里巴巴集团控股有限公司Method and system for updating statistical data
CN107798036A (en)*2017-04-102018-03-13平安科技(深圳)有限公司A kind of method of counting and counter
US20180096033A1 (en)*2016-10-042018-04-05International Business Machines CorporationQuery management in database management systems
CN108804237A (en)*2017-05-052018-11-13北京京东尚科信息技术有限公司Data real-time statistical method, device, storage medium and electronic equipment
CN110069547A (en)*2019-03-192019-07-30天津字节跳动科技有限公司Online database list data statistical method, device, medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101557316A (en)*2009-05-142009-10-14阿里巴巴集团控股有限公司Method and system for updating statistical data
US20180096033A1 (en)*2016-10-042018-04-05International Business Machines CorporationQuery management in database management systems
CN107798036A (en)*2017-04-102018-03-13平安科技(深圳)有限公司A kind of method of counting and counter
CN108804237A (en)*2017-05-052018-11-13北京京东尚科信息技术有限公司Data real-time statistical method, device, storage medium and electronic equipment
CN110069547A (en)*2019-03-192019-07-30天津字节跳动科技有限公司Online database list data statistical method, device, medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
唐扬: "计数系统设计(一):面对海量数据的计数器要如何做", pages 1 - 11, Retrieved from the Internet <URL:https://freegeektime.com/100035801/179373/>*

Similar Documents

PublicationPublication DateTitle
CN110008045B (en)Method, device and equipment for aggregating microservices and storage medium
CN109471851B (en)Data processing method, device, server and storage medium
CN113220710B (en) Data query method, device, electronic device and storage medium
CN112835980B (en) Index reconstruction method, device, equipment, computer-readable storage medium and product
US20170083617A1 (en)Posterior probabilistic model for bucketing records
CN114265966A (en) A data processing method, device, electronic device and storage medium
WO2024041022A1 (en)Database table alteration method and apparatus, device and storage medium
US20210365406A1 (en)Method and apparatus for processing snapshot, device, medium and product
CN114090124A (en) Data processing method, apparatus, computer equipment and storage medium
CN114356962A (en)Data query method and device, electronic equipment and storage medium
CN113760905A (en)Database index processing method and device, electronic equipment and computer readable medium
CN109542912B (en) Interval data storage method, device, server and storage medium
CN111782614A (en) Data access method, device, device and storage medium
CN108182241B (en)Data interaction optimization method and device, server and storage medium
CN111858587A (en) A method, device, equipment and storage medium for counting database data
CN113220237B (en)Distributed storage method, device, equipment and storage medium
CN115587090A (en)Data storage method, device, equipment and medium based on Doris
CN113326268B (en)Data writing and reading method and device
CN114443484A (en)Program testing method, device, equipment and storage medium
CN115391605A (en) Data query method, device, device, computer readable medium and program product
CN111159218B (en)Data processing method, device and readable storage medium
CN115292313A (en)Pseudo-column implementation method and device, electronic equipment and storage medium
CN117971827B (en)Data table association method, device, electronic equipment and computer readable medium
CN112115154A (en)Data processing and data query method, device, equipment and computer readable medium
CN115994151B (en)Data request changing method, device, electronic equipment and computer readable medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
CB02Change of applicant information

Address after:100000 Unit 501A, Floor 5, 101, Building 1, Yard 5, Laiguangying West Road, Chaoyang District, Beijing

Applicant after:Beijing Qingyun Science and Technology Co.,Ltd.

Address before:100020 601, 6 floor, 16 building, No. 36 Chuang Yuan Road, Chaoyang District, Beijing.

Applicant before:Beijing Qingyun Science and Technology Co.,Ltd.

CB02Change of applicant information
RJ01Rejection of invention patent application after publication

Application publication date:20201030

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp