Message processing method, system, electronic device, storage medium and program product

CN123020516APending Publication Date: 2026-10-30ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510562960.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0003]相关技术中,消息通知服务器对接收到的事件消息进行过滤处理,对于高流量场景中包含的大量无效事件消息,需要额外的机器资源来处理过滤逻辑,计算压力大且资源成本高

Benefits of technology

[0011]根据本申请实施例的方法,消息处理客户端可以接收来自云服务端的各事件消息,这些事件消息是用户终端基于预定云资源进行数据处理时触发的。基于来自消息处理服务端的消息过滤规则对这些事件消息进行过滤,消息过滤规则与用户终端提交的规则构建需求相匹配,可以明确指示用户终端指定的与预定云资源相关的数据对象。通过获取的消息过滤规则对事件消息进行过滤,有利于得到满足消息过滤需求的事件消息。并且,在消息处理客户端对各事件消息执行消息过滤,有利于将消息过滤的处理逻辑与消息处理服务端解耦,从而可以有效降低消息处理服务端的资源压力和资源成本,提升系统的整体稳定性和可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123020516A_ABST
    Figure CN123020516A_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of message processing method, system, electronic equipment, storage medium and program product, it is related to computer technical field, method includes: receiving each event message sent by cloud server, each event message is triggered based on predetermined cloud resource by user terminal data processing;Message filtering rule from message processing server is obtained, message filtering rule matches the rule construction demand submitted by user terminal, and rule construction demand is used to indicate the data object related to predetermined cloud resource specified by user terminal;Each event message is filtered based on message filtering rule.According to the scheme of the embodiment of the application, it is beneficial to reduce the resource pressure and resource cost of message processing server, improve the overall stability and reliability of system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a message processing method, system, electronic device, storage medium, and program product. Background Technology

[0002] In cloud service scenarios, data processing based on cloud resources triggers the generation of corresponding event messages. These event messages are then distributed to multiple downstream applications via message notification servers for further processing. In real-world scenarios, due to the large number of downstream applications, each event message is repeatedly distributed, causing the total number of messages to increase exponentially. Downstream applications then need to filter and discard useless messages, thus increasing the system load. Therefore, message filtering is necessary during the message flow process to reduce the flow of useless messages.

[0003] In related technologies, message notification servers filter received event messages. For high-traffic scenarios with a large number of invalid event messages, additional machine resources are needed to process the filtering logic, resulting in high computational pressure and resource costs. Summary of the Invention

[0004] This application provides a message processing method, system, electronic device, storage medium, and program product to alleviate or solve one or more technical problems existing in the prior art.

[0005] In a first aspect, embodiments of this application provide a message processing method applied to a message processing client. The method includes: receiving event messages sent by a cloud server, wherein each event message is triggered by a user terminal performing data processing based on predetermined cloud resources; obtaining message filtering rules from the message processing server, wherein the message filtering rules match a rule construction requirement submitted by the user terminal, the rule construction requirement being used to indicate a data object specified by the user terminal that is related to the predetermined cloud resources; and filtering the event messages based on the message filtering rules.

[0006] Secondly, embodiments of this application provide a message processing method applied to a message processing server. The method includes: obtaining a rule building requirement submitted by a user terminal, the rule building requirement indicating a data object related to a predetermined cloud resource specified by the user terminal; matching the data object with rule templates in a rule template library to generate a message filtering rule matching the rule building requirement; and sending the message filtering rule to a message processing client, the message filtering rule enabling the message processing client to filter event messages, wherein each event message is triggered by the user terminal performing data processing based on the predetermined cloud resource.

[0007] Thirdly, embodiments of this application provide a message processing system, including: a cloud server, a message processing server, and a message processing client; the cloud server is used to send event messages triggered by data processing by a user terminal based on predetermined cloud resources to the message processing client; the message processing server is used to obtain rule building requirements submitted by the user terminal, the rule building requirements being used to indicate data objects specified by the user terminal related to the predetermined cloud resources; match the data objects with rule templates in a rule template library to generate message filtering rules matching the rule building requirements; and send the message filtering rules to the message processing client; the message processing client is used to receive the event messages, obtain the message filtering rules, and filter the event messages based on the message filtering rules.

[0008] Fourthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor implements any of the methods of embodiments of this application when executing the computer program.

[0009] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method of any one of the embodiments of this application.

[0010] Sixthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements any of the methods described in the embodiments of this application.

[0011] According to the method in this application embodiment, a message processing client can receive various event messages from a cloud server. These event messages are triggered when a user terminal processes data based on predetermined cloud resources. These event messages are filtered based on message filtering rules from the message processing server. These filtering rules match the rule construction requirements submitted by the user terminal and can explicitly indicate the data objects related to the predetermined cloud resources specified by the user terminal. Filtering event messages using the obtained message filtering rules helps to obtain event messages that meet the message filtering requirements. Furthermore, performing message filtering on each event message on the message processing client helps to decouple the message filtering processing logic from the message processing server, thereby effectively reducing the resource pressure and resource cost of the message processing server and improving the overall stability and reliability of the system.

[0012] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application, it can be implemented according to the contents of the specification. In order to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description

[0013] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments according to this application and should not be construed as limiting the scope of this application.

[0014] Figure 1 This application illustrates relevant scenario diagrams as examples;

[0015] Figure 2 A flowchart of a message processing method according to an embodiment of this application is shown;

[0016] Figure 3 This diagram illustrates the lifecycle management of a rule object pool, as shown in an exemplary embodiment of this application.

[0017] Figure 4 This diagram illustrates a method for managing message filtering rules in a message processing client according to an embodiment of this application.

[0018] Figure 5 A flowchart illustrating another embodiment of the message processing method of this application is shown;

[0019] Figure 6 A flowchart illustrating the rule processing and verification mechanism of the message processing server in an embodiment of this application is shown.

[0020] Figure 7 A schematic diagram of the system architecture illustrating an exemplary embodiment of this application is shown;

[0021] Figure 8 This diagram illustrates the structure of a message processing apparatus according to an embodiment of this application.

[0022] Figure 9 This diagram illustrates the structure of a message processing apparatus according to an embodiment of this application.

[0023] Figure 10 This diagram illustrates the structure of a message processing system according to an embodiment of this application.

[0024] Figure 11 This is a block diagram of an electronic device used to implement embodiments of this application. Detailed Implementation

[0025] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the concept or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.

[0026] To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and all of them fall within the protection scope of the embodiments of this application.

[0027] In cloud computing-related data stream processing, data plane state operations of cloud products such as Object Storage Service (OSS), DirectMail (DM), and Simple Log Service (SLS) trigger the generation of numerous event messages. Object Storage Service is a cloud-provided storage service used to store and manage unstructured data. DirectMail is a cloud-provided bulk email service used for sending transactional, notification, and batch emails. Simple Log Service is a cloud-native log processing platform used to manage and analyze log data. Data plane state operations include, but are not limited to, at least one of the following operations performed on data in cloud resources: creation, reading, modification, uploading, downloading, copying, deletion, and restoration. These operations cause changes in data state, thereby triggering the generation of event messages. These event messages can be used to describe changes in data state, such as file upload completed, file deleted, task execution completed, etc.

[0028] Cloud computing data flows across multiple fields, such as intelligent driving vehicles, intelligent transportation, telecommunications, logistics, and environmental monitoring. The following section will combine... Figure 1 Taking the field of intelligent driving vehicles as an example, this paper describes the data upload and processing chain of the vehicle end in related technologies.

[0029] Figure 1 The diagram illustrates relevant scenarios exemplified by this application. For example... Figure 1 As shown, the vehicle uploads data to the object storage service via link 1. When the object storage service detects a change in data status, it triggers a data change event. The cloud server then sends these events to the Simple Message Queue server via link 2, so that the Simple Message Queue can distribute these events to downstream applications, including but not limited to... Figure 1 Downstream applications 11 and 12 are shown in the figure.

[0030] In real-world scenarios, with the continuous increase in the number of cars, Figure 1The increasing data volume transmitted via Link 1 puts immense pressure on the object storage service and subsequent links. In Link 2, all event messages generated by the object storage service are routed to multiple downstream applications via the message notification service. Due to the large number of downstream applications (e.g., at least two), each event message is repeatedly distributed, causing the total message volume to multiply. However, over 90% of these messages are likely useless. Useless messages include, for example, temporary files generated during data processing and events generated during development and testing. Downstream applications require additional computing resources to filter and discard these useless messages, further increasing the system burden.

[0031] It is evident that vendors face significant cost pressures in high-data-traffic scenarios. Furthermore, in extreme scenarios (such as sudden surges in traffic), massive requests (data upload requests and / or event notification requests, etc.) may result in core data not receiving priority protection. Therefore, it is necessary to identify data characteristics and filter out invalid traffic during message flow, retaining only important traffic for processing, thereby reducing the flow of useless messages. It should be understood that current cloud products that push notifications to services or products that use message queues for message relay face similar issues, demonstrating the widespread universality of message filtering requirements.

[0032] In related technologies, message services provided by object storage services can support configuring event notifications for a single bucket, supporting only prefix matching rules, or matching rules for prefixes, suffixes, and combinations of prefixes and suffixes. However, this method only supports the granularity of a single bucket and cannot configure unified rules across multiple buckets. When multiple buckets are involved, rules need to be configured repeatedly, leading to an increased number of rules and high rule maintenance costs. Furthermore, this method only supports prefixes, suffixes, and prefixes and suffixes, so it can only distribute known valid messages, lacking the ability to filter known invalid message characteristics, failing to effectively reduce useless traffic, and exhibiting insufficient rule flexibility.

[0033] In related technologies, events can also be automatically collected, processed, and distributed through the Eventbridge of object storage services. It supports configuring event notifications for single and multiple buckets, and supports matching rules for prefixes, suffixes, and combinations of prefixes and suffixes. However, its filtering logic runs on the server side of the event bus, and invalid messages in the actual traffic directly increase the computational pressure on the event bus. In high-traffic scenarios (especially when containing a large number of invalid messages), additional machine resources are required to process the filtering logic, resulting in high resource costs. Furthermore, when the service provided by the event bus fails, or when the network link from the object storage service to the event bus is abnormal (e.g., only allowing small-scale network traffic to pass), because the filtering rules run on the server side of the event bus, events cannot reach the event bus, and the system cannot filter event messages. This may lead to critical data not being processed in a timely manner, thereby causing system stability and reliability issues.

[0034] It should be noted that the application scenarios or examples provided in the embodiments of this application are for ease of understanding, and the embodiments of this application do not specifically limit the application of the technical solutions. In addition, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0035] The technical solution of this application and how it solves the aforementioned technical problems are described in detail below with specific embodiments. The listed specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0036] Figure 2 A flowchart illustrating a message processing method according to an embodiment of this application is shown. Figure 2 As shown, the method may include steps S201, S202 and S203.

[0037] S201, receive various event messages sent by the cloud server. Each event message is triggered by the user terminal performing data processing based on predetermined cloud resources.

[0038] S202, Obtain message filtering rules from the message processing server. The message filtering rules match the rule building requirements submitted by the user terminal. The rule building requirements are used to instruct the user terminal on the data objects related to the reserved cloud resources.

[0039] S203, filter event messages based on message filtering rules.

[0040] According to the method in this application embodiment, the message processing client can receive various event messages from the cloud server. These event messages are triggered when the user terminal performs data processing based on predetermined cloud resources. These event messages are filtered based on message filtering rules from the message processing server. The message filtering rules match the rule construction requirements submitted by the user terminal, explicitly indicating the data objects related to the predetermined cloud resources specified by the user terminal. Filtering event messages using the obtained message filtering rules helps obtain data that meets the user's filtering requirements. Furthermore, performing message filtering on each event message on the message processing client helps decouple the message filtering processing logic from the server, thereby effectively reducing the resource pressure and cost of the message processing server and improving the overall stability and reliability of the system.

[0041] In step S201, the reserved cloud resources include various service resources provided by the cloud server. These include, but are not limited to, cloud object storage resources, cloud log service resources, and cloud email service resources. These resources can be understood as computing, storage, network, and other services or components used and managed by the user. In a cloud computing environment, the reserved cloud resources support event notification functionality, which can send event messages triggered by data processing performed by the user terminal based on the reserved cloud resources to the message processing client.

[0042] In some embodiments, according to the allocated resource capacity, the predetermined cloud resources may include multiple resource units, each of which may be referred to as a resource object. The resource object is used to store data objects, and the data objects are used to indicate specific data content.

[0043] For example, if the reserved cloud resource is a cloud object storage resource, then the resource object is a storage bucket or storage space, and the data object is information such as files, pictures, and videos stored in the storage bucket. If the reserved cloud resource is a cloud log service resource, then the resource object may include log projects, and the data object includes log data stored in the log projects. If the reserved cloud resource is a cloud email service resource, then the resource object includes email folders, and the data object includes email files organized and managed through the email folders.

[0044] In step S202, obtaining message filtering rules from the message processing server can be implemented in several ways. For example, the message processing client can send a rule request to the message processing server, the rule request containing a user identifier, which can be used to identify the target user. The rule request is used to request the message filtering rules for that target user. The message processing client receives the message filtering rules corresponding to the user identifier returned by the message processing server in response to the rule request. As another example, the message processing client can receive message filtering rules generated and sent by the message processing server in real time. The message processing client does not need to request them; the message processing server can send the message filtering rules to the message processing client as long as it generates message filtering rules that match the rule construction requirements submitted by the user terminal.

[0045] It should be understood that message filtering rules are generated on the message processing server. Message processing clients can obtain message filtering rules from the message processing server in various ways, and this application embodiment does not make specific limitations.

[0046] In some embodiments, the step of filtering each event message based on message filtering rules in step S203 may specifically include: obtaining a rule object of message filtering rules from the cache, wherein the rule object is used to represent the executable code obtained by instantiating the message filtering rules; executing the executable code of the rule object on each event message to obtain the filtered event message.

[0047] Specifically, the rule object (RuleObj) is used to instantiate message filtering rules into executable objects. Through instantiation, abstract message filtering rules can be transformed into concrete code logic that can be executed at runtime.

[0048] As can be seen, the rule object in this embodiment has a three-layer rule structure: a user ID (UID) layer, a rule text layer, and a rule object layer. The user ID layer, or simply the user layer, is used to distinguish different target users or usage scenarios through different user IDs, avoiding rule conflicts. The rule text layer stores the specific rule definitions. The rule object layer corresponds to the rule object obtained by instantiating the rule text of the message filtering rule.

[0049] As an example, when executing the executable code of the rule object on each event message, the three-layer rule structure of the rule object can be used to filter out event messages of the target user that match the message filtering rules. For instance, event messages triggered by other users (not the target user) processing data on the designated cloud resources will be filtered out; event messages triggered by the target user processing data on other resources (not the designated cloud resources) will also be filtered out; and event messages of the target user processing data on the designated cloud resources but not meeting the specific filtering conditions will also be filtered out. Instantiating the message filtering rules as executable objects ensures that the message filtering rules only apply to the data stream that needs to be processed. That is, the message filtering rules only apply to event messages triggered by the target user processing data on the designated cloud resources. These filtered event messages are treated as invalid messages and can continue to flow normally.

[0050] For example, when the cloud resource is designated as a cloud object storage resource, other resources are cloud resources other than cloud object storage resources, such as including but not limited to at least one of cloud log service resources and cloud email service resources.

[0051] For example, a specific filtering condition may include at least one of the following: the type of the event message conforms to the event type defined in the message filtering rules; the object characteristics (including but not limited to data type, file name, and / or data value, etc.) of the data object in the resource object involved in the event message conform to the requirements of the message filtering rules for the object characteristics.

[0052] This example provides a hierarchical rule mechanism. Through a three-tier (i.e., three-level) rule structure, the definition and application of rules become clearer and more precise. By explicitly defining rule construction requirements (rule text) and converting them into rule objects, they can be accurately applied to received event messages. This ensures that traffic unrelated to message filtering rules (i.e., normal, legitimate traffic that does not require rule intervention) is not incorrectly intercepted or interfered with, significantly reducing the consumption of system resources by invalid messages and lowering the processing pressure on the message processing server.

[0053] In this embodiment, retrieving the rule object of the message filtering rule from the cache instead of querying the database can reduce the database query overhead and reduce the performance overhead caused by repeated loading of rules.

[0054] In some embodiments, the step of filtering each event message based on message filtering rules in step S203 can also be implemented in other ways. For example, the message filtering rules corresponding to the user identifier can be directly read from the database as the message filtering rules for the target user; a rule object can be constructed based on the message filtering rules, and then the executable code of the rule object can be executed on each event message to obtain the filtered event message. As another example, the rule object of the message filtering rules corresponding to the user identifier can be directly read from the database, and then the executable code of the rule object can be executed on each event message to obtain the filtered event message.

[0055] For example, the database can be a local database corresponding to the message processing client. The database type can be any of the following: relational database, non-relational database, in-memory database, embedded database, and distributed database. The specific type can be selected as needed, and this application embodiment does not impose any specific limitations.

[0056] It should be understood that whether to store message filtering rules (message text) or the executable code of rule objects in the database depends on the specific application scenario and requirements. If flexibility and maintainability are required, message filtering rules in text form can be stored; if high performance and security are required, the executable code of rule objects can be stored. In practical applications, the appropriate storage method can be selected based on actual needs, or the advantages of both can be combined to achieve flexible and efficient rule management.

[0057] In some embodiments, before retrieving the rule object of the message filtering rule from the cache, the method further includes: sending a rule request to the message processing server, the rule request being used to request the retrieval of the message filtering rule; receiving the message filtering rule returned by the message processing server in response to the rule request; constructing a rule object based on the message filtering rule; and lazy loading the rule object into the cache based on the fact that the rule object does not exist in the cache.

[0058] For example, a rule request may include at least one of the following: a user identifier, a resource identifier for the reserved cloud resource, and a rule name. The user identifier is used to identify the target user, and the resource identifier is used to identify the type of cloud resource, such as one of cloud object storage resources, cloud log service resources, and cloud email service resources.

[0059] For example, constructing a rule object based on message filtering rules is an automated process of converting text-based rules into executable code or data structures. Specifically, this may include: First, parsing the rule text of the message filtering rules into structured data to ensure that the various parts of the rule, such as patterns, operations, and conditions, can be correctly identified and extracted. Second, a class or struct can be created to encapsulate the various parts of the rule as properties or methods of the object, thereby converting the parsed rule data into an executable rule object.

[0060] For example, lazy loading is a technique that delays the loading of resources or objects until they are actually needed. Rule objects employing a lazy loading strategy can be preloaded into memory and stored in a cache (essentially, loaded into the cache) only when actually needed, avoiding prolonged occupation of memory resources.

[0061] In this embodiment, by sending a rule request to the message processing server, the latest message filtering rules can be dynamically obtained, ensuring the real-time nature and accuracy of the rules. Constructing a rule object based on the obtained message filtering rules enables rule instantiation and execution. When using the rule object, lazy loading is employed to load the rule object into the cache on demand, which helps reduce memory usage and resource consumption. Especially in high-concurrency scenarios, this effectively reduces the resource consumption of expired rule objects, ensuring efficient system operation.

[0062] In some embodiments, before the step of reading the rule object of the message filtering rule corresponding to the user identifier from the database, the method further includes: sending a rule request to the message processing server, the rule request being used to request the acquisition of message filtering rules; receiving the message filtering rules returned by the message processing server in response to the rule request; constructing a rule object based on the message filtering rules; and storing the rule object in the database. Also, before the step of reading the message filtering rule corresponding to the user identifier from the database, the method further includes: sending a rule request to the message processing server, the rule request being used to request the acquisition of message filtering rules; receiving the message filtering rules returned by the message processing server in response to the rule request; and storing the message filtering rules in the database.

[0063] In this embodiment, flexible management and efficient application of rules are achieved through dynamic requests and storage of message filtering rules. Storing message filtering rules in the database, i.e., storing the rule text, offers greater flexibility and maintainability. Storing rule objects of message filtering rules in the database provides higher invocation efficiency and security. The specific storage method can be chosen according to actual needs, and this embodiment does not impose specific limitations.

[0064] In some embodiments, constructing a rule object based on message filtering rules includes: verifying whether the message filtering rules meet the verification pass conditions, wherein the verification pass conditions include at least one of the following: the message filtering rules conform to the syntax rules of regular expressions and the message filtering rules can run; the length of the message filtering rules is less than or equal to a predetermined length threshold; the syntax used by the message filtering rules conforms to a predetermined syntax specification; the beginning and end of the message filtering rules conform to a predetermined format; and constructing a rule object based on the message filtering rules that meet the verification pass conditions.

[0065] For example, a regular expression is a text pattern matching tool used to search, match, replace, and validate strings. A regular expression consists of a set of characters and symbols that define the pattern of a string. The syntax rules of a regular expression refer to the set of characters and special symbols used to define the string pattern contained in the regular expression.

[0066] For example, determining whether a message filtering rule can run provides a rule correctness check. Specifically, a pre-set test message and expected test results can be obtained; the message filtering rule is compiled into an executable rule object; the compiled rule object is used to match the test message, and the matching results are recorded. The matching result is verified to see if it matches the expected test result. If it does, the filtering rule is determined to run. If the matching result does not match the expected test result, or if an error or inability to match occurs during the matching process, the message filtering rule cannot run. In this example, the message filtering rule conforms to the syntax rules of regular expressions, and the rule can run, ensuring its validity and correctness. This rule correctness check helps avoid rule failure due to syntax errors or logical problems.

[0067] For example, the length of the message filtering rule is less than or equal to a predetermined length threshold, providing a rule length limit verification. It should be understood that the predetermined length threshold can be set as needed, and this embodiment does not impose a specific limitation. In this example, the predetermined length threshold is a strict limit on the rule length, which helps reduce performance issues or potential security risks (such as regular expression backtracking attacks) caused by excessively long regular expressions.

[0068] For example, the syntax used by the message filtering rules conforms to a predetermined syntax specification, providing a syntax constraint check. This includes ensuring that the message filtering rules use only basic syntax and not complex syntax.

[0069] As a concrete example, the basic syntax used includes: using simple character matching such as directly matching a single character or string (such as a, abc, etc.), using matching characters within a specified range (such as [az], [0-9], [a-zA-Z0-9], etc.), using escape characters (such as \. for a period, \* for an asterisk), using grouping such as using parentheses to group parts of the regular expression (such as (abc), (a|b), etc.), and using anchors to match the beginning or end of a string (such as using the symbol '^' to match the beginning of a string, and using the symbol '$' to match the end of a string).

[0070] As concrete examples, complex syntax includes the use of at least one of recursive matching, assertions, and conditional expressions. Recursive matching is a regular expression feature that allows a pattern to call itself during the matching process, thus enabling the matching of nested structures. Assertions are a special syntax in regular expressions used to check whether certain conditions are met during the matching process. Conditional expressions are a syntactic structure in regular expressions that selects different matching patterns based on specific conditions.

[0071] It should be understood that the examples of basic and complex syntax above are merely illustrative. In practical applications, basic and complex syntax libraries can be pre-configured. When a specific syntax used in a message filtering rule is detected, if that specific syntax is included in the basic syntax library but not in the complex syntax library, it can be determined that it conforms to the predetermined syntax specification. Alternatively, only the complex syntax library can be configured; as long as the specific syntax is not included in the complex syntax library, it can be determined that it conforms to the predetermined syntax specification. In this example, by using syntax restriction validation to allow the use of basic syntax while prohibiting complex or high-risk regular expression-related syntax, the risk of errors and anomalies during rule execution can be effectively reduced.

[0072] For example, the beginning and end of a message filtering rule conform to a predetermined format, providing a front-to-back matching check. Specifically, this means determining that the message filtering rule begins with a specific format and ends with a specific character.

[0073] For example, message filtering rules require the string `acs:${ProductName}:${Region}:${AccountId}` to begin and end with the character `$`. Here, `acs` represents the resource identifier of the cloud resource. `${ProductName}` is the product name of the cloud service, ensuring the rule applies to a specific service. `${Region}` is the region identifier of the cloud service, representing the geographical region where the resource is located, ensuring the rule applies to a specific geographical region. `${AccountId}` is the cloud account identifier, used to uniquely identify the user, ensuring the rule applies to a specific user. This approach, through front-end and back-end matching checks, avoids unexpected backtracking or mismatches caused by partial matching.

[0074] In this embodiment, multi-layered rule verification is provided through at least one or more of the aforementioned rule correctness verification, rule length limit verification, syntax restriction verification, and front-back matching verification. Even if the message processing server has already performed verification, the message processing client's verification serves as a double guarantee, ensuring that the rules remain correct and valid in the message processing client environment. If the message processing server fails to perform rule verification or misses checks, the invalid rule fault tolerance mechanism introduced by the message processing client, which verifies the message filtering rules obtained from the message processing server, can compensate for this deficiency. The fault tolerance mechanism of the message processing client can be regarded as a fallback measure, which can further ensure the correctness of the rules and help avoid operational problems of the rules in the message processing client due to incorrect or malicious rules.

[0075] In some embodiments, constructing a rule object based on message filtering rules can also be achieved in other ways. For example, during the process of parsing the rule text of message filtering rules into structured data, message filtering rules that cannot be parsed or fail to be parsed can be cached and marked as invalid. Similarly, message filtering rules that do not meet the validation pass conditions can also be cached and marked as invalid. Before subsequently constructing a rule object based on the message filtering rules obtained from the message processing server, it is necessary to first determine that there are no identical rules marked as invalid in the cache to avoid resource waste caused by duplicate calculations.

[0076] In some scenarios, message filtering rules that cannot be parsed, fail to be parsed, do not meet the verification conditions, or fail to match due to network anomalies can be cached and marked as invalid. This helps to avoid resource waste caused by repeated calculations and maintain stable system operation.

[0077] In this embodiment, rules marked as invalid can be periodically removed from the cache to release the resources they occupy. "Periodically" means at fixed intervals, which can be daily, weekly, or monthly. The specific interval depends on the actual application scenario and requirements, and this embodiment does not impose specific limitations.

[0078] For example, constructing a rule object based on message filtering rules may include: first, using an application firewall to detect whether there is malicious injection content in the message filtering rules; if it is determined that there is no malicious injection content, then executing the construction of a rule object based on the message filtering rules to ensure the security of the message filtering rules.

[0079] In this embodiment, the specific implementation method of constructing the rule object based on the message filtering rules can be selected according to actual needs, and this embodiment does not impose specific limitations.

[0080] In some embodiments, after lazy loading the rule object into the cache, the method further includes the following steps: setting a valid time period for the rule object; marking the rule object as valid based on the current time being within the valid time period; and extending the end time of the valid time period in response to detecting that the frequency of use of the rule object is greater than or equal to a first frequency threshold, based on the current time being within the valid time period.

[0081] For example, the time difference between the start and end times of the effective time period can be referred to as the effective duration. The effective duration and the extended duration can be the same or different. For example, if they are different, the extended duration can be less than the effective duration. In practical scenarios, the extended duration can be selected according to actual needs, and this application embodiment does not impose specific limitations.

[0082] In this embodiment, by explicitly setting the effective time period of the rule object, it is beneficial to accurately control the activation and deactivation time of the rule object, avoiding the rule object occupying cache resources for a long time and improving the overall resource utilization. Furthermore, extending the end time of the effective time period based on the usage frequency of the rule object is a way to dynamically extend the effective time period of the rule object. This helps maintain the continuous availability of the corresponding rule object when it is frequently used, reducing the risk of message processing interruptions caused by the duration limit of the effective time period, thus contributing to system stability.

[0083] In some embodiments, filtering each event message based on message filtering rules includes: retrieving a rule object marked as valid from the cache; executing the executable code of the rule object marked as valid on each event message to obtain the filtered event message.

[0084] For example, a flag bit can be set for each rule object in the cache. For instance, a flag bit value of 1 indicates that the corresponding rule object is a valid rule object. A flag bit value of 0 or null indicates that the corresponding rule object is not a valid rule object. The specific value of the flag bit can be customized according to actual needs, and this application embodiment does not impose specific limitations.

[0085] In this embodiment, valid rule objects are quickly retrieved from the cache by effectively marking them, and their executable code is executed to filter event messages. This helps to avoid interference from invalid rule objects, improve the efficiency of event message filtering and processing, and maintain system stability.

[0086] In some embodiments, filtering event messages based on message filtering rules may also include other implementation methods. For example, retrieving rule objects marked as valid from the cache; grouping event messages according to event type, with each group corresponding to one event type; and executing the executable code of the valid rule object on the event messages in each group in order of priority of event type to obtain the filtered event messages. As an example, suppose the event types include at least one of the following: log events, file operation events, network events, etc. The priority of log events can be set to be higher than that of file operation events, and the priority of file operation events can be set to be higher than that of network events. Suppose that file operation events can include at least one of the following operation types: create file event, read file event, modify file event, upload file event, download file event, copy file event, delete file event, and restore file event. Then the priority order of event types from high to low is: delete file event, create file event, modify file event, read file event, restore file event, upload file event, download file event, and copy file event.

[0087] It should be understood that in practical applications, among log events, file operation events, and network events, different types of events within a file operation event can be configured to have the same or different priorities. The specific event types and priority order can be customized according to actual needs, and this application embodiment does not impose specific limitations.

[0088] In this embodiment, the event messages are grouped and filtered according to priority, which helps to improve processing efficiency, ensure that high-priority events are processed first, and enhance system response speed and stability.

[0089] In some embodiments, the method further includes: determining that the current time is not within the valid time period of the rule object, and deleting the rule object from the cache.

[0090] For example, the current time not being within a valid time period includes situations where the current time is earlier than the start time of a valid time period or later than the end time of a valid time period. Removing a rule object from the cache does not mean the rule object itself is deleted; rather, it means the loading of it has been removed from the cache. This ensures that the rule object is no longer loaded and used in the cache, but the rule object itself may still exist in the message processing client's database or file system.

[0091] In this embodiment, timely clearing of expired rule objects in the cache helps reduce cache usage and improve system resource utilization efficiency.

[0092] Figure 3This diagram illustrates the lifecycle management of a rule object pool according to an exemplary embodiment of this application. In this embodiment, each rule object loaded into the cache constitutes a rule object pool. Figure 3 As shown, the lifecycle management of the rule object pool includes validity period management, renewal management, and expiration management.

[0093] Regarding validity period management Figure 3 In this context, T0 represents the time when the message filtering rule enters the cache, and T1 represents the expiration time after entering the cache. The period between the entry time and the expiration time is the valid time period for the rule object. Within the valid period, the rule object can be retrieved from the cache.

[0094] As shown in "all requests within the validity period are processed through the cache," the rule object can be preloaded into memory and stored in the cache upon initial loading (which can be summarized as being loaded into the cache). The validity period of the rule object can be set, and this validity period can be considered an expiration time attribute. Within the validity period, all requests for message filtering rules can directly retrieve the message retrieval rule from the cache, avoiding the performance overhead of repeated loading. The setting of the validity period or expiration time can be dynamically adjusted according to user needs; this embodiment does not impose specific limitations.

[0095] For renewal management, the meanings of T0 and T1 are the same as those in validity management. T2 represents the expiration time of the extended validity period.

[0096] As shown in "Request Automatic Renewal", if a high-frequency traffic request (the frequency of use of the rule object is greater than or equal to the first frequency threshold) is detected within a unit of time (e.g., one day, one hour) before the rule object expires, the system will automatically trigger a renewal operation to extend the end time of the valid period of the rule object.

[0097] For expiration management, the meanings of T0 and T1 are the same as those in expiration management. The meaning of T2 is the same as that in renewal management. As shown in "Periodic Cleanup and Expiration", the client can perform global memory management through an independent thread, periodically scanning rule objects that are currently within their valid time period, identifying them as expired rule objects, and cleaning them up to release the memory resources occupied by expired rule objects. As shown in "Request to Re-trigger Build Loading", after deleting expired rule objects from the cache, the corresponding rule objects can be lazy-loaded back into the cache.

[0098] In this embodiment, a refined lifecycle management mechanism is introduced into the message processing client, including validity period management, renewal management, and expiration management, which helps optimize the resource utilization efficiency of rule objects. Validity period management ensures that rule objects remain available within a reasonable timeframe. Renewal management helps avoid performance fluctuations caused by rule reloading in high-concurrency scenarios, ensuring stable system operation. Expiration management prevents resource waste caused by unlimited memory growth, controls the system resource consumption of the message processing client, reduces the processing pressure on the client, and also helps mitigate system stability risks caused by excessive memory usage.

[0099] In some embodiments, before obtaining the message filtering rules from the message processing server in step S202, the method further includes: receiving rule keywords through a preset console page, wherein the rule keywords include at least one of the following: rule name, event type, and matching object characteristics; the matching object characteristics include at least one of the following characteristics: the number of resource objects covered by the rule, the identification information of the resource objects, the object characteristics of the data objects, and the matching operator corresponding to the object characteristics; the resource objects are resource units in a predetermined cloud resource, and the data objects are stored in the resource objects; generating rule construction requirements based on the rule keywords; and sending the rule construction requirements to the message processing server, wherein the rule construction requirements are used to enable the message processing server to generate corresponding message filtering rules.

[0100] As an example, the rule name is a string. Specific format requirements for the received rule name can be set. For example, the name must begin with an English letter, and the remaining characters can contain at least one of English letters, numbers, and hyphens (-), with a length not exceeding a predetermined number of characters. If the received rule name does not meet the corresponding specific format requirements, a corresponding prompt message can be generated. The predetermined number of characters and the specific content of the prompt message can be customized according to actual needs; this embodiment does not impose specific limitations.

[0101] Event types include, but are not limited to, at least one of the following: log events, file operation events, and network events. File operation events may further include at least one of the following: file creation events, file reading events, file modification events, file upload events, file download events, file copy events, file deletion events, and file recovery events. Specific event types can be customized according to actual needs, and this application embodiment does not impose specific limitations.

[0102] As an example, matching object features are used to indicate the characteristic information of the resource objects that need to be matched.

[0103] Specifically, the number of resource objects covered by the rule can include, for example, a single resource object or multiple resource objects. Assuming the cloud resource is a cloud object storage resource, the number of resource objects could include, for example, a single storage bucket or multiple storage buckets. As a specific example, the console page can include a first interactive element and a second interactive element. In response to an operation command on the first interactive element, the number of resource objects covered by the rule is set to a single resource object; in response to an operation command on the second interactive element, the number of resource objects covered by the rule is set to multiple resource objects. The first and second interactive elements can be, for example, radio buttons or buttons. The specific settings can be configured according to actual needs, and this application embodiment does not impose specific limitations.

[0104] Specifically, the identification information of the resource object can be, for example, the object name of the resource object. Similar to the rule name, specific format requirements for the received resource object identification information can be set. These can be set according to actual needs, and this application embodiment does not impose specific limitations. If the received resource object identification information does not conform to the corresponding specific format requirements, a corresponding prompt message can be generated. The specific content of the prompt message can be customized according to actual needs, and this application embodiment does not impose specific limitations. As a specific example, a console page can include a third interactive element, which, in response to an operation command on the third interactive element, triggers the reception of user-inputted resource object identification information.

[0105] Specifically, the object characteristics of a data object are used to indicate at least one characteristic information of a specific data object stored in a resource object within a predetermined cloud resource. The object characteristics of a data object can also be called matching objects or matching rules. Taking a predetermined cloud resource as a cloud object storage resource as an example, the resource object is a storage bucket, and the data object is a file within that storage bucket. Assuming the rule covers a single storage bucket of resource objects, any object characteristic of a data object (the characteristic information of the stored file) includes at least one of the following: full file name, file extension, file prefix, a combination of file prefix and suffix, or all files. Assuming the rule covers multiple storage buckets of resource objects, any object characteristic of a data object includes at least one of the following: full file name, file prefix, file extension, or prefix and suffix.

[0106] Considering the large file range across multiple storage buckets, file filtering requires traversing all files in multiple buckets, resulting in significant computational overhead and time complexity. In this case, the object characteristics of the data object may not include "all files". Whether or not to include "all files" can be customized according to actual needs, and this application embodiment does not impose specific limitations.

[0107] It should be understood that if the reserved cloud resource is a cloud log service resource, then the resource object includes log items, and the data object includes log data stored in the log items. For log data in a single log item or log data in multiple log items, the specific characteristic items in any object characteristic (characteristic information of log files) of the data object are similar to those in the examples above. Similarly, if the reserved cloud resource is a cloud email service resource, then the resource object includes email folders, and the data object can be email information organized and managed through email folders. For email information in a single email folder or email information in multiple email folders, the specific characteristic items in any object characteristic (characteristic information of email files) of the data object are also similar to those in the examples above. Further details will not be elaborated here.

[0108] As a specific example, the console page may include at least one group of object feature interactive elements, which includes a fourth interactive element and a fifth interactive element. In response to an operation command on the fourth interactive element, the system triggers the reception of the object feature selected by the user. In response to an operation command on the fifth interactive element, the system triggers the reception of the feature value of the object feature input by the user. The console page may also include a sixth interactive element and a seventh interactive element. In response to an operation command on the sixth interactive element, the system triggers the addition of a new group of object feature interactive elements. In response to an operation command on the seventh interactive element, the system triggers the removal of an existing group of object feature interactive elements. When there is only one group of object feature interactive elements, the seventh interactive element is inactive. For example, the fourth interactive element may be a dropdown list, and the fifth interactive element may be a text box. The sixth and seventh interactive elements may be buttons.

[0109] Specifically, the matching operators corresponding to object features include: operators on the object features themselves and operators between object features. Operators on the object features themselves (also called rule matching methods) include, for example, any one of equality and not equality. Operators between object features include, for example, any one of logical AND, logical OR, and logical NOT.

[0110] As a specific example, the console page may include an eighth and a ninth interactive element. In response to an operation command on the eighth interactive element, an operation is triggered to set the operator of the object's own characteristics to equal, i.e., the rule matching method is: equal to the object characteristics of a certain data object. In response to an operation command on the ninth interactive element, an operation is triggered to set the operator of the object's own characteristics to not equal, i.e., the rule matching method is: not equal to the object characteristics of a certain data object. The console page may also include a tenth interactive element, which, in response to an operation command on the tenth interactive element, triggers the reception of operators between object characteristics selected by the user. Exemplarily, the eighth and ninth interactive elements can be either radio buttons or buttons. The tenth interactive element can be, for example, a dropdown list or a text box.

[0111] As a concrete example, if the operator of an object feature is set to "not equal to", the object feature is a suffix, and the value of the object feature is a predetermined suffix, strings in the object feature whose suffix equals the predetermined suffix can be excluded, thus meeting the specific rule-building needs of clients. This customization not only enhances the system's flexibility and adaptability but also better meets the filtering requirements of different clients.

[0112] It should be understood that the types of the above-mentioned interactive elements can be customized according to actual needs, and the embodiments of this application do not impose specific limitations.

[0113] In this embodiment, the console page receives rule keywords, such as rule name, event type, and matching object characteristics, and generates rule building requirements based on these keywords, which are then sent to the message processing server. This enables the dynamic generation of message filtering rules, improving the flexibility and automation of rule management.

[0114] In some embodiments, the method further includes: obtaining filtered event messages obtained by filtering each event message; sending the filtered event messages to a message processing server, and having the message processing server forward the filtered event messages to application clients that have subscribed to the corresponding message topics.

[0115] In this embodiment, the filtering logic is moved forward to the message processing client, enabling event message filtering to be completed on the client side. This approach decouples the filtering logic from the message processing server capabilities, significantly reducing the resource pressure on the message processing server while improving the overall stability and reliability of the system.

[0116] Figure 4 This diagram illustrates a method for managing message filtering rules in a message processing client according to an embodiment of this application. Figure 4 As shown, the message processing method of the message processing client includes the following steps.

[0117] like Figure 4 As shown in "S401, Rule Object Construction", the message filtering rules from the message processing server are obtained, and a rule object is constructed based on the message filtering rules.

[0118] like Figure 4 As shown in "S402, Lazy Loading", the rule object is lazy-loaded into the cache if it does not exist in the cache.

[0119] like Figure 4 As shown in "S403, Managing the rule object pool", rule objects are preloaded and cached when loaded for the first time, and the validity period (expiration time attribute) of the rule objects is set.

[0120] Specifically, such as Figure 4 As shown in the "Valid Rule Object Pool," rule objects that are within the valid time period at the current time are considered valid rule objects and added to the valid rule object pool. For example... Figure 4 As shown in the "Invalid Rule Object Pool", rule objects that are not within the valid time period at the current time are periodically scanned from the cache and identified as invalid rule objects. These invalid rule objects are then added to the invalid rule object pool. Finally, invalid rule objects in the invalid rule object pool are removed from the cache to release the resources they occupy.

[0121] like Figure 4 As shown in "S404, Get Message Filtering Rules (User: Rule Text: Rule Object)", the rule object corresponding to the user identifier is retrieved from the cache, and the event messages sent by the pre-defined cloud resources are filtered to obtain the filtered message events.

[0122] like Figure 4 As shown in "S405, Valid message sent to server", the filtered message event is sent to the message processing server, and the filtered message event is forwarded by the message processing server to the application client that has subscribed to the corresponding message topic.

[0123] The message processing client in this embodiment can provide an efficient rule processing mechanism and resource management strategy, which is conducive to supporting the normal operation of core data streams with low resource overhead in high-concurrency scenarios, and ensuring the stability and reliability of the system.

[0124] According to the message processing method in this application, the message processing client, through a hierarchical rule mechanism, lazy loading mechanism, fault tolerance for invalid rules, and lifecycle management of the rule object pool, can support the normal operation of important data streams with low resource overhead in high-concurrency scenarios. These designs not only improve the performance and stability of the system, but also lay a solid foundation for subsequent system expansion and optimization.

[0125] Figure 5 A flowchart illustrating a message processing method according to another embodiment of this application is shown. In some embodiments, this message processing method is applied to a message processing server. Figure 5 As shown, the method includes the following steps.

[0126] S501, Obtain the rule building request submitted by the user terminal. The rule building request is used to instruct the user terminal to specify the data object related to the reserved cloud resource.

[0127] S502 matches the data object with the rule templates in the rule template library to generate message filtering rules that match the rule building requirements.

[0128] S503 sends message filtering rules to the message processing client. The message filtering rules are used to enable the message processing client to filter each event message. Each event message is triggered by the user terminal performing data processing based on predetermined cloud resources.

[0129] According to the message processing method in this application embodiment, the message processing server obtains the rule building requirements submitted by the user terminal, matches and generates corresponding message filtering rules, and sends the generated message filtering rules to the message processing client. This allows the message processing client to filter the received event messages from the user terminal, obtaining filtered event messages. Based on the rule building requirements obtained from the user terminal, this message processing method generates message filtering rules that better meet the message filtering needs of the corresponding user. Furthermore, by performing message filtering on the message processing client, the filtering logic is brought forward to the message processing client side, which significantly reduces the resource pressure on the message processing server and improves the overall stability of the system.

[0130] In some embodiments, matching a data object with a rule template in a rule template library may include the following steps: obtaining rule keywords from the rule construction requirements, wherein the rule keywords include at least one of the following: rule name, event type, and matching object characteristics; the matching object characteristics include at least one of the following: the number of resource objects covered by the rule, the identification information of the resource objects, the object characteristics of the data object, and the matching operator corresponding to the object characteristics; the resource object is a resource unit in a predetermined cloud resource, and the data object is stored in the resource object; and matching the rule keywords with the rule templates in the rule template library.

[0131] For example, a rule template library is a collection of templates containing multiple rule templates. These templates are designed based on the user's message filtering semantics, enabling the rapid transformation of the user's rule building requirements into regular expression rules. The rule keywords in the message filtering semantics include at least the matching object characteristics in the resource object corresponding to the event message that the message filtering rule needs to match.

[0132] For example, if a user proposes a new custom message filtering semantic, the message processing server can add a rule template corresponding to the rule keywords in that new message filtering semantic. This approach helps ensure the determinism of rules and improves the response speed to new requirements.

[0133] As a specific example, the characteristics of matching objects in resource objects include, but are not limited to, at least one of the following: characteristics of information such as files, images, and videos stored in buckets, characteristics of log files stored in log projects, and characteristics of email files stored in email folders.

[0134] For example, after matching the data object with rule templates in the rule template library to obtain the matched rule template, the actual content of the rule keywords in the rule construction requirements is used, and the matched rule template is combined to generate message filtering rules. The message processing server can perform rule matching tests on the generated rules to ensure that they meet the expected filtering logic.

[0135] In this embodiment, a standardized regular expression rule template library allows users to quickly generate customized message filtering rules based on their own rule building needs, thereby improving system processing efficiency and the flexibility and reliability of the rules. The specific meanings of the rule keywords are described in the above embodiments; this application does not impose specific limitations.

[0136] In some embodiments, matching data objects with rule templates in a rule template library can also be achieved in other ways. For example, a language model can be used to perform semantic understanding of the rule building requirements, obtaining the semantics of the rule building requirements, and then searching for the rule template in the rule template library that best matches the semantics. In this embodiment, a flexible rule matching scheme is provided, which is beneficial to improving the flexibility and efficiency of rule generation.

[0137] In some embodiments, after generating message filtering rules that match the rule building requirements, the method further includes: verifying whether the message filtering rules meet the verification pass conditions, wherein the verification pass conditions include at least one of the following: the message filtering rules conform to the syntax rules of regular expressions and the message filtering rules can run; the length of the message filtering rules is less than or equal to a predetermined length threshold; the syntax used by the message filtering rules conforms to a predetermined syntax specification; the beginning and end of the message filtering rules conform to a predetermined format; and storing the message filtering rules that meet the verification pass conditions in a predetermined database.

[0138] In this embodiment, the message processing server can provide diverse rule verification through at least one or more of the above-mentioned rule correctness verification, rule length limit verification, syntax restriction verification, and front-back matching verification. This helps reduce processing failures caused by rule errors by the message processing client, ensuring that each rule is rigorously verified before being issued, thereby guaranteeing the correctness and effectiveness of the rules and the stable operation of the message processing client. It should be understood that the specific meaning and implementation method of the above verification conditions can be referred to the description of the above embodiments, and will not be repeated here.

[0139] In some embodiments, the step of storing message filtering rules that meet the verification pass conditions into a predetermined database may specifically include: obtaining test event messages that are pre-set for rule building requirements; performing rule matching tests on message filtering rules that meet the verification pass conditions using test event messages to obtain test results; and storing message filtering rules that meet the verification pass conditions into a predetermined database if the test results match the expected results.

[0140] For example, if the test results do not match the expected results, at least one of the message filtering rules and test cases can be adjusted based on the test results, and the test can be retested based on the adjusted message filtering rules and at least one of the adjusted test cases until the test results match the expected results are obtained. Furthermore, problems discovered during the testing process and the adjusted solutions can be recorded to facilitate subsequent maintenance and optimization.

[0141] As a concrete example, when test results do not match expected results, message filtering rules and test event messages can be adjusted based on the test results. For instance, suppose a message filtering rule is named "File Upload Rule," the event type is a file upload event, and the file name in the object characteristics is "report.txt." Also suppose the test event message corresponds to a file upload event, and the file name in the object characteristics is "report.pdf."

[0142] If the test results show that the test event message matches the filtering rule, but the expected result is a mismatch (because the filename needs to be equal to "report.txt", while the filename in the test event message is "report.pdf"), then it can be determined that the test result does not match the expected result. This indicates an error in the rule definition or execution process. Therefore, the message filtering rule can be adjusted. For example, change the filename from "report.txt" to a filename that is exactly "report.txt". This achieves a change from fuzzy matching to exact matching of object features (filename) in the message filtering rule.

[0143] In this example, the test cases can also be adjusted. Specifically, after adjusting the message filtering rules, test event messages for the same type of object characteristic can be added based on the type of the adjusted object characteristic. For example, if the type of the adjusted object characteristic is filename, more filename-related test cases can be added to cover various real-world filename matching scenarios.

[0144] It should be understood that the above specific examples are merely illustrative. In this specific example, to determine the specific adjustments to the message filtering rules and test cases, the test results and expected results can be compared first to determine the specific reasons for the discrepancy. Then, based on at least one of the rule names, event types, and matching object characteristics involved in the specific reasons, the message filtering rules and test cases can be adjusted to achieve continuous optimization of the message filtering rules and test cases.

[0145] In this embodiment, rule matching tests are performed using preset test event messages. If the test results meet expectations, the validated and tested rules are stored in a predetermined database to ensure rule persistence and traceability. Furthermore, for adjusted message filtering rules, the version information of the corresponding rules is recorded in the database for subsequent auditing and rollback operations, improving the system's reliability and maintainability.

[0146] Figure 6 A flowchart illustrating the rule processing and verification mechanism of the message processing server in an embodiment of this application is shown. Figure 6 As shown, the rule processing and verification mechanism includes the following steps.

[0147] like Figure 6 As shown in "S601, Obtain Message Filtering Semantics", the rule construction requirements submitted by the user terminal are obtained.

[0148] Among them, the rule building requirement is used to instruct the target user to specify the data object related to the reserved cloud resource through the user terminal.

[0149] like Figure 6 As shown in “S602, Matching Regular Expression Template Library”, the data object indicated by the rule building requirement is matched with the rule template in the rule template library to generate a message filtering rule that matches the rule building requirement.

[0150] The "regular expression template library" can include different types of regular expression template sub-libraries. For example, a non-empty suffix regular expression template sub-library, a non-empty prefix regular expression template sub-library, a full file name template sub-library, etc. Specific settings can be customized according to actual needs; this application embodiment does not impose specific limitations.

[0151] like Figure 6 As shown in "S603, Regular Expression Rule Construction", message filtering rules are generated by combining the actual content of the rule keywords in the rule construction requirements with regular expression templates.

[0152] like Figure 6 As shown in "S604, using rule validation chain for validation", message filtering rules can be validated sequentially for rule correctness, rule length limit, syntax limit, and before and after matching.

[0153] The order of the various checks described above can be adjusted according to actual needs. The specific check content is as described in the above embodiment and will not be repeated here.

[0154] like Figure 6 As shown in "S605, store to database", message filtering rules that meet the verification conditions are stored in a predetermined database.

[0155] In this embodiment of the application, the message processing server can ensure that the constructed message filtering rules can meet the rule construction requirements submitted by the user terminal through a flexible and reliable rule processing mechanism.

[0156] In some embodiments, sending message filtering rules to a message processing client includes: receiving a rule request from the message processing client, the rule request being used to request the retrieval of message filtering rules; sending message filtering rules extracted from the distributed cache to the message processing client based on the existence of message filtering rules in the distributed cache; and sending message filtering rules extracted from a predetermined database to the message processing client based on the absence of message filtering rules in the distributed cache.

[0157] In this embodiment, message filtering rules are quickly extracted and sent to the message processing client through distributed caching, thereby improving response speed, reducing database access pressure, and optimizing system performance.

[0158] In some embodiments, in addition to the client requesting message filtering rules, the server can also proactively push rules to the client. This approach enables more timely rule updates, reduces client waiting time, and further improves the system's real-time performance and response efficiency.

[0159] In some embodiments, before the step of sending message filtering rules extracted from the distributed cache to the message processing client based on the existence of message filtering rules in the distributed cache, the method further includes: counting the request frequency of each message filtering rule stored in a predetermined database; and storing message filtering rules whose request frequency is greater than or equal to a second frequency threshold in the distributed cache.

[0160] In this embodiment, both the first frequency threshold and the second frequency threshold can be customized according to actual needs, and this embodiment does not impose any specific limitations.

[0161] For example, caching can employ a Time-to-Live (TTL) strategy. Specifically, by setting a time-to-live for message filtering rules in the cache, the system automatically reloads the rules from a predefined database periodically to ensure data freshness when the rules expire in the distributed cache.

[0162] In this embodiment, frequently used rules can be stored in memory to reduce database query overhead and improve the response speed of rule issuance.

[0163] In some embodiments, after storing message filtering rules that meet the verification conditions into a predetermined database, the method further includes: obtaining message filtering rules for different users from the predetermined database; and storing the message filtering rules for different users in isolation.

[0164] For example, message filtering rules can be stored in a distributed cache or database based on the user identifier corresponding to the message filtering rule, and can be indexed and isolated by user identifier.

[0165] For example, message filtering rules can also be stored in a distributed cache or database based on user identifiers and different resource characteristics to avoid the use of other rules being affected by the error of a single rule, which helps to ensure the security of rule usage and system stability.

[0166] In some embodiments, after the step of sending message filtering rules to the message processing client, the method further includes: receiving filtered event messages obtained by the message processing client based on the message filtering rules; and sending the filtered event messages to application clients that have subscribed to the corresponding message topics.

[0167] In this embodiment, by filtering event messages through the message processing client, the message processing server can send only event messages that meet the rules to application clients that have subscribed to the corresponding topic, reducing unnecessary message transmission and improving the overall efficiency of the system.

[0168] In this embodiment, abnormal situations in the rule verification and rule-issuing message processing client process can be detected in real time, and technical or maintenance personnel can be notified in a timely manner through an alarm mechanism to ensure that the problem can be quickly located and resolved.

[0169] Figure 7 A schematic diagram of the system architecture illustrating an exemplary embodiment of this application is shown. Figure 7 The system includes a message processing server 710 and a message processing client 720. The message processing server 710 includes a regular expression template construction module 711, a rule validation module 712, a rule caching module 713, and a message receiving module 714. The message processing client 720 includes: a hierarchical management module 721, a regular expression rule module 722, an invalid rule fault tolerance module 723, a lazy loading module 724, an effective time management module 725, a periodic cleanup module 726, and a message filtering module 727.

[0170] In the message processing server 710, the regular expression template construction module 711 stores various regular expression rule templates. It obtains rule construction requirements submitted by the user terminal, matches the rule keywords in the rule construction requirements with the rule templates in the rule template library, and generates message filtering rules that match the rule construction requirements. The rule validation module 712 performs at least one or more of the following checks on the generated message filtering rules: rule correctness, rule length limit, syntax restriction, and front-back matching. The rule caching module 713 stores the message filtering rules that pass the validation and meet the validation conditions in a predetermined database.

[0171] In the message processing client 720, the hierarchical management module 721 provides a hierarchical rule mechanism. Through a three-layer rule structure—user layer, rule text layer, and rule object layer—the definition and application of rules become clearer and more precise. The regular expression template module 722 stores message filtering rules from the message processing server. The invalid rule fault tolerance module 723 verifies whether message filtering rules meet the validation criteria. It constructs rule objects based on valid rules and caches invalid rules, preventing subsequent use of cached invalid rules and avoiding resource waste from redundant calculations. The lazy loading module 724 lazily loads valid message filtering rules into the cache. The valid time management module 725 sets the valid time period for rule objects when they are first loaded into the cache, managing their lifecycle. The periodic cleanup module 726 periodically cleans up cached rule objects whose current time is not within a valid time period. The message filtering module 727 is used to filter the event messages sent by the predetermined cloud resources using the valid message filtering rules in the cache, and send the filtered messages to the message receiving module 714 in the message processing server 710.

[0172] In this embodiment, the message processing server 710 can be used to ensure the correctness of rules. Specifically, based on the rule construction requirements input by the user, a standardized regular expression template is constructed, and the legality and accuracy of the rules are ensured through a multi-layered rule verification chain. For the massive rule requests that the message processing client may generate, an efficient rule caching strategy is introduced to reduce the computational pressure on the server and improve response speed. The message processing client 720 can be used to achieve low resource consumption and high availability of rules. Specifically, based on the message filtering rules obtained from the message processing server, a lightweight regular expression matching logic based on a three-layer rule structure is constructed to ensure the execution efficiency of rules on the client. Through a fine-grained caching management strategy, the lifecycle of the rule cache is dynamically adjusted to balance memory consumption and data freshness. Furthermore, a flexible fault tolerance mechanism is designed for network fluctuations or server anomalies to ensure that the client can still run stably under extreme conditions and avoid affecting message filtering.

[0173] In some embodiments, machine learning or deep learning techniques can be used to construct an intelligent filtering model. By learning from historical data, invalid messages can be automatically identified and filtered. The solution in this application can combine regular expression matching of message filtering rules with a rule engine based on the intelligent filtering model to form a hybrid filtering mechanism for each event message received from a predetermined cloud resource. For example, each event message can be filtered first based on message filtering rules, and then the intelligent filtering model can be used to filter the event messages after the first filtering to obtain the final filtered event messages. This hybrid mechanism can fully utilize the efficient matching capability of regular expressions and the flexible decision-making capability of the rule engine, making it suitable for complex message processing scenarios and improving message processing efficiency.

[0174] In some embodiments, for filtered event messages, the message processing client can send a rule object constructed according to the message filtering rules and the received event messages to a middleware proxy server. The middleware proxy server executes the executable code of the rule object on each event message to obtain the filtered event messages, and then sends the filtered event messages to the message processing server. By introducing a middleware proxy server between the message processing client and the message processing server, the proxy server is responsible for filtering and forwarding each event message. This proxy server can filter messages according to the rule object of the message filtering rules received from the message processing client, and only pass the filtered, valid messages to the message processing server.

[0175] In this embodiment, a rule template library is introduced, based on a general rule mechanism using regular expression models. This supports unified rule configuration for multiple resource objects (e.g., multiple storage buckets) and provides flexible forward and reverse matching capabilities. Through standardized regular expression templates and a dynamic extension mechanism, users can quickly define complex message filtering rules, reducing rule maintenance costs and increasing the flexibility of rule construction. The solution in this embodiment places the filtering logic forward on the message processing client side. Through a hierarchical rule mechanism and lazy loading strategy, invalid message filtering is completed on the client side, decoupling the filtering logic from the message processing server capabilities. This significantly reduces server resource pressure and improves the overall stability of the system.

[0176] In real-world scenarios (including but not limited to the intelligent vehicle field), the console's white-screen rule configuration capabilities can be used to receive rule keywords. Based on these keywords, rule building requirements are generated and sent to the message processing server. The message processing server matches the rule keywords in the rule building requirements with rule templates in the rule template library to generate message filtering rules that match the requirements. "White-screen" refers to configuring keywords through a graphical user interface (GUI). A white-screen interface is typically designed for simplicity and intuitiveness, resembling a blank sheet of paper. Users can submit rule keywords through simple clicks, drags, and input to complete rule configuration without needing to understand the complex underlying logic, thus lowering the barrier to entry and improving efficiency. The message processing server sends the generated message filtering rules to the message processing client. The client filters event messages based on these rules, obtaining the filtered event messages (those not filtered out), effectively reducing server resource pressure and costs.

[0177] In real-world scenarios, this message processing method effectively reduces the number of requests per second (QPS) for event messages sent from pre-allocated cloud resources to the message processing server from hundreds of thousands to approximately 20,000, a reduction of nearly 96%. This not only significantly reduces the flow of invalid event messages but also helps reduce the processing pressure on downstream application clients. Furthermore, after introducing the filtering logic, the resource overhead (processor overhead, memory overhead, etc.) of the message processing client remains stable with no significant change, and the impact on overall performance is negligible, verifying the efficiency of the solution in client-side message processing and the controllability of resource overhead. Moreover, because each event message is filtered upfront, the server's computing resource requirements are significantly reduced, and resource overhead is significantly lowered. Especially in high-traffic scenarios, it effectively reduces the flow of invalid messages, significantly reducing cloud service costs. The upfront design of the filtering logic helps avoid stability issues on the server side caused by high traffic or network anomalies, ensuring reliable transmission of core data streams and contributing to the overall reliability of the message processing server.

[0178] Corresponding to the application scenarios and methods provided in the embodiments of this application, the embodiments of this application also provide a message filtering device applied to a message processing client. Figure 8 This diagram illustrates the structure of a message processing apparatus according to an embodiment of this application. The apparatus is used to execute the message processing method applied to a message processing client provided in the above embodiments, such as… Figure 8 As shown, the message processing device includes:

[0179] The receiving module 810 is used to receive various event messages sent by the cloud server. Each event message is triggered by the user terminal performing data processing based on predetermined cloud resources.

[0180] The acquisition module 820 is used to acquire message filtering rules from the message processing server. The message filtering rules are matched with the rule building requirements submitted by the user terminal. The rule building requirements are used to indicate the data objects related to the reserved cloud resources specified by the user terminal.

[0181] The filtering module 830 is used to filter event messages based on message filtering rules.

[0182] In some embodiments, the filtering module is specifically used to retrieve a rule object of message filtering rules from the cache. The rule object is used to represent the executable code obtained by instantiating the message filtering rules. The executable code of the rule object is executed on each event message to obtain the filtered event message.

[0183] In some embodiments, the apparatus further includes: a request sending module, configured to send a rule request to a message processing server before retrieving a rule object of a message filtering rule from a cache, the rule request being used to request the retrieval of message filtering rules; a receiving module 810, further configured to receive a message filtering rule returned by the message processing server in response to the rule request; a building module, configured to build a rule object based on the message filtering rule; and a loading module, configured to lazy-load the rule object into the cache based on the absence of a rule object in the cache.

[0184] In some embodiments, the construction module is specifically used to verify whether the message filtering rule meets the verification pass conditions. The verification pass conditions include at least one of the following: the message filtering rule conforms to the syntax rules of a regular expression and the message filtering rule can run; the length of the message filtering rule is less than or equal to a predetermined length threshold; the syntax used by the message filtering rule conforms to a predetermined syntax specification; the beginning and end of the message filtering rule conform to a predetermined format; and a rule object is constructed based on the message filtering rule that meets the verification pass conditions.

[0185] In some embodiments, the apparatus further includes: an effective management module, configured to set an effective time period for the rule object after lazy loading the rule object into the cache; mark the rule object as effective based on the current time being within the effective time period; and extend the end time of the effective time period in response to detecting that the frequency of use of the rule object is greater than or equal to a first frequency threshold, based on the current time being within the effective time period.

[0186] In some embodiments, when the filtering module 830 filters each event message based on message filtering rules, it is specifically used to: retrieve a rule object marked as valid from the cache; execute the executable code of the rule object marked as valid on each event message to obtain the filtered event message.

[0187] In some embodiments, the effective management module is further configured to determine if the current time is not within the valid time period of the rule object and delete the rule object in the cache.

[0188] In some embodiments, the apparatus further includes: a requirement determination module, configured to receive rule keywords through a preset console page before obtaining message filtering rules from a message processing server; the rule keywords include at least one of the following: rule name, event type, and matching object characteristics; the matching object characteristics include at least one of the following: the number of resource objects covered by the rule, the identification information of the resource objects, the object characteristics of the data objects, and the matching operator corresponding to the object characteristics; the resource objects are resource units in a predetermined cloud resource, and the data objects are stored in the resource objects; generate rule construction requirements based on the rule keywords; and send the rule construction requirements to the message processing server, the rule construction requirements being used to enable the message processing server to generate corresponding message filtering rules.

[0189] In some embodiments, the message sending module is used to obtain filtered event messages obtained by filtering each event message; send the filtered event messages to the message processing server; and the message processing server forwards the filtered event messages to application clients that have subscribed to the corresponding message topics.

[0190] The functions of each module in each device in the embodiments of this application can be found in the corresponding description in the above method, and they have corresponding beneficial effects, which will not be repeated here.

[0191] Corresponding to the application scenarios and methods provided in the embodiments of this application, the embodiments of this application also provide a message processing device applied to a message processing server. Figure 9 This diagram illustrates the structure of a message processing apparatus according to an embodiment of this application. The apparatus is used to execute the message processing method provided in the above embodiments for use on a message processing server, such as... Figure 9 As shown, the message processing device includes:

[0192] The acquisition module 910 is used to acquire the rule building requirements submitted by the user terminal. The rule building requirements are used to indicate the data objects specified by the user terminal that are related to the reserved cloud resources.

[0193] The matching module 920 is used to match data objects with rule templates in the rule template library to generate message filtering rules that match the rule building requirements.

[0194] The sending module 930 is used to send message filtering rules to the message processing client. The message filtering rules are used to enable the message processing client to filter each event message. Each event message is triggered by the user terminal to process data based on predetermined cloud resources.

[0195] In some embodiments, when the matching module 920 matches a data object with a rule template in the rule template library, it is specifically used to: obtain rule keywords in the rule construction requirements, wherein the rule keywords include at least one of the following: rule name, event type, and matching object characteristics; the matching object characteristics include at least one of the following characteristics: the number of resource objects covered by the rule, the identification information of the resource objects, the object characteristics of the data object, and the matching operator corresponding to the object characteristics; the resource object is a resource unit in a predetermined cloud resource, and the data object is stored in the resource object; and match the rule keywords with the rule templates in the rule template library.

[0196] In some embodiments, the apparatus further includes: a verification module, configured to verify whether the message filtering rules meet verification pass conditions after generating message filtering rules that match the rule construction requirements, the verification pass conditions including at least one of the following: the message filtering rules conform to the syntax rules of regular expressions and the message filtering rules can run; the length of the message filtering rules is less than or equal to a predetermined length threshold; the syntax used by the message filtering rules conforms to a predetermined syntax specification; the beginning and end of the message filtering rules conform to a predetermined format; and a storage module, configured to store the message filtering rules that meet the verification pass conditions in a predetermined database.

[0197] In some embodiments, the storage module, when storing message filtering rules that meet the verification pass conditions to a predetermined database, is specifically configured to: obtain test event messages pre-set for rule building requirements; perform rule matching tests on message filtering rules that meet the verification pass conditions using the test event messages to obtain test results; and store message filtering rules that meet the verification pass conditions to the predetermined database if the test results match the expected results.

[0198] In some embodiments, the sending module 930, when sending message filtering rules to the message processing client, is specifically configured to: receive a rule request from the message processing client, the rule request being used to request the retrieval of message filtering rules; send the message filtering rules extracted from the distributed cache to the message processing client based on the existence of message filtering rules in the distributed cache; and send the message filtering rules extracted from a predetermined database to the message processing client based on the absence of message filtering rules in the distributed cache.

[0199] In some embodiments, the apparatus includes: a first storage module, configured to, before sending message filtering rules extracted from the distributed cache to the message processing client based on the existence of message filtering rules in the distributed cache, count the request frequency of each message filtering rule stored in a predetermined database; and store message filtering rules whose request frequency is greater than or equal to a second frequency threshold in the distributed cache.

[0200] In some embodiments, the apparatus includes: a second storage module, configured to, after storing message filtering rules that meet the verification pass conditions into a predetermined database, retrieve message filtering rules for different users from the predetermined database respectively; and store the message filtering rules for different users separately in isolation.

[0201] In some embodiments, the apparatus further includes: a message transmission module, configured to receive a filtered event message obtained by the message processing client based on the message filtering rules after sending message filtering rules to the message processing client; and send the filtered event message to an application client that has subscribed to the corresponding message topic.

[0202] The functions of each module in each device in the embodiments of this application can be found in the corresponding description in the above method, and they have corresponding beneficial effects, which will not be repeated here.

[0203] This application also provides a message processing system. Figure 10 A schematic diagram of the structure of a message processing system according to an embodiment of this application is shown. Figure 10 As shown, the message processing system includes:

[0204] The cloud server 1010 is used to send event messages triggered by data processing by the user terminal based on predetermined cloud resources to the message processing client 1020.

[0205] The message processing server 1030 is used to obtain the rule building requirements submitted by the user terminal. The rule building requirements are used to indicate the data objects related to the reserved cloud resources specified by the user terminal; match the data objects with the rule templates in the rule template library to generate message filtering rules that match the rule building requirements; and send the message filtering rules to the message processing client 1020.

[0206] The message processing client 1020 is used to receive various event messages, obtain message filtering rules, and filter each event message based on the message filtering rules.

[0207] In this embodiment, the cloud server 1010 can be a cloud server used to provide predetermined cloud resources. The functions of each module in the message processing server and the functions of each module in the message processing client of this application embodiment can be found in the corresponding descriptions in the above methods, and have corresponding beneficial effects, which will not be repeated here.

[0208] Figure 11 This is a block diagram of an electronic device used to implement embodiments of this application. For example... Figure 11 As shown, the electronic device includes a memory 1101 and a processor 1102. The memory 1101 stores a computer program that can run on the processor 1102. When the processor 1102 executes the computer program, it implements the method described in the above embodiments. The number of memories 1101 and processors 1102 can be one or more. In a specific implementation, the electronic device may also include a communication interface 1103 for communicating with external devices and performing data exchange and transmission.

[0209] In practical implementation, if the memory 1101, processor 1102, and communication interface 1103 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 11 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0210] Optionally, in a specific implementation, if the memory 1101, processor 1102, and communication interface 1103 are integrated on a single chip, then the memory 1101, processor 1102, and communication interface 1103 can communicate with each other through an internal interface.

[0211] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the message processing method provided in this application.

[0212] This application provides a computer program product, including a computer program that, when executed by a processor, implements the message processing method provided in this application.

[0213] This application also provides a chip, which includes a processor for calling and executing instructions stored in a memory, causing a communication device equipped with the chip to execute the message processing method provided in this application.

[0214] This application also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute the message processing method provided in the application.

[0215] It should be understood that the aforementioned processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Machines (ARM) architecture.

[0216] Further, optionally, the aforementioned memory may include read-only memory and random access memory. The memory may be volatile memory or non-volatile memory, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available. Examples include Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0217] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.

[0218] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0219] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0220] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.

[0221] The logic and / or steps described in the flowchart or otherwise herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0222] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.

[0223] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a disk, or an optical disk, etc.

[0224] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope described in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A message processing method, applied to a message processing client, comprising: Receive event messages sent by the cloud server, wherein each event message is triggered by the user terminal performing data processing based on predetermined cloud resources; Obtain message filtering rules from the message processing server. The message filtering rules are matched with the rule building requirements submitted by the user terminal. The rule building requirements are used to indicate the data objects related to the predetermined cloud resources specified by the user terminal. The event messages are filtered based on the aforementioned message filtering rules.

2. The method according to claim 1, wherein, The filtering of each event message based on the message filtering rules includes: Retrieve the rule object of the message filtering rule from the cache. The rule object is used to represent the executable code obtained by instantiating the message filtering rule. The executable code of the rule object is executed on each event message to obtain the filtered event message.

3. The method according to claim 2, wherein, Before retrieving the rule object of the message filtering rule from the cache, the method further includes: A rule request is sent to the message processing server, the rule request being used to request the message filtering rules; Receive the message filtering rules returned by the message processing server in response to the rule request; Construct the rule object based on the message filtering rules; Since the rule object does not exist in the cache, the rule object is lazy-loaded into the cache.

4. The method according to claim 3, wherein, The step of constructing the rule object based on the message filtering rules includes: The message filtering rule is verified to meet the verification pass conditions, which include at least one of the following: the message filtering rule conforms to the syntax rules of regular expressions and the message filtering rule can run; the length of the message filtering rule is less than or equal to a predetermined length threshold; the syntax used by the message filtering rule conforms to a predetermined syntax specification; the beginning and end of the message filtering rule conform to a predetermined format. The rule object is constructed based on the message filtering rules that meet the verification pass conditions.

5. The method according to claim 3, wherein, After lazy loading the rule object into the cache, the method further includes: Set the valid time period for the rule object; Based on the current time, within the effective time period, the rule object is marked as valid; Based on the current time within the effective time period, in response to detecting that the frequency of use of the rule object is greater than or equal to a first frequency threshold, the end time of the effective time period is extended.

6. The method according to claim 1, wherein, The filtering of each event message based on the message filtering rules includes: Retrieve the rule object marked as valid from the cache; Execute the executable code of the rule object marked as valid on each event message to obtain the filtered event message.

7. The method according to claim 5, wherein, Also includes: If the current time is determined to be outside the valid time period of the rule object, the rule object is deleted from the cache.

8. The method according to claim 1, wherein, Before obtaining the message filtering rules from the message processing server, the process also includes: The rule keywords are received through a preset console page. The rule keywords include at least one of the following: rule name, event type, and matching object characteristics. The matching object characteristics include at least one of the following: the number of resource objects covered by the rule, the identification information of the resource objects, the object characteristics of the data objects, and the matching operator corresponding to the object characteristics. The resource objects are resource units in the predetermined cloud resources, and the data objects are stored in the resource objects. The rule construction requirements are generated based on the rule keywords; The rule building request is sent to the message processing server, and the rule building request is used to enable the message processing server to generate corresponding message filtering rules.

9. The method according to any one of claims 1-8, wherein, Also includes: Obtain the filtered event messages obtained by filtering the event messages; The filtered event message is sent to the message processing server, and the filtered event message is forwarded by the message processing server to the application client that has subscribed to the corresponding message topic.

10. A message processing method, applied to a message processing server, comprising: Obtain the rule building requirements submitted by the user terminal, wherein the rule building requirements are used to indicate the data objects specified by the user terminal that are related to the predetermined cloud resources; The data object is matched with the rule templates in the rule template library to generate message filtering rules that match the rule building requirements; The message filtering rules are sent to the message processing client. The message filtering rules are used to enable the message processing client to filter each event message, which is triggered by the user terminal performing data processing based on the predetermined cloud resources.

11. The method according to claim 10, wherein, The step of matching the data object with rule templates in the rule template library includes: Obtain the rule keywords from the rule construction requirements. The rule keywords include at least one of the following: rule name, event type, and matching object characteristics. The matching object characteristics include at least one of the following: the number of resource objects covered by the rule, the identification information of the resource objects, the object characteristics of the data objects, and the matching operator corresponding to the object characteristics. The resource objects are resource units in the predetermined cloud resources, and the data objects are stored in the resource objects. The rule keywords are matched with the rule templates in the rule template library.

12. The method according to claim 10, wherein, After generating message filtering rules that match the rule building requirements, the method further includes: The message filtering rule is verified to meet the verification pass conditions, which include at least one of the following: the message filtering rule conforms to the syntax rules of regular expressions and the message filtering rule can run; the length of the message filtering rule is less than or equal to a predetermined length threshold; the syntax used by the message filtering rule conforms to a predetermined syntax specification; the beginning and end of the message filtering rule conform to a predetermined format. Message filtering rules that meet the verification pass conditions are stored in a predetermined database.

13. The method according to claim 12, wherein, The step of storing message filtering rules that meet the verification pass conditions into a predetermined database includes: Retrieve test event messages pre-configured for the requirements of the rules; The test results are obtained by performing rule matching tests on message filtering rules that meet the verification pass conditions using the test event messages. If the test results match the expected results, the message filtering rules that meet the verification pass conditions are stored in a predetermined database.

14. The method according to claim 10, wherein, Sending the message filtering rules to the message processing client includes: Receive a rule request from the message processing client, the rule request being used to request the message filtering rules; Based on the existence of the message filtering rules in the distributed cache, the message filtering rules extracted from the distributed cache are sent to the message processing client; Since the message filtering rule does not exist in the distributed cache, the message filtering rule extracted from the predetermined database will be sent to the message processing client.

15. The method according to claim 14, wherein, Before sending the message filtering rules extracted from the distributed cache to the message processing client, the method based on the existence of the message filtering rules in the distributed cache further includes: Statistically count the request frequency of each message filtering rule stored in the pre-defined database; The message filtering rules whose request frequency is greater than or equal to the second frequency threshold are stored in the distributed cache.

16. The method according to claim 12, wherein, After storing the message filtering rules that meet the verification pass conditions into a predetermined database, the method further includes: Retrieve message filtering rules for different users from the predefined database; The message filtering rules for the different users are stored separately in isolation.

17. The method according to any one of claims 10-16, wherein, After sending the message filtering rules to the message processing client, the method further includes: Receive the filtered event message obtained by the message processing client based on the message filtering rules; The filtered event message is sent to the application client that has subscribed to the corresponding message topic.

18. A message processing system, comprising: Cloud server, message processing server, and message processing client; The cloud server is used to send various event messages triggered by the user terminal's data processing based on predetermined cloud resources to the message processing client. The message processing server is configured to obtain the rule building requirements submitted by the user terminal, wherein the rule building requirements are used to indicate the data objects specified by the user terminal that are related to the predetermined cloud resources; match the data objects with the rule templates in the rule template library to generate message filtering rules that match the rule building requirements; and send the message filtering rules to the message processing client. The message processing client is used to receive the event messages, obtain the message filtering rules, and filter the event messages based on the message filtering rules.

19. An electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor, when executing the computer program, implements the method of any one of claims 1 to 9 or any one of claims 10 to 17.

20. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of any one of claims 1 to 9 or any one of claims 10 to 17.

21. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 9 or any one of claims 10 to 17.