Retention index calculation method and device, storage medium and electronic equipment
By analyzing user query instructions and converting data into efficient compressed bitmap format, the retention calculation function in bitmap data is solved, and the traditional method has poor calculation performance under large data volumes is achieved, and efficient retention indicator calculation is achieved.
Patent Information
- Application Number
- CN202411517574.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-07
AI Technical Summary
When facing large data volumes, the traditional method of calculating retention indicators has complex calculation logic and low performance, resulting in serious decline in query performance.
By obtaining the query instructions input by the user, parsing and generating execution code, identifying the retention calculation function containing the retention calculation function, converting the target data into an efficient compressed bitmap format, and executing the retention calculation function in the bitmap data to calculate the retention indicator.
It improves the efficiency of retention indicator calculation, reduces the amount of data processed, reduces the system load, and significantly improves the overall performance of the database system.
Smart Images

Figure CN119396917A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a retention index calculation method, device, storage medium and electronic device. Background Art
[0002] Today, in big data analysis systems, the calculation of retention metrics is crucial to understanding user behavior and product health. Retention metrics are important indicators for measuring product user stickiness. They reflect how many users of a product actually stay, and are one of the most core indicators of product value.
[0003] Currently, the traditional way to calculate retention indicators is to connect the daily active user table to itself through self-join to calculate the retention rate. However, with the surge in data volume, this method not only has complex calculation logic, but also has low performance, especially when performing a large number of self-join operations, it consumes a lot of memory and computing resources, resulting in a serious decline in query performance.
[0004] Therefore, how to quickly and efficiently calculate the retention indicators of products is an urgent problem to be solved. Summary of the invention
[0005] The present specification provides a retention index calculation method, device, storage medium and electronic device to at least partially solve the above-mentioned problems existing in the prior art.
[0006] This manual adopts the following technical solutions:
[0007] This specification provides a method for calculating retention indicators, including:
[0008] Get the query command entered by the user;
[0009] Parsing the query instruction to obtain an execution code corresponding to the query instruction;
[0010] In response to the execution code including a retention calculation function, determining target data required for calculating a retention index according to the retention calculation function;
[0011] Converting the target data into a highly efficient compressed bitmap format to obtain bitmap data;
[0012] The retention calculation function is executed according to the bitmap data to obtain a retention index.
[0013] Optionally, before obtaining the query instruction input by the user, the method further includes:
[0014] A retention calculation function is registered in the database, where the retention calculation function is used to calculate the retention index.
[0015] Optionally, the retention calculation function includes a benchmark condition and an observation condition, wherein the benchmark condition is used to characterize the initial state of the user group, and the observation condition is used to characterize the subsequent state of the user group;
[0016] Determining the target data required for calculating the retention index according to the retention calculation function specifically includes:
[0017] According to the reference condition and the observation condition, data related to the reference condition and the observation condition are determined in a user activity data table as target data.
[0018] Optionally, executing the retention calculation function according to the bitmap data to obtain a retention index specifically includes:
[0019] Determining, according to the bitmap data, a value of the reference condition and a value of the observation condition included in the retention calculation function;
[0020] A retention index is determined based on the value of the baseline condition and the value of the observation condition.
[0021] Optionally, executing the retention calculation function according to the bitmap data to obtain a retention index specifically includes:
[0022] The bitmap data is processed using a set operation to obtain a retention index.
[0023] Optionally, the set operation includes at least an intersection operation, a union operation, and a difference operation.
[0024] Optionally, the bitmap data is processed by a set operation to obtain a retention index, specifically including:
[0025] Using the difference operation to filter the bitmap data;
[0026] Determining the value of the reference condition and the value of the observation condition based on the filtered bitmap data using the union operation;
[0027] The intersection operation is used to determine a retention indicator based on the value of the baseline condition and the value of the observation condition.
[0028] This specification provides a retention index calculation device, the device comprising:
[0029] An acquisition module is used to acquire the query instruction input by the user;
[0030] A parsing module, used to parse the query instruction to obtain an execution code corresponding to the query instruction;
[0031] a determination module, configured to determine target data required for calculating a retention index according to the retention calculation function in response to the execution code including the retention calculation function;
[0032] A conversion module, used for converting the target data into a highly efficient compressed bitmap format to obtain bitmap data;
[0033] A calculation module is used to execute the retention calculation function according to the bitmap data to obtain a retention index.
[0034] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned retention index calculation method is implemented.
[0035] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned retention index calculation method when executing the program.
[0036] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0037] In the retention index calculation method provided in the present specification, a query instruction input by a user is obtained; the query instruction is parsed to obtain an execution code corresponding to the query instruction; in response to the retention calculation function included in the execution code, the target data required for calculating the retention index is determined according to the retention calculation function; the target data is converted into an efficient compressed bitmap format to obtain bitmap data; the retention calculation function is executed according to the bitmap data to obtain the retention index.
[0038] When the retention index calculation method provided in this specification is used to calculate the retention index in the database, the data required for calculating the retention index can be converted into data in an efficient compressed bitmap format when parsing the retention calculation function, and the retention calculation function is subsequently executed by a more efficient bit calculation method to finally complete the calculation of the retention index. Compared with the traditional method, the calculation method used in this method to calculate the retention index is more efficient and requires less data to be processed. While being able to calculate the retention index more simply and efficiently, it greatly reduces the system load and effectively improves the overall efficiency of the database system. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0040] Figure 1A flowchart of a retention index calculation method in this specification;
[0041] Figure 2 A schematic diagram of a retention index calculation device provided in this specification;
[0042] Figure 3 The corresponding Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0044] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0045] Figure 1 The following is a flow chart of a retention index calculation method in this specification, which specifically includes the following steps:
[0046] S100: Obtaining a query instruction input by a user.
[0047] All steps in the retention index calculation method provided in this specification can be implemented by any electronic device with computing functions, such as terminals, servers and other devices.
[0048] This method is mainly used when a user queries a retention index in a database, and can respond quickly and efficiently calculate the retention index of a product. Based on this, when executing this method, the query instruction input by the user can be first obtained in this step. Among them, the query instruction input by the user can be any query instruction, and this specification does not make specific restrictions on this.
[0049] S102: Parse the query instruction to obtain an execution code corresponding to the query instruction.
[0050] After the query instruction input by the user is obtained in step S100, the query instruction may be parsed in this step to obtain the execution code converted from the query instruction.
[0051] At present, when users search in a database, the query instructions they input are not code instructions that can be directly processed by computers, but are more like natural language query statements. Computers usually cannot directly execute the query instructions input by users, but need to parse the query instructions first to obtain execution codes that can be processed by computers.
[0052] Generally, in a database, query instructions input by a user can be parsed and optimized through parsing and query optimization components such as Parser and Optimizer.
[0053] Among them, Parser is a parsing component, whose function is to convert the Structured Query Language (SQL) query statement input by the user from a string form into a structured form that can be understood and processed by the database system. Generally, the parsing component can convert the query instruction into a structured statement that can be understood by the computer according to the grammatical rules of the SQL language through word segmentation and syntax analysis operations.
[0054] Optimizer is a query optimization component. Its function is to generate one or more possible execution plans based on the structured statements obtained by parsing query instructions and statistical information in the database, evaluate the costs of these execution plans, and finally determine the optimal plan and pass it to the execution engine for actual data retrieval and processing.
[0055] Corresponding to this method, the parsing and optimization component will convert the obtained query instructions into corresponding execution codes for application in subsequent steps.
[0056] S104: In response to the execution code including a retention calculation function, determining target data required for calculating a retention index according to the retention calculation function.
[0057] The method focuses on the calculation of the retention index. Based on this, after obtaining the execution code that can be processed by the database system in step S102, the content that needs to be paid attention to is the retention index calculation part in the execution code. In this method, the database uses the retention calculation function to realize the calculation of the retention index.
[0058] The retention index function may be pre-registered in the database system. Specifically, the retention calculation function may be registered in the database before executing step S100, that is, before obtaining the query instruction input by the user. In this method, the retention calculation function calculates the retention index of the product according to the conditions specified by the user.
[0059] Furthermore, in order to ensure the efficiency and accuracy of calculating the retention index, the design of the retention calculation function is also a crucial link. This method provides a specific embodiment of designing the retention calculation function for reference. Specifically, the retention calculation function includes a baseline condition and an observation condition, wherein the baseline condition is used to characterize the initial state of the user group, and the observation condition is used to characterize the subsequent state of the user group.
[0060] When registering, the retention calculation function can be registered as:
[0061] retention_cardinality(Cohort_condition, Observation_condition).
[0062] Among them, Cohort_condition represents the baseline condition, which is used to define the initial state of the user group; Observation_condition represents the observation condition, which is used to define the state of the user group at subsequent time points. retention_cardinality is the retention calculation function for calculating the retention index, which determines the number of retained users through the baseline condition and the observation condition. By encapsulating the complex retention calculation logic into a simple function interface, users only need to call the relevant function to complete the calculation of the retention index, which greatly reduces the difficulty of use.
[0063] At the same time, the data required for calculating the retention index this time can also be obtained according to the retention calculation function. Specifically, according to the benchmark condition and the observation condition, data related to the benchmark condition and the observation condition can be determined in the user activity data table as target data. Among them, the user activity data table is a data table that records the identity and number of daily active users.
[0064] When using the retention function, users need to provide benchmark conditions and observation conditions based on the query requirements of the retention indicator. Based on the benchmark conditions and observation conditions provided by the user, it is possible to determine which data is needed for this calculation, and then obtain the target data. For example, suppose a platform holds an event, and now wants to know the retention of users who participated in the event on the first day in the subsequent days of the event. At this time, when entering the query command, the user can enter the following query command based on the SQL language:
[0065] SELECT retention_cardinality(
[0066] cohort_condition=>'day=1',
[0067] observation_condition=>'day IN(2,3)'
[0068] )AS retention_count;
[0069] Among them, SELECT retention_cardinality indicates calling the retention calculation function; cohort_condition=>'day=1' indicates that in this call, the benchmark condition is users who participated in the activity on the first day; observation_condition=>'day IN(2,3)' indicates that in this call, the observation condition is users who participated in the activity on the second and third days; retention_count indicates the result obtained after calculation, that is, the retention indicator.
[0070] In this embodiment, the benchmark condition provided by the user is "day=1", and the observation condition is "day IN(2,3)", that is, in the calculation of this retention index, the data of the 1st day, the 2nd day and the 3rd day in the user activity data table need to be used.
[0071] S106: Convert the target data into a highly efficient compressed bitmap format to obtain bitmap data.
[0072] After obtaining the target data required for calculating the retention index in step S104, the target data may be converted into a format in this step, and the target data may be converted into data in an efficient compressed bitmap format to obtain bitmap data. There are many types of data in an efficient compressed bitmap format that can be applied, including but not limited to RoaringBitmap, Word AlignedHybrid, Enhanced Word Aligned Hybrid, Concise Bitmap, etc. In this specification, RoaringBitmap is used as an example to illustrate this method.
[0073] RoaringBitmap is mainly used to process large amounts of Boolean data. It can significantly save memory and computing resources, and optimize storage space and computing performance through intelligent container selection and compression algorithms. RoaringBitmap splits 32-bit unsigned integers into high 16 bits and low 16 bits. The high 16 bits are used as indexes to quickly locate a specific container; the low 16 bits store the specific data in the container. This segmentation method enables RoaringBitmap to efficiently process large amounts of integer data.
[0074] Generally speaking, among all forms of operations performed by computers, bit operations have the highest computational efficiency. Therefore, converting the target data into bitmap data in an efficient compressed bitmap format in this step can greatly improve the efficiency of subsequent calculations of retention indicators.
[0075] S108: Execute the retention calculation function according to the bitmap data to obtain a retention index.
[0076] After obtaining the bitmap data converted from the target data in step S106, the bitmap data may be used to execute a retention calculation function in this step to finally obtain the required retention index.
[0077] For different forms of retention calculation functions, the way of calculating the retention index will also be different. In the embodiment of the retention calculation function introduced in step S104 of the present method, when calculating the retention index, specifically, according to the bitmap data, the value of the reference condition and the value of the observation condition included in the retention calculation function are determined; and the retention index is determined according to the value of the reference condition and the value of the observation condition.
[0078] As described in step S104, based on the baseline conditions and observation conditions in the retention function input by the user, it is possible to determine which days of data in the user active data table are needed when calculating the retention index, i.e., the target data. Based on this, in the calculation process of this step, the specific values of each data in the bitmap data converted from the target data can be further obtained for the calculation of the retention index.
[0079] Furthermore, when the retention index is calculated using bitmap data in an efficient compressed bitmap format such as RoaringBitmap, the bitmap data may be processed using a set operation to obtain the retention index, wherein the set operation may include at least an intersection operation, a union operation, and a difference operation.
[0080] RoaringBitmap uses different types of containers to store data, mainly including ArrayContainer, BitmapContainer and RunContainer. Among them, ArrayContainer is used to store sparse data, that is, when the amount of data is small but the range of values is large. It uses an ordered and non-repeating short array to store data. When the amount of data exceeds a certain threshold, it will be converted to BitmapContainer; BitmapContainer is used to store dense data, that is, when the amount of data is large and the range of values is relatively concentrated. It uses a long array to store bitmap data. Each long can represent 64 bits, so a large amount of data can be stored efficiently. When BitmapContainer is constructed, it will initialize a long array with a length of 1024. No matter how much data is stored, it occupies a fixed 8KB space; RunContainer uses run-length encoding (Run-Length Encoding, RLE) to compress continuous data. It is suitable for storing a large number of consecutive integers. It can greatly reduce storage space, but its usage scenarios are relatively few.
[0081] Based on the characteristic that RoaringBitmap stores data through containers, containers storing different data can be regarded as sets containing different data, and efficient operations can be achieved between containers through set operations. Corresponding to this method, specifically, the difference operation can be used to filter the bitmap data; the union operation can be used to determine the value of the reference condition and the value of the observation condition based on the filtered bitmap data; and the intersection operation can be used to determine the retention index based on the value of the reference condition and the value of the observation condition.
[0082] Taking the specific embodiment mentioned in step S104 as an example, the bitmap data may be filtered by a difference operation. In this embodiment, the required data is the data of the first day, the second day, and the third day. Assume that the filtered data is as follows:
[0083] Day1: [User A,User B,User C,User D];
[0084] Day2:[User B,User C,User E];
[0085] Day3: [User A, User C, User D, User F].
[0086] It is known that the data required for the benchmark condition is Day 1 data. At this time, according to the data of the second and third days required in the observation condition, the data of Day 2 and Day 3 can be merged through the union operation in the set, that is:
[0087] Day2∪Day3=[User B,User C,User E,User A,User D,User F].
[0088] At this time, through the intersection operation, we can find the intersection between Day1 and Day2∪Day3, that is:
[0089] Day1∩(Day2∪Day3)=[User B, User C, User A, User D].
[0090] Of course, the above embodiment is only one of the feasible calculation methods. In practical applications, the final retention index can also be obtained by using intersection, union, and difference calculations in other orders. For example, in the above embodiment, the intersection operation is first used to obtain Day 1∩Day 2 and Day 1∩Day 3, and then the union operation is used to obtain the combination of the two. In the end, the result of Day1∩(Day2∪Day3) can still be obtained, which is the required retention index.
[0091] Additionally, in this method, in addition to using data in efficient compressed bitmap formats such as RoaringBitmap, other data structures that can support set operations can also be used, such as HyperLogLog, Bloom Filter and other data structures. The difference is that RoaringBitmap is more efficient when processing set operations on large-scale data; HyperLogLog has a smaller memory footprint and is suitable for approximate counting; Bloom Filter also has a smaller memory footprint and is more suitable for fast set member detection. In general, in scenarios with different requirements, this method can use data in different formats to realize the calculation of retention indicators to ensure high computational efficiency in various situations.
[0092] As mentioned in the background technology, the traditional retention index calculation method calculates the retention index by self-joining. The self-join operation requires multiple scans and matching of data, and the logic is complex and difficult to maintain. When the amount of data is very large, the JOIN operation will become very slow, seriously affecting the query performance. At the same time, a large number of JOIN operations will consume a lot of memory and computing resources, resulting in an increase in system load.
[0093] When the retention index calculation method provided in this specification is used to calculate the retention index in the database, the data required for calculating the retention index can be converted into data in an efficient compressed bitmap format when parsing the retention calculation function, and the retention calculation function is subsequently executed by a more efficient bit calculation method to finally complete the calculation of the retention index. Compared with the traditional method, the calculation method used in this method to calculate the retention index is more efficient and requires less data to be processed. While being able to calculate the retention index more simply and efficiently, it greatly reduces the system load and effectively improves the overall efficiency of the database system.
[0094] The above is the retention index calculation method provided in this specification. Based on the same idea, this specification also provides a corresponding retention index calculation device, such as Figure 2 shown.
[0095] Figure 2 A schematic diagram of a retention index calculation device provided in this specification specifically includes:
[0096] The acquisition module 200 is used to acquire the query instruction input by the user;
[0097] The parsing module 202 is used to parse the query instruction to obtain the execution code corresponding to the query instruction;
[0098] A determination module 204, configured to determine target data required for calculating a retention index according to a retention calculation function included in the execution code;
[0099] A conversion module 206, configured to convert the target data into an efficient compressed bitmap format to obtain bitmap data;
[0100] The calculation module 208 is used to execute the retention calculation function according to the bitmap data to obtain a retention index.
[0101] Optionally, the device further includes a registration module 210, which is specifically used to register a retention calculation function in a database, where the retention calculation function is used to calculate the retention index.
[0102] Optionally, the retention calculation function includes a benchmark condition and an observation condition, wherein the benchmark condition is used to characterize the initial state of the user group, and the observation condition is used to characterize the subsequent state of the user group;
[0103] The determination module 204 is specifically configured to determine, according to the benchmark condition and the observation condition, data related to the benchmark condition and the observation condition in the user activity data table as target data.
[0104] Optionally, the calculation module 208 is specifically used to determine the value of the baseline condition and the value of the observation condition included in the retention calculation function according to the bitmap data; and determine the retention index according to the value of the baseline condition and the value of the observation condition.
[0105] Optionally, the calculation module 208 is specifically configured to process the bitmap data using a set operation to obtain a retention index.
[0106] Optionally, the set operation includes at least an intersection operation, a union operation, and a difference operation.
[0107] Optionally, the calculation module 208 is specifically used to filter the bitmap data using the difference operation; determine the value of the baseline condition and the value of the observation condition based on the filtered bitmap data using the union operation; and determine the retention index based on the value of the baseline condition and the value of the observation condition using the intersection operation.
[0108] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 The retention metric calculation method provided.
[0109] This manual also provides Figure 3 The schematic structure diagram of the electronic device shown in FIG. Figure 3 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 The retention index calculation method described above. Of course, in addition to the software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0110] For the improvement of a technology, it can be clearly distinguished whether it is a hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0111] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0112] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0113] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0114] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0115] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0116] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0117] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0118] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0119] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0120] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0121] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0122] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0123] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media including storage devices.
[0124] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0125] The above description is only an embodiment of this specification and is not intended to limit this specification. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this application.
Claims
1. A retention index calculation method, characterized in that: include: Get the query command entered by the user; Parsing the query instruction to obtain an execution code corresponding to the query instruction; In response to the execution code including a retention calculation function, determining target data required for calculating a retention index according to the retention calculation function; Converting the target data into a highly efficient compressed bitmap format to obtain bitmap data; The retention calculation function is executed according to the bitmap data to obtain a retention index.
2. The method according to claim 1, characterized in that Before obtaining the query instruction input by the user, the method further includes: A retention calculation function is registered in the database, where the retention calculation function is used to calculate the retention index.
3. The method according to claim 1, characterized in that The retention calculation function includes a benchmark condition and an observation condition, wherein the benchmark condition is used to characterize the initial state of the user group, and the observation condition is used to characterize the subsequent state of the user group; Determining the target data required for calculating the retention index according to the retention calculation function specifically includes: According to the reference condition and the observation condition, data related to the reference condition and the observation condition are determined in a user activity data table as target data.
4. The method according to claim 3, characterized in that Executing the retention calculation function according to the bitmap data to obtain a retention index specifically includes: Determining, according to the bitmap data, a value of the reference condition and a value of the observation condition included in the retention calculation function; A retention index is determined based on the value of the baseline condition and the value of the observation condition.
5. The method according to claim 1, characterized in that Executing the retention calculation function according to the bitmap data to obtain a retention index specifically includes: The bitmap data is processed using a set operation to obtain a retention index.
6. The method according to claim 5, characterized in that The set operations include at least an intersection operation, a union operation, and a difference operation.
7. The method according to claim 6, characterized in that The bitmap data is processed by using a set operation to obtain a retention index, which specifically includes: Using the difference operation to filter the bitmap data; Determining the value of the reference condition and the value of the observation condition based on the filtered bitmap data using the union operation; The intersection operation is used to determine a retention indicator based on the value of the baseline condition and the value of the observation condition.
8. A retention index calculation device, characterized in that: include: An acquisition module is used to acquire the query instruction input by the user; A parsing module, used to parse the query instruction to obtain an execution code corresponding to the query instruction; a determination module, configured to determine target data required for calculating a retention index according to the retention calculation function in response to the execution code including the retention calculation function; A conversion module, used for converting the target data into a highly efficient compressed bitmap format to obtain bitmap data; A calculation module is used to execute the retention calculation function according to the bitmap data to obtain a retention index.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.