Stream data processing method, device, equipment and storage medium

By using rule identifiers in the stream data processing engine to call corresponding rule objects for matching, the problems of poor performance and high maintenance costs caused by hard coding are solved, and more efficient stream data processing is achieved.

CN115017172BActive Publication Date: 2025-09-16BEIJING HONGTENG INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110237806.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-03
Publication Date
2025-09-16
Estimated Expiration
2041-03-03

AI Technical Summary

Technical Problem

In the existing technology, the rules in the stream data processing engine need to be hard-coded, resulting in poor system performance, excessive memory consumption and high manual maintenance costs.

Method used

By obtaining the user behavior log set, event matching rule identifier and behavior matching rule identifier in the stream data processing request, and using the rule identifier to call the corresponding rule object for matching, it avoids the need for hard coding of each rule and adopts the method of dynamic parsing and rule calling.

Benefits of technology

It reduces the performance usage and manual maintenance costs of the stream data processing engine and improves the processing efficiency and flexibility of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115017172B_ABST
    Figure CN115017172B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of big data processing, and discloses a stream data processing method, apparatus, device, and storage medium. The method comprises: upon receiving a stream data processing request, obtaining a user behavior log set, an event matching rule identifier, and a behavior matching rule identifier in the stream data processing request; then matching the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain a key object; and then matching the key event according to the behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior. Since the present invention adopts a method of calling the event matching rules and the behavior matching rules in the stream data processing engine according to the rule identifier, it avoids the situation where each rule in the stream data processing engine needs to be encoded, reduces the performance of the stream data processing engine, and reduces the cost of manual system maintenance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data processing, and in particular to a stream data processing method, apparatus, device and storage medium. Background Art

[0002] With the advancement of science and technology, people's lives are becoming increasingly dependent on the internet. Consequently, big data has quietly emerged in this information age. Big data refers to collections of data that cannot be captured, managed, and processed within a specific timeframe using conventional software tools. These massive, high-growth, and diverse information assets require new processing models to enhance decision-making, insight discovery, and process optimization.

[0003] Streaming data, a type of big data, is continuously generated by thousands of data sources and is currently being used in a growing number of scenarios. When a stream data processing engine is operating, it must be processed according to specific rules. Current technology implements this rule-making by hard-coding business logic directly into Java code within the processing engine module. This approach can easily lead to poor system performance and excessive memory consumption, requiring the rewriting of relevant hard-coded code, which incurs excessive performance and wastes manual maintenance costs.

[0004] The above content is only used to assist in understanding the technical solution of the present invention and does not constitute an admission that the above content is prior art. Summary of the Invention

[0005] The main purpose of the present invention is to provide a stream data processing method, apparatus, device and storage medium, aiming to solve the technical problem that stream data processing rules need to be hard-coded.

[0006] To achieve the above object, the present invention provides a method for processing stream data, the method comprising the following steps:

[0007] Upon receiving a stream data processing request, obtaining a user behavior log set, an event matching rule identifier, and a behavior matching rule identifier in the stream data processing request;

[0008] Matching the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain key events;

[0009] The key event is matched according to the behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior.

[0010] Optionally, matching the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain key events includes:

[0011] Searching for a corresponding event matching rule object in an event rule table in a preset storage space according to the event matching rule identifier;

[0012] The user behavior logs in the user behavior log set are matched according to the event matching rule object to obtain key events.

[0013] Optionally, matching the user behavior logs in the user behavior log set according to the event matching rule object to obtain key events includes:

[0014] Matching the user behavior logs in the user behavior log set according to the event set in the event matching rule object;

[0015] According to the matching results, the successfully matched target user behavior log is defined as a key event.

[0016] Optionally, before matching the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain key events, the method includes:

[0017] Traversing the rule grammar database to obtain rule grammar entries;

[0018] Establishing an event rule table containing key event rules according to the rule grammar entries;

[0019] The event rule table is stored in a preset storage space.

[0020] Optionally, an event rule table containing key event rules is established according to the rule grammar, including:

[0021] Performing lexical analysis on the rule grammar, deleting the rule grammar with lexical errors according to the lexical analysis result, and obtaining the rule grammar to be processed;

[0022] Performing grammatical analysis on the grammar of the rule to be processed, deleting the grammatical errors of the rule according to the grammatical analysis result, and obtaining the target grammatical rule;

[0023] An event rule table including key event rules is generated according to the target grammatical rules.

[0024] Optionally, matching the key event according to the behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior includes:

[0025] Searching for a corresponding behavior matching rule object in a rule detection table in a preset storage space according to the behavior matching rule identifier;

[0026] The key events are matched according to the behavior matching rule objects to determine user behavior.

[0027] Optionally, matching the key event according to the behavior matching rule object to determine the user behavior includes:

[0028] Matching the key events according to the behavior matching rule object;

[0029] When the key event meets the rules defined by the matching rule object, the user behavior is determined according to the matching result.

[0030] Optionally, before searching a rule detection table in a preset storage space for a corresponding behavior matching rule object according to the behavior matching rule identifier, the method includes:

[0031] Establish a rule detection table containing complex event screening rules based on key event rules;

[0032] The rule detection table is stored in a preset storage space.

[0033] Optionally, a rule detection table containing complex event screening rules is established based on key event rules, including:

[0034] Performing lexical analysis on the key event rule grammar, deleting key event rules with lexical errors according to the lexical analysis result, and obtaining a key event rule grammar to be processed;

[0035] Performing grammatical analysis on the grammar of the key event rule to be processed, deleting the key event rule with errors according to the grammatical analysis result, and obtaining the target key event rule;

[0036] A rule detection table including complex event screening rules is generated according to the target key event rules.

[0037] Optionally, upon receiving a stream data processing request, after obtaining the user behavior log set, event matching rule identifier, and behavior matching rule identifier in the stream data processing request, the following steps are included:

[0038] According to the event matching rule identifier and the behavior matching rule identifier, query whether there is a historical analysis result in the rule status table;

[0039] When the historical analysis result exists, key events or user behaviors are extracted from the stream data corresponding to the stream data processing request according to the historical analysis result.

[0040] Optionally, after querying the event matching rule identifier and the behavior matching rule identifier in the rule status table, the method includes:

[0041] When the historical analysis result does not exist, the step of matching the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier is performed to obtain key events.

[0042] In addition, to achieve the above-mentioned object, the present invention further provides a stream data processing device, comprising:

[0043] The acquisition module is used to obtain the user behavior log set, event matching rule identifier and behavior matching rule identifier in the stream data processing request when receiving the stream data processing request;

[0044] An extraction module, configured to match the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain key events;

[0045] A matching module, configured to match the key event according to the behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior;

[0046] Optionally, the extraction module is further used to search for a corresponding event matching rule object in an event rule table in a preset storage space according to the event matching rule identifier; and match the user behavior logs in the user behavior log set according to the event matching rule object to obtain key events.

[0047] Optionally, the extraction module is further used to match the user behavior logs in the user behavior log set according to the event matching rule object to obtain key events; match the user behavior logs in the user behavior log set according to the event set in the event matching rule object; and define the successfully matched target user behavior log as a key event based on the matching result.

[0048] Optionally, the matching module is further configured to search for a corresponding behavior matching rule object in a rule detection table in a preset storage space according to the behavior matching rule identifier; and match the key event according to the behavior matching rule object to determine the user behavior.

[0049] Optionally, the matching module is further configured to match the key event according to the behavior matching rule object; and when the key event satisfies a rule defined by the matching rule object, determine the user behavior according to the matching result.

[0050] Optionally, the stream data processing device further includes: a query module;

[0051] The adjustment module is used to query whether there is a historical analysis result in the rule status table according to the event matching rule identifier and the behavior matching rule identifier; when the historical analysis result exists, extract key events or user behaviors from the stream data corresponding to the stream data processing request according to the historical analysis result.

[0052] Optionally, the query module is further configured to extract key events or user behaviors from the stream data corresponding to the stream data processing request according to the historical analysis results when the historical analysis results exist.

[0053] In addition, to achieve the above-mentioned purpose, the present invention also proposes a stream data processing device, which includes: a memory, a processor, and a stream data processing generation program stored in the memory and executable on the processor, wherein the stream data processing program is configured to implement the steps of the stream data processing method described above.

[0054] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a stream data processing program is stored. When the stream data processing program is executed by a processor, the steps of the stream data processing generation method described above are implemented.

[0055] The present invention obtains the user behavior log set, event matching rule identifier, and behavior matching rule identifier in the stream data processing request upon receiving the stream data processing request; then matches the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain the key object; and then matches the key event according to the behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior. Since the present invention adopts the method of calling the event matching rules and behavior matching rules in the stream data processing engine according to the rule identifier, it avoids the situation where each rule in the stream data processing engine needs to be encoded, reduces the performance of the stream data processing engine, and reduces the cost of manual system maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a structural diagram of a stream data processing device in a hardware operating environment involved in an embodiment of the present invention;

[0057] Figure 2 This is a flow chart of a first embodiment of a method for processing stream data according to the present invention;

[0058] Figure 3 This is a flow chart of a second embodiment of a method for processing stream data according to the present invention;

[0059] Figure 4 Schematic diagram of the flow of the third embodiment of the stream data processing method of the present invention;

[0060] Figure 5 This is a structural block diagram of the first embodiment of the stream data processing device of the present invention.

[0061] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0062] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0063] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a stream data processing device in the hardware operating environment involved in an embodiment of the present invention.

[0064] like Figure 1 As shown, the stream data processing device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0065] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the stream data processing device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0066] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module and a stream data processing program.

[0067] exist Figure 1In the stream data processing device shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the stream data processing device of the present invention can be set in the stream data processing device. The stream data processing device calls the stream data program stored in the memory 1005 through the processor 1001 and executes the stream data processing method provided by the embodiment of the present invention.

[0068] The embodiment of the present invention provides a method for processing stream data. Figure 2 , Figure 2 FIG. 1 is a flow chart of a first embodiment of a method for processing stream data according to the present invention.

[0069] In this embodiment, the stream data processing method includes the following steps:

[0070] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0071] Step S10: upon receiving a stream data processing request, obtaining the user behavior log set, event matching rule identifier, and behavior matching rule identifier in the stream data processing request;

[0072] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a smartphone, tablet computer, personal computer, etc., or other devices capable of performing the above functions, and this embodiment does not limit this. This embodiment and the following embodiments will be specifically described using a stream data processing device as an example.

[0073] It's important to note that stream data is a sequence of data that arrives sequentially, in large quantities, quickly, and continuously. Generally, a data stream can be considered a dynamic data set that grows infinitely over time. For example, data generated by online applications such as shopping websites, aerospace, and weather data is stream data.

[0074] It is understood that user behavior logs include user behavior traces, traffic logs, etc., which are the behavioral data (visits, browsing, searches, clicks, etc.) generated each time a user visits a website. For example, if a user visits a website, the website will record the user's behavior, including the addresses visited, search results, and click records during the browsing process.

[0075] It should be noted that the event matching rule identifier is an identifier carried by the data in the user log set in the stream data. It is used to request the stream data processing engine to process the corresponding processing rule. For example, after obtaining stream data containing user logs, event A in the stream data carries an event matching identifier, which is used to request the stream data processing engine to process event A according to the event matching rule.

[0076] It can be understood that the behavior matching rule identifier is an identifier carried in a specific event and is used to request the corresponding processing rule from the stream data processing engine so that the stream data processing engine can process the specific event. For example, after receiving a key event, the behavior matching rule identifier in the key event will request the stream data processing engine to process it into a complex behavior event set with high-level semantics, that is, a specific behavior.

[0077] Step S20: matching the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain key events;

[0078] It can be understood that the event matching rule object is a rule applicable to the stream data processing engine, which is used to specify the specific processing method of the stream data processing engine on the user log.

[0079] It should be noted that the event matching object corresponding to the event matching rule identifier is obtained by searching the rule table in the internal database by the stream data processing engine.

[0080] In practice, the stream data processing engine matches user logs against specific events defined in the event matching rules. When a matching event occurs, it defines it as a key event. For example, if the event matching rule is "download," the stream data processing engine matches user logs against the event matching rule and defines all events containing the "download" behavior in the user log as key events.

[0081] It is understandable that the defined key events are events generated according to event matching rules, and are events generated under the rule definitions.

[0082] Step S30: matching the key event according to the behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior;

[0083] It is understood that a behavior matching rule object is a rule applicable to a stream data processing engine, which is used to define a behavior composed of complex events. For example, a behavior matching rule can be specified as: click on webpage A, and download content related to C on webpage A.

[0084] It should be noted that the behavior matching rule object corresponding to the behavior matching rule identifier is obtained by searching the rule table in the internal database by the stream data processing engine.

[0085] In a specific implementation, the stream data processing engine matches the key events based on the behavior matching rule objects. When an object that meets the behavior matching rule appears, the event is defined as a user behavior. For example, if the behavior matching rule is: click on webpage A, then download content related to C from webpage A, the stream data processing engine matches the key events based on the behavior matching rule. When the event of clicking on webpage A and the event of downloading content related to C from webpage A occurs, the event is defined as a user behavior.

[0086] Furthermore, for the sake of stream data processing efficiency, before step S10, the following steps are further included:

[0087] Step S01: querying whether there is a historical analysis result in the rule status table according to the event matching rule identifier and the behavior matching rule identifier;

[0088] Step S02: when the historical analysis result exists, extract key events or user behaviors from the stream data corresponding to the stream data processing request according to the historical analysis result.

[0089] Step S03: When the historical analysis result does not exist, performing the step of matching the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain key events.

[0090] It should be noted that the historical analysis results are records generated when the stream data processing engine performs rule analysis based on event matching rule identifiers and behavior matching rule identifiers during operation.

[0091] In a specific implementation, according to the event matching rule identifier and the behavior matching rule identifier, the rule status table is queried to see whether there is a historical parsing result, and the rule status table is traversed to find whether there is a historical parsing result for the event matching rule identifier and the behavior matching rule identifier.

[0092] It is understood that, when the historical parsing results exist, extracting key events or user behaviors from the stream data corresponding to the stream data processing request based on the historical parsing results means that after the historical parsing results exist, the stream data processing engine directly calls the historical records to process the stream data. For example, when the stream data processing engine processes stream data containing user logs, it has already generated corresponding rules for event A. When it subsequently receives a rule matching request for event A, the stream data processing engine obtains the historical parsing results for the rules of event A and directly applies the parsing results to match event A in the stream data.

[0093] In a specific implementation, when the historical parsing result does not exist, the step of matching the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain the key event can be understood as when there is no historical parsing result, the rule request is deemed to be the first rule request, and step S10 is executed. For example: when the stream data processing engine is processing stream data containing user logs, the stream data processing engine queries the rule application for event A through the rule status table as the first application. There is no matching rule for event A in the rule status table. Then, when the rule engine receives the stream data processing request, it executes the step of obtaining the user behavior log set, event matching rule identifier, and behavior matching rule identifier in the stream data processing request.

[0094] This example obtains the user behavior log set, event matching rule identifier, and behavior matching rule identifier in the stream data processing request upon receiving the stream data processing request; then matches the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain the key object; and then matches the key event according to the behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior. Since the present invention adopts the method of calling the event matching rules and behavior matching rules in the stream data processing engine according to the rule identifier, it avoids the situation where each rule in the stream data processing engine needs to be encoded, reduces the performance of the stream data processing engine, and reduces the cost of manual system maintenance.

[0095] refer to Figure 3 , Figure 3 FIG. 2 is a flow chart of a second embodiment of a method for processing stream data according to the present invention.

[0096] Based on the above first embodiment, in this embodiment, step S20 includes:

[0097] Step S201: searching for a corresponding event matching rule object in an event rule table in a preset storage space according to the event matching rule identifier;

[0098] It is understood that the event rule table is a table containing a series of key event matching rules. For example, when the event rule table contains event matching rule A, the stream data processing engine will process the stream data containing user logs according to the event rule table to match event A in the user log.

[0099] It should be noted that the event matching rule object is a rule tree generated by the event rule table and applicable to the stream data processing engine.

[0100] It is understood that the preset storage space is established and generated in the database and includes an event rule table. Furthermore, the preset storage space includes an event rule table with a mapping relationship for mapping event matching rule identifiers to event matching rule objects. Once an event matching rule identifier is determined, the corresponding event matching rule object can be searched for using the event rule table in the preset storage space.

[0101] Furthermore, in order to improve the efficiency of stream data processing, before step S201, the following steps are included:

[0102] Step S101: traverse the rule grammar database to obtain rule grammar entries;

[0103] Step S102: creating an event rule table containing key event rules according to the rule grammar entries;

[0104] Step S103: storing the event rule table in a preset storage space.

[0105] In a specific implementation, traversing the rule grammar database is specifically performed by performing a paged loop traversal or a chain traversal with an index on the database to obtain all grammar entries in the database.

[0106] It will be appreciated that the rule grammar is the basic rule language stored in the database.

[0107] In a specific implementation, establishing an event rule table containing key event rules according to the rule grammar entries specifically includes the following steps:

[0108] Performing lexical analysis on the rule grammar, deleting the rule grammar with lexical errors according to the lexical analysis result, and obtaining the rule grammar to be processed;

[0109] Performing grammatical analysis on the grammar of the rule to be processed, deleting the grammatical errors of the rule according to the grammatical analysis result, and obtaining the target grammatical rule;

[0110] An event rule table including key event rules is generated according to the target grammatical rules.

[0111] Step S202: Match the user behavior logs in the user behavior log set according to the event matching rule object to obtain key events.

[0112] In practice, the event matching rule object defines specific event rules. The stream data processing engine then matches user behavior logs against these specific events to obtain key events. For example, if the event matching rule object defines the matching rule as "opening website A," the stream data processing engine will match the event "opening website A" in the log set to obtain key events when processing stream data containing user logs.

[0113] This embodiment searches for a corresponding event matching rule object in an event rule table in a preset storage space based on the event matching rule identifier; then matches the user behavior logs in the user behavior log set against the event matching rule object to obtain key events. By dynamically parsing the rules of the stream data request containing the user log, an event rule matching object is established, avoiding the need to hard-code rule entries one by one in software, further addressing the performance issues associated with traditional rule writing.

[0114] refer to Figure 4 , Figure 4 FIG. 4 is a flow chart of a third embodiment of a stream data processing method according to the present invention.

[0115] Based on the above first embodiment, in this embodiment, step S30 includes:

[0116] Step S301: searching for a corresponding behavior matching rule object in a rule detection table in a preset storage space according to the behavior matching rule identifier;

[0117] It should be noted that the behavior matching rule object is a rule tree generated by the rule detection table and suitable for the stream data processing engine.

[0118] It is understood that behavior matching rules specifically encompass a series of complex key events. For example, if the behavior matching rule is opening webpage A and downloading content C, the stream data processing engine will match key events based on the behavior matching rule. If a series of events, namely, opening webpage A and downloading content C, occurs, it is defined as a user behavior.

[0119] In order to further improve the efficiency of stream data processing, before step S301, the following steps are included:

[0120] Step S2021: establishing a rule detection table including complex event screening rules according to key event rules;

[0121] Step S2022: storing the rule detection table into a preset storage space.

[0122] In a specific implementation, establishing a rule detection table containing complex event screening rules based on key event rules specifically includes the following steps:

[0123] Performing lexical analysis on the key event rule grammar, deleting key event rules with lexical errors according to the lexical analysis result, and obtaining a key event rule grammar to be processed;

[0124] Performing grammatical analysis on the grammar of the key event rule to be processed, deleting the key event rule with errors according to the grammatical analysis result, and obtaining the target key event rule;

[0125] A rule detection table including complex event screening rules is generated according to the target key event rules.

[0126] Step S302: Match the key events according to the behavior matching rule object to determine the user behavior.

[0127] In practice, the behavior matching rule object is responsible for defining the rules for a behavior consisting of a series of complex key events. The stream data processing engine matches key events against the defined event components to obtain user behaviors. For example, the matching rule defined in the current behavior matching rule object is: log in to website A, download content C from website A, and save the downloaded file C to the desktop. When processing key events, the stream data processing engine defines the series of consecutive events—log in to website A, download content C from website A, and save the downloaded file C to the desktop—as user behaviors.

[0128] This embodiment searches for a corresponding behavior matching rule object in a rule detection table in a preset storage space based on the behavior matching rule identifier; then matches the key event against the behavior matching rule object to determine user behavior. Dynamically parsing key event rules to match behavioral features composed of complex events avoids hard-coding rule entries one by one in software, further addressing the performance overhead of traditional rule writing.

[0129] Reference Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the stream data processing device of the present invention.

[0130] like Figure 5 As shown, the stream data processing device proposed in the embodiment of the present invention includes:

[0131] The acquisition module 10 is configured to obtain the user behavior log set, event matching rule identifier, and behavior matching rule identifier in the stream data processing request upon receiving the stream data processing request;

[0132] An extraction module 20 is configured to match the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain key events;

[0133] A matching module 30 is configured to match the key event according to the behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior;

[0134] This example obtains the user behavior log set, event matching rule identifier, and behavior matching rule identifier in the stream data processing request upon receiving the stream data processing request; then matches the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain the key object; and then matches the key event according to the behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior. Since the present invention adopts the method of calling the event matching rules and behavior matching rules in the stream data processing engine according to the rule identifier, it avoids the situation where each rule in the stream data processing engine needs to be encoded, reduces the performance of the stream data processing engine, and reduces the cost of manual system maintenance.

[0135] In one embodiment, the extraction module 20 searches for a corresponding event matching rule object in an event rule table of a preset storage space according to the event matching rule identifier; and matches the user behavior logs in the user behavior log set according to the event matching rule object to obtain key events.

[0136] In one embodiment, the extraction module 20 is further configured to match the user behavior logs in the user behavior log set according to the event set in the event matching rule object; and define the successfully matched target user behavior log as a key event according to the matching result.

[0137] In one embodiment, the matching module 30 searches for a corresponding behavior matching rule object in a rule detection table in a preset storage space according to the behavior matching rule identifier; and matches the key event according to the behavior matching rule object to determine the user behavior.

[0138] In one embodiment, the matching module 30 is further configured to determine the user behavior according to the matching result when the key event satisfies the rule defined by the matching rule object.

[0139] In one embodiment, the stream data processing apparatus further includes: a query module;

[0140] The query module is used to query whether there is a historical analysis result in the rule status table based on the event matching rule identifier and the behavior matching rule identifier; when the historical analysis result exists, extract key events or user behaviors from the stream data corresponding to the stream data processing request based on the historical analysis result; when the historical analysis result exists, extract key events or user behaviors from the stream data corresponding to the stream data processing request based on the historical analysis result.

[0141] It should be understood that the above is only an example and does not constitute any limitation to the technical solution of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any limitation on this.

[0142] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of the embodiment scheme, and no limitation is made here.

[0143] In addition, for technical details not fully described in this embodiment, please refer to the stream processing method provided in any embodiment of the present invention, and will not be repeated here.

[0144] In addition, it should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0145] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0146] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0147] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for processing stream data, characterized in that: The following steps are involved: Upon receiving a stream data processing request, obtaining a user behavior log set, an event matching rule identifier, and a behavior matching rule identifier in the stream data processing request; Matching the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain key events; Matching the key event according to the behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior, wherein the behavior matching rule object is obtained by searching the rule detection table in a preset storage space through the behavior matching rule identifier; Before matching the key event according to the behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior, the method includes: Analyze the key event rules, and delete the key event rules with lexical errors and grammatical errors according to the analysis results to obtain the target key event rules; Generating a rule detection table including complex event screening rules according to the target key event rules; The rule detection table is stored in a preset storage space.

2. The method according to claim 1, wherein The matching the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain key events includes: Searching for a corresponding event matching rule object in an event rule table in a preset storage space according to the event matching rule identifier; The user behavior logs in the user behavior log set are matched according to the event matching rule object to obtain key events.

3. The method according to claim 2, wherein Matching the user behavior logs in the user behavior log set according to the event matching rule object to obtain key events includes: Matching the user behavior logs in the user behavior log set according to the event set in the event matching rule object; According to the matching results, the successfully matched target user behavior log is defined as a key event.

4. The method according to claim 1, wherein Before matching the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain key events, the method includes: Traversing the rule grammar database to obtain rule grammar entries; Establishing an event rule table containing key event rules according to the rule grammar entries; The event rule table is stored in a preset storage space.

5. The method according to claim 4, wherein The step of establishing an event rule table containing key event rules according to the rule grammar includes: Performing lexical analysis on the rule grammar, deleting the rule grammar with lexical errors according to the lexical analysis result, and obtaining the rule grammar to be processed; Performing grammatical analysis on the grammar of the rule to be processed, deleting the grammatical errors of the rule according to the grammatical analysis result, and obtaining the target grammatical rule; An event rule table including key event rules is generated according to the target grammatical rules.

6. The method according to claim 1, wherein The matching the key event according to the behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior includes: Searching for a corresponding behavior matching rule object in a rule detection table in a preset storage space according to the behavior matching rule identifier; The key events are matched according to the behavior matching rule objects to determine user behavior.

7. The method according to claim 6, wherein Matching the key event according to the behavior matching rule object to determine the user behavior includes: Matching the key events according to the behavior matching rule object; When the key event meets the rules defined by the matching rule object, the user behavior is determined according to the matching result.

8. The method according to claim 1, wherein The key event rules are analyzed, and key event rules with lexical errors and grammatical errors are deleted according to the analysis results to obtain target key event rules, including: Performing lexical analysis on the key event rules, deleting the key event rules with lexical errors according to the lexical analysis results, and obtaining the grammar of the key event rules to be processed; A syntax analysis is performed on the syntax of the key event rule to be processed, and key event rules with syntax errors are deleted according to the syntax analysis result to obtain target key event rules.

9. The method according to any one of claims 1 to 8, wherein Upon receiving the stream data processing request, after obtaining the user behavior log set, the event matching rule identifier, and the behavior matching rule identifier in the stream data processing request, the method further includes: According to the event matching rule identifier and the behavior matching rule identifier, query whether there is a historical analysis result in the rule status table; When the historical analysis result exists, key events or user behaviors are extracted from the stream data corresponding to the stream data processing request according to the historical analysis result.

10. The method according to claim 9, wherein After querying the event matching rule identifier and the behavior matching rule identifier in the rule status table, the following steps are included: When the historical analysis result does not exist, the step of matching the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier is performed to obtain key events.

11. A stream data processing device, characterized in that: The stream data processing device comprises: The acquisition module is used to obtain the user behavior log set, event matching rule identifier and behavior matching rule identifier in the stream data processing request when receiving the stream data processing request; An extraction module, configured to match the user behavior logs in the user behavior log set according to the event matching rule object corresponding to the event matching rule identifier to obtain key events; a matching module, configured to match the key event according to a behavior matching rule object corresponding to the behavior matching rule identifier to determine the user behavior, wherein the behavior matching rule object is obtained by searching a rule detection table in a preset storage space by the behavior matching rule identifier; The matching module is also used to analyze the key event rules, delete the key event rules with lexical errors and grammatical errors according to the analysis results, and obtain the target key event rules; generate a rule detection table containing complex event screening rules according to the target key event rules; and store the rule detection table in a preset storage space.

12. The device according to claim 11, wherein The extraction module is further configured to search for a corresponding event matching rule object in an event rule table in a preset storage space according to the event matching rule identifier; and match the user behavior logs in the user behavior log set according to the event matching rule object to obtain key events.

13. The device according to claim 12, wherein The extraction module is further configured to match the user behavior logs in the user behavior log set according to the event set in the event matching rule object; and define the successfully matched target user behavior log as a key event according to the matching result.

14. The device according to claim 11, wherein The matching module is further configured to search for a corresponding behavior matching rule object in a rule detection table in a preset storage space according to the behavior matching rule identifier; and match the key event according to the behavior matching rule object to determine the user behavior.

15. The device according to claim 14, wherein The matching module is further configured to match the key event according to the behavior matching rule object; and when the key event satisfies the rule defined by the matching rule object, determine the user behavior according to the matching result.

16. The device according to claim 11, wherein The stream data processing device further includes: a query module; the query module is used to query whether there is a historical analysis result in the rule state table according to the event matching rule identifier and the behavior matching rule identifier; The query module is further configured to extract key events or user behaviors from the stream data corresponding to the stream data processing request according to the historical analysis results when the historical analysis results exist.

17. A stream data processing device, characterized in that: The stream data processing device includes: a memory, a processor, and a stream data processing program stored in the memory and executable on the processor, wherein the stream data processing program is configured to implement the steps of the stream data processing method according to any one of claims 1 to 10.

18. A storage medium, characterized in that The storage medium stores a stream data processing program, which, when executed by a processor, implements the steps of the stream data processing and generation method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Data analysis method and device, equipment and storage medium

    CN109474643A

  • User behavior data processing method and device, computer equipment and storage medium

    CN112017007A