Log query method and device
By using bitmap to store log identifiers in a multidimensional database and using bitmap operations, the problem of low log query efficiency is solved, and faster query time and higher query efficiency are achieved.
Patent Information
- Application Number
- CN202510014171.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-01-06
AI Technical Summary
In multidimensional databases, log query efficiency is inefficient, especially when storing a large number of logs in relational databases, the query time is long and inefficient.
Log identifiers are stored in the form of bitmaps, and efficient bit operations supported by bitmaps are used to determine target log identifiers based on the log relationships of multiple filter dimensions, shorten query time and improve query efficiency.
Through efficient bit operation of bitmap, the log query time is shortened, the log query efficiency is improved, and the query process of multi-dimensional database is optimized.
Smart Images

Figure CN119537440B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to a log query method and device. Background Art
[0002] When using a multidimensional database, operations such as inserting, querying, updating, and deleting cells are performed on the database based on business needs, and computing devices generate logs to record these cell operations. Typically, computing devices use relational databases to store logs and write standardized Structured Query Language (SQL) queries based on specified query conditions to select logs that meet the specified query conditions from all logs stored in the relational database.
[0003] In the above process, when the number of logs stored in the relational database is large, the computing device needs to traverse a large number of logs to select logs that meet the specified query conditions, resulting in long query time and low query efficiency. Summary of the Invention
[0004] The present application provides a log query method and device for solving the problem of low log query efficiency.
[0005] In a first aspect, the present application provides a log query method. The method is applied to a database, which stores multiple logs. The log identifier of each log is stored in the form of a bitmap. The log identifier is used to uniquely mark the log in the database. The method provided in the first aspect of the present application includes: a computing device obtains a log query request. The log query request includes one or more target filtering conditions. The computing device queries the database for a target log identifier that matches the one or more target filtering conditions based on the log query request. The database stores log relationships of multiple filtering dimensions. The log relationship of a filtering dimension includes: log identifiers under multiple filtering conditions. The target log identifier includes: one or more log identifiers that match the log query request. The computing device reads the target log from the database based on the target log identifier.
[0006] In the first aspect of the present application, a computing device stores log identifiers of logs in the form of a bitmap. During log querying, the computing device can utilize the efficient bit operations supported by the bitmap to determine the target log identifier based on the log relationships across multiple screening dimensions, thereby shortening the time required for the computing device to determine the target log identifier and, in turn, the time required for the computing device to determine the target log, thereby improving the efficiency of log querying.
[0007] Exemplarily, the above method can be executed by a computing device, or by a computing device cluster including multiple computing devices, or by a component of a computing device, such as a processor, chip or chip system of a computing device, or by a logic module or software that can implement all or part of the functions of the computing device, etc.
[0008] In one possible implementation, a computing device queries a database for target log identifiers that match one or more target filtering conditions based on a log query request. This includes: the computing device queries log relationships across multiple filtering dimensions based on the log query request to determine the target log relationships that match the one or more target filtering conditions; and the computing device queries target log identifiers that match the one or more target filtering conditions based on the log relationships across the target filtering dimensions. In this manner, the computing device determines the target log identifier based on the log relationships across the target filtering dimensions. This narrows the scope of log relationships across the filtering dimensions that need to be queried, shortens the time required for log queries, and improves the efficiency of log queries.
[0009] In another possible implementation, the log relationship of the target filtering dimension includes the log relationship of the first filtering dimension. The computing device queries the target log identifier that matches one or more target filtering conditions based on the log relationship of the target filtering dimension, including: the computing device determines the first log identifier that matches the first target filtering condition based on the log relationship of the first filtering dimension. The computing device determines the second log identifier that matches the second target filtering condition based on the log relationship of the first filtering dimension. The first target filtering condition and the second target filtering condition belong to one or more target filtering conditions. And the computing device calculates the OR of the bitmap of the first log identifier and the bitmap of the second log identifier to obtain the target log identifier. In this way, the computing device uses the efficient bit operation of the bitmap to determine the target log identifier, shorten the time required for log query, and improve the efficiency of log query.
[0010] In another possible implementation, the log relationship of the target screening dimension includes a log relationship of the first screening dimension and a log relationship of the second screening dimension. The computing device queries the target log identifier that matches one or more target screening conditions based on the log relationship of the target screening dimension, including: the computing device queries the target log identifier that matches one or more target screening conditions based on the log relationship of the first screening dimension and the log relationship of the second screening dimension in a specified query order. In this way, the computing device queries the log relationships of different dimensions in the specified query order, shortening the time required for log queries and improving the efficiency of log queries.
[0011] In another possible implementation, the specified query order is determined based on the number of log identifiers in log relationships across different filtering dimensions. In this way, the computing device determines the specified query order based on the number of log identifiers in log relationships across different filtering dimensions, which can reduce the computational effort required to determine the target log identifier.
[0012] In another possible implementation, a specified query order is used to indicate that the log relationships of the target filtering dimension are queried in the order of the log relationships of the first filtering dimension and the log relationships of the second filtering dimension. The computing device queries the target log identifiers that match one or more target filtering conditions according to the log relationships of the first filtering dimension and the log relationships of the second filtering dimension in the specified query order, including: the computing device determines a third log identifier that matches a third target filtering condition based on the log relationships of the first filtering dimension. The computing device determines a fourth log identifier that matches a fourth target filtering condition based on the log relationships of the second filtering dimension. The third target filtering condition and the fourth target filtering condition belong to one or more target filtering conditions. Furthermore, the computing device calculates the sum of the bitmap of the third log identifier and the bitmap of the fourth log identifier to obtain the target log identifier. In this way, the computing device calculates the sum of the bitmaps of log identifiers determined by the log relationships of different filtering dimensions, and determines the target log identifier using the efficient bitwise operation of the bitmap, thereby shortening the time required for log queries and improving the efficiency of log queries.
[0013] In another possible implementation, before the computing device obtains the log query request, the method further includes: the computing device obtains multiple logs. A log includes one or more filtering conditions. The computing device generates a log identifier for each of the multiple logs. The computing device stores the log identifier of each of the multiple logs in the form of a bitmap. And the computing device generates log relationships of multiple filtering dimensions based on the filtering conditions of each log, the filtering dimensions corresponding to the filtering conditions, and the log identifier of each log. In this way, the computing device generates log relationships of multiple filtering dimensions, which ensures that the number of log identifiers under the multiple filtering conditions included in the log relationship of each filtering dimension is controllable, shortens the time required for log queries, and improves the efficiency of log queries.
[0014] In another possible implementation, the method further includes: the computing device obtains a first log. The first log includes one or more filtering conditions. The computing device generates a first log identifier for the first log. The computing device stores the first log identifier in the form of a bitmap. And the computing device adds the one or more filtering conditions and the first log identifier to the log relationship of multiple filtering dimensions. In this way, the computing device can use the above process to add the new log to the log relationship of multiple filtering dimensions. In this way, the log relationship of multiple filtering dimensions includes relevant information of the most recently generated log, thereby ensuring the accuracy of the query results.
[0015] In another possible implementation, multiple logs are used to record operations performed on each cell in the multidimensional database.
[0016] In another possible implementation, the computing device provides an operation interface, and generates a log query request based on the user's operation on the operation interface. In this way, the user can complete the log query operation through the operation interface, which is convenient and improves the interactive friendliness.
[0017] In another possible implementation, the computing device provides a result display interface including the target log, so that the user can directly view the target log, thereby improving the friendliness of the interaction.
[0018] In a second aspect, the present application provides a log query device, which includes modules for executing the log query method in the first aspect or any possible design of the first aspect.
[0019] In a third aspect, the present application provides a processor comprising an interface circuit and a control circuit, wherein the interface circuit is configured to obtain a log query request and collaborate with the control circuit to implement the operation steps of the method in the first aspect or any possible design of the first aspect.
[0020] In a fourth aspect, the present application provides a computing device cluster. The computing device cluster includes at least one computing device, each computing device including a processor and a memory. The processor of at least one computing device is configured to execute instructions stored in the at least one memory, causing the computing device cluster to perform the operating steps of the log query method according to the first aspect or any possible design of the first aspect.
[0021] In a fifth aspect, the present application provides a computer-readable storage medium comprising computer software instructions that, when executed in a computing device, cause the computing device to execute the operating steps of the method described in the first aspect or any possible implementation of the first aspect.
[0022] In a sixth aspect, the present application provides a computer program product that, when executed on a computer cluster, causes the computing device cluster to execute the operating steps of the method described in the first aspect or any possible implementation of the first aspect.
[0023] The beneficial effects of the second to sixth aspects above can be referred to the description of the first aspect or any implementation of the first aspect, and will not be repeated here. Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1This is an example diagram of a multidimensional data model;
[0025] Figure 2 Schematic diagram of two log screening methods;
[0026] Figure 3 A schematic diagram of the architecture of a log query system provided for this application;
[0027] Figure 4 A schematic diagram of the structure of a chip provided in this application;
[0028] Figure 5 A flow chart of a log query method provided by this application;
[0029] Figure 6 An example diagram of a log query process provided by this application;
[0030] Figure 7 A comparison chart of log query methods;
[0031] Figure 8 A schematic diagram of the structure of a log query device provided by this application;
[0032] Figure 9 A schematic diagram of the structure of a computing device cluster provided in this application;
[0033] Figure 10 A schematic diagram of the connection between computing devices provided in this application. DETAILED DESCRIPTION
[0034] This application provides a log query method. In this method, a computing device stores log identifiers of logs in the form of a bitmap. During the log query process, the computing device can utilize the efficient bit operations supported by the bitmap to determine the target log identifier based on log relationships across multiple filtering dimensions. This shortens the time required for the computing device to determine the target log identifier, thereby shortening the time required for the computing device to determine the target log and improving the efficiency of log queries.
[0035] In order to make the description of the following embodiments clear and concise, the relevant terms that may be involved in this application are first briefly introduced.
[0036] A multidimensional data model (MDM) is a data structure used to represent and query data. In a MDM, data is organized into a multidimensional data cube, with each dimension representing a different data attribute. The MDM allows data to be viewed and analyzed in a multidimensional manner. Figure 1 This is an example diagram of a multidimensional data model, such as Figure 1As shown, the multidimensional data model includes three dimensions: time, region, and product. Users can specify a cell (cube) based on time, region, or product and perform operations such as insert, query, update, and delete on the specified cell. The computing device can use logs to record operations performed on the cell.
[0037] Multi Dimensional Database (MDD) is a database system based on the multidimensional data model.
[0038] Logging is a technology for recording the history of database operations. For example, logging can be used to record operations performed on cells of a multidimensional data model in a multidimensional database.
[0039] A bitmap is a data structure that implements bit operations. A bitmap uses a single bit to represent the state of an object, such as using "1" to indicate the object's presence and 0 to indicate its absence. In this case, "0110" could represent bits 2 and 3 being present, but bits 1 and 4 being absent.
[0040] A compressed bitmap (roaring bitmap) is a data structure of a compressed bitmap. A compressed bitmap uses multiple data structures (such as containers and data) to store data to reduce storage space waste caused by data sparsity of the stored data.
[0041] The above briefly introduces the relevant terms involved in this application, and the following briefly introduces the relevant technologies involved in this application.
[0042] During the use of a multidimensional database, a computing device generates a log for each operation performed on each cell in the multidimensional data model. The number of cells in the multidimensional data model is large, and as the number of operations on the cells of the multidimensional data model increases, the number of logs generated by the computing device also increases. The computing device can use Figure 2 Method 1 and Method 2 shown in the figure select logs that meet the specified filtering conditions from a large number of logs. Figure 2 Schematic diagram of two log filtering methods.
[0043] Method 1
[0044] like Figure 2As shown in (a), the computing device uses the log analysis component ELK to select logs that meet specified filtering criteria from a large number of logs. Specifically, the computing device uses data capture and log collection components (such as Logsta and Beat) to capture all logs. The computing device uses data storage and search components (such as Elasticsearch) to select logs that meet the specified filtering criteria from all logs. The computing device also uses visualization components (such as Kibana) to display the logs that meet the specified filtering criteria.
[0045] In the above process, when writing data concurrently, data storage and search components (such as Elasticsearch) experience write delays, resulting in low log query efficiency.
[0046] Method 2
[0047] like Figure 2 As shown in (b), the computing device obtains a log table that stores logs in a preset format and stores the log table in a relational database. Furthermore, the computing device receives a user-written SQL query statement using a standardized Structured Query Language (SQL) based on specified filtering conditions and selects logs from the relational database that meet the specified filtering conditions based on the SQL query statement.
[0048] In the above process, when the number of logs between different logs of the same cell is large, the computing device needs to traverse all logs between different logs to obtain all logs of the same cell, which takes a long time to query and has low query efficiency.
[0049] In order to solve the problem of low log query efficiency in both the above methods 1 and 2, this application provides a log query method. Figure 3 The log query system shown.
[0050] Figure 3 A schematic diagram of the architecture of a log query system provided for this application, such as Figure 3 As shown, log query system 300 includes a computing device 310. Computing device 310 can be a common computer device, such as a personal computer, a tablet computer, or a server with an external display device. Computing device 310 can obtain input data (e.g., obtain a log query request), process the input data (e.g., obtain a target log from the log query request), and obtain and output a result (e.g., the target log).
[0051] Computing device 310 includes a communication interface 314, a processor 311, a memory 312, and a bus 316. Communication interface 314 is used to communicate with devices external to computing device 310. For example, a user may input a log query request to computing device 310 via communication interface 314. This communication interface may be an input / output (I / O) interface.
[0052] Processor 311 is the computing and control core of computing device 310. It may include a central processing unit (CPU), a specific integrated circuit, other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic devices, discrete hardware components, etc. In actual applications, computing device 310 may also include multiple processors. Processor 311 may include one or more processor cores. An operating system and other software programs are installed in processor 311, enabling processor 311 to access memory 312 and various peripheral component interconnect express (PCIe) devices.
[0053] Processor 311 is connected to memory 312 via bus 316. Memory 312 is the main memory of computing device 310. Bus 316 can be a double data rate (DDR) bus or other types of buses. Memory 312 is typically used to store various running software in the operating system. To improve the access speed of processor 311, memory 312 must have a fast access speed. In traditional computer devices, dynamic random access memory (DRAM) is commonly used as memory 312. In addition to DRAM, memory 312 can also be other random access memories, such as static random access memory (SRAM). Memory 312 can also be read-only memory (ROM). For example, read-only memory can be programmable read-only memory (PROM) or erasable programmable read-only memory (EPROM). This embodiment does not limit the number or type of memory 312.
[0054] In some possible scenarios, computing device 310 may also include a display 318. Display 318 can display an operation interface and, in response to user operations on the operation interface, obtain log query requests, etc. Display 318 can also display a result display interface, which includes the target log. Display 318 can be a liquid crystal display (LCD), etc.
[0055] In some possible situations, in order to store data (such as target logs) persistently, the log query system 300 is further provided with a data storage system 313, which can be located outside the computing device 310 (such as Figure 3 As shown in FIG3 ), data is exchanged with computing device 310 via a network. Optionally, data storage system 313 may also be located inside the host, such as data storage system 313 exchanging data with processor 311 via bus 316. In this case, data storage system 313 is a hard disk.
[0056] In some possible scenarios, the log query system 300 may also include a client device 320. In this scenario, the computing device 310 may obtain a log query request from the client device 320. The client device 320 may provide an operation interface, generate a log query request based on user operations performed on the operation interface, and send the log query request to the computing device 310. The client device 320 may be a common computing device, including but not limited to a personal computer, server, mobile phone, tablet computer, etc.
[0057] For example, Figure 3 The processor 311 in the embodiment may be implemented by a chip, such as Figure 4 As shown, Figure 4 This is a schematic diagram of the structure of a chip provided in the present application. For example, the chip 400 includes a core 401, a CPU 402, a system buffer 403, an input / output (I / O) device 405, and a double data rate synchronous dynamic random access memory (DDR) 406.
[0058] CPU 402 is used to accept tasks (such as log query tasks) and call core 401 to execute them. If chip 400 has multiple cores 401, CPU 402 also handles scheduling tasks. For example, CPU 402 can be implemented by an ARM processor, which is compact, low-power, uses a 34-bit reduced instruction set, and has simple and flexible addressing. Of course, in some embodiments, CPU 402 can also be implemented by other processors.
[0059] Core 401 is used to provide the computing power required for log query tasks. In one optional scenario, core 401 includes a load / store unit (LSU), a cube compute unit, a scalar compute unit, a vector compute unit, and a buffer. The LSU is used to load data to be processed and store processed data. It can also be used to manage the reading and writing of internal data between different buffers within the core and perform certain format conversion operations. The cube compute unit provides the core computing power for matrix multiplication. The scalar compute unit is a single instruction single data (SISD) processor that processes only one piece of data (usually an integer or floating-point number) at a time. The vector compute unit, also known as an array processor, is a processor that can directly operate on a group of arrays or vectors for calculations. The number of buffers may be one or more. For example, the buffer primarily refers to the level 1 cache (L1 buffer). The buffer is used to temporarily store data that core 401 needs to use repeatedly, thereby reducing bus reads and writes. In addition, the implementation of certain data format conversion functions also requires the source data to be located in the buffer. In this embodiment, since the buffer is located in the core, the distance between the cube computing unit in the core and the storage area where the data is located is shortened, reducing the cube computing unit's access to DDR 406, thereby reducing data access latency and core data processing latency.
[0060] The system buffer 403 mainly refers to the secondary cache, which is used to temporarily store input data, intermediate results or final results passing through the chip.
[0061] DDR 406 is an off-chip memory that can be replaced with high-bandwidth memory (HBM) or other off-chip memory. DDR 406 is located between the chip and the external memory, overcoming the access speed limitations of shared memory reads and writes for computing resources.
[0062] The I / O device 405 included in chip 400 refers to the hardware that performs data transmission and can also be understood as a device that interfaces with an I / O interface. Common I / O devices include network cards, printers, keyboards, mice, etc. All external storage devices can also serve as I / O devices, such as hard drives, floppy disks, and optical disks.
[0063] Core 401, CPU 402, system buffer 403, I / O devices 405, and DDR 406 are connected via a bus. The bus may include a path for transmitting information between the aforementioned components (e.g., CPU 402 and system buffer 403). In addition to a data bus, a bus may also include a power bus, a control bus, and a status signal bus. However, for clarity, the bus may be a PCIe bus, an extended industry standard architecture (EISA) bus, a unified bus (UBus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), or the like. For example, core 401 may access these I / O devices 405 via the PCIe bus. Core 401 is connected to system buffer 403 via the DDR bus. Here, different system buffers 403 may use different data buses to communicate with core 401. Therefore, the DDR bus may be replaced with other types of data buses. This embodiment of the present application does not limit the bus type.
[0064] For example, after CPU 402 loads the data to be processed by a log query task (e.g., a log query request) into DDR 406, the LSU in core 401 reads (loads) the data from DDR 406 and processes it to obtain a processing result (e.g., the target log). Once the processing result is obtained, the LSU then stores (stores) it into DDR 406, which is then sent by the network interface card to the data storage system 313 for persistent storage.
[0065] It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the computing device or chip. In other embodiments, the computing device and chip may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0066] The following combination Figure 3 and Figure 4 The content shown provides a detailed description of the log query method provided by this application.
[0067] Figure 5This is a flow chart of a log query method provided by this application. The log query method can be executed by a computing device, a computing device cluster, a component of a computing device (such as a processor, chip or chip system of a computing device), etc., and can also be implemented by a logic module or software. In the case where the log query method is executed by a computing device, the computing device can be Figure 3 The computing device 310 and the client device 320 are shown. For the hardware implementation of the computing device, please refer to the aforementioned Figure 3 In the case where the log query method is executed by a component of a computing device, the computing device component may be Figure 4 The chip shown, etc. For the hardware implementation of the chip, please refer to the aforementioned Figure 4 In some optional examples, the log query method can also be executed by other computing devices. For the hardware implementation of other computing devices, please refer to the aforementioned Figure 3 、 Figure 4 The description is not repeated here.
[0068] Here, the log query method provided by this embodiment is executed by a computing device as an example for explanation. Figure 5 As shown, the log query method provided by this embodiment includes the following S510 to S530.
[0069] S510: The computing device obtains a log query request.
[0070] The log query request includes one or more target filtering conditions.
[0071] The computing device may obtain the log query request in a variety of ways. Two possible ways are described below.
[0072] Example 1: A computing device receives a log query request.
[0073] For example, a computing device can receive log query requests sent by a user through a client. In this scenario, the computing device can provide a callable interface, and the client can use this interface to query logs. Specifically, the client accesses the computing device interface from the management interface or browser, and the computing device receives the log query request based on this access. The client's management interface is used to implement client management.
[0074] Example 2: A computing device generates a log query request.
[0075] In this scenario, the computing device may generate a log query request based on the user's operation. These operations include, but are not limited to, touch, swipe, click, and so on. The computing device may also generate a log query request when it detects that a log generation condition is met. These log generation conditions may include, but are not limited to, the number of logs meeting a specified condition being greater than or equal to a log quantity threshold. The specified conditions may include, but are not limited to, date, cell, operation type, and so on.
[0076] In some possible scenarios, the computing device may employ an interface layer to obtain a log query request, and employ an engine layer to determine a target log identifier based on the obtained log query request, and determine a target log according to the target log identifier.
[0077] Based on the above exemplary description of the manner in which the computing device obtains the log query request, the following describes the process of the computing device determining the target log identifier using S520.
[0078] S520: The computing device searches the database for target log identifiers that match one or more target screening conditions according to the log query request.
[0079] The database stores log relationships for multiple filtering dimensions. A log relationship for a filtering dimension includes log identifiers under multiple filtering conditions. The computing device can generate log relationships for multiple filtering dimensions using S61 to S64. For details, see the relevant description below. The target log identifier includes one or more log identifiers that match the log query request.
[0080] The computing device is provided with a database, and a plurality of logs are stored in the database. The log identifier of each of the plurality of logs is stored in the form of a bitmap, and the log identifier of the log is used to uniquely mark the log in the database. For example, the computing device can store the corresponding relationship between the log and the bitmap of the log identifier. The computing device can store the above-mentioned corresponding relationship in various forms, such as using the method shown in Table 1 to store the corresponding relationship between the log and the bitmap of the log identifier. In some possible scenarios, the corresponding relationship between the log and the log identifier can also be referred to as log data.
[0081] Table 1 An example of the correspondence between logs and log identification bitmaps
[0082]
[0083] The computing device can determine, from the log relationships of multiple filtering dimensions, a target filtering dimension log relationship that matches one or more target filtering conditions, and determine a target log identifier based on the log relationships of the target filtering dimensions. Specifically, the computing device queries the log relationships of multiple filtering dimensions based on the log query request to determine the target filtering dimension log relationship that matches the one or more target filtering conditions. Furthermore, the computing device queries the target log identifier that matches the one or more target filtering conditions based on the log relationships of the target filtering dimensions.
[0084] In some possible scenarios, when the filtering dimension corresponding to the target filtering condition is the same as the first filtering dimension among multiple filtering dimensions, the first filtering dimension can be considered to be the target filtering dimension that matches the target filtering condition. For example, the target filtering condition is xx / xx / x. The multiple filtering dimensions include time, operation type, and cell. In this scenario, the filtering dimension corresponding to the target filtering condition xx / xx / x is time. The computing device determines that time among the multiple filtering dimensions is the target filtering dimension that matches the target filtering condition.
[0085] The above describes the process by which a computing device determines a target filtering dimension based on one or more target filtering conditions, and then determines a target log identifier based on the target filtering dimension. The process by which the computing device determines a target log identifier based on the target filtering dimension varies depending on the number of filtering dimensions included in the target filtering dimension. The following describes these processes in different scenarios.
[0086] In case A, the number of filtering dimensions included in the target filtering dimension is 1.
[0087] In this case, depending on the number of target screening conditions, the process of the computing device determining the target log identifier according to the target screening dimensions is also different, which is described below in different cases.
[0088] In case a1, the number of target screening conditions is 1.
[0089] In this case, the computing device may perform the following process to determine the target log identifier: Specifically, the computing device determines a log identifier that matches the target screening condition based on the log relationship of the target screening dimension, and determines the log identifier as the target log identifier.
[0090] For example, the log relationship of the target screening dimension is shown in Table 2. The target screening condition is xx year x month 1. In this case, the computing device determines that the log identifiers that match the target screening condition are 1 and 2 based on the log relationship of the target screening dimension shown in Table 2, and the computing device determines 1 and 2 as the target log identifiers.
[0091] Table 2 An example of a log relationship for target screening dimensions
[0092]
[0093] Case a2: The number of target screening conditions is greater than or equal to 2.
[0094] In this case, the computing device can determine multiple log identifiers that match multiple target filtering conditions based on the log relationship of the target filtering dimension, and the computing device can OR the bitmap of the above multiple log identifiers based on one target filtering condition to obtain the target log identifier.
[0095] Take the log relationship of the target filtering dimension as the log relationship of the first filtering dimension. Take the target filtering condition including the first target filtering condition and the second target filtering condition as an example. In this case, the computing device can perform the following process to determine the target log identifier. Specifically, the computing device determines the first log identifier that matches the first target filtering condition based on the log relationship of the first filtering dimension. The computing device determines the second log identifier that matches the second target filtering condition based on the log relationship of the first filtering dimension. The first target filtering condition and the second target filtering condition belong to one or more target filtering conditions. And the computing device calculates the OR of the bitmap of the first log identifier and the bitmap of the second log identifier to obtain the target log identifier.
[0096] The above description uses the example of a target filtering condition including two, namely the first target filtering condition and the second target filtering condition, to explain the process of the computing device determining the target log identifier. According to the needs of the actual application, the target filtering condition may also include other target filtering conditions, such as a third target filtering condition. In this case, the computing device determines the third log identifier that matches the third target filtering condition based on the log relationship of the first filtering dimension. And the computing device calculates the bitmap of the first log identifier, the bitmap of the second log identifier, and the bitmap of the third log identifier to obtain the target log identifier. Regarding the specific method of calculating the bitmap, please refer to the description of the general technology, which will not be repeated here.
[0097] For example, the log relationships for the target filtering dimension are shown in Table 2 above. The target filtering conditions include xx / xx / 1 and xx / xx / 2. In this scenario, the computing device determines, based on the log relationships for the target filtering dimension shown in Table 2, that the log identifiers matching xx / xx / 1 are 1 and 2, and that the log identifiers matching xx / xx / 2 are 33 and 55. The computing device then calculates the OR of the log identifiers 1, 2, 33, and 55, resulting in target log identifiers 1, 2, 33, and 55.
[0098] In case B, the number of filtering dimensions included in the target filtering dimension is greater than or equal to 2.
[0099] In this case, depending on the number of target filtering conditions corresponding to each filtering dimension in the target filtering dimension, the process of the computing device determining the target log identifier according to the target filtering dimension is also different, which is described below in different cases.
[0100] In case b1, the number of target filtering conditions corresponding to each filtering dimension is 1.
[0101] In this case, the computing device determines the log identifier corresponding to each target filtering condition based on the log relationship of multiple target filtering dimensions, and calculates the bitmap of the log identifiers in units of one target filtering dimension to obtain the target log identifier.
[0102] Taking the example of a target screening dimension including a first screening dimension and a second screening dimension, a target screening condition including a third target screening condition and a fourth target screening condition, and the third target screening condition corresponding to the first screening dimension and the fourth target screening condition corresponding to the second screening dimension, the process of determining the target log identifier by the computing device is described. Specifically, the computing device determines a third log identifier that matches the third target screening condition based on the log relationship of the first screening dimension. The computing device determines a fourth log identifier that matches the fourth target screening condition based on the log relationship of the second screening dimension. The computing device then ANDs the bitmap of the third log identifier with the bitmap of the fourth log identifier to obtain the target log identifier.
[0103] The above text takes the case where the target screening dimensions include two, namely the first screening dimension and the second screening dimension, as an example to illustrate the process of the computing device determining the target log identifier. According to the needs of the actual application, the target screening dimension may also include other screening dimensions, such as the third screening dimension. The target screening condition may also include other target screening conditions, such as the fifth target screening condition. In this case, the computing device uses the above method to determine the fifth log identifier that matches the fifth target screening condition. And the computing device calculates the bitmap of the third log identifier, the bitmap of the fourth log identifier, and the bitmap of the fifth log identifier to obtain the target log identifier. Regarding the specific method of calculating the bitmap, please refer to the description of the general technology, which will not be repeated here.
[0104] Exemplarily, the target screening dimension includes a first screening dimension and a second screening dimension. The log relationship of the first screening dimension is shown in Table 2 above, and the log relationship of the second screening dimension is shown in Table 3 below. The third target screening condition is xx / xx / xx. The fourth target screening condition is cell 1. In this case, the computing device determines that the log identifiers that match the third screening condition are 1 and 2 based on the log relationship of the first screening dimension shown in Table 2. The computing device determines that the log identifiers that match the fourth screening condition are 1 and 55 based on the log relationship of the second screening dimension shown in Table 3. And the computing device calculates the sum of the above log identifiers 1, 2, 1 and 55, and obtains the target log identifier 1.
[0105] Table 3 Another example of the log relationship of the target filter dimension
[0106]
[0107] Case b2: Among the multiple screening dimensions, there is at least one screening dimension for which the number of target screening conditions is greater than or equal to 2.
[0108] In this case, the computing device can use the method described in the above case a2 to determine the log identifier under each filtering dimension in the target filtering dimension, and use the method described in the above case b1 to determine the target log identifier based on the log identifier under each filtering dimension. For specific descriptions, please refer to the relevant instructions above and will not be repeated here.
[0109] Exemplarily, the target screening dimension includes a first screening dimension and a second screening dimension. The target screening condition includes the first target screening condition to the third target screening condition. The log relationship of the first screening dimension is shown in Table 2 above, and the log relationship of the second screening dimension is shown in Table 3 above. The first target screening condition is xx / xx / xx / xx, the second target screening condition is xx / xx / xx / xx, and the third target screening condition is cell 1. In this case, the computing device determines that the log identifiers that match the first target screening condition are 1 and 2 based on the log relationship of the first screening dimension. The computing device determines that the log identifiers that match the second target screening condition are 33 and 55 based on the log relationship of the first screening dimension. The computing device performs an OR operation on the bitmap of the above log identifiers to obtain log identifiers of 1, 2, 33, and 55. The computing device determines that the log identifiers that match the third target screening condition are 1 and 55 based on the log relationship of the second screening dimension. The computing device performs an AND operation on the log identifiers 1, 2, 33, and 55, and the log identifiers 1 and 55 to determine the target log identifiers are 1 and 55.
[0110] In some possible situations, in order to further improve the efficiency of the computing device in determining the target log identifier. When the target filtering dimension includes multiple filtering dimensions, the computing device can filter the multiple filtering dimensions according to the specified query order. For example, the log relationship of the target filtering dimension includes the log relationship of the first filtering dimension and the log relationship of the second filtering dimension. In this case, the computing device queries the target log identifier that matches one or more target filtering conditions according to the log relationship of the first filtering dimension and the log relationship of the second filtering dimension in the specified query order.
[0111] In some possible scenarios, the above-mentioned specified query order is determined based on the number of log identifiers possessed by log relations of different screening dimensions. For example, the specified query order is to query log relations of different screening dimensions in order from least to greatest number of log identifiers possessed by log relations of different screening dimensions. In this way, the number of log identifiers determined based on log relations of screening dimensions is reduced to reduce the amount of computation required by the computing device to calculate OR and AND of log identifiers, thereby improving query efficiency. The computing device can determine the number of log identifiers based on statistical information of log identifiers of log relations of different screening dimensions under multiple screening conditions.
[0112] Exemplarily, the target filtering dimensions include time, cell, and operation type. The log relationship of time is shown in Table 2 above, the log relationship of cell is shown in Table 3 above, and the log relationship of operation type is shown in Table 4 below. The filtering conditions include xx / x / 1, xx / x / 2, and cell 2 insertion. In this case, the computing device can determine the target log identifier in the following order. Specifically, the computing device determines that the log identifier that matches cell 2 is 2 based on the log relationship of the cell. The computing device determines that the log identifier that matches the insertion is 1 based on the log relationship of the operation type. And the computing device calculates the AND of the above-mentioned log identifier 2 and log identifier 1 to determine that the target log identifier is empty. In this case, the computing device does not need to determine the log identifier that matches the filtering conditions xx / x / 1 and xx / x / 2 based on the log relationship of time, and can determine that the target log identifier is empty, which shortens the time required to query and obtain the target log identifier and improves the efficiency of the query. And the target log can be determined without querying all filtering conditions, which reduces the requirements for the filtering conditions.
[0113] Table 4 Another example of the log relationship of the target screening dimension
[0114]
[0115] S530: The computing device reads the target log from the database according to the target log identifier.
[0116] The computing device can determine the target log based on the correspondence between the log and the log identifier bitmap. Taking the correspondence between the log and the log identifier bitmap as shown in Table 1, and the target log identifiers being 1 and 55 as an example, in this case, the computing device can directly determine the target logs as log1 and log55 based on the correspondence shown in Table 1.
[0117] The above describes the process of the computing device determining the target log according to the target log identifier in conjunction with S510 to S530. The following describes the process of the computing device generating log relationships of multiple filtering dimensions according to multiple logs in conjunction with S61 to S64.
[0118] S61: The computing device obtains multiple logs.
[0119] A log contains one or more filter conditions. These include, but are not limited to, time, operation type, and cell. Time can be xx / xx / x / x, or other time formats tailored to the application, such as xx / xx / x / x / x. Operation types include, but are not limited to, insert, update, and delete.
[0120] Exemplarily, the multiple logs include log 1 and log 2. Log 1 includes a filter condition of xx year x month 1 day, and performs an insert operation on cells [3, 5, 7]. Log 2 includes a filter condition of xx year x month 1 day, and performs an update operation on cells [1, 2, 3].
[0121] S62: The computing device generates a log identifier for each of the multiple logs.
[0122] The computing device can generate a log identifier for each of the multiple logs using various methods, such as using a self-incrementing log identifier method. For example, if the computing device obtains logs i through i+1, and the generation time of log i is earlier than the generation time of log i+1, the computing device can generate a log identifier i for log i and a log identifier i+1 for log i+1, where i ≥ 1 and i is an integer.
[0123] S63: The computing device stores the log identifier of each log in the plurality of logs in a bitmap format.
[0124] For example, the log ID of log 5 is 5. In this case, the computing device may use 00010000 to store the log ID of log 5.
[0125] In some possible scenarios, to further reduce the storage resources occupied by storing log identifiers, the computing device may also store the log identifier of each of the multiple logs in the form of a compressed bitmap. For more information about the computing device using compressed bitmap data, please refer to the general technical description and will not be further explained here.
[0126] S64: The computing device generates a log relationship of multiple filtering dimensions according to the filtering condition of each log, the filtering dimension corresponding to the filtering condition, and the log identifier of each log.
[0127] The filter dimension corresponding to a filter condition can refer to the filter dimension to which the filter condition belongs. For example, if the filter condition is xx / xx / xx / xx, the time can be considered as the filter dimension corresponding to the filter condition. For another example, if the filter condition is insert, the operation type can be considered as the filter dimension corresponding to the filter condition. For another example, if the filter condition is cell [1, 2, 3], the cell can be considered as the filter dimension corresponding to the filter condition.
[0128] For example, multiple logs include Log 1 and Log 2. Log 1 includes the filter condition "xx year x month 1 day", and an insert operation is performed on cell [3, 5, 7]. Log 2 includes the filter condition "xx year x month 1 day", and an update is performed on cell [1, 2, 3]. Log 1 has a log identifier of 1, and Log 2 has a log identifier of 2. In this case, the computing device can generate, based on the above content, the time correspondence shown in Table 5, the operation type correspondence shown in Table 6, and the cell correspondence shown in Table 7.
[0129] Table 5 Time correspondence
[0130]
[0131] Table 6 Correspondence between operation types
[0132]
[0133] Table 7 Correspondence between cells
[0134]
[0135] In some possible scenarios, after the computing device generates log relationships of multiple filtering dimensions based on multiple logs using S61 to S64 above, new logs may also be generated. For example, according to the needs of actual applications, the computing device performs operations such as inserting, updating, and deleting on cells of the multidimensional data model, and the computing device generates logs to record the above operations. In this case, the computing device can use the following process to update the log relationship of the multidimensional filtering dimension based on the relevant information of the new log. Specifically, the computing device obtains a first log, which includes one or more filtering conditions. The computing device generates a first log identifier for the first log, and stores the first log identifier in the form of a bitmap. And the computing device adds the one or more filtering conditions and the first log identifier to the log relationship of multiple filtering dimensions.
[0136] For example, the new log is Log 3. Log 3 includes the filter criteria "Year-X Month-2" and deletes cells [3, 5, 7]. In this case, the computing device generates Log ID 3 for Log 3 and stores Log ID 3 in a bitmap format. The computing device then adds the relevant information for Log 3 to Tables 5 through 7, resulting in Tables 8 through 10 below.
[0137] Table 8 Time correspondence
[0138]
[0139] Table 9 Correspondence between operation types
[0140]
[0141] Table 10 Correspondence between cells
[0142]
[0143] The above describes the process of a computing device inserting logs into a log relationship of multiple filtering dimensions. The following example illustrates the log query process by taking the computing device using an interface layer to receive a log query request, using an engine layer to determine a target log identifier based on the log query request, and determining a target log based on the target log identifier as an example.
[0144] Figure 6 An example diagram of a log query process provided by this application, such as Figure 6 As shown, the client calls the computing device's interface from the management plane and initiates a log query request. The computing device's interface layer receives the log query request and transmits it to the computing device's engine layer. The computing device's engine layer then queries log relationships and log data across multiple filtering dimensions to determine the target log identifier. The computing device then determines the target log based on the target log identifier.
[0145] In the above Figure 7 Based on the explanation of the log query process, the following uses multiple logs including log1 to log99, and multiple logs are used to record the operations performed by the computing device on the cells of the three-dimensional data model, and the filtering conditions corresponding to the filtering dimensions of the multiple logs include time, operation type, and cell as an example to compare the log query method provided by the conventional technology and the log query method provided by this application. In this application, log i can also be referred to as logi, where i is a positive integer greater than or equal to 1.
[0146] Figure 7 A comparison chart of log query methods, such as Figure 7 As shown in (a), in conventional technology, a computing device generates a log table. The log table includes filtering conditions for each log from log1 to log99, as well as each log. For example, the log to be queried is the log associated with the cell [3, 5, 7]. In this case, the computing device traverses the log table one by one and determines that the target logs are log1 and log55. For another example, the log to be queried is the insert operation performed on the cell [3, 5, 7] on xx / xx / xx. In this case, the computing device obtains the log recording xx / xx / xx in the log table, obtains the log about the cell [3, 5, 7] in the log recording xx / xx / xx, and determines from the above log about the cell [3, 5, 7] that the operation performed is an insert operation.
[0147] like Figure 7 As shown in (b), in this application, the computing device can generate a log identifier for each log and generate log relationships of multiple filtering dimensions based on the filtering conditions of each log. The computing device also determines a target log identifier based on the log relationships of the multiple filtering dimensions and determines the target log based on the target log identifier.
[0148] Specifically, the computing device generates a log identifier for each log in log1 to log99 and stores the log identifier in a bitmap format. The computing device generates a time log relationship based on the time of each log in log1 to log99, generates an operation type log relationship based on the operation type of each log, generates a cell log relationship based on the cell corresponding to each log, and generates log data based on the corresponding relationship between the log identifier and the log. Furthermore, the computing device determines a target log identifier based on the log identifiers of multiple filtering dimensions according to the target filtering conditions included in the log query request, and determines a target log based on the target log identifier and the log data.
[0149] For example, the target screening condition is cells [3, 5, 7]. In this case, the computing device determines the target log identifiers as 1 and 55 based on the log relationship of the cells. The computing device also determines the target logs as log1 and log55 based on the log data.
[0150] For another example, the target screening conditions are: cell [3, 5, 7], date xx / xx / xx, and insert operation. In this case, the computing device determines log identifiers 1 and 55 based on the log relationship between cell [3, 5, 7] and the cell. The computing device determines log identifiers 1 and 2 based on the log relationship between date xx / xx / xx and time. The computing device also determines log identifier 1 based on the log relationship between the insert operation and the operation type. The computing device ANDs the bitmaps of log identifiers 1 and 55, the bitmaps of log identifiers 1 and 2, and the bitmap of log identifier 1, and determines the target log identifier to be 1. The computing device also determines the target log to be log1 based on the target log identifier 1 and the log data.
[0151] In an embodiment of the present application, the computing device stores log identifiers of logs in the form of a bitmap. During log querying, the computing device can utilize the efficient bit operations supported by the bitmap to determine the target log identifier based on the log relationships across multiple filtering dimensions. This shortens the time required for the computing device to determine the target log identifier, thereby shortening the time required for the computing device to determine the target log, and improving the efficiency of log querying.
[0152] It is understood that in order to implement the functions in the above embodiments, the computing device includes hardware structures and / or software modules corresponding to the execution of each function. It should be readily apparent to those skilled in the art that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in hardware or in a manner driven by computer software depends on the specific application scenario and design constraints of the technical solution.
[0153] Combined with the above Figures 1 to 7 , describes in detail the log query method provided by this embodiment, and will be combined with Figure 8 , describes the log query device provided according to this embodiment.
[0154] Figure 8 A structural diagram of a log query device provided by this application, such as Figure 8As shown, the log query device 800 includes: a transceiver module 810 and a processing module 820. The transceiver module 810 is used to obtain a log query request. The log query request includes one or more target filtering conditions. The processing module 820 is used to query the database for a target log identifier that matches the one or more target filtering conditions based on the log query request. The database stores log relationships of multiple filtering dimensions, and a log relationship of a filtering dimension includes log identifiers under multiple filtering conditions, and the target log identifier includes one or more log identifiers that match the log query request. The processing module 820 is also used to read the target log from the database based on the target log identifier.
[0155] In some possible scenarios, processing module 820 is configured to query log relationships of multiple filtering dimensions based on a log query request and determine log relationships of target filtering dimensions that match one or more target filtering conditions. Processing module 820 is further configured to query target log identifiers that match one or more target filtering conditions based on the log relationships of the target filtering dimensions.
[0156] In some possible scenarios, the log relationship of the target filtering dimension includes the log relationship of the first filtering dimension. Processing module 820 is configured to determine a first log identifier that matches the first target filtering condition based on the log relationship of the first filtering dimension. Processing module 820 is further configured to determine a second log identifier that matches the second target filtering condition based on the log relationship of the first filtering dimension. The first target filtering condition and the second target filtering condition belong to one or more target filtering conditions. Processing module 820 is further configured to obtain a target log identifier by performing an OR operation on the bitmap of the first log identifier and the bitmap of the second log identifier.
[0157] In some possible scenarios, the log relationships of the target screening dimension include log relationships of the first screening dimension and log relationships of the second screening dimension. Processing module 820 is configured to query target log identifiers that match one or more target screening conditions based on the log relationships of the first screening dimension and the log relationships of the second screening dimension in a specified query order.
[0158] In some possible scenarios, the specified query order is determined according to the number of log identifiers possessed by log relations of different filtering dimensions.
[0159] In some possible situations, the specified query order is used to indicate that the log relationship of the target filtering dimension is queried in the order of the log relationship of the first filtering dimension and the log relationship of the second filtering dimension. The processing module 820 is used to: determine a third log identifier that matches the third target filtering condition based on the log relationship of the first filtering dimension. The processing module 820 is also used to: determine a fourth log identifier that matches the fourth target filtering condition based on the log relationship of the second filtering dimension. The third target filtering condition and the fourth target filtering condition belong to one or more target filtering conditions. The processing module 820 is also used to: calculate the bitmap of the third log identifier and the bitmap of the fourth log identifier to obtain the target log identifier.
[0160] In some possible scenarios, the transceiver module 810 is further configured to obtain multiple logs. Each log includes one or more filtering conditions. The processing module 820 is further configured to generate a log identifier for each of the multiple logs. The processing module 820 is further configured to store the log identifier of each of the multiple logs in a bitmap format. The processing module 820 is further configured to generate log relationships for multiple filtering dimensions based on the filtering conditions of each log, the filtering dimensions corresponding to the filtering conditions, and the log identifier of each log.
[0161] In some possible scenarios, the transceiver module 810 is further configured to obtain a first log. The first log includes one or more filtering conditions. The processing module 820 is further configured to generate a first log identifier for the first log. The processing module 820 is further configured to store the first log identifier in a bitmap format. The processing module 820 is further configured to add the one or more filtering conditions and the first log identifier to a log relationship of multiple filtering dimensions.
[0162] In some possible situations, the log query device 800 further includes a display module 830. The display module 830 is configured to display an operation interface. The processing module 820 is configured to generate a log query request based on an operation performed by a user on the operation interface.
[0163] In some possible situations, the display module 830 is further used to: display a result interface, where the result display interface includes a target log.
[0164] In some possible scenarios, multiple logs are used to record operations performed on cells in a multidimensional database.
[0165] Specifically, for more descriptions of the transceiver module 810, the processing module 820 and the display module 830, please refer to the above description of the log query method, which will not be repeated here.
[0166] When the log query device 800 corresponds to the steps performed by the computing device in executing the log query method described in the embodiments of the present application, the above-mentioned and other operations and / or functions of each module in the log query device 800 are respectively for implementing the method flow performed by the computing device in the aforementioned figures.
[0167] It is worth noting that if the above-mentioned log query devices are implemented through software modules, for example, the software module can be provided to users through a cloud service subscription model, and users can choose different subscription levels according to their needs; for example, the software module can also provide enterprise-level customized services with professional domain customization, interface personalization and extended functions according to the needs of users or enterprises.
[0168] In addition, the log query device 800 provided in this application can also be made into a value-added service and provided to users, which is not limited in this application.
[0169] The log query device of the embodiment of the present application can also be implemented by hardware. For example, the hardware refers to a computing device, a chip or a processor. For the specific implementation of the computing device, please refer to Figure 3 For the specific implementation of chips and processors, please refer to Figure 4 The description is not repeated here.
[0170] The method steps in this embodiment can be implemented via hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, a hard disk, a removable hard disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium can be located in an ASIC. Alternatively, the ASIC can be located in a computing device. Of course, the processor and storage medium can also exist as discrete components in a network device or terminal device.
[0171] The present application also provides a computing device cluster. The computing device cluster includes at least one computing device, which may be a server with a display. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0172] like Figure 9 As shown, Figure 9 This is a schematic diagram of the structure of a computing device cluster provided by the present application, which includes at least one computing device 310. The memory 312 of one or more computing devices 310 in the computing device cluster may store the same instructions for executing the log query method.
[0173] In some possible implementations, the memory 312 of one or more computing devices 310 in the computing device cluster may also store partial instructions for executing the log query method. In other words, the combination of one or more computing devices 310 can jointly execute the instructions for executing the log query method.
[0174] It should be noted that the memory 312 in different computing devices 310 in the computing device cluster can store different instructions, each used to perform part of the functions of the computing device. In other words, the instructions stored in the memory 312 in different computing devices 310 can implement the functions of one or more units in the transceiver module 810, the processing module 820, and the display module 830.
[0175] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network, which may be a wide area network or a local area network. Figure 10 A possible implementation is shown. Figure 10 As shown, Figure 10 This application provides a schematic diagram of a connection between computing devices. Two computing devices 310A and 310B are connected via a network. Specifically, the connection to the network is achieved through a communication interface in each computing device. In this possible implementation, the instructions stored in the memory 312 of the computing device 310A can implement the functions of the transceiver module 810 and the display module 830. Simultaneously, the instructions stored in the memory 312 of the computing device 310B can implement the functions of the processing module 820.
[0176] The present application also provides a computer program product containing instructions. This computer program product can be software or a program product containing instructions that can be run on a computing device or stored on any available medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to execute the log query method.
[0177] Embodiments of the present application also provide a computer-readable storage medium. This computer-readable storage medium can be any available medium capable of storing data on a computing device, or a data storage device such as a data center that contains one or more available media. This available medium can be a magnetic medium (e.g., a floppy disk, hard disk, or magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). This computer-readable storage medium includes instructions that instruct the computing device to execute the log query method.
[0178] The present application also provides a chip. The chip includes an interface circuit and a control circuit. The interface circuit is used to obtain a log query request, and the control circuit is used to implement the functions of the computing device in the log query method.
[0179] The above embodiments can be implemented in whole or in part using software, hardware, firmware, or any combination thereof. When implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer programs or instructions are loaded and executed on a computer, the processes or functions described in the embodiments of this application are performed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, or other programmable device. The computer program or instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; an optical medium, such as a digital video disc (DVD); or a semiconductor medium, such as a solid-state drive (SSD).
[0180] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A log query method, characterized in that: The method is applied to a database, wherein the database stores a plurality of logs, wherein a log identifier of each log is stored in the form of a bitmap, and the log identifier is used to uniquely mark the log in the database, and the method comprises: Obtaining a log query request; the log query request includes one or more target screening conditions; According to the log query request, querying the database for target log identifiers that match the one or more target screening conditions; The database stores log relationships of multiple screening dimensions, wherein a log relationship of one screening dimension includes: log identifiers under multiple screening conditions under the one screening dimension, and the target log identifier includes: one or more log identifiers matching the log query request; The step of querying the database for target log identifiers matching the one or more target screening conditions according to the log query request includes: querying the log relationships of the multiple screening dimensions according to the log query request, and determining the log relationships of the target screening dimensions that match the one or more target screening conditions; Querying target log identifiers that match the one or more target screening conditions based on the log relationship of the target screening dimension; The log relationship of the target screening dimension includes the log relationship of the first screening dimension and the log relationship of the second screening dimension; The querying of target log identifiers matching the one or more target screening conditions based on the log relationship of the target screening dimension includes: Determining, based on the log relationship of the first screening dimension, a first log identifier that matches the first target screening condition; determining, based on the log relationship of the second screening dimension, a third log identifier that matches a third target screening condition; wherein the first target screening condition and the third target screening condition belong to the one or more target screening conditions; Calculating the sum of the bitmap of the first log identifier and the bitmap of the third log identifier to obtain the target log identifier; The target log is read from the database according to the target log identifier.
2. The method according to claim 1, characterized in that The querying of target log identifiers matching the one or more target screening conditions based on the log relationship of the target screening dimension further includes: Determining, based on the log relationship of the first screening dimension, a second log identifier that matches a second target screening condition; the second target screening condition belongs to the one or more target screening conditions; The bitmap of the first log identifier and the bitmap of the second log identifier are ORed to obtain the target log identifier.
3. The method according to claim 1, characterized in that The querying of target log identifiers matching the one or more target screening conditions based on the log relationship of the target screening dimension includes: In a specified query order, according to the log relationship of the first screening dimension and the log relationship of the second screening dimension, target log identifiers matching the one or more target screening conditions are queried.
4. The method according to claim 3, characterized in that The specified query order is determined according to the number of log identifiers possessed by log relations of different screening dimensions.
5. The method according to claim 3 or 4, characterized in that The specified query order is used to indicate that the log relationship of the target filtering dimension is queried in the order of the log relationship of the first filtering dimension and the log relationship of the second filtering dimension. The step of searching for target log identifiers matching the one or more target screening conditions according to the log relationship of the first screening dimension and the log relationship of the second screening dimension in a specified query order includes: Determining, based on the log relationship of the first screening dimension, a third log identifier that matches a third target screening condition; Determining, based on the log relationship of the second screening dimension, a fourth log identifier that matches a fourth target screening condition; wherein the third target screening condition and the fourth target screening condition belong to the one or more target screening conditions; The bitmap of the third log identifier and the bitmap of the fourth log identifier are ANDed to obtain the target log identifier.
6. The method according to any one of claims 1 to 4, characterized in that Before obtaining the log query request, the method further includes: Get multiple logs; a log includes one or more filter conditions; generating a log identifier for each of the plurality of logs; Storing a log identifier of each log in the plurality of logs in a bitmap format; A plurality of log relationships of the filtering dimensions are generated according to the filtering condition of each log, the filtering dimension corresponding to the filtering condition, and the log identifier of each log.
7. The method according to claim 6, characterized in that The method further comprises: Obtaining a first log; the first log includes one or more filtering conditions; generating a first log identifier for the first log; Storing the first log identifier in a bitmap format; The one or more filtering conditions and the first log identifier are added to the log relationship of the multiple filtering dimensions.
8. A log query device, characterized in that: The device comprises: The transceiver module is used to: obtain a log query request; the log query request includes one or more target screening conditions; A processing module, configured to: query a database for target log identifiers matching the one or more target screening conditions according to the log query request; The database stores log relationships of multiple screening dimensions, wherein a log relationship of one screening dimension includes: log identifiers under multiple screening conditions under the one screening dimension, and the target log identifier includes: one or more log identifiers matching the log query request; The processing module is specifically configured to: query the log relationships of the multiple screening dimensions according to the log query request, and determine the log relationship of the target screening dimension that matches the one or more target screening conditions; the log relationship of the target screening dimension includes the log relationship of the first screening dimension and the log relationship of the second screening dimension; The processing module is further specifically configured to: determine a first log identifier that matches a first target screening condition based on the log relationship of the first screening dimension; determine a third log identifier that matches a third target screening condition based on the log relationship of the second screening dimension; the first target screening condition and the third target screening condition belong to the one or more target screening conditions; and obtain the target log identifier by performing an AND operation on a bitmap of the first log identifier and a bitmap of the third log identifier. The processing module is further configured to read the target log from the database according to the target log identifier.
9. A processor, characterized in that: The processor includes an interface circuit and a control circuit; the interface circuit is used to obtain a log query request and cooperate with the control circuit to execute the method according to any one of claims 1 to 7.
10. A computing device cluster, characterized in that: The computing device cluster includes at least one computing device, each computing device includes a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs the method according to any one of claims 1 to 7.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium includes computer instructions; when the computer instructions are executed in a computing device, the computing device executes the method according to any one of claims 1 to 7.
12. A computer program product, characterized in that When the computer program product is run in a computing device, the computing device performs the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Object query platform, object query method and device and query server
CN111813812A
Log retrieval method and device and electronic equipment
CN113177023A