User behavior statistical data extreme value query method and device, equipment and medium

The user behavior statistics data are divided into blocks through the divide-and-conquer method and prefix sum idea to generate the maximum value array, which solves the problem of low efficiency in querying user behavior statistics data and realizes more efficient maximum value query.

CN120670478APending Publication Date: 2025-09-19CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510708152.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

In the prior art, the query efficiency of the maximum value of user behavior statistical data is low, especially when querying over a long time interval, the complexity is high, resulting in low query efficiency.

Method used

The statistical data is divided into blocks using the divide-and-conquer method, and combined with the prefix sum idea, the maximum value arrays of multiple data blocks are generated, and the maximum value query is performed through index information.

Benefits of technology

It effectively reduces the time complexity of statistical data and improves the efficiency of maximum value query.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670478A_ABST
    Figure CN120670478A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a user behavior statistical data extreme value query method and device, equipment and a medium, belongs to the technical field of data statistics and analysis processing, can be applied to the financial field for carrying out risk identification on user transaction behaviors, and can also be applied to the medical health field for assisting medical resource allocation. The method comprises the following steps: acquiring user behavior data reported by a service recommendation platform, and summing the user behavior data according to a preset time unit to obtain statistical data; performing square root segmentation processing on the statistical data in the preset time interval to obtain a plurality of data blocks of the statistical data; recording index information of each statistical time in the plurality of data blocks in a preset time interval; and generating extreme value arrays of the plurality of data blocks based on the index information, and performing extreme value query on the statistical data based on the plurality of extreme value arrays. According to the embodiment of the invention, the time complexity of the statistical data can be reduced, so that the efficiency of querying the extreme value in the statistical data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data statistics and analysis processing, and can be applied to the financial field as well as the medical and health field. In particular, it relates to a method and apparatus, equipment and medium for querying the maximum value of user behavior statistical data. Background Art

[0002] User peak value queries are widely used across various industries and technologies to mine extreme data features, identify abnormal behavior patterns, optimize resource allocation, and assist in decision-making. For example, in the insurance industry, to better provide personalized recommendations, many insurance service providers typically count user impressions and clicks on recommended services, then analyze user interests by looking for the peak values ​​in these statistics.

[0003] However, in related technologies, user behavior statistics are typically stored as dates plus the number of user behaviors across different platforms each day. To find the maximum value for a specific time interval, one must traverse the array of dates and times corresponding to that time interval. In this case, the more maximum values ​​a query has and the longer the time interval, the greater the complexity of the overall query, resulting in inefficient maximum value queries.

[0004] Therefore, how to improve the efficiency of querying the maximum value in statistical data has become a technical problem that needs to be solved urgently in this field. Summary of the Invention

[0005] The main purpose of the embodiments of the present application is to propose a method and apparatus, device and medium for querying the maximum value of user behavior statistical data, aiming to reduce the time complexity of statistical data and thus improve the efficiency of performing maximum value queries on statistical data.

[0006] To achieve the above objectives, a first aspect of an embodiment of the present application proposes a method for querying the maximum value of user behavior statistics data, the method comprising:

[0007] Obtaining user behavior data reported by the business recommendation platform, and summing the user behavior data according to a preset time unit to obtain statistical data of the user behavior data;

[0008] Performing square root division processing on the statistical data within a preset time interval to obtain multiple data blocks of the statistical data;

[0009] Recording index information of each statistical time in the preset time interval in the multiple data blocks; each statistical time is the same size as the preset time unit;

[0010] A maximum value array of the plurality of data blocks is generated based on the index information, and a maximum value query is performed on the statistical data based on the maximum value array of the plurality of data blocks.

[0011] In some embodiments, generating a maximum value array of the plurality of data blocks based on the index information includes:

[0012] Obtaining a first maximum value of each statistical data item in a first data block up to a first index information, and obtaining a left maximum value array of the first data block; the left maximum value data includes a plurality of first maximum values, the first data block is any data block among the plurality of data blocks, and the first index information is left boundary index information of index information in the first data block;

[0013] Obtain the second maximum value of each statistical data in the first data block to the second index information, and obtain the right maximum value array of the first data block; the right maximum value data includes multiple second maximum values, and the second index information is the right boundary index information of the index information in the first data block.

[0014] The performing a maximum value query on the statistical data based on the maximum value arrays of the multiple data blocks includes:

[0015] A maximum value query is performed on the statistical data based on the left maximum value array and the right maximum value array of the multiple data blocks.

[0016] In some embodiments, performing a maximum value query on the statistical data based on the left maximum value array and the right maximum value array of the plurality of data blocks includes:

[0017] When the statistical data of the time interval to be queried are all contained in the only second data block among the multiple data blocks, traversing the statistical data in the second data block to query and obtain the maximum value data in the statistical data of the time interval to be queried;

[0018] When the statistical data of the time interval to be queried is contained in at least two third data blocks among the multiple data blocks, the target index information of the left boundary statistical time and the right boundary statistical time of the time interval to be queried in the third data blocks are obtained, and the left maximum value array and the right maximum value array of the third data block are queried based on the target index information to obtain the maximum value data in the statistical data of the time interval to be queried.

[0019] In some embodiments, the statistical data of the left boundary statistical time is contained in a header data block in the third data block, and the statistical data of the right boundary statistical time is contained in a tail data block in the third data block; the target index information includes: index information of the left boundary statistical time in the header data block, and index information of the right boundary statistical time in the tail data block;

[0020] The querying of the left maximum value array and the right maximum value array of the third data block based on the target index information to obtain the maximum value data in the statistical data of the time interval to be queried includes:

[0021] Based on the index information of the left boundary statistical time in the header data block, query a plurality of second maximum values ​​in the right maximum value array of the header data block to obtain right maximum value data;

[0022] Based on the index information of the right boundary statistical time in the tail data block, query multiple first maximum values ​​in the left maximum value array of the tail data block to obtain left maximum value data;

[0023] The maximum value data among the right maximum value data and the left maximum value data is used as the maximum value data in the statistical data of the time interval to be queried.

[0024] In some embodiments, recording index information of each statistical time in the preset time interval in the plurality of data blocks includes:

[0025] Recording index information of each statistical time in the preset time interval in the multiple data blocks through a hash table;

[0026] Wherein, in the case of storing the statistical data through a hash table, the subscript of the array of each statistical data in the hash table is the index information of each statistical time.

[0027] In some embodiments, the method further comprises:

[0028] Obtaining the statistical data to be updated for any target statistical time in the preset time interval;

[0029] Determining a fourth data block among the multiple data blocks based on index information of the target statistical time in the multiple data blocks; the fourth data block contains statistical data of the target statistical time;

[0030] The fourth data block is updated based on the statistical data to be updated.

[0031] In some embodiments, updating the fourth data block based on the to-be-updated statistical data includes:

[0032] Performing numerical updates on the statistical data of the target statistical time in the fourth data block based on the statistical data to be updated;

[0033] Based on the statistical data after the target statistical time is updated in the fourth data block, the left maximum value array and the right maximum value array of the fourth data block are updated.

[0034] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a device for querying the maximum value of user behavior statistics data, the device comprising:

[0035] A data acquisition module is used to acquire user behavior data reported by the business recommendation platform and sum the user behavior data according to a preset time unit to obtain statistical data of the user behavior data;

[0036] a data block module, configured to perform square root division processing on the statistical data within a preset time interval to obtain a plurality of data blocks of the statistical data;

[0037] a discretization module, configured to record index information of each statistical time in the preset time interval in the plurality of data blocks; each statistical time having the same size as the preset time unit;

[0038] A maximum value query module is configured to generate a maximum value array of the plurality of data blocks based on the index information, and perform a maximum value query on the statistical data based on the maximum value array of the plurality of data blocks.

[0039] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes a computer device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the maximum value query method of user behavior statistical data described in the first aspect when executing the computer program.

[0040] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the maximum value query method of user behavior statistical data described in the first aspect above.

[0041] To achieve the above-mentioned purpose, the fifth aspect of the embodiment of the present application proposes a computer program product, which stores a computer program, and when the computer program is executed by a processor, it implements the maximum value query method of user behavior statistical data described in the first aspect above.

[0042] The embodiments of the present application propose a maximum value query method for user behavior statistical data, a maximum value query device for user behavior statistical data, a computer device, and a computer-readable storage medium. The method obtains user behavior data reported by a business recommendation platform and sums the user behavior data according to preset time units to obtain statistical data of the user behavior data; then, square root division processing is performed on the statistical data within the preset time interval to obtain multiple data blocks of the statistical data, and index information of each statistical time in the preset time interval in the multiple data blocks is recorded; wherein each statistical time is the same size as the preset time unit; finally, a maximum value array of the multiple data blocks is generated based on the index information, so that the statistical data can be queried for a maximum value based on the maximum value array.

[0043] In this way, the embodiment of the present application uses the divide-and-conquer method to divide the statistical data into blocks, and combines the prefix sum idea to optimize the query problem after the data is modified, that is: based on the index information of the statistical time in multiple data blocks, a maximum value array of multiple data blocks is generated, so that the statistical data can be queried for the maximum value based on the maximum value array. In this way, the time complexity of modifying the statistical data and the maximum value query can be effectively reduced, thereby improving the efficiency of querying the maximum value in the statistical data. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic flow chart of the steps of the maximum value query method for user behavior statistics provided in some embodiments of the present application;

[0045] Figure 2 A schematic flow chart of steps in other embodiments of the method for querying the maximum value of user behavior statistics data provided in an embodiment of the present application;

[0046] Figure 3 for Figure 2 Schematic diagram of the detailed steps of step S203;

[0047] Figure 4 for Figure 1 A schematic diagram of a detailed step flow of step S104;

[0048] Figure 5 A flowchart illustrating the steps of querying the maximum value based on the maximum value array involved in some embodiments of the maximum value query method for user behavior statistics provided in the embodiments of the present application;

[0049] Figure 6 for Figure 5 Schematic diagram of the detailed steps of step S502;

[0050] Figure 7 This is a schematic diagram of the structure of a maximum value query device for user behavior statistical data provided by an embodiment of the present application;

[0051] Figure 8 This is a schematic diagram of the hardware structure of the computer device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0053] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0055] First, several nouns involved in the embodiments of this application are analyzed:

[0056] Artificial intelligence (AI) is a new technical discipline that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. A branch of computer science, AI seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thinking. It also encompasses the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.

[0057] Natural language processing (NLP): NLP uses computers to process, understand, and apply human languages ​​(such as Chinese and English). A branch of artificial intelligence, NLP is an interdisciplinary field between computer science and linguistics, often referred to as computational linguistics. Natural language processing encompasses grammatical analysis, semantic analysis, and discourse comprehension. Natural language processing is commonly used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis, and opinion mining. It encompasses data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research related to language processing, and linguistics research related to language computing.

[0058] Information Extraction: A text processing technology that extracts specified types of entity, relationship, event, and other factual information from natural language text and forms structured data output. Information extraction is a technology that extracts specific information from text data. Text data is composed of some specific units, such as sentences, paragraphs, and chapters. Text information is composed of some small specific units, such as characters, words, phrases, sentences, paragraphs, or a combination of these specific units. Extracting noun phrases, names, place names, etc. from text data is all text information extraction. Of course, the information extracted by text information extraction technology can be of various types.

[0059] Next, the overall concept of the embodiment of the present application is briefly described.

[0060] User peak value queries are widely used across various industries and technologies to mine extreme data features, identify abnormal behavior patterns, optimize resource allocation, and assist in decision-making. For example, in the insurance industry, to better provide personalized recommendations, many insurance service providers typically count user impressions and clicks on recommended services, then analyze user interests by looking for the peak values ​​in these statistics.

[0061] In actual recommendation scenarios, the reading, exposure, clicks, and forwarding of recommended services (such as an article introducing insurance business) can occur on different platform products (service recommendation platforms). For example, a good article on the Ping An Financial Manager application (Application, APP) may be shared by agents simultaneously on WeChat Moments, Tencent QQ Space, etc. This means that the statistics of the number of times users read, expose, click, and forward an article are the sum of user behavior data from all platforms.

[0062] In related technologies, statistical data is typically stored as a date plus the number of times a piece of recommended content was viewed, clicked, and forwarded by users across different platforms each day. To find the peak value for a specific time interval, one must traverse the array of dates and times corresponding to that time interval. In this case, the more peak values ​​a query requires and the longer the time interval, the greater the overall query complexity, resulting in inefficient peak value searches.

[0063] For example, assume that the current statistical data is stored in the format of [date, number], that is, [(2023-10-0110), (2023-10-02, 20), (2023-10-03, 30), (2023-10-04, 25) ...]. If you need to count the maximum value from 2023-10-01 to 2023-10-04, you need to traverse the entire array from beginning to end. The time complexity at this time is O(N), that is, the query time interval size. When user behavior data collected by different products or platforms updates the total data for a certain day, you need to traverse the array again to calculate the new maximum value. At this time, the update time complexity is O(1), and the query time interval size is O(N). In this case, if there are m queries, the time complexity at this time is O(MN).

[0064] In order to facilitate the query of updated statistical data, we consider introducing the divide-and-conquer method and combining it with the prefix sum idea to optimize the data, so that the time complexity of modifying and querying statistical data can be reduced to at least Thus, the efficiency of maximum value query on statistical data can be improved by reducing the time complexity of statistical data.

[0065] Based on this, the embodiments of the present application provide a method and apparatus for querying the maximum value of user behavior statistical data, a computer device, and a storage medium, aiming to reduce the time complexity of statistical data and thus improve the efficiency of performing maximum value queries on statistical data.

[0066] To achieve this goal, the embodiments of the present application propose a maximum value query method for user behavior statistical data, a maximum value query device for user behavior statistical data, a computer device, and a computer-readable storage medium. The method obtains user behavior data reported by a business recommendation platform and sums the user behavior data according to preset time units to obtain statistical data of the user behavior data; then, square root division processing is performed on the statistical data within the preset time interval to obtain multiple data blocks of the statistical data, and the index information of each statistical time in the preset time interval in the multiple data blocks is recorded; wherein each statistical time is the same size as the preset time unit; finally, a maximum value array of multiple data blocks is generated based on the index information, so that the statistical data can be queried based on the maximum value array.

[0067] In this way, the embodiment of the present application uses the divide-and-conquer method to divide the statistical data into blocks, and combines the prefix sum idea to optimize the query problem after the data is modified, that is: based on the index information of the statistical time in multiple data blocks, a maximum value array of multiple data blocks is generated, so that the statistical data can be queried for the maximum value based on the maximum value array. In this way, the time complexity of modifying the statistical data and the maximum value query can be effectively reduced, thereby improving the efficiency of performing the maximum value query on the statistical data.

[0068] Next, the specific embodiments of the maximum value query method for user behavior statistical data, the maximum value query device for user behavior statistical data, the computer equipment and the computer storage medium provided in the embodiments of the present application are explained, and the maximum value query method for user behavior statistical data in the embodiments of the present application is first described.

[0069] It should be noted that embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.

[0070] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0071] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to the user's identity or characteristics, such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0072] The maximum value query method for user behavior statistical data provided in the embodiment of the present application relates to the field of data statistics and analysis and processing technology. The maximum value query method for user behavior statistical data provided in the embodiment of the present application can be applied in a terminal, can also be applied in a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a platform device, a smart phone, a tablet computer, a laptop computer, a desktop computer, etc. used by an insurance service agency to provide insurance business services; the server side can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the maximum value query method for user behavior statistical data, etc., but is not limited to the above forms.

[0073] Embodiments of the present application can also be used in numerous general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer computer devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can 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, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0074] For ease of understanding and explanation, the following text will use the terminal device's application of the maximum value query method for user behavior statistical data provided by the embodiment of the present application as an example for detailed description. The implementation of the maximum value query method for user behavior statistical data provided by the embodiment of the present application by any of the above-mentioned forms of subject can refer to the process of the terminal device applying the maximum value query method for user behavior statistical data described below.

[0075] Please refer to Figure 1 , Figure 1 This is a flowchart of the steps in some embodiments of the method for querying the maximum value of user behavior statistics provided in the embodiment of the present application. It should be understood that although Figure 1The execution order of some method steps is shown in the figure, but based on the different design requirements of actual applications, the maximum value query method for user behavior statistical data provided by the embodiment of the application can certainly adopt an execution order different from the method steps shown in the figure. That is, Figure 1 The order of the steps in the method shown does not constitute a limitation on the execution logic order of the method for querying the maximum value of user behavior statistics data provided in the embodiment of the present application. Figure 1 Reasonable changes in the order of the steps of the method shown should be included in the scope of protection of the maximum value query method for user behavior statistical data provided in the embodiments of the present application.

[0076] like Figure 1 As shown, in some embodiments, the maximum value query method for user behavior statistical data provided by the embodiments of the present application may include but is not limited to steps S101 to S104 as shown below.

[0077] Step S101: obtaining user behavior data reported by a business recommendation platform, and summing the user behavior data according to a preset time unit to obtain statistical data of the user behavior data.

[0078] In the process of collecting statistics on users' behavioral data such as reading, exposure, clicks and forwarding of recommended services, the terminal device first obtains the user behavior data reported by one or more service recommendation platforms (such as the above-mentioned APP, Moments and QQ Space, etc., which can also be called user terminal platforms), and then sums up all user behavior data of each unit according to preset time units such as "days, weeks, months or even years" to obtain statistical data of these user behavior data.

[0079] In some embodiments, when the terminal device counts the user behavior data reported by each user terminal platform based on "days", the user behavior data are summed up by "day" and stored in a data table, thereby obtaining statistical data of these user behavior data. For example: if the terminal device needs to count the user behavior data within 2025, the terminal device can create an array of size 365 (non-leap year), and the array subscript corresponds to the date (every day). In addition, the terminal device can store the array through a hash table. In this case, since the array nums subscript in the hash table starts from 0, the date 2025.1.1 corresponds to a nums subscript of 0, and the date 2023.12.31 corresponds to a nums subscript of 364.

[0080] Step S102: performing square root division processing on the statistical data within a preset time interval to obtain a plurality of data blocks of the statistical data.

[0081] It should be noted that the preset time interval is a period of time that the terminal device needs to count. For example, when the terminal device sums the user behavior data according to the preset time unit "day" to perform user behavior data statistics, the preset time interval can be the number of days n that the terminal device needs to count user behavior data.

[0082] After obtaining the statistical data of the user behavior data, the terminal device further uses the divide-and-conquer method to perform square root division processing on the statistical data of a preset time interval, thereby dividing the statistical data into multiple data blocks.

[0083] In some embodiments, when the preset time interval is the number of days n for the terminal device to collect user behavior data, the terminal device performs square root division processing on the statistical data obtained by collecting user behavior data, and the statistical data can be divided into data blocks, and the data size of each data block is

[0084] Step S103: Record index information of each statistical time in the preset time interval in the multiple data blocks; each statistical time has the same size as the preset time unit.

[0085] It should be noted that each statistical time in the preset time interval can be the aforementioned preset time unit. For example, when the terminal device sums the user behavior data according to the preset time unit "day" to obtain statistical data, each statistical time in the preset time interval is also "day".

[0086] After obtaining the multiple data blocks of statistical data, the terminal device further performs discretization processing on the multiple data blocks, and in this process records index information of each statistical time in the preset time interval in the multiple data blocks.

[0087] For example, assuming that among the multiple data blocks obtained by dividing the statistical data, one data block is the array arr = [2, 1, 4, 3, 5], and the array size is n = 5, then the terminal device can record each statistical time in the preset time interval [2025.1.1, 2025.1.5], and the index information in the data block is the array index [0, 1, 2, 3, 4].

[0088] In some embodiments, the above-mentioned step S103: recording the index information of each statistical time in the preset time interval in the multiple data blocks may include but is not limited to the following steps:

[0089] The index information of each statistical time in the preset time interval in the multiple data blocks is recorded through a hash table.

[0090] It should be noted that, in the case where the statistical data is stored in a hash table, the subscript of the array of each statistical data in the hash table is the index information of each statistical time.

[0091] When discretizing multiple data blocks, the terminal device can use a hash table to record the data block number corresponding to each statistical time (e.g., each day), as well as the index information of each data block for each statistical time. In this way, when the user behavior data of a certain statistical time in the statistical data needs to be updated later, the terminal device can find the data block corresponding to the statistical time and perform the data update operation with O(1) time complexity.

[0092] Step S104: Generate a maximum value array of the plurality of data blocks based on the index information, and perform a maximum value query on the statistical data based on the maximum value array of the plurality of data blocks.

[0093] After the terminal device further records the index information of each statistical time in the preset time interval in multiple data blocks, it combines the prefix and idea to generate the maximum value arrays of multiple data blocks based on the index information. In this way, when the terminal device needs to perform a maximum value query on a certain time interval in the preset time interval in the future, it can directly query the maximum value in the statistical data of the time interval based on the maximum value arrays of multiple data blocks.

[0094] In steps S101 to S104 shown in the embodiment of the present application, in the process of statistically analyzing the user's reading, exposure, click and forwarding behavior data on the recommended service through the terminal device, the user behavior data reported by the service recommendation platform is summed according to preset time units such as "days, weeks, months and even years" to obtain statistical data of these user behavior data, and then the divide-and-conquer method is used to perform square root division processing on the statistical data of a preset time interval to divide the statistical data into multiple data blocks, and the multiple data blocks are discretized to record the index information of each statistical time in the preset time interval in the multiple data blocks, and finally, the prefix sum idea is combined to generate the maximum value arrays of the multiple data blocks based on the index information, so that when it is necessary to perform a maximum value query on a time interval in the preset time interval later, the maximum value in the statistical data of the time interval can be directly queried based on the maximum value arrays of the multiple data blocks.

[0095] Thus, compared with the traditional method of traversing the entire array of statistical data to perform maximum value query, the embodiment of the present application uses the divide-and-conquer method to divide the statistical data into blocks, and combines the prefix sum idea to optimize the query problem after the data is modified, that is: based on the index information of the statistical time in multiple data blocks, the maximum value array of multiple data blocks is generated, so that the statistical data can be queried for the maximum value based on the maximum value array, so that the time complexity of the modification of the statistical data and the maximum value query can be effectively reduced, that is: in the embodiment of the present application, the terminal device adopts square root division when designing the algorithm. As the size of multiple data blocks after segmenting statistical data, the time complexity n of traditional traversal of the entire array for maximum value query can be reduced to This can effectively improve the efficiency of maximum value queries on statistical data.

[0096] Please refer to Figure 2 , Figure 2 A flowchart of the steps of the maximum value query method for user behavior statistics provided in the embodiment of the present application in other embodiments.

[0097] In some embodiments, as Figure 2 As shown, the maximum value query method of user behavior statistical data provided by the embodiment of the present application may also include but is not limited to steps S201 to S203 as shown below.

[0098] Step S201: Obtain the statistical data to be updated at any target statistical time in the preset time interval.

[0099] After receiving new user behavior data for a specific day, week, month, or year from one or more service recommendation platforms, the terminal device immediately updates the statistical data that has been divided into multiple data blocks. In this case, the terminal device first obtains new user behavior data for any target statistical time within a preset time interval reported by one or more service recommendation platforms, and then uses this new user behavior data as the statistical data to be updated for the target statistical time.

[0100] Step S202: determining a fourth data block among the multiple data blocks based on index information of the target statistical time in the multiple data blocks; the fourth data block contains statistical data of the target statistical time.

[0101] It should be noted that when a terminal device needs to update a statistical data in a database block, the entire database block also needs to be updated.

[0102] Based on this, after obtaining the updated statistical data of a target statistical time in the preset time interval, the terminal device further determines the fourth data block in the multiple data blocks that contains the statistical data of the target statistical time based on the index information of the target statistical time in multiple data blocks.

[0103] Step S203: updating the fourth data block based on the statistical data to be updated.

[0104] After determining the fourth data block, the terminal device further uses the to-be-updated statistical data of the target statistical time to update the statistical data of the target statistical time stored in the fourth data block, and updates the entire fourth data block.

[0105] Please refer to Figure 3 , Figure 3 for Figure 2 Schematic diagram of the detailed process flow of step S203.

[0106] In some embodiments, as Figure 3 As shown, the above step S203 may include the following steps S301 and S302.

[0107] Step S301: updating the statistical data of the target statistical time in the fourth data block based on the statistical data to be updated.

[0108] When the terminal device updates the statistical data in the fourth data block, it updates the statistical data of the target statistical time in the fourth data block based on the statistical data to be updated. For example, when the statistical data to be updated is the newly added user behavior data of the target statistical time reported by the business recommendation platform, the terminal device superimposes the statistical data to be updated on the statistical data of the target statistical time in the fourth data block. For another example, when the statistical data to be updated is the sum of the new user behavior data of the target statistical time obtained through a re-request reported by the business recommendation platform, the terminal device replaces the statistical data to be updated with the new statistical data of the target statistical time in the fourth data block.

[0109] Step S302: Based on the statistical data after the target statistical time in the fourth data block is updated, the left maximum value array and the right maximum value array of the fourth data block are updated.

[0110] It should be noted that the left and right maximum value arrays are the maximum value arrays of the data block generated based on the index information of the statistical time within the data block. Here, the left and right maximum value arrays of the fourth data block are both maximum value arrays of the fourth data block generated in advance based on the index information of the target statistical time within the fourth data block. The specific method of generating the maximum value array based on index information will be described in detail in subsequent embodiments.

[0111] When the terminal device updates the fourth data block as a whole, it recalculates the maximum value array of the fourth data block based on the index information of the target statistical time in the fourth data block and the updated statistical data of the target statistical time in the fourth data block, thereby updating the left maximum value array and the right maximum value array of the fourth data block.

[0112] In this embodiment, when updating or modifying statistical data, the terminal device first determines the data block where the statistical data of the target statistical time is located based on the index information of the target statistical time to be updated in multiple data blocks, and then updates the numerical value of the statistical data in the data block based on the statistical data to be updated, and simultaneously updates the left maximum value array and the right maximum value array corresponding to this data block, thereby facilitating subsequent maximum value queries based on the left maximum value array and the right maximum value array. Since the statistical data has been divided into multiple data blocks using the divide-and-conquer method in advance, the time complexity n of the statistical data of time units such as n days, weeks, months, or even years is reduced to Therefore, when updating or modifying the statistical data in the data block, the time complexity is reduced to This also improves the efficiency of updating or modifying statistical data.

[0113] Please refer to Figure 4 , Figure 4 for Figure 1 A schematic diagram of a detailed step flow of step S104.

[0114] In some embodiments, as Figure 4 As shown, the step of "generating the maximum value array of the multiple data blocks based on the index information" in the above step S104 may include but is not limited to the following steps S401 and S402.

[0115] Step S401: Obtain the first maximum value of each statistical data in the first data block to the first index information, and obtain the left maximum value array of the first data block; the left maximum value data includes multiple first maximum values, the first data block is any data block among the multiple data blocks, and the first index information is the left boundary index information of the index information in the first data block.

[0116] When the terminal device generates the maximum value arrays of multiple data blocks based on the index information of each statistical time in multiple data blocks in a preset time interval, it takes any one of the multiple data blocks as the first data block, and then determines the left boundary index information in the index information of the statistical time in the preset time interval in the first data block, and records the left boundary index information as the first index information, thereby obtaining the first maximum value of each statistical data in the first data block at the first index information in turn, and recording the obtained multiple first maximum values ​​as the left maximum value array of the first data block.

[0117] Exemplarily, assuming that the first data block is an array arr = [2, 1, 4, 3, 5], the array size is n = 5, and the index information of each statistical time (2025.1.1, 2025.1.2, 2025.1.3, 2025.1.4 and 2025.1.5) in the preset time interval [2025.1.1, 2025.1.5] in the first data block is the array index [0, 1, 2, 3, 4], then the terminal device can generate the left maximum value array left of the first data block by recording the maximum value from each point to the left boundary index information 0 (first index information), that is: let left[i] represent the maximum value to the left of index i (including i), then the left maximum value array left corresponding to the original array arr is left = [2, 2, 4, 4, 5].

[0118] Step S402: Obtain the second maximum value of each statistical data in the first data block to the second index information, and obtain the right maximum value array of the first data block; the right maximum value data includes multiple second maximum values, and the second index information is the right boundary index information of the index information in the first data block.

[0119] When a terminal device generates maximum value arrays for multiple data blocks based on the index information of each statistical time in the multiple data blocks during a preset time interval, in addition to generating a left maximum value array for the first data block, the terminal device also needs to generate a right maximum value array for the first data block. That is, the terminal device determines the right boundary index information in the index information of the statistical time in the preset time interval in the first data block, records the right boundary index information as the second index information, then sequentially obtains the second maximum value of each statistical data in the first data block up to the second index information, and records the obtained multiple second maximum values ​​as the right maximum value array of the first data block.

[0120] For example, it is still assumed that the first data block is an array arr = [2, 1, 4, 3, 5], the array size is n = 5, and the index information of each statistical time (2025.1.1, 2025.1.2, 2025.1.3, 2025.1.4 and 2025.1.5) in the preset time interval [2025.1.1, 2025.1.5] in the first data block is the array index [0, 1, 2, 3, 4]. Then, the terminal device can generate the right maximum value array right of the first data block by recording the maximum value from each point to the right boundary index information n-1 = 4 (second index information), that is: let right[i] represent the maximum value to the right of index i (including i), then the right maximum value array right corresponding to the original array arr is right = [5, 5, 5, 5, 5].

[0121] In some embodiments, the step of "performing a maximum value query on the statistical data based on the maximum value arrays of the multiple data blocks" in the above step S104 may include but is not limited to the following steps:

[0122] A maximum value query is performed on the statistical data based on the left maximum value array and the right maximum value array of the multiple data blocks.

[0123] After the terminal device generates the left maximum value array and the right maximum value array of multiple data blocks based on the index information, in the subsequent process of performing maximum value queries on statistical data, the terminal device can directly use the left maximum value array and the right maximum value array of a certain data block among the multiple data blocks to perform maximum value queries, or use the left maximum value array and the right maximum value array of each of several data blocks among the multiple data blocks to perform maximum value queries.

[0124] Please refer to Figure 5 , Figure 5 A flowchart of the steps involved in querying the maximum value based on the maximum value array in some embodiments of the maximum value query method for user behavior statistics provided in the embodiments of the present application.

[0125] In some embodiments, as Figure 5 As shown, the above-mentioned step of "performing a maximum value query on the statistical data based on the left maximum value array and the right maximum value array of the multiple data blocks" may include but is not limited to the following steps S501 and S502.

[0126] Step S501: When the statistical data of the time interval to be queried are all contained in the only second data block among the multiple data blocks, traverse the statistical data in the second data block to query and obtain the maximum value data in the statistical data of the time interval to be queried.

[0127] When a terminal device performs a maximum value query on statistical data that has been divided into multiple data blocks, if the statistical data of the time interval to be queried with the maximum value are all contained in a unique second data block among the multiple data blocks, then the terminal device only needs to traverse the statistical data in the second data block once to query and obtain the maximum value data in the statistical data of the time interval to be queried.

[0128] Exemplarily, when the maximum value query request received by the terminal device indicates that it wishes to query the maximum value of the statistical data within an interval [L, R] (the time interval to be queried, L is the left boundary, and R is the right boundary), if all the statistical data of the interval are in one data block (the first data block), that is: the index information of each statistical time in the interval [L, R] all exists in the same data block, then the terminal device can directly traverse the statistical data in the data block and find the maximum value in the statistical data of the interval [L, R].

[0129] Step S502: When the statistical data of the time interval to be queried is contained in at least two third data blocks among the multiple data blocks, obtain the target index information of the left boundary statistical time and the right boundary statistical time of the time interval to be queried in the third data blocks respectively, and query the left maximum value array and the right maximum value array of the third data block based on the target index information to obtain the maximum value data in the statistical data of the time interval to be queried.

[0130] When the terminal device performs a maximum value query on statistical data that has been divided into multiple data blocks, if the statistical data of the time interval to be queried with the maximum value is contained in at least two third data blocks among the multiple data blocks, then in this case, the terminal device obtains the left boundary statistical time and the right boundary statistical time of the time interval to be queried, and the target index information of each in the third data block, and then queries the left maximum value array and the right maximum value array of the third data block based on the target index information, thereby calculating the maximum value data in the statistical data of the time interval to be queried based on the maximum values ​​in each third data block recorded in the left maximum value array and the right maximum value array.

[0131] In some embodiments, the statistical data of the left boundary statistical time is contained in the header data block in the third data block, and the statistical data of the right boundary statistical time is contained in the tail data block in the third data block; the target index information includes: the index information of the left boundary statistical time in the header data block, and the index information of the right boundary statistical time in the tail data block.

[0132] Please refer to Figure 6 , Figure 6 for Figure 5 Schematic diagram of the detailed steps of step S502.

[0133] In some embodiments, as Figure 6 As shown, in the above-mentioned step S502, "the querying of the left maximum value array and the right maximum value array of the third data block based on the target index information to obtain the maximum value data in the statistical data of the time interval to be queried" may include but is not limited to the steps S601 and S602 shown below.

[0134] Step S601: Based on the index information of the left boundary statistical time in the header data block, query multiple second maximum values ​​in the right maximum value array of the header data block to obtain right maximum value data;

[0135] When the terminal device queries the maximum value in multiple third data blocks, it first queries the multiple second maximum values ​​in the right maximum value array of the header data block based on the statistical time of the left boundary of the time interval to be queried and the index information in the header data block in the multiple third data blocks to obtain the right maximum value data.

[0136] Step S602: Based on the index information of the right boundary statistical time in the tail data block, query multiple first maximum values ​​in the left maximum value array of the tail data block to obtain left maximum value data.

[0137] When the terminal device queries for the maximum value in multiple third data blocks, it further queries the multiple first maximum values ​​in the left maximum value array of the tail data block based on the right boundary statistical time of the time interval to be queried and the index information in the tail data block in the multiple third data blocks, thereby obtaining the left maximum value data.

[0138] Exemplarily, when the maximum value query request received by the terminal device indicates that it wishes to query the maximum value of statistical data within an interval [L, R] (the time interval to be queried, L is the left boundary, and R is the right boundary), if all statistical data of the interval are in multiple data blocks (third data blocks), that is: the index information of each statistical time in the interval [L, R] exists in multiple data blocks, and in the interval, [L, t0] belongs to the first data block (head data block), and the interval [t1, R] belongs to the last data block (tail data block), then the terminal device will query the multiple second maximum values ​​right[i] in the right maximum value array of the first data block based on the index information i corresponding to the left boundary statistical time L of the interval [L, R], and then determine the maximum value of the multiple second maximum values ​​right[i] as the maximum value of the interval [L, t0]. Similarly, the terminal device further calculates the index information j of the right boundary statistical time R in the last data block based on the interval [L, R], and queries the multiple second maximum values ​​left[j] in the left maximum value array of the last data block, and can determine the maximum value of the multiple second maximum values ​​left[j] as the maximum value of the interval [t1, R].

[0139] Step S603: taking the maximum value data of the right maximum value data and the left maximum value data as the maximum value data in the statistical data of the time interval to be queried.

[0140] After obtaining the right and left maximum values, the terminal device further selects the maximum value of the data block and uses it as the maximum value in the statistical data for the queried time interval. Specifically, the terminal device obtains the maximum values ​​of each data block in the interval [L, R] by querying the right and left maximum values. Then, based on these maximum values, it calculates the maximum value in the statistical data for the entire interval [L, R].

[0141] Next, complete embodiments of applying the maximum value query method for user behavior statistical data provided in the embodiments of the present application to the fields of financial technology and medical health are proposed respectively.

[0142] In some embodiments, terminal devices in the field of financial technology can apply the maximum value query method for user behavior statistical data provided by the embodiments of the present application to identify possible theft or fraud by analyzing the extreme consumption amount and transaction frequency peak of the user's historical transaction data. For example, the terminal device can collect the user's transaction records for the past 12 months (user behavior data, fields include: transaction time, amount, location, merchant type, payment method, etc.), and the terminal device sums these transaction records by "day" and stores them in a data table, thereby obtaining statistical data of these transaction records. Afterwards, the terminal device performs square root division processing on the statistical data to divide the statistical data into data blocks, and the data size of each data block is Next, the terminal device discretizes each data block and records the index information for each day (statistical time) within 12 months (preset time interval) across multiple data blocks. Finally, the terminal device combines the prefix sum concept and uses the index information as a basis to generate maximum value arrays for each of the multiple data blocks. This allows the terminal device to determine, from the maximum value arrays, such maximum daily spending (e.g., the user's maximum transaction amount on May 1st was 150,000 yuan) and peak transaction frequency within a short period of time (e.g., the user completed two large transactions between 2:30 PM and 2:45 PM on May 1st).

[0143] In this case, the terminal device can combine the maximum value data obtained through quick query to configure corresponding risk warning rules for the user. For example, if the user's single-day spending exceeds 5 times the user's average monthly spending over the past three months (for example, if the user's average monthly spending is 10,000 yuan and it suddenly increases to over 50,000 yuan in a single day), an alert will be triggered. Another example: if the user's transaction frequency is ≥2 times within 30 minutes and the cumulative amount is ≥100,000 yuan, and the transaction location is across cities, the operation will be marked as high-risk.

[0144] Thus, compared with the traditional method of searching the statistical data of the entire 12 months to query the maximum single-day consumption amount of the user and the peak transaction frequency in a short period of time, the embodiment of the present application uses square root division to obtain the maximum value of the single-day consumption amount of the user and the peak transaction frequency in a short period of time. Split the statistical data for 12 months, and then generate the maximum value array of multiple data blocks after division based on the index information, so that the maximum value query of the statistical data can be performed based on the maximum value array. In this way, the time complexity n of traditional traversal of the entire statistical data for maximum value query can be reduced to This will improve the efficiency of using the most valuable query statistical data for user transaction behavior warnings, and more quickly and accurately identify possible theft or fraud in user transactions.

[0145] In other embodiments, terminal devices in the field of medical and health technology can apply the maximum value query method of user behavior statistical data provided in the embodiments of the present application to optimize department scheduling and reduce patient waiting time by analyzing the time extremes and traffic peaks of outpatient registration, check-in, and medical treatment. For example, the terminal device can collect user behavior data recorded in the outpatient system within a week (fields include: registration time, check-in time, medical treatment start / end time, department type, waiting time, etc.), and the terminal device also sums these user behavior data by "day" and stores them in a data table, thereby obtaining statistical data of these user behavior data. Afterwards, the terminal device divides the statistical data into data blocks (the data size of each data block is also ). After that, the terminal device discretizes each data block and records the index information in multiple data blocks from Sunday to Monday (the statistical time is every day). Finally, the terminal device combines the prefix and idea to generate the maximum value array of each data block based on the index information. In this way, the terminal device can determine the maximum value (such as the average waiting time of the cardiology department is 30 minutes, and a patient waits for 45 minutes) and minimum value (such as some patients wait for 10 minutes after signing in in advance) of the waiting time of patients in each department from the maximum value array, as well as the peak time of registration and signing in from 9:00 to 11:00 every morning (accounting for 60% of the total traffic for the whole day), which leads to the waiting time of more than 1 hour in some departments and other maximum value data.

[0146] In this case, the terminal device can combine the maximum value data obtained from the above efficient query and temporarily add one or two doctors to the appointment schedule during peak hours for departments with wait times ≥40 minutes (such as cardiology), and adjust the registration time period from "30 minutes / appointment" to "20 minutes / appointment." For departments with wait times ≤15 minutes, the terminal device can merge appointments from adjacent time periods to reduce doctor vacancies.

[0147] In this way, compared with the traditional method of traversing a whole week of statistical data to determine the waiting time of patients in each department and the peak registration and check-in time for outpatient resource allocation, the embodiment of the present application can more quickly determine the relevant maximum values ​​for designing an efficient outpatient resource allocation plan.

[0148] See also Figure 7 The present application also provides a device for querying the maximum value of user behavior statistics data, which can implement the above-mentioned method for querying the maximum value of user behavior statistics data. The device includes:

[0149] A data acquisition module is used to acquire user behavior data reported by the business recommendation platform and sum the user behavior data according to a preset time unit to obtain statistical data of the user behavior data;

[0150] a data block module, configured to perform square root division processing on the statistical data within a preset time interval to obtain a plurality of data blocks of the statistical data;

[0151] a discretization module, configured to record index information of each statistical time in the preset time interval in the plurality of data blocks; each statistical time having the same size as the preset time unit;

[0152] A maximum value query module is configured to generate a maximum value array of the plurality of data blocks based on the index information, and perform a maximum value query on the statistical data based on the maximum value array of the plurality of data blocks.

[0153] In some embodiments, the maximum value query module is also used to obtain the first maximum value of each statistical data in the first data block to the first index information, and obtain the left maximum value array of the first data block; the left maximum value data includes multiple first maximum values, the first data block is any data block among the multiple data blocks, and the first index information is the left boundary index information of the index information in the first data block; and, obtain the second maximum value of each statistical data in the first data block to the second index information, and obtain the right maximum value array of the first data block; the right maximum value data includes multiple second maximum values, and the second index information is the right boundary index information of the index information in the first data block.

[0154] In some embodiments, the maximum value query module is also used to traverse the statistical data in the second data block when the statistical data of the time interval to be queried are all contained in the only second data block among the multiple data blocks, so as to query and obtain the maximum value data in the statistical data of the time interval to be queried; and, when the statistical data of the time interval to be queried are contained in at least two third data blocks among the multiple data blocks, obtain the target index information of the left boundary statistical time and the right boundary statistical time of the time interval to be queried in the third data block respectively, and query the left maximum value array and the right maximum value array of the third data block based on the target index information to obtain the maximum value data in the statistical data of the time interval to be queried.

[0155] In some embodiments, the statistical data of the left boundary statistical time is contained in a header data block in the third data block, and the statistical data of the right boundary statistical time is contained in a tail data block in the third data block; the target index information includes: index information of the left boundary statistical time in the header data block, and index information of the right boundary statistical time in the tail data block;

[0156] The maximum value query module is also used to query multiple second maximum values ​​in the right maximum value array of the header data block based on the index information of the left boundary statistical time in the header data block to obtain right maximum value data; query multiple first maximum values ​​in the left maximum value array of the tail data block based on the index information of the right boundary statistical time in the tail data block to obtain left maximum value data; and use the maximum value data among the right maximum value data and the left maximum value data as the maximum value data in the statistical data of the time interval to be queried.

[0157] In some embodiments, the discretization module is also used to record the index information of each statistical time in the preset time interval in the multiple data blocks through a hash table; wherein, when the statistical data is stored through a hash table, the subscript of the array of each statistical data in the hash table is the index information of each statistical time.

[0158] In some embodiments, the maximum value query device for user behavior statistics provided by the embodiments of the present application further includes:

[0159] An update module is used to obtain the statistical data to be updated of any target statistical time in the preset time interval; determine a fourth data block among the multiple data blocks based on the index information of the target statistical time in the multiple data blocks; the fourth data block contains the statistical data of the target statistical time; and update the fourth data block based on the statistical data to be updated.

[0160] In some embodiments, the update module is also used to numerically update the statistical data of the target statistical time in the fourth data block based on the statistical data to be updated; and to update the left maximum value array and the right maximum value array of the fourth data block based on the updated statistical data of the target statistical time in the fourth data block.

[0161] It should be noted that the specific implementation of the maximum value query device for user behavior statistical data provided in the embodiment of the present application is basically the same as the specific implementation of the maximum value query method for user behavior statistical data mentioned above, and will not be repeated here.

[0162] The present application also provides a computer device comprising a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method for querying the maximum value of user behavior statistics. The computer device can be any intelligent terminal, including a tablet computer and an in-vehicle computer.

[0163] See also Figure 8 , Figure 8 The hardware structure of a computer device according to an embodiment is shown. The computer device includes:

[0164] The processor 801 can be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0165] The memory 802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 802, and the processor 801 calls and executes the maximum value query method for user behavior statistical data in the embodiments of this application;

[0166] Input / output interface 803, used to implement information input and output;

[0167] Communication interface 804, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0168] Bus 805 , which transmits information between various components of the device (e.g., processor 801 , memory 802 , input / output interface 803 , and communication interface 804 );

[0169] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus 805 .

[0170] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the maximum value query method of the above-mentioned user behavior statistical data.

[0171] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0172] An embodiment of the present application also provides a computer program product, which stores a computer program. When the computer program is executed by a processor, it implements the maximum value query method of the above-mentioned user behavior statistical data.

[0173] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0174] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0175] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0176] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0177] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0178] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0179] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0180] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0181] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0182] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0183] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. A method for querying the maximum value of user behavior statistical data, characterized in that: The method comprises: Obtaining user behavior data reported by the business recommendation platform, and summing the user behavior data according to a preset time unit to obtain statistical data of the user behavior data; Performing square root division processing on the statistical data within a preset time interval to obtain multiple data blocks of the statistical data; Recording index information of each statistical time in the preset time interval in the multiple data blocks; each statistical time is the same size as the preset time unit; A maximum value array of the plurality of data blocks is generated based on the index information, and a maximum value query is performed on the statistical data based on the maximum value array of the plurality of data blocks.

2. The method according to claim 1, characterized in that Generating the maximum value array of the plurality of data blocks based on the index information includes: Obtaining a first maximum value of each statistical data item in a first data block up to a first index information, and obtaining a left maximum value array of the first data block; the left maximum value data includes a plurality of first maximum values, the first data block is any data block among the plurality of data blocks, and the first index information is left boundary index information of index information in the first data block; Obtaining the second maximum value of each statistical data in the first data block up to the second index information to obtain a right maximum value array of the first data block; the right maximum value data includes a plurality of second maximum values, and the second index information is right boundary index information of the index information in the first data block; The performing a maximum value query on the statistical data based on the maximum value arrays of the multiple data blocks includes: A maximum value query is performed on the statistical data based on the left maximum value array and the right maximum value array of the multiple data blocks.

3. The method according to claim 2, characterized in that The performing a maximum value query on the statistical data based on the left maximum value array and the right maximum value array of the plurality of data blocks includes: When the statistical data of the time interval to be queried are all contained in the only second data block among the multiple data blocks, traversing the statistical data in the second data block to query and obtain the maximum value data in the statistical data of the time interval to be queried; When the statistical data of the time interval to be queried is contained in at least two third data blocks among the multiple data blocks, the target index information of the left boundary statistical time and the right boundary statistical time of the time interval to be queried in the third data blocks are obtained, and the left maximum value array and the right maximum value array of the third data block are queried based on the target index information to obtain the maximum value data in the statistical data of the time interval to be queried.

4. The method according to claim 3, characterized in that The statistical data of the left boundary statistical time is included in the head data block of the third data block, and the statistical data of the right boundary statistical time is included in the tail data block of the third data block; The target index information includes: index information of the left boundary statistical time in the head data block, and index information of the right boundary statistical time in the tail data block; The querying of the left maximum value array and the right maximum value array of the third data block based on the target index information to obtain the maximum value data in the statistical data of the time interval to be queried includes: Based on the index information of the left boundary statistical time in the header data block, query a plurality of second maximum values ​​in the right maximum value array of the header data block to obtain right maximum value data; Based on the index information of the right boundary statistical time in the tail data block, query multiple first maximum values ​​in the left maximum value array of the tail data block to obtain left maximum value data; The maximum value data among the right maximum value data and the left maximum value data is used as the maximum value data in the statistical data of the time interval to be queried.

5. The method according to claim 1, wherein The recording of index information of each statistical time in the preset time interval in the plurality of data blocks includes: Recording index information of each statistical time in the preset time interval in the multiple data blocks through a hash table; Wherein, in the case of storing the statistical data through a hash table, the subscript of the array of each statistical data in the hash table is the index information of each statistical time.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Obtaining the statistical data to be updated for any target statistical time in the preset time interval; Determining a fourth data block among the multiple data blocks based on index information of the target statistical time in the multiple data blocks; the fourth data block contains statistical data of the target statistical time; The fourth data block is updated based on the statistical data to be updated.

7. The method according to claim 6, characterized in that The updating of the fourth data block based on the to-be-updated statistical data includes: Performing numerical updates on the statistical data of the target statistical time in the fourth data block based on the statistical data to be updated; Based on the statistical data after the target statistical time is updated in the fourth data block, the left maximum value array and the right maximum value array of the fourth data block are updated.

8. A device for querying the maximum value of user behavior statistical data, characterized in that: The device comprises: A data acquisition module is used to acquire user behavior data reported by the business recommendation platform and sum the user behavior data according to a preset time unit to obtain statistical data of the user behavior data; a data block module, configured to perform square root division processing on the statistical data within a preset time interval to obtain a plurality of data blocks of the statistical data; a discretization module, configured to record index information of each statistical time in the preset time interval in the plurality of data blocks; each statistical time having the same size as the preset time unit; A maximum value query module is configured to generate a maximum value array of the plurality of data blocks based on the index information, and perform a maximum value query on the statistical data based on the maximum value array of the plurality of data blocks.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the maximum value query method of user behavior statistical data according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the maximum value query method of user behavior statistical data according to any one of claims 1 to 7 is implemented.