Event sequence processing method and device, event query method and device and electronic equipment
By performing binary encoding and field fusion on the event sequence, the problems of large memory consumption and low transmission efficiency in event sequence data storage are solved, achieving compact storage and efficient transmission.
Patent Information
- Application Number
- CN202411679205.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2026-05-22
AI Technical Summary
Existing technologies for storing event sequence data involve large memory usage, low transmission efficiency, and high network resource consumption.
By binary encoding the event fields, merging the event fields to generate a merged field, and then concatenating the merged field to generate event encoding information, the compact storage and transmission of event sequences are achieved.
It reduces memory usage when storing event sequences, improves data transmission efficiency, and saves network resources.
Smart Images

Figure CN122072812A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an event sequence processing method, an event query method, an apparatus, and an electronic device. Background Technology
[0002] Event sequence data is a sequence of events with timestamps. In current technology, event sequence data is generally stored directly on the server, which results in large memory consumption. Furthermore, during the transmission of event sequence data, there may be problems such as low transmission efficiency and high network resource consumption. Summary of the Invention
[0003] The technical problem to be solved by this application is to provide an event sequence processing method, event query method, apparatus and electronic device that can reduce the memory occupation of event sequence data when storing it, and improve data transmission efficiency and save network resources during transmission.
[0004] To address the aforementioned technical problems, this application provides an event sequence processing method, comprising:
[0005] Obtain a target event sequence; the target event sequence includes multiple target events, each target event includes multiple event fields, and the event field value corresponding to each of the multiple event fields;
[0006] The event field values corresponding to each of the multiple event fields are binary encoded to obtain the first encoded information corresponding to each event field;
[0007] Based on the plurality of event fields of each target event and the first encoding information corresponding to each of the plurality of event fields, the plurality of target events are fused to obtain a plurality of fused fields corresponding to the target event sequence and a second encoding information corresponding to each of the plurality of fused fields; wherein, the second encoding information corresponding to at least one fused field is obtained by concatenating the first encoding information corresponding to the same event field in the plurality of target events;
[0008] The second encoding information corresponding to each of the multiple fusion fields is concatenated to obtain the target encoding information corresponding to the target event sequence;
[0009] When there are multiple target event sequences, the target encoding information corresponding to each of the multiple target event sequences is concatenated to obtain event encoding information.
[0010] On the other hand, this application provides an event query method, including:
[0011] Event encoding information is obtained; the event encoding information is obtained by concatenating the target encoding information corresponding to each of multiple target event sequences; the target event sequence includes multiple target events, each target event includes multiple event fields, and event field values corresponding to each of the multiple event fields; the target encoding information corresponding to the target event sequence is obtained by concatenating the second encoding information corresponding to each of the multiple fusion fields; the multiple fusion fields corresponding to each target event sequence and the second encoding information corresponding to each of the multiple fusion fields are obtained by fusing the event fields of each target event and the first encoding information corresponding to each of the multiple event fields; the first encoding information corresponding to each event field is obtained by binary encoding the event field values corresponding to each of the multiple event fields;
[0012] Obtain the event query conditions; the event query conditions include the query fields and the corresponding query field values;
[0013] The target encoding information corresponding to each of the plurality of target event sequences is traversed, and a query region corresponding to the query field is determined in the target encoding information corresponding to each target event sequence. Based on the query region, matching encoding information that matches the value of the query field is queried; the query region represents the region where the second encoding information of the fusion field that matches the query field is located.
[0014] Identify the target query event; the target query event has matching encoding information that matches the value of the query field.
[0015] On the other hand, this application provides an event sequence processing apparatus, including:
[0016] An event sequence acquisition module is used to acquire a target event sequence; the target event sequence includes multiple target events, each target event includes multiple event fields, and the event field value corresponding to each of the multiple event fields;
[0017] The binary encoding module is used to perform binary encoding on the event field values corresponding to each of the multiple event fields to obtain the first encoding information corresponding to each event field;
[0018] The field fusion module is used to perform event field fusion on the multiple target events based on the multiple event fields of each target event and the first encoding information corresponding to each of the multiple event fields, to obtain multiple fusion fields corresponding to the target event sequence and the second encoding information corresponding to each of the multiple fusion fields; wherein, the second encoding information corresponding to at least one fusion field is obtained by concatenating the first encoding information corresponding to the same event field in the multiple target events;
[0019] The first splicing module is used to splice the second encoding information corresponding to each of the multiple fusion fields to obtain the target encoding information corresponding to the target event sequence;
[0020] The second splicing module is used to splice the target encoding information corresponding to each of the multiple target event sequences to obtain event encoding information when there are multiple target event sequences.
[0021] On the other hand, this application provides an event query apparatus, including:
[0022] An encoding information acquisition module is used to acquire event encoding information. The event encoding information is obtained by concatenating the target encoding information corresponding to each of multiple target event sequences. Each target event sequence includes multiple target events, each target event includes multiple event fields, and event field values corresponding to each of the multiple event fields. The target encoding information corresponding to the target event sequence is obtained by concatenating the second encoding information corresponding to each of the multiple fusion fields. The multiple fusion fields corresponding to each target event sequence and the second encoding information corresponding to each of the multiple fusion fields are obtained by fusing the event fields of each target event and the first encoding information corresponding to each of the multiple event fields. The first encoding information corresponding to each event field is obtained by binary encoding the event field values corresponding to each of the multiple event fields.
[0023] The query condition acquisition module is used to acquire event query conditions; the event query conditions include query fields and the corresponding query field values;
[0024] The event query module is used to traverse the target encoding information corresponding to each of the multiple target event sequences, determine the query region corresponding to the query field in the target encoding information corresponding to each target event sequence, and query the matching encoding information that matches the value of the query field based on the query region; the query region represents the region where the second encoding information of the fusion field that matches the query field is located.
[0025] The event determination module is used to determine the target query event; the target query event has matching encoding information that matches the query field value.
[0026] On the other hand, this application provides an electronic device including a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the event sequence processing method or event query method as described above.
[0027] On the other hand, this application provides a computer storage medium storing at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded by a processor and executed as described above, such as the event sequence processing method or the event query method.
[0028] On the other hand, this application provides a computer program product including computer instructions stored in a computer-readable storage medium; a processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the electronic device to perform the above-described event sequence processing method or event query method.
[0029] Implementing the embodiments of this application has the following beneficial effects:
[0030] In this application, the event field values corresponding to each event field are binary encoded to obtain the first encoded information corresponding to each event field. Then, when multiple fusion fields corresponding to the target event sequence are obtained by fusing event fields, the first encoded information corresponding to the same event fields in multiple target events can be concatenated to obtain the second encoded information of at least one fusion field. Furthermore, the second encoded information corresponding to each of the multiple fusion fields can be concatenated to obtain the target encoded information corresponding to the target event sequence, thus achieving compact storage of binary encoded information within the target event sequence. Additionally, when there are multiple target event sequences, the target encoded information corresponding to each of the multiple target event sequences can be concatenated to obtain event encoded information, thus achieving compact storage of binary encoded information between target event sequences. Therefore, by achieving compact storage of binary encoded information within and between target event sequences during event sequence processing, the memory usage for storing the event encoded sequence can be reduced, and data transmission efficiency can be improved and network resources saved during event encoded sequence transmission. Attached Figure Description
[0031] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a schematic diagram of an implementation scenario provided in the embodiments of this application;
[0033] Figure 2 This is a flowchart of an event sequence processing method provided in an embodiment of this application;
[0034] Figure 3 This is a flowchart illustrating a method for determining a fusion field and its encoding information, as provided in an embodiment of this application.
[0035] Figure 4 This is a flowchart illustrating another fusion field and a method for determining the encoding information of the fusion field provided in an embodiment of this application;
[0036] Figure 5 This is a flowchart of an encoding method for a key-value pair field provided in an embodiment of this application;
[0037] Figure 6 This is a flowchart of an event query method provided in an embodiment of this application;
[0038] Figure 7 This is a flowchart of an event query method based on a preset dictionary provided in an embodiment of this application;
[0039] Figure 8 This is a schematic diagram of an event sequence processing device provided in an embodiment of this application;
[0040] Figure 9 This is a schematic diagram of an event query device provided in an embodiment of this application;
[0041] Figure 10 This is a block diagram of an electronic device that uses event querying, as provided in an embodiment of this application.
[0042] Figure 11 This is a block diagram of an electronic device for event sequence processing provided in an embodiment of this application. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0044] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0045] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0046] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0047] Please see Figure 1 It illustrates a schematic diagram of an implementation scenario provided in the embodiments of this application, wherein... Figure 1 (a) shows a schematic diagram of a real-time environment, which may include at least one event analysis terminal 110 and an event processing server 120, which can communicate with each other via a network.
[0048] Specifically, the event processing server 120 can acquire a target event sequence and perform binary encoding on the target event sequence to obtain target encoding information corresponding to the target event sequence. Furthermore, when there are multiple target event sequences, the target encoding information of multiple target event sequences can be concatenated to obtain event encoding information, which is then stored. The event analysis terminal 110 can acquire event encoding information from the event processing server 120, store the acquired event encoding information in a local cache, and perform event queries within the event encoding information by setting query conditions.
[0049] The event analysis terminal 110 can communicate with the event processing server 120 based on either a browser / server (B / S) or client / server (C / S) model. The event analysis terminal 110 may include physical devices such as smartphones, tablets, laptops, digital assistants, smart wearable devices, and in-vehicle terminals, and may also include software running on these physical devices, such as applications. The operating system running on the event analysis terminal 110 in this embodiment may include, but is not limited to, Android, iOS, Linux, and Windows.
[0050] The event processing server 120 and the event analysis terminal 110 can establish a communication connection via wired or wireless means. The event processing server 120 may include a stand-alone server, a distributed server, or a server cluster consisting of multiple servers, wherein the server may be a cloud server.
[0051] The event sequence processing method in this embodiment can be applied to product experience analysis scenarios. Specifically, the time sequence processing method can be integrated into a product experience analysis tool, thereby enabling the tool to perform experience analysis on the target product. By using this tool to analyze the target product, it can help improve user acquisition, retention, and conversion rates, identify problems and defects, and ultimately optimize the product. Specifically, the product experience analysis tool can include multi-dimensional analysis tools such as interaction replay, heatmaps, and conversion analysis. Taking the target product as an example, the interaction replay analysis dimension records and replays each interaction between the user and the target application, allowing the user to view their specific actions during the interaction and understand their access path, operation mode, and page navigation within the target application. Figure 1 (b) shows a schematic diagram of the user's operation replay in the target application, wherein the main interface can display the page information corresponding to the current replay operation, and the auxiliary interface can display the replay operation node of the current replay. For example, in an interaction, the first operation is "click to select", so the main interface displays the page corresponding to the selection, and the auxiliary interface highlights the current replay operation, such as "1. Click to select". As the page information in the main interface changes, the replay operation node in the auxiliary interface flows accordingly.
[0052] The analysis dimensions of heatmaps provide a visual representation of how users interact with a target application. Heatmaps allow you to see where users click and where they stay on the page, enabling you to analyze the exposure of page elements and optimize the presentation of page information. Please refer to [link to relevant documentation]. Figure 1(c) This displays a heatmap of user actions in the target application, where hot spots are the focal areas during user actions and cold spots are areas easily overlooked by users. Specifically, the main interface can display a heatmap of user actions in the corresponding areas of the target page, and the auxiliary interface can display a heatmap statistics list. The heatmap statistics list can sort the user's actions from largest to smallest based on the heat value (or the number of actions). For example, if the user clicks on element 1 on the target page the most times, the corresponding heat value of element 1 is the largest, and the action of clicking on element 1 is ranked first in the heatmap statistics list.
[0053] For conversion analytics, we can analyze traffic flow across different pages and times, identify and optimize user churn issues, and improve user conversion and retention rates; please participate. Figure 1 (d) shows the user's journey through the target application, which shows that the user gradually drops off as they enter the application, enter the product list, and then enter the product details.
[0054] To address the problems of high memory consumption, low transmission efficiency, and high network resource consumption in existing technologies for storing event sequences, this application provides an event sequence processing method. The execution entity of this method can be the aforementioned event processing server. For details, please refer to... Figure 2 The method may include:
[0055] S210. Obtain the target event sequence; the target event sequence includes multiple target events, each target event includes multiple event fields, and the event field value corresponding to each of the multiple event fields.
[0056] In this embodiment, the event can be an interaction event of the target object or an automatically triggered event of the target system, etc. There is no specific limitation here. Any scenario that can generate events and that requires event analysis can use the method in this embodiment.
[0057] Each target event sequence may include multiple target events, and these target events may be arranged in chronological order based on their event times; that is, the event time of the target event that is ranked earlier in the target event sequence is earlier than the event time of the target event that is ranked later.
[0058] In this embodiment, each target event includes multiple event fields such as event timestamp, event type, and key-value pair attributes. Taking an interactive event with the target object as an example, the event timestamp event field value can be the time when the interactive event occurs. The event type event field value can include first interactive operation, second interactive operation, third interactive operation, etc. The key-value pair attribute event field value can include detailed information related to the event. For example, when the event type is the first interactive operation, the first interactive operation can be a page click operation. The corresponding key-value pair attribute event field value can include key-value pair 1 and key-value pair 2. Key-value pair 1 represents the page identifier of the target page where the first interactive operation is performed, and key-value pair 2 represents the operation position where the first interactive operation is performed on the target page, that is, the click position on the target page.
[0059] S220. The event field values corresponding to each of the multiple event fields are binary encoded to obtain the first encoded information corresponding to each event field.
[0060] Binary encoding allows data to be stored in a compact binary format, thereby improving storage efficiency and query performance. Accordingly, each event field value corresponding to each event field can be binary encoded separately to obtain the first encoded information for each event field.
[0061] In one example, this embodiment provides a binary encoding method for event field values, which may include:
[0062] Obtain the preset encoding bit length corresponding to each of the multiple event fields;
[0063] The event field value corresponding to each event field is binary encoded based on the preset encoding bit length corresponding to each event field to obtain the first encoding information corresponding to the preset encoding bit length of each event field.
[0064] The preset encoding bit lengths for multiple event fields can be the same or different. For example, multiple event fields include A1, A2, A3, A4... with preset encoding bit lengths of m1, m2, m3, m4... respectively. The preset encoding bit lengths m1, m2, m3, m4... can be the same or different. The preset encoding bit length for each event field can be determined based on the field value type or field value length, and is not limited here. Based on the determined preset encoding bit lengths for each event field, the event field value can be binary encoded to obtain the first encoding information with the preset encoding bit length. Field values of the same event field from different events can be encoded into the same first encoding information with the same preset encoding bit length.
[0065] In this embodiment, each event field has a corresponding preset encoding length, so that the field values corresponding to the same event field can be encoded with the same preset encoding length. That is, the first encoding information corresponding to each event field has a fixed length, which makes it easier to determine the area where the first encoding information of each event field of each event is located when performing event queries in the future, thereby improving the efficiency of event query.
[0066] In another example, this embodiment provides another binary encoding method for event field values, wherein the plurality of event fields include at least one target field, and each target field corresponds to one or more target field values. The method may include:
[0067] Each target field value is binary encoded to obtain the encoding information corresponding to each target field value.
[0068] When a target field corresponds to multiple target field values, the encoding information corresponding to each of the multiple target field values is concatenated sequentially to obtain the first encoding information corresponding to each target field.
[0069] In this embodiment, multiple event fields may include target fields and non-target fields. A target field corresponds to one or more field values; that is, in some scenarios, a target field corresponds to one field value, while in others, it corresponds to multiple field values. The number of field values for a target field is flexible. For example, a target field can be one of the key-value pair attribute fields mentioned above. In the case of an event type of "first interactive operation," the first interactive operation can be a page click operation. The event field values of the corresponding key-value pair attribute may include key-value pair 1 and key-value pair 2. Key-value pair 1 represents the page identifier of the target page where the first interactive operation is performed, and key-value pair 2 represents the operation position on the target page where the first interactive operation is performed, i.e., the click position on the target page. In this example, the target field may correspond to two field values, namely key-value pair 1 and key-value pair 2. Correspondingly, a non-target field may correspond to one field value. The number of field values for a non-target field does not change with the scenario. Non-target fields may include fields such as the event timestamp and event type mentioned above, with each event timestamp and event type corresponding to one field value.
[0070] When a target field corresponds to multiple target field values, each target field value can be binary encoded separately to obtain the encoding information corresponding to each target field value. Then, the encoding information corresponding to each target field value is concatenated sequentially to obtain the first encoding information corresponding to the target field. For example, for the event field values of the above key-value pair attribute field, which include key-value pair 1 and key-value pair 2, key-value pair 1 can be binary encoded to obtain encoding information 1, key-value pair 2 can be binary encoded to obtain encoding information 2, and encoding information 1 and encoding information 2 can be concatenated to obtain encoding information 1 encoded information 2. That is, the first encoding information corresponding to the key-value pair attribute field is encoding information 1 encoded information 2.
[0071] In this embodiment, for target fields with flexible values, each target field value can be binary encoded separately to obtain the encoding information corresponding to each target field value. Then, the encoding information corresponding to multiple target field values is concatenated sequentially to obtain the first encoding information corresponding to each target field. That is, when a target field corresponds to multiple target field values, each target field value corresponding to the target field is first binary encoded separately, and then the encoding information is concatenated. This ensures that each target field value is encoded independently, rather than encoding multiple target field values as a whole. As a result, the original information of each target field value is preserved in the obtained encoding information, improving the accuracy of field value encoding.
[0072] S230. Based on the plurality of event fields of each target event and the first encoding information corresponding to each of the plurality of event fields, the plurality of target events are fused to obtain a plurality of fused fields corresponding to the target event sequence and a second encoding information corresponding to each of the plurality of fused fields; wherein, the second encoding information corresponding to at least one fused field is obtained by concatenating the first encoding information corresponding to the same event field in the plurality of target events.
[0073] In this embodiment, the event field is for each individual event, while the fusion field is for the event sequence. By fusing the event fields of each event in the target event sequence and the corresponding first encoded information, the fusion field and its corresponding second encoded information for the target event sequence can be obtained. The fusion field for the target event sequence can be determined by extracting and integrating information such as the event fields of each target event, the number of target events, and the number of field values corresponding to the event fields. For example, the event fields of each target event may include an event timestamp, event type, and key-value pair attributes. The corresponding fusion field may include an event start timestamp, the number of target events, the event type of each target event, the timestamp of each target event, the number of key-value pairs for each target event, and all key-value pairs for each target event in the target event sequence. The event start timestamp can be the timestamp of the first event in the target event sequence. The multiple fusion fields corresponding to the target event sequence and their respective field values enable a comprehensive description of the event information for each target event in the target event sequence.
[0074] S240. The second encoding information corresponding to each of the multiple fusion fields is concatenated to obtain the target encoding information corresponding to the target event sequence.
[0075] Given the second encoding information corresponding to each fusion field, the second encoding information corresponding to multiple fusion fields can be concatenated to obtain the target encoding information corresponding to the target event sequence. This enables the compact storage of the encoding information within the target event sequence by directly concatenating the second encoding information, without the need to introduce other delimiters, based on the information extraction and analysis of the event information of each target event in the target event sequence.
[0076] S250. When there are multiple target event sequences, the target encoding information corresponding to each of the multiple target event sequences is concatenated to obtain event encoding information.
[0077] Having obtained the target encoding information corresponding to each of the multiple target event sequences, the target encoding information corresponding to each of the multiple target event sequences can be further concatenated to obtain event encoding information. By directly concatenating the target encoding information, no other delimiters need to be introduced, thus achieving compact storage of the encoding information between the target event sequences.
[0078] In this application, the event field values corresponding to each event field are binary encoded to obtain the first encoded information corresponding to each event field. Then, when multiple fusion fields corresponding to the target event sequence are obtained by fusing event fields, the first encoded information corresponding to the same event fields in multiple target events can be concatenated to obtain the second encoded information of at least one fusion field. Furthermore, the second encoded information corresponding to each of the multiple fusion fields can be concatenated to obtain the target encoded information corresponding to the target event sequence, thus achieving compact storage of binary encoded information within the target event sequence. Additionally, when there are multiple target event sequences, the target encoded information corresponding to each of the multiple target event sequences can be concatenated to obtain event encoded information, thus achieving compact storage of binary encoded information between target event sequences. Therefore, by achieving compact storage of binary encoded information within and between target event sequences during event sequence processing, the memory usage for storing the event encoded sequence can be reduced, and data transmission efficiency can be improved and network resources saved during event encoded sequence transmission.
[0079] Furthermore, this embodiment also provides a method for determining the fusion field and its encoding information. Please refer to [link to relevant documentation]. Figure 3 The method may include:
[0080] S310. Determine multiple first fusion fields based on the multiple event fields; each event field corresponds one-to-one with each first fusion field.
[0081] In other words, multiple event fields of the target event can be directly determined as the first fusion field. As can be seen from the above, multiple event fields of the target event may include event timestamp, event type, key-value pair attributes, etc., and the corresponding first fusion field may also include event timestamp, event type, key-value pair attributes, etc.
[0082] S320. The first encoding information corresponding to the same first fusion field of the multiple target events is concatenated to obtain the second encoding information corresponding to each first fusion field.
[0083] Although multiple event fields are identical to multiple first fusion fields, for a target event, the value of each event field is the event field value of the corresponding target event, while the value of each first fusion field is the event field value of multiple target events in the target event sequence. Accordingly, the first encoded information of the same event fields for each target event can be concatenated to form the second encoded information of the corresponding first fusion field.
[0084] For example, the target event sequence includes target event a, target event b, target event c, etc., where the first encoding information of target event a in the event type field is encoding a1, the second encoding information of target event b in the event type field is encoding b1, and the third encoding information of target event c in the event type field is encoding c1. Correspondingly, the second encoding information of the first fusion field corresponding to the event type field is encoding a1, encoding b1, and encoding c1, which is formed by concatenating encoding a1, encoding b1, and encoding c1.
[0085] S330. Determine the second encoding information corresponding to each of the plurality of first fusion fields based on the second encoding information corresponding to each of the plurality of first fusion fields.
[0086] In addition to the first fusion field, there may be other additional fusion fields among the multiple fusion fields. These additional fusion fields also have corresponding second encoding information. Thus, the second encoding information corresponding to each of the multiple fusion fields can be obtained based on the second encoding information of the multiple first fusion fields and the second encoding information of the additional fusion fields.
[0087] In this embodiment, a corresponding first fusion field is determined through multiple event fields, and the second encoding information corresponding to the first fusion field can be obtained by concatenating the first encoding information corresponding to the same first fusion field for multiple target events. Thus, the field value information of the original event field of the target event is retained in the first fusion field, and the first encoding information of multiple target events in the same event field is merged and displayed. That is, one first fusion field can correspond to the relevant information of multiple target events, thereby realizing information aggregation and storage.
[0088] Furthermore, this embodiment also provides another method for determining the fusion field and its encoding information; please refer to [link to relevant documentation]. Figure 4 The method may include:
[0089] S410. Determine the value of the fusion field corresponding to the second fusion field based on the number of events of the multiple target events.
[0090] The second fusion field corresponding to the target event sequence can be a field that represents the number of target events in the target event sequence, and the field value of the corresponding second fusion field can be the number of target events.
[0091] S420. Determine the fusion field value corresponding to the third fusion field based on the total number of target field values corresponding to the target fields of the multiple target events.
[0092] In this embodiment, multiple event fields may include target fields and non-target fields. A target field corresponds to one or more field values; that is, in some scenarios, a target field corresponds to one field value, while in others, it corresponds to multiple field values. The number of field values for a target field is flexible. For example, a target field can be one of the key-value pair attribute fields mentioned above. In the case of an event type of "first interactive operation," the first interactive operation can be a page click operation. The event field values of the corresponding key-value pair attribute may include key-value pair 1 and key-value pair 2. Key-value pair 1 represents the page identifier of the target page where the first interactive operation is performed, and key-value pair 2 represents the operation position on the target page where the first interactive operation is performed, i.e., the click position on the target page. In this example, the target field may correspond to two field values, namely key-value pair 1 and key-value pair 2. Correspondingly, a non-target field may correspond to one field value. The number of field values for a non-target field does not change with the scenario. Non-target fields may include fields such as the event timestamp and event type mentioned above, with each event timestamp and event type corresponding to one field value.
[0093] Since the total number of target field values corresponding to the target field varies flexibly in different target event sequences, the third fusion field can represent the total number of target field values corresponding to the target field of each target event in the target event sequence. Accordingly, the fusion field value of the third fusion field can be the total number of target field values corresponding to the target field of each target event in the target event sequence.
[0094] S430. The value of the fusion field of the second fusion field is binary encoded to obtain the second encoded information corresponding to the second fusion field.
[0095] S440. The value of the fusion field of the third fusion field is binary encoded to obtain the second encoding information corresponding to the third fusion field.
[0096] By binary encoding the values of the second and third fusion fields respectively, the corresponding second encoding information for the second and third fusion fields can be obtained. The second and third fusion fields also have their own preset encoding bit lengths, thus yielding the second encoding information for the second and third fusion fields with their respective preset encoding bit lengths.
[0097] S450. Determine the second encoding information corresponding to each of the plurality of fusion fields based on the second encoding information corresponding to the second fusion field and the second encoding information corresponding to the third fusion field.
[0098] The second encoding information corresponding to each of the multiple fusion fields can be determined based on the second encoding information corresponding to the first fusion field, the second encoding information corresponding to the second fusion field, and the second encoding information corresponding to the third fusion field.
[0099] In this embodiment, when determining the fusion field, relevant fusion fields that can describe the total number of target events or the total number of target field values in the target event sequence as a whole can be further determined, and the field values of the corresponding fusion fields are stored in binary encoding. The second encoding information of these stored fusion fields can serve as metadata for each target event sequence, making it easier to understand and determine the event scale and other relevant information of the target event sequence, thus providing a basis for subsequent event queries.
[0100] In this embodiment, the plurality of event fields include key-value pair fields. The event field value of the key-value pair field includes at least one key-value pair, and each key-value pair includes a target keyword and a value corresponding to the target keyword. Accordingly, a preset dictionary can be created, and integer mapping can be performed based on the preset fields, thereby generating the first encoded information corresponding to the key-value pair fields through binary encoding. Please refer to [link to specific details] for details. Figure 5 It illustrates an encoding method for key-value pair fields, which may include:
[0101] S510. Obtain multiple preset keywords and multiple preset values.
[0102] Multiple preset keywords and multiple preset values can be keywords and preset values that may be involved in specific implementation scenarios.
[0103] S520. Determine the first integer corresponding to each preset keyword and the second integer corresponding to each preset value.
[0104] Each preset keyword has a corresponding unique first integer, and each preset value also has a corresponding unique second integer. Different preset keywords correspond to different first integers, and different preset values correspond to different second integers. Both the first and second integers can be decimal integers.
[0105] S530. Generate a preset dictionary based on the first correspondence between each preset keyword and the first integer, and the second correspondence between each preset value and the second integer.
[0106] The preset dictionary can record the first preset keyword → 1, the second preset keyword → 2, the third preset keyword → 3, the fourth preset keyword → 4, the first preset value → 5, the second preset value → 6, the third preset value → 7, the fourth preset value → 8, etc.
[0107] S540. Based on the preset dictionary, determine the first integer corresponding to the target keyword and the second integer corresponding to the value of the target keyword.
[0108] For example, if the target key-value pair is "page":"home", where the target keyword is "page" and the target keyword value is "home", based on the preset dictionary, we can determine page→1 and home→5; if the target key-value pair is "action":"click", where the target keyword is "action" and the target keyword value is "click", based on the preset dictionary, we can determine action→2 and click→6.
[0109] S550. The first integer corresponding to the target keyword and the second integer corresponding to the value of the target keyword are respectively binary encoded to obtain the first encoded information corresponding to the key-value pair field.
[0110] If neither the first integer nor the second integer is binary, the first integer and the second integer can be encoded into binary to obtain the first encoded information corresponding to the key-value pair field.
[0111] In this embodiment, a preset dictionary can be created to map preset keywords and preset values to corresponding integers. By storing a preset dictionary containing integers, memory usage can be reduced and the efficiency of data transmission to the preset dictionary can be improved. Furthermore, the preset dictionary can directly map target keywords and their values to corresponding integers, and then perform binary encoding on the mapped integers, thereby improving the encoding efficiency of target keywords and their values.
[0112] On the other hand, this application also provides an event query method, the execution subject of which can be the aforementioned event analysis terminal. Please refer to [link to relevant documentation]. Figure 6 The method may include:
[0113] S610. Obtain event encoding information; the event encoding information is obtained by concatenating the target encoding information corresponding to each of the multiple target event sequences; the target event sequence includes multiple target events, each target event includes multiple event fields, and event field values corresponding to each of the multiple event fields; the target encoding information corresponding to the target event sequence is obtained by concatenating the second encoding information corresponding to each of the multiple fusion fields, the multiple fusion fields corresponding to each target event sequence and the second encoding information corresponding to each of the multiple fusion fields are obtained by fusing the multiple target events based on the multiple event fields of each target event and the first encoding information corresponding to each of the multiple event fields; the first encoding information corresponding to each event field is obtained by binary encoding the event field values corresponding to each of the multiple event fields.
[0114] For the specific method of generating event encoding information, please refer to the event sequence processing method shown in steps S210-S250 of this embodiment, which will not be repeated here.
[0115] S620. Obtain event query conditions; the event query conditions include query fields and query field values corresponding to the query fields.
[0116] The event query conditions may include at least one query field and at least one query field value corresponding to the query field. Here, the query field may be a field corresponding to the fusion field of the event sequence. In this embodiment, the fusion field may include fields such as event timestamp, event type, key-value pair attribute, number of events of the target event, and total number of target field values corresponding to the target field. The corresponding query conditions may be an event sequence with an event number of n for the target event, where the event number of the target event is the query field and n is the query field value.
[0117] S630. Traverse the target encoding information corresponding to each of the plurality of target event sequences, determine the query region corresponding to the query field in the target encoding information corresponding to each target event sequence, and query the matching encoding information that matches the value of the query field based on the query region; the query region represents the region where the second encoding information of the fusion field that matches the query field is located.
[0118] As can be seen from the above, each of the multiple event fields corresponds to a first encoding information with a preset encoding length. Correspondingly, the second encoding information obtained by concatenating the first encoding information also has fixed placeholder information. Specifically, determining the query region corresponding to the query field in the target encoding information corresponding to each target event sequence includes:
[0119] Based on the preset number of bits of the second encoding information corresponding to each of the multiple fusion fields in each target event sequence, the region where the second encoding information of the multiple fusion fields is located is determined.
[0120] The region containing the second encoded information of the field that matches the query field among the plurality of fused fields is determined as the query region.
[0121] Since the event encoding information is obtained by splicing together the target encoding information corresponding to each of the multiple target event sequences, the event encoding information contains compact encoding information. Furthermore, since the number of bits occupied by the target encoding information corresponding to each target event sequence can be predetermined, and the number of bits occupied by the encoding information of each fusion field corresponding to each target event can also be predetermined, the area where the second encoding information corresponding to each fusion field is located can be determined in the area where the target encoding information corresponding to each target event sequence is located.
[0122] For example, the target encoded information corresponding to target event sequence 1 is located in regions x to y, where the placeholder between regions x and y represents the number of bits occupied by the target encoded information corresponding to target event sequence 1; the target encoded information corresponding to target event sequence 2 is located in regions y+1 to z, where the placeholder between regions y+1 and z represents the number of bits occupied by the target encoded information corresponding to target event sequence 2. Therefore, the regions containing the second encoded information corresponding to each of the multiple fusion fields corresponding to target event sequence 1 can be determined in regions x to y, and the regions containing the second encoded information corresponding to each of the multiple fusion fields corresponding to target event sequence 2 can be determined in regions y+1 to z. Furthermore, the regions containing the second encoded information of the matching fields can be determined in regions x to y, designated as query region 1, and the regions containing the second encoded information of the matching fields can be determined in regions y+1 to z, designated as query region 2.
[0123] In this embodiment, each event field has a corresponding preset encoding length, so that the field values corresponding to the same event field can be encoded with the same preset encoding length. That is, the first encoding information corresponding to each event field has a fixed length. The second encoding information is obtained by concatenating the first encoding information. Accordingly, the number of bits occupied by the second encoding information can be predetermined. Thus, when performing event queries, it is convenient to quickly find the query area where the encoding information of the matching field is located, so as to facilitate information matching based on the query area, and thus facilitate the determination of the target query event based on the information matching result, thereby improving the event query efficiency.
[0124] In another example, the plurality of event fields include key-value pair fields, wherein the event field value of the key-value pair fields includes at least one key-value pair, each key-value pair including a target keyword and a value corresponding to the target keyword; the query field value includes query key-value pairs; accordingly, please refer to Figure 7 It illustrates an event query method based on a preset dictionary, which may include:
[0125] S710. Obtain a preset dictionary; the preset dictionary is generated based on a first correspondence between multiple preset keywords and a first integer, and a second correspondence between multiple preset values and a second integer.
[0126] Each preset keyword has a corresponding unique first integer, and each preset value also has a corresponding unique second integer. Different preset keywords correspond to different first integers, and different preset values correspond to different second integers. Both the first and second integers can be decimal integers. The preset dictionary can record the following: first preset keyword → 1, second preset keyword → 2, third preset keyword → 3, fourth preset keyword → 4, first preset value → 5, second preset value → 6, third preset value → 7, fourth preset value → 8, and so on. For example, if the target key-value pair is "page":"home", where the target keyword is "page" and the target keyword value is "home", based on the preset dictionary, we can determine page → 1 and home → 5. Similarly, if the target key-value pair is "action":"click", where the target keyword is "action" and the target keyword value is "click", based on the preset dictionary, we can determine action → 2 and click → 6.
[0127] S720. Based on the preset dictionary, perform integer conversion on the query key-value pair to obtain the query key-value integer corresponding to the query key-value pair.
[0128] S730. The query key value integer is binary encoded to obtain query key value encoding information.
[0129] S740. Based on the query area, query the matching encoding information that matches the query key value encoding information.
[0130] Since the target encoding information corresponding to each target event sequence is stored as binary encoding information, when performing event queries based on query key values, the query key values can also be encoded as binary data, which facilitates the matching of query key values with binary encoded data in the query area and improves data matching efficiency.
[0131] S640. Determine the target query event; the target query event has matching encoding information that matches the query field value.
[0132] The number of target query events can be one or more; the target query event having matching code information that matches the query field value can mean that the target query event has a matching field that matches the query field, and the matching code information corresponding to the matching field of the target query event matches the code information corresponding to the query field value. Here, the matching code information corresponding to the matching field and the code information corresponding to the query field value can be the same, or the matching code information corresponding to the matching field can contain the code information corresponding to the query field value.
[0133] The event query method in this embodiment can also be used to perform event sequence queries. For example, it can query event sequences containing a target number of target events, or event sequences containing target events of the target event type. That is, the event query method of this application can be flexibly applied to querying events in terms of both event dimension and event sequence dimension.
[0134] In this application, the event field values corresponding to each event field are binary encoded to obtain the first encoded information corresponding to each event field. Then, when multiple fusion fields corresponding to the target event sequence are obtained by fusing event fields, the first encoded information corresponding to the same event field in multiple target events can be concatenated to obtain the second encoded information of at least one fusion field. Furthermore, the second encoded information corresponding to each of the multiple fusion fields can be concatenated to obtain the target encoded information corresponding to the target event sequence, thus achieving compact storage of binary encoded information within the target event sequence. Additionally, when there are multiple target event sequences, the target encoded information corresponding to each of the multiple target event sequences can be concatenated to obtain event encoded information, thus achieving compact storage of binary encoded information between target event sequences. Therefore, when processing event sequences, by implementing compact storage of binary encoded information within and between target event sequences, the memory usage when storing event encoded sequences can be reduced. Furthermore, when querying events, information can be directly queried based on binary encoded data without object parsing, thereby improving event query speed and processing efficiency.
[0135] The following is a specific example illustrating the implementation process of this application, which may include multiple steps such as data acquisition, data encoding, data transmission, and event querying:
[0136] 1. Data Collection
[0137] Each event may include the following fields:
[0138] Timestamp: The time when the event occurred;
[0139] Event types: such as page initialization, page redirection, page click, etc.;
[0140] Key-value pair properties: Detailed information related to the event, such as page identifier, click location, etc.
[0141] 2. Data Encoding
[0142] (1) Dictionary processing: Convert all event keys and values to integer types to reduce memory usage.
[0143] Create a dictionary named dict with the structure Record.<int,string> It stores all possible keys and values in a dictionary and assigns a unique integer to each key and value.
[0144] For example, the original key-value pair {"page":"home","action":"click"} might be converted to {1:2,3:4}. The corresponding dictionary would be: 1->page, 5->home, 2->action, 6->click.
[0145] (2) Binary encoding: Encode event sequence data into a compact binary format.
[0146] Specifically, the following fusion fields may be included:
[0147] startTimestamp: int(c1) Start timestamp
[0148] eventCount: int(c2) The number of events
[0149] eventTypes: int(c3)[] The type of each event
[0150] timestamps: int(c4)[] Timestamp of each event (offset relative to startTimestamp)
[0151] kvLength:int(c5)[] The number of key-value pairs for each event
[0152] kvs:[int(c6),int(c7)][] All key-value pairs (key and value IDs)
[0153] Wherein, c1, c2, c3, c4, c5, c6, and c7 are the preset encoding bit lengths corresponding to each fused field.
[0154] The target encoding information corresponding to a target event sequence can be shown in Table 1:
[0155] Table 1
[0156]
[0157] The event encoding information is obtained by concatenating the target encoding information corresponding to multiple target event sequences, as shown in Table 2:
[0158] Table 2
[0159]
[0160]
[0161] 3. Data transmission
[0162] When transmitting data from the event processing server to the event analysis server, both the event encoding information and the dictionary can be transmitted to the event analysis server.
[0163] 4. Event Inquiry
[0164] Specific query operations include:
[0165] (1) Traverse the event sequence: Scan the event sequence from beginning to end, and check the type, timestamp and attributes of each event one by one.
[0166] (2) Condition judgment: Filter and count events based on user-defined query conditions.
[0167] Specifically, this may include: traversing the target encoding information corresponding to each target event sequence in the event encoding information; reading the start timestamp; reading the number of events; reading the event type array; reading the timestamp array; reading the number of key-value pairs for each event; reading all key-value pairs; and filtering events based on query conditions.
[0168] (3) Result return: Return the query results to the front-end interface for display.
[0169] This application presents an efficient event sequence query method based on binary encoding, enabling efficient processing and querying of large amounts of event sequence data, optimizing data storage and transmission: the compact binary encoding format significantly reduces data transmission and memory usage, improving data processing efficiency; it enhances query performance: by performing queries and calculations directly on the binary data, the parsing process is avoided, improving query speed and processing efficiency; it maintains flexibility and scalability: supporting flexible event sequence queries and complex logical judgments, adapting to various analysis needs, and improving the system's practicality and scalability.
[0170] Please see Figure 8 It illustrates an event sequence processing apparatus, comprising:
[0171] The event sequence acquisition module 810 is used to acquire a target event sequence; the target event sequence includes multiple target events, each target event includes multiple event fields, and the event field value corresponding to each of the multiple event fields;
[0172] The binary encoding module 820 is used to perform binary encoding on the event field values corresponding to each of the multiple event fields to obtain the first encoding information corresponding to each event field.
[0173] The field fusion module 830 is used to perform event field fusion on the multiple target events based on the multiple event fields of each target event and the first encoding information corresponding to each of the multiple event fields, to obtain multiple fusion fields corresponding to the target event sequence and the second encoding information corresponding to each of the multiple fusion fields; wherein, the second encoding information corresponding to at least one fusion field is obtained by concatenating the first encoding information corresponding to the same event field in the multiple target events;
[0174] The first splicing module 840 is used to splice the second encoding information corresponding to each of the multiple fusion fields to obtain the target encoding information corresponding to the target event sequence;
[0175] The second splicing module 850 is used to splice the target encoding information corresponding to each of the multiple target event sequences to obtain event encoding information when there are multiple target event sequences.
[0176] Furthermore, the binary encoding module is specifically used for:
[0177] Obtain the preset encoding bit length corresponding to each of the multiple event fields;
[0178] The event field value corresponding to each event field is binary encoded based on the preset encoding bit length corresponding to each event field to obtain the first encoding information corresponding to the preset encoding bit length of each event field.
[0179] Furthermore, the field fusion module is specifically used for:
[0180] Multiple first fusion fields are determined based on the multiple event fields; each event field corresponds one-to-one with each first fusion field.
[0181] The first encoded information corresponding to the same first fusion field of the multiple target events is concatenated to obtain the second encoded information corresponding to each first fusion field;
[0182] The second encoding information corresponding to each of the plurality of first fusion fields is determined based on the second encoding information corresponding to each of the plurality of first fusion fields.
[0183] Furthermore, the plurality of event fields include at least one target field, and each target field corresponds to one or more target field values;
[0184] The binary encoding module is specifically used for:
[0185] When a target field corresponds to multiple target field values, the multiple target field values corresponding to each target field are binary encoded to obtain the encoding information corresponding to the multiple target field values respectively.
[0186] The encoded information corresponding to the values of the multiple target fields is concatenated sequentially to obtain the first encoded information corresponding to each target field.
[0187] Furthermore, the field fusion module is specifically used for:
[0188] The value of the fusion field corresponding to the second fusion field is determined based on the number of events of the multiple target events;
[0189] The value of the fusion field corresponding to the third fusion field is determined based on the total number of target field values corresponding to the target fields of the multiple target events;
[0190] The value of the fusion field of the second fusion field is binary encoded to obtain the second encoded information corresponding to the second fusion field;
[0191] The value of the fusion field of the third fusion field is binary encoded to obtain the second encoding information corresponding to the third fusion field;
[0192] The second encoding information corresponding to each of the plurality of fusion fields is determined based on the second encoding information corresponding to the second fusion field and the second encoding information corresponding to the third fusion field.
[0193] Furthermore, the plurality of event fields include a key-value pair field, wherein the event field value of the key-value pair field includes at least one key-value pair, and each key-value pair includes a target keyword and a value corresponding to the target keyword;
[0194] The device further includes a dictionary creation module, which is used for:
[0195] Retrieve multiple preset keywords and multiple preset values;
[0196] Determine the first integer corresponding to each preset keyword, and the second integer corresponding to each preset value;
[0197] Based on the first correspondence between each preset keyword and the first integer, and the second correspondence between each preset value and the second integer, a preset dictionary is generated;
[0198] The binary encoding module is also used for:
[0199] Based on the preset dictionary, determine a first integer corresponding to the target keyword and a second integer corresponding to the target keyword;
[0200] The first integer corresponding to the target keyword and the second integer corresponding to the target keyword are respectively binary encoded to obtain the first encoded information corresponding to the key-value pair field.
[0201] Please see Figure 9 It illustrates an event query device, comprising:
[0202] The encoding information acquisition module 910 is used to acquire event encoding information; the event encoding information is obtained by concatenating the target encoding information corresponding to each of multiple target event sequences; the target event sequence includes multiple target events, each target event includes multiple event fields, and event field values corresponding to each of the multiple event fields; the target encoding information corresponding to the target event sequence is obtained by concatenating the second encoding information corresponding to each of the multiple fusion fields; the multiple fusion fields corresponding to each target event sequence and the second encoding information corresponding to each of the multiple fusion fields are obtained by fusing the multiple target events based on the multiple event fields of each target event and the first encoding information corresponding to each of the multiple event fields; the first encoding information corresponding to each event field is obtained by binary encoding the event field values corresponding to each of the multiple event fields.
[0203] The query condition acquisition module 920 is used to acquire event query conditions; the event query conditions include query fields and query field values corresponding to the query fields.
[0204] The event query module 930 is used to traverse the target encoding information corresponding to each of the plurality of target event sequences, determine the query region corresponding to the query field in the target encoding information corresponding to each target event sequence, and query the matching encoding information that matches the value of the query field based on the query region; the query region represents the region where the second encoding information of the fusion field that matches the query field is located.
[0205] The event determination module 940 is used to determine the target query event; the target query event has matching encoding information that matches the query field value.
[0206] Furthermore, each of the multiple event fields corresponds to first encoded information with a preset number of encoded bits;
[0207] The event query module is also used for:
[0208] Based on the preset number of bits of the second encoding information corresponding to each of the multiple fusion fields in each target event sequence, the region where the second encoding information of the multiple fusion fields is located is determined;
[0209] The region containing the second encoded information of the field that matches the query field among the plurality of fused fields is determined as the query region.
[0210] Furthermore, the plurality of event fields include key-value pair fields, wherein the event field value of the key-value pair field includes at least one key-value pair, and each key-value pair includes a target keyword and a value corresponding to the target keyword; the query field value includes query key-value pairs;
[0211] The device further includes a query key-value encoding module, used for:
[0212] Obtain a preset dictionary; the preset dictionary is generated based on a first correspondence between multiple preset keywords and a first integer, and a second correspondence between multiple preset values and a second integer;
[0213] Based on the preset dictionary, the query key-value pair is converted to an integer to obtain the query key-value integer corresponding to the query key-value pair;
[0214] The query key value integer is binary encoded to obtain the query key value encoding information;
[0215] The event query module is also used for:
[0216] Based on the query area, query the matching encoding information that matches the query key value encoding information.
[0217] The apparatus provided in the above embodiments can execute the methods provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the above embodiments can be found in the methods provided in any embodiment of this application.
[0218] This embodiment also provides a computer-readable storage medium storing at least one instruction or at least one program, which is loaded by a processor and executed as any of the methods described above in this embodiment.
[0219] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the methods described above.
[0220] Figure 10 This is a block diagram illustrating an electronic device that uses event querying, according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 10 As shown, the electronic device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an event query method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.
[0221] Figure 11 This is a block diagram illustrating an electronic device for event sequence processing according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 11 As shown, this electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an event sequence processing method.
[0222] Those skilled in the art will understand that Figure 10 and Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the electronic device to which the present disclosure is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0223] This specification provides the operational steps of the methods described in the embodiments or flowcharts, but more or fewer operational steps may be included based on conventional or non-inventive labor. The steps and order listed in the embodiments are merely one possible execution order among many steps and do not represent the only execution order. In actual system or interrupt product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).
[0224] The structure shown in this embodiment is only a partial structure related to the solution of this application and does not constitute a limitation on the device to which the solution of this application is applied. Specific devices may include more or fewer components than shown, or combinations of certain components, or arrangements of different components. It should be understood that the methods, apparatuses, etc., disclosed in this embodiment can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or unit modules through some interfaces.
[0225] Based on this understanding, the technical solution of this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0226] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this specification can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0227] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. An event sequence processing method, characterized in that, include: Obtain the target event sequence; The target event sequence includes multiple target events, each target event includes multiple event fields, and the event field value corresponding to each of the multiple event fields; The event field values corresponding to each of the multiple event fields are binary encoded to obtain the first encoded information corresponding to each event field; Based on the plurality of event fields of each target event and the first encoding information corresponding to each of the plurality of event fields, the plurality of target events are fused to obtain a plurality of fused fields corresponding to the target event sequence and a second encoding information corresponding to each of the plurality of fused fields; wherein, the second encoding information corresponding to at least one fused field is obtained by concatenating the first encoding information corresponding to the same event field in the plurality of target events; The second encoding information corresponding to each of the multiple fusion fields is concatenated to obtain the target encoding information corresponding to the target event sequence; When there are multiple target event sequences, the target encoding information corresponding to each of the multiple target event sequences is concatenated to obtain event encoding information.
2. The method according to claim 1, characterized in that, The step of binary encoding the event field values corresponding to each of the plurality of event fields to obtain the first encoded information corresponding to each event field includes: Obtain the preset encoding bit length corresponding to each of the multiple event fields; The event field value corresponding to each event field is binary encoded based on the preset encoding bit length corresponding to each event field to obtain the first encoding information corresponding to the preset encoding bit length of each event field.
3. The method according to claim 1, characterized in that, The step of fusing event fields of each target event and the first encoding information corresponding to each of the event fields to obtain multiple fused fields corresponding to the target event sequence, and the second encoding information corresponding to each of the multiple fused fields, includes: Multiple first fusion fields are determined based on the multiple event fields; each event field corresponds one-to-one with each first fusion field. The first encoded information corresponding to the same first fusion field of the multiple target events is concatenated to obtain the second encoded information corresponding to each first fusion field; The second encoding information corresponding to each of the plurality of first fusion fields is determined based on the second encoding information corresponding to each of the plurality of first fusion fields.
4. The method according to claim 1, characterized in that, The plurality of event fields include at least one target field, and each target field corresponds to one or more target field values; The step of binary encoding the event field values corresponding to each of the plurality of event fields to obtain the first encoded information corresponding to each event field includes: When a target field corresponds to multiple target field values, the multiple target field values corresponding to each target field are binary encoded to obtain the encoding information corresponding to the multiple target field values respectively. The encoded information corresponding to the values of the multiple target fields is concatenated sequentially to obtain the first encoded information corresponding to each target field.
5. The method according to claim 4, characterized in that, The step of fusing event fields of each target event and the first encoding information corresponding to each of the event fields to obtain multiple fused fields corresponding to the target event sequence, and the second encoding information corresponding to each of the multiple fused fields, includes: The value of the fusion field corresponding to the second fusion field is determined based on the number of events of the multiple target events; The value of the fusion field corresponding to the third fusion field is determined based on the total number of target field values corresponding to the target fields of the multiple target events; The value of the fusion field of the second fusion field is binary encoded to obtain the second encoded information corresponding to the second fusion field; The value of the fusion field of the third fusion field is binary encoded to obtain the second encoding information corresponding to the third fusion field; The second encoding information corresponding to each of the plurality of fusion fields is determined based on the second encoding information corresponding to the second fusion field and the second encoding information corresponding to the third fusion field.
6. The method according to claim 1, characterized in that, The plurality of event fields include key-value pair fields, wherein the event field value of the key-value pair field includes at least one key-value pair, and each key-value pair includes a target keyword and a value corresponding to the target keyword; The method further includes: Retrieve multiple preset keywords and multiple preset values; Determine the first integer corresponding to each preset keyword, and the second integer corresponding to each preset value; Based on the first correspondence between each preset keyword and the first integer, and the second correspondence between each preset value and the second integer, a preset dictionary is generated; The step of binary encoding the event field values corresponding to each of the plurality of event fields to obtain the first encoded information corresponding to each event field includes: Based on the preset dictionary, determine a first integer corresponding to the target keyword and a second integer corresponding to the target keyword; The first integer corresponding to the target keyword and the second integer corresponding to the target keyword are respectively binary encoded to obtain the first encoded information corresponding to the key-value pair field.
7. An event query method, characterized in that, include: Obtain event encoding information; The event encoding information is obtained by concatenating the target encoding information corresponding to each of multiple target event sequences; The target event sequence includes multiple target events, each target event includes multiple event fields, and the event field value corresponding to each of the multiple event fields; The target encoding information corresponding to the target event sequence is obtained by concatenating the second encoding information corresponding to each of the multiple fusion fields. The multiple fusion fields corresponding to each target event sequence and the second encoding information corresponding to each of the multiple fusion fields are obtained by fusing the multiple event fields of each target event and the first encoding information corresponding to each of the multiple event fields. The first encoding information corresponding to each event field is obtained by binary encoding the event field value corresponding to each of the multiple event fields. Retrieve event query criteria; The event query conditions include the query fields and the corresponding query field values; The target encoding information corresponding to each of the multiple target event sequences is traversed, and a query region corresponding to the query field is determined in the target encoding information corresponding to each target event sequence. Based on the query region, matching encoding information that matches the value of the query field is queried. The query region represents the area where the second encoded information of the fusion field that matches the query field is located; Identify the target query event; The target query event has matching encoding information that matches the value of the query field.
8. The method according to claim 7, characterized in that, Each of the multiple event fields corresponds to first encoded information with a preset encoding length; Determining the query region corresponding to the query field in the target encoding information corresponding to each target event sequence includes: Based on the preset number of bits of the second encoding information corresponding to each of the multiple fusion fields in each target event sequence, the region where the second encoding information of the multiple fusion fields is located is determined; The region containing the second encoded information of the field that matches the query field among the plurality of fused fields is determined as the query region.
9. The method according to claim 7, characterized in that, The plurality of event fields include key-value pair fields, wherein the event field value of the key-value pair field includes at least one key-value pair, and each key-value pair includes a target keyword and a value corresponding to the target keyword; The query field values include query key-value pairs; The method further includes: Obtain a preset dictionary; the preset dictionary is generated based on a first correspondence between multiple preset keywords and a first integer, and a second correspondence between multiple preset values and a second integer; Based on the preset dictionary, the query key-value pair is converted to an integer to obtain the query key-value integer corresponding to the query key-value pair; The query key value integer is binary encoded to obtain the query key value encoding information; The step of querying matching encoding information that matches the query field value based on the query area includes: Based on the query area, query the matching encoding information that matches the query key value encoding information.
10. An event sequence processing apparatus, characterized in that, include: The event sequence acquisition module is used to acquire the target event sequence; The target event sequence includes multiple target events, each target event includes multiple event fields, and the event field value corresponding to each of the multiple event fields; The binary encoding module is used to perform binary encoding on the event field values corresponding to each of the multiple event fields to obtain the first encoding information corresponding to each event field; The field fusion module is used to perform event field fusion on the multiple target events based on the multiple event fields of each target event and the first encoding information corresponding to each of the multiple event fields, to obtain multiple fusion fields corresponding to the target event sequence and the second encoding information corresponding to each of the multiple fusion fields; wherein, the second encoding information corresponding to at least one fusion field is obtained by concatenating the first encoding information corresponding to the same event field in the multiple target events; The first splicing module is used to splice the second encoding information corresponding to each of the multiple fusion fields to obtain the target encoding information corresponding to the target event sequence; The second splicing module is used to splice the target encoding information corresponding to each of the multiple target event sequences to obtain event encoding information when there are multiple target event sequences.
11. An event query device, characterized in that, include: The encoding information acquisition module is used to acquire event encoding information; The event encoding information is obtained by concatenating the target encoding information corresponding to each of multiple target event sequences; The target event sequence includes multiple target events, each target event includes multiple event fields, and the event field value corresponding to each of the multiple event fields; The target encoding information corresponding to the target event sequence is obtained by concatenating the second encoding information corresponding to each of the multiple fusion fields. The multiple fusion fields corresponding to each target event sequence and the second encoding information corresponding to each of the multiple fusion fields are obtained by fusing the multiple event fields of each target event and the first encoding information corresponding to each of the multiple event fields. The first encoding information corresponding to each event field is obtained by binary encoding the event field value corresponding to each of the multiple event fields. The query condition acquisition module is used to acquire event query conditions; the event query conditions include query fields and the corresponding query field values; The event query module is used to traverse the target encoding information corresponding to each of the multiple target event sequences, determine the query area corresponding to the query field in the target encoding information corresponding to each target event sequence, and query the matching encoding information that matches the value of the query field based on the query area; The query region represents the area where the second encoded information of the fusion field that matches the query field is located; The event determination module is used to determine the target query event; The target query event has matching encoding information that matches the value of the query field.
12. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the event sequence processing method as described in any one of claims 1 to 6, or the event query method as described in any one of claims 7 to 9.
13. A computer storage medium, characterized in that, The storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor using the event sequence processing method as described in any one of claims 1 to 6, or the event query method as described in any one of claims 7 to 9.